MDL-55821 assign: Show assign grade
When marking workflow is enabled and the grade is not released yet, it would be helpful to show the assignment grade in the grading form.
This commit is contained in:
@@ -128,6 +128,7 @@ $string['couldnotconvertsubmission'] = 'Could not convert assignment submission
|
||||
$string['couldnotcreatecoursemodule'] = 'Could not create course module.';
|
||||
$string['couldnotcreatenewassignmentinstance'] = 'Could not create new assignment instance.';
|
||||
$string['couldnotfindassignmenttoupgrade'] = 'Could not find old assignment instance to upgrade.';
|
||||
$string['currentassigngrade'] = 'Current grade in assignment';
|
||||
$string['currentgrade'] = 'Current grade in gradebook';
|
||||
$string['currentattempt'] = 'This is attempt {$a}.';
|
||||
$string['currentattemptof'] = 'This is attempt {$a->attemptnumber} ( {$a->maxattempts} attempts allowed ).';
|
||||
|
||||
@@ -7406,6 +7406,14 @@ class assign {
|
||||
$options = array('' => get_string('markingworkflowstatenotmarked', 'assign')) + $states;
|
||||
$mform->addElement('select', 'workflowstate', get_string('markingworkflowstate', 'assign'), $options);
|
||||
$mform->addHelpButton('workflowstate', 'markingworkflowstate', 'assign');
|
||||
$gradingstatus = $this->get_grading_status($userid);
|
||||
if ($gradingstatus != ASSIGN_MARKING_WORKFLOW_STATE_RELEASED) {
|
||||
if ($grade->grade && $grade->grade != -1) {
|
||||
$assigngradestring = html_writer::span(grade_floatval($grade->grade), 'currentgrade');
|
||||
$label = get_string('currentassigngrade', 'assign');
|
||||
$mform->addElement('static', 'currentassigngrade', $label, $assigngradestring);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->get_instance()->markingworkflow &&
|
||||
@@ -7427,6 +7435,7 @@ class assign {
|
||||
$mform->disabledIf('allocatedmarker', 'workflowstate', 'eq', ASSIGN_MARKING_WORKFLOW_STATE_READYFORRELEASE);
|
||||
$mform->disabledIf('allocatedmarker', 'workflowstate', 'eq', ASSIGN_MARKING_WORKFLOW_STATE_RELEASED);
|
||||
}
|
||||
|
||||
$gradestring = '<span class="currentgrade">' . $gradestring . '</span>';
|
||||
$mform->addElement('static', 'currentgrade', get_string('currentgrade', 'assign'), $gradestring);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user