Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit fae11d2ef1b43909f964998fe7f17171fe99c210 1 parent 5fb1fad
@ashleyholman ashleyholman authored damyon committed
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
@@ -175,6 +175,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
@@ -4969,11 +4969,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);
Please sign in to comment.
Something went wrong with that request. Please try again.