MDL-29482: error message is displayed to graders if grading form is unavailable

This commit is contained in:
Marina Glancy
2011-11-02 11:12:02 +08:00
parent 3599b113a6
commit 0e2a1d755a
4 changed files with 17 additions and 7 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ abstract class gradingform_controller {
if ($this->is_form_available()) {
return null;
}
return get_string('gradingformunavailable', 'grades');
return get_string('gradingformunavailable', 'grading');
}
/**
-1
View File
@@ -289,7 +289,6 @@ $string['gradetype_help'] = 'There are 4 grade types:
Only value and scale grade types may be aggregated. The grade type for an activity-based grade item is set on the activity settings page.';
$string['gradeview'] = 'View grade';
$string['gradeweighthelp'] = 'Grade weight help';
$string['gradingformunavailable'] = 'Please note: this form is not available for grading at the moment. Simple grading method will be used until form has a valid status.';
$string['groupavg'] = 'Group average';
$string['hidden'] = 'Hidden';
$string['hidden_help'] = 'If ticked, grades are hidden from students. A hidden until date may be set if desired, to release grades after grading is completed.';
+1
View File
@@ -32,6 +32,7 @@ $string['changeactivemethod'] = 'Change active grading method to';
$string['clicktoclose'] = 'click to close';
$string['exc_gradingformelement'] = 'Unable to instantiate grading form element';
$string['formnotavailable'] = 'Advanced grading method was selected to use but the grading form is not available yet. You may need to define it first via a link in the Settings block.';
$string['gradingformunavailable'] = 'Please note: the advanced grading form is not ready at the moment. Simple grading method will be used until the form has a valid status.';
$string['gradingmanagement'] = 'Advanced grading';
$string['gradingmanagementtitle'] = 'Advanced grading: {$a->component} ({$a->area})';
$string['gradingmethod'] = 'Grading method';
+15 -5
View File
@@ -1068,12 +1068,19 @@ class assignment_base {
} elseif ($assignment->assignmenttype == 'uploadsingle') {
$mformdata->fileui_options = array('subdirs'=>0, 'maxbytes'=>$CFG->userquota, 'maxfiles'=>1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL);
}
if ($controller = get_grading_manager($this->context, 'mod_assignment', 'submission')->get_active_controller()) {
$itemid = null;
if (!empty($submission->id)) {
$itemid = $submission->id;
$advancedgradingwarning = false;
$gradingmanager = get_grading_manager($this->context, 'mod_assignment', 'submission');
if ($gradingmethod = $gradingmanager->get_active_method()) {
$controller = $gradingmanager->get_controller($gradingmethod);
if ($controller->is_form_available()) {
$itemid = null;
if (!empty($submission->id)) {
$itemid = $submission->id;
}
$mformdata->advancedgradinginstance = $controller->create_instance($USER->id, $itemid);
} else {
$advancedgradingwarning = $controller->form_unavailable_notification();
}
$mformdata->advancedgradinginstance = $controller->create_instance($USER->id, $itemid);
}
$submitform = new mod_assignment_grading_form( null, $mformdata );
@@ -1102,6 +1109,9 @@ class assignment_base {
echo $OUTPUT->heading(get_string('feedback', 'assignment').': '.fullname($user, true));
// display mform here...
if ($advancedgradingwarning) {
echo $OUTPUT->notification($advancedgradingwarning, 'error');
}
$submitform->display();
$customfeedback = $this->custom_feedbackform($submission, true);