Skip to content
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.

Conflicts:

	mod/assign/locallib.php
  • Loading branch information...
1 parent cd08b5c commit 214dd19aa2bbf6bae07729664738a51ae00e58ec @ashleyholman ashleyholman committed with damyon May 29, 2013
Showing with 12 additions and 5 deletions.
  1. +1 −0 mod/assign/lang/en/assign.php
  2. +11 −5 mod/assign/locallib.php
View
1 mod/assign/lang/en/assign.php
@@ -155,6 +155,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
16 mod/assign/locallib.php
@@ -4166,11 +4166,17 @@ public function add_grade_form_elements(MoodleQuickForm $mform, stdClass $data,
} else {
// use simple direct grading
if ($this->get_instance()->grade > 0) {
- $gradingelement = $mform->addElement('text', 'grade', get_string('gradeoutof', 'assign',$this->get_instance()->grade));
- $mform->addHelpButton('grade', 'gradeoutofhelp', 'assign');
- $mform->setType('grade', PARAM_TEXT);
- if ($gradingdisabled) {
- $gradingelement->freeze();
+ $name = get_string('gradeoutof', 'assign', $this->get_instance()->grade);
+ 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 214dd19

Please sign in to comment.
Something went wrong with that request. Please try again.