From 0ad73f711dd985281665b7bc042439355e51c0a0 Mon Sep 17 00:00:00 2001 From: Guillaume Barat Date: Fri, 19 Jul 2024 11:54:20 +1000 Subject: [PATCH 1/3] Update grader data / text --- classes/rubric_ranges.php | 2 +- lang/en/report_advancedgrading.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/rubric_ranges.php b/classes/rubric_ranges.php index 995316a..eff72d5 100644 --- a/classes/rubric_ranges.php +++ b/classes/rubric_ranges.php @@ -82,7 +82,7 @@ public function get_data(\assign $assign, \cm_info $cm): array { level.definition, grf.remark, grf.grade as grade_rub_range, grf.criterionid, stu.id AS userid, stu.idnumber AS idnumber, stu.firstname, stu.lastname, stu.username, - stu.username, stu.email, rubm.username AS grader, + stu.username, stu.email, CONCAT(rubm.firstname, ' - ',rubm.lastname) AS grader, ag.timemodified AS modified, ctx.instanceid, ag.grade, asg.blindmarking, assign_comment.commenttext as overallfeedback FROM {assign} asg diff --git a/lang/en/report_advancedgrading.php b/lang/en/report_advancedgrading.php index 725fcc5..ad32c57 100644 --- a/lang/en/report_advancedgrading.php +++ b/lang/en/report_advancedgrading.php @@ -27,7 +27,7 @@ $string['btecgrades'] = 'BTEC breakdown report'; $string['rubricgrades'] = 'Rubric breakdown report'; $string['guidegrades'] = 'Marking guide breakdown report'; -$string['rubricrangesgrades'] = 'rubric range breakdown report'; +$string['rubricrangesgrades'] = 'Rubric range breakdown report'; $string['rubric'] = 'Rubric'; $string['assignment'] = 'Assignment'; $string['grademethod'] = 'Grade method'; @@ -36,7 +36,7 @@ $string['showgroups'] = 'Show groups'; $string['showgroups_desc'] = 'Show groups in the report'; $string['exceldownload'] = 'Excel download'; -$string['exceldownload_help'] = 'Download an Excel spreaedsheet format (xlsx) version of the table'; +$string['exceldownload_help'] = 'Download an Excel spreadsheet format (xlsx) version of the table'; $string['csvdownload'] = 'CSV download'; $string['csvdownload_help'] = 'Download a comma Separated values version of the table'; $string['profilefields'] = 'Profile fields'; From 65b445c1372b024f96665484ebf8f17c016368c5 Mon Sep 17 00:00:00 2001 From: Guillaume Barat Date: Mon, 19 Aug 2024 16:46:57 +1000 Subject: [PATCH 2/3] Add setting for graded by column --- classes/btec.php | 4 +++- classes/guide.php | 4 +++- classes/rubref.php | 4 +++- classes/rubric.php | 4 +++- classes/rubric_ranges.php | 4 +++- lang/en/report_advancedgrading.php | 6 ++++++ locallib.php | 18 +++++++++++++++++- settings.php | 19 +++++++++++++++++++ version.php | 2 +- 9 files changed, 58 insertions(+), 7 deletions(-) diff --git a/classes/btec.php b/classes/btec.php index 8d68cbe..ebf1313 100644 --- a/classes/btec.php +++ b/classes/btec.php @@ -76,7 +76,9 @@ public function get_data(\cm_info $cm) : array { global $DB; $sql = "SELECT gbf.id AS ggfid, crs.shortname AS course, asg.name AS assignment, asg.grade as gradeoutof, gd.name AS btec, criteria.shortname, criteria.description as definition, criteria.description , gbf.score, - gbf.remark, gbf.criterionid, marker.username AS grader, + gbf.remark, gbf.criterionid, marker.username AS graderusername, + marker.firstname AS graderfirstname, marker.lastname AS graderlastname, + marker.email AS graderemail, stu.id AS userid, stu.idnumber AS idnumber, stu.firstname, stu.lastname, stu.username AS username, gin.timemodified AS modified,ag.id, ag.grade, assign_comment.commenttext as overallfeedback diff --git a/classes/guide.php b/classes/guide.php index 9ce5d74..00c2e25 100644 --- a/classes/guide.php +++ b/classes/guide.php @@ -85,7 +85,9 @@ public function get_data(\assign $assign, \cm_info $cm) :array { $sql = "SELECT fillings.id AS ggfid, cm.course AS course, asg.name AS assignment, asg.grade as gradeoutof,gd.name AS guide, criteria.description,criteria.shortname, - fillings.score, fillings.remark, fillings.criterionid, rubm.username AS grader, + fillings.score, fillings.remark, fillings.criterionid, rubm.username AS graderusername, + rubm.firstname AS graderfirstname, rubm.lastname AS graderlastname, + rubm.email AS graderemail, stu.id AS userid, stu.idnumber AS idnumber, stu.firstname, stu.lastname, stu.username, stu.email, ag.timemodified AS modified, ag.grade, assign_comment.commenttext as overallfeedback diff --git a/classes/rubref.php b/classes/rubref.php index b4b7ded..13b1ab1 100644 --- a/classes/rubref.php +++ b/classes/rubref.php @@ -81,7 +81,9 @@ public function get_data(\assign $assign, \cm_info $cm) : array { level.definition, grf.remark, grf.criterionid, stu.id AS userid, stu.idnumber AS idnumber, stu.firstname, stu.lastname, stu.username, - stu.username, stu.email, rubm.username AS grader, + stu.username, stu.email, rubm.username AS graderusername, + rubm.firstname AS graderfirstname, rubm.lastname AS graderlastname, + rubm.email AS graderemail, gin.timemodified AS modified, ctx.instanceid, ag.grade, asg.blindmarking, assign_comment.commenttext as overallfeedback FROM {assign} asg diff --git a/classes/rubric.php b/classes/rubric.php index 5782053..4b07655 100644 --- a/classes/rubric.php +++ b/classes/rubric.php @@ -81,7 +81,9 @@ public function get_data(\assign $assign, \cm_info $cm) : array { level.definition, grf.remark, grf.criterionid, stu.id AS userid, stu.idnumber AS idnumber, stu.firstname, stu.lastname, stu.username, - stu.username, stu.email, rubm.username AS grader, + stu.username, stu.email, rubm.username AS graderusername, + rubm.firstname AS graderfirstname, rubm.lastname AS graderlastname, + rubm.email AS graderemail, ag.timemodified AS modified, ctx.instanceid, ag.grade, asg.blindmarking, assign_comment.commenttext as overallfeedback FROM {assign} asg diff --git a/classes/rubric_ranges.php b/classes/rubric_ranges.php index eff72d5..55a3d51 100644 --- a/classes/rubric_ranges.php +++ b/classes/rubric_ranges.php @@ -82,7 +82,9 @@ public function get_data(\assign $assign, \cm_info $cm): array { level.definition, grf.remark, grf.grade as grade_rub_range, grf.criterionid, stu.id AS userid, stu.idnumber AS idnumber, stu.firstname, stu.lastname, stu.username, - stu.username, stu.email, CONCAT(rubm.firstname, ' - ',rubm.lastname) AS grader, + stu.username, stu.email, rubm.username AS graderusername, + rubm.firstname AS graderfirstname, rubm.lastname AS graderlastname, + rubm.email AS graderemail, ag.timemodified AS modified, ctx.instanceid, ag.grade, asg.blindmarking, assign_comment.commenttext as overallfeedback FROM {assign} asg diff --git a/lang/en/report_advancedgrading.php b/lang/en/report_advancedgrading.php index ad32c57..be65096 100644 --- a/lang/en/report_advancedgrading.php +++ b/lang/en/report_advancedgrading.php @@ -61,3 +61,9 @@ $string['viewsubmissions_help'] = 'View submissions'; $string['enable_javascriptlayout'] = 'Enable javascript layout'; $string['enable_javascriptlayout_desc'] = 'Adds paging and sorting to the table layout, may add a performance overhead'; +$string['profilefieldsgradeby'] = 'Profile fields graded by'; +$string['profilefieldsgradeby_desc'] = 'Additional user fields shown in report for column \'Graded By\''; +$string['graderusername'] = 'Username'; +$string['graderfirstname'] = 'First name'; +$string['graderlastname'] = 'Last name'; +$string['graderemail'] = 'Email address'; diff --git a/locallib.php b/locallib.php index cd49afc..a512544 100755 --- a/locallib.php +++ b/locallib.php @@ -253,7 +253,7 @@ function get_grades(array $data, array $dbrecords): array { $gi = [ 'overallfeedback' => $grade->overallfeedback, - 'grader' => $grade->grader, + 'grader' => gradedbydata($grade), 'timegraded' => $grade->modified, 'grade' => $formattedgrade ]; @@ -418,3 +418,19 @@ function output_header(string $filename, string$filetype) : bool { header('Content-Disposition: attachment;filename="' . $filename); return true; } + +/** + * Return the data for the graded by column following the config. + * + * @param array $gradedata + * @return string The corresponding data from the settings. + */ +function gradedbydata($gradedata): string { + $graderprofileconfig = trim(get_config('report_advancedgrading', 'profilefieldsgradeby')); + $gradedbyfields = empty($graderprofileconfig) ? [] : explode(',', $graderprofileconfig); + $fielddata = []; + foreach ($gradedbyfields as $field) { + $fielddata[] = $gradedata->$field; + } + return implode(' - ', $fielddata); +} diff --git a/settings.php b/settings.php index 57ad51f..60c68be 100644 --- a/settings.php +++ b/settings.php @@ -43,4 +43,23 @@ ['username' => 1], $choices )); + + $rawchoicesgradeby = [ + 'graderusername', + 'graderfirstname', + 'graderlastname', + 'graderemail', + ]; + $choices = []; + foreach ($rawchoicesgradeby as $choice) { + $choices[$choice] = new lang_string($choice, 'report_advancedgrading'); + } + + $settings->add(new admin_setting_configmulticheckbox( + 'report_advancedgrading/profilefieldsgradeby', + new lang_string('profilefieldsgradeby', 'report_advancedgrading'), + new lang_string('profilefieldsgradeby_desc', 'report_advancedgrading'), + ['graderusername' => 1], + $choices + )); } diff --git a/version.php b/version.php index a90f50b..5d79af2 100755 --- a/version.php +++ b/version.php @@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2024030400; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2024081900; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2021051715; // Moodle 3.11. $plugin->release = '1.0'; $plugin->supported = [311, 404]; From 1d2109ae800867c3bc098fec5566d022957b6d7d Mon Sep 17 00:00:00 2001 From: Marcus Green Date: Tue, 20 Aug 2024 21:37:24 +0100 Subject: [PATCH 3/3] Attempted fix for the ci --- .github/workflows/moodle-ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml index 8f36b8e..6cfc22d 100644 --- a/.github/workflows/moodle-ci.yml +++ b/.github/workflows/moodle-ci.yml @@ -46,7 +46,13 @@ jobs: extensions: ${{ matrix.extensions }} ini-values: max_input_vars=5000 coverage: none - + - name: Install NVM and Node + run: | + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + nvm install 20 + nvm use 20 - name: Initialise moodle-plugin-ci run: | composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3