mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-11282 Using notice_yesno(), but not sure how to provide a backlink with the cancel action...
This commit is contained in:
parent
e171963b3e
commit
b159da787a
3 changed files with 26 additions and 18 deletions
|
@ -163,6 +163,7 @@ $string['gradeexceptions'] = 'Grade Exceptions';
|
|||
$string['gradeexceptionshelp'] = 'Grade Exceptions Help';
|
||||
$string['gradehelp'] = 'Grade Help';
|
||||
$string['gradeitem'] = 'Grade item';
|
||||
$string['gradeitemislocked'] = 'This activity is locked in the gradebook. If you regrade it, the grades held internally by this activity will be different from the ones in the gradebook, the latter which will remain unchanged. Are you sure you want to proceed with the regrading?';
|
||||
$string['gradeitemlocked'] = 'Grading locked';
|
||||
$string['gradeitemsinc'] = 'Grade items to be included';
|
||||
$string['gradeitemaddusers'] = 'Exclude from Grading';
|
||||
|
|
|
@ -98,6 +98,7 @@ function grade_update($source, $courseid, $itemtype, $itemmodule, $iteminstance,
|
|||
}
|
||||
|
||||
/// Create or update the grade_item if needed
|
||||
|
||||
if (!$grade_item) {
|
||||
if ($itemdetails) {
|
||||
$itemdetails = (array)$itemdetails;
|
||||
|
@ -127,9 +128,15 @@ function grade_update($source, $courseid, $itemtype, $itemmodule, $iteminstance,
|
|||
|
||||
} else {
|
||||
if ($grade_item->is_locked()) {
|
||||
debugging('Grading item is locked!');
|
||||
$confirm_regrade = optional_param('confirm_regrade', 0, PARAM_INT);
|
||||
if (!$confirm_regrade) {
|
||||
$message = get_string('gradeitemislocked', 'grades', $grade_item->itemname);
|
||||
$back_link = '';
|
||||
$regrade_link = qualified_me() . '&confirm_regrade=1';
|
||||
notice_yesno($message, $regrade_link, $back_link);
|
||||
return GRADE_UPDATE_ITEM_LOCKED;
|
||||
}
|
||||
}
|
||||
|
||||
if ($itemdetails) {
|
||||
$itemdetails = (array)$itemdetails;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue