Browse files

MDL-34989 assign: Allow students to submit when grade is overriden

Also inform teachers when grading is disabled due to gradebook lock/override.
  • Loading branch information...
1 parent 8452248 commit c33b4c81bb76b8719ad4bd14eca8263c2d6805ec @ashleyholman ashleyholman committed with damyon May 29, 2013
Showing with 11 additions and 5 deletions.
  1. +1 −0 mod/assign/lang/en/assign.php
  2. +10 −5 mod/assign/locallib.php
View
1 mod/assign/lang/en/assign.php
@@ -187,6 +187,7 @@
$string['gradedon'] = 'Graded on';
$string['gradebelowzero'] = 'Grade must be greater than or equal to zero.';
$string['gradeabovemaximum'] = 'Grade must be less than or equal to {$a}.';
+$string['gradelocked'] = 'This grade is locked or overridden in the gradebook.';
$string['gradeoutof'] = 'Grade out of {$a}';
$string['gradeoutofhelp'] = 'Grade';
$string['gradeoutofhelp_help'] = 'Enter the grade for the student\'s submission here. You may include decimals.';
View
15 mod/assign/locallib.php
@@ -5271,11 +5271,16 @@ public function add_grade_form_elements(MoodleQuickForm $mform, stdClass $data,
// Use simple direct grading.
if ($this->get_instance()->grade > 0) {
$name = get_string('gradeoutof', 'assign', $this->get_instance()->grade);
- $gradingelement = $mform->addElement('text', 'grade', $name);
- $mform->addHelpButton('grade', 'gradeoutofhelp', 'assign');
- $mform->setType('grade', PARAM_TEXT);
- if ($gradingdisabled) {
- $gradingelement->freeze();
+ if (!$gradingdisabled) {
+ $gradingelement = $mform->addElement('text', 'grade', $name);
+ $mform->addHelpButton('grade', 'gradeoutofhelp', 'assign');
+ $mform->setType('grade', PARAM_TEXT);
+ } else {
+ $mform->addElement('hidden', 'grade', $name);
+ $mform->hardFreeze('grade');
+ $strgradelocked = get_string('gradelocked', 'assign');
+ $mform->addElement('static', 'gradedisabled', $name, $strgradelocked);
+ $mform->addHelpButton('gradedisabled', 'gradeoutofhelp', 'assign');
}
} else {
$grademenu = make_grades_menu($this->get_instance()->grade);

0 comments on commit c33b4c8

Please sign in to comment.