Skip to content

Commit

Permalink
MDL-34989 assign: Do not add a param to grading_disabled - cannot be …
Browse files Browse the repository at this point in the history
…backported.
  • Loading branch information
Damyon Wiese committed Jul 29, 2013
1 parent c33b4c8 commit fafad00
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions mod/assign/locallib.php
Expand Up @@ -4086,7 +4086,15 @@ public function submissions_open($userid = 0) {
}
}

if ($this->grading_disabled($userid, false)) {
// See if this user grade is locked in the gradebook.
$gradinginfo = grade_get_grades($this->get_course()->id,
'mod',
'assign',
$this->get_instance()->id,
array($userid));
if ($gradinginfo &&
isset($gradinginfo->items[0]->grades[$userid]) &&
$gradinginfo->items[0]->grades[$userid]->locked) {
return false;
}

Expand Down Expand Up @@ -5137,7 +5145,7 @@ protected function process_save_submission(&$mform, &$notices) {


/**
* Determine if this users grade is locked or overridden.
* Determine if this users grade can be edited.
*
* @param int $userid - The student userid
* @param bool $checkworkflow - whether to include a check for the workflow state.
Expand Down Expand Up @@ -5274,10 +5282,11 @@ public function add_grade_form_elements(MoodleQuickForm $mform, stdClass $data,
if (!$gradingdisabled) {
$gradingelement = $mform->addElement('text', 'grade', $name);
$mform->addHelpButton('grade', 'gradeoutofhelp', 'assign');
$mform->setType('grade', PARAM_TEXT);
$mform->setType('grade', PARAM_RAW);
} else {
$mform->addElement('hidden', 'grade', $name);
$mform->hardFreeze('grade');
$mform->setType('grade', PARAM_RAW);
$strgradelocked = get_string('gradelocked', 'assign');
$mform->addElement('static', 'gradedisabled', $name, $strgradelocked);
$mform->addHelpButton('gradedisabled', 'gradeoutofhelp', 'assign');
Expand Down

0 comments on commit fafad00

Please sign in to comment.