diff --git a/mod/kalvidassign/db/install.xml b/mod/kalvidassign/db/install.xml index 38705673..403030d8 100755 --- a/mod/kalvidassign/db/install.xml +++ b/mod/kalvidassign/db/install.xml @@ -18,7 +18,8 @@ - + + diff --git a/mod/kalvidassign/db/upgrade.php b/mod/kalvidassign/db/upgrade.php index 2d47d9c7..bee9a42d 100644 --- a/mod/kalvidassign/db/upgrade.php +++ b/mod/kalvidassign/db/upgrade.php @@ -71,8 +71,8 @@ function xmldb_kalvidassign_upgrade($oldversion) { } if ($oldversion < 2014023000.01) { - - // Define field metadata to be added to kalvidassign_submission. + // + // // Define field metadata to be added to kalvidassign_submission. $table = new xmldb_table('kalvidassign_submission'); $field = new xmldb_field('metadata', XMLDB_TYPE_TEXT, null, null, null, null, null, 'timemarked'); @@ -85,5 +85,18 @@ function xmldb_kalvidassign_upgrade($oldversion) { upgrade_mod_savepoint(true, 2014023000.01, 'kalvidassign'); } + if ($oldversion < 2022041905) { + $table = new xmldb_table('kalvidassign'); + $field = new xmldb_field('hidegrader', XMLDB_TYPE_INTEGER, 1, true, true, null, 0, 'timemodified'); + + // Conditionally launch add field metadata. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + } + + // Kalvidassign savepoint reached. + upgrade_mod_savepoint(true, 2014023000.01, 'kalvidassign'); + return true; } \ No newline at end of file diff --git a/mod/kalvidassign/lang/en/kalvidassign.php b/mod/kalvidassign/lang/en/kalvidassign.php index 521f5b85..1b04e933 100644 --- a/mod/kalvidassign/lang/en/kalvidassign.php +++ b/mod/kalvidassign/lang/en/kalvidassign.php @@ -79,6 +79,8 @@ $string['savedchanges'] = 'Changed Saved'; $string['save'] = 'Save Changes'; $string['cancel'] = 'Close'; +$string['hidegrader'] = 'Hide grader identity from students'; +$string['hidegrader_help'] = 'If enabled, the identity of any user who grades an assignment submission is not shown, so students can\'t see who marked their work.'; $string['checkconversionstatus'] = 'Check video conversion status'; $string['pluginname'] = 'Kaltura Media Assignment'; $string['video_converting'] = 'The video is still converting. Please check the status of the video at a later time.'; diff --git a/mod/kalvidassign/mod_form.php b/mod/kalvidassign/mod_form.php index d5125382..9ab77b94 100644 --- a/mod/kalvidassign/mod_form.php +++ b/mod/kalvidassign/mod_form.php @@ -71,6 +71,10 @@ public function definition() { $this->standard_grading_coursemodule_elements(); + $name = get_string('hidegrader', 'kalvidassign'); + $mform->addElement('selectyesno', 'hidegrader', $name); + $mform->addHelpButton('hidegrader', 'hidegrader', 'kalvidassign'); + $this->standard_coursemodule_elements(); $this->add_action_buttons(); diff --git a/mod/kalvidassign/renderer.php b/mod/kalvidassign/renderer.php index 2e4f95d8..a182df6a 100644 --- a/mod/kalvidassign/renderer.php +++ b/mod/kalvidassign/renderer.php @@ -1096,9 +1096,14 @@ public function display_grade_feedback($kalvidassign, $context) { $gradedate = $grade->dategraded; $gradeby = $grade->usermodified; + // We need the teacher info - if (!$teacher = $DB->get_record('user', array('id'=>$gradeby))) { - print_error('cannotfindteacher'); + $teacher = null; + if (!$kalvidassign->hidegrader) + { + if (!$teacher = $DB->get_record('user', array('id'=>$gradeby))) { + print_error('cannotfindteacher'); + } } // Print the feedback