mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +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
|
@ -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,8 +128,14 @@ function grade_update($source, $courseid, $itemtype, $itemmodule, $iteminstance,
|
|||
|
||||
} else {
|
||||
if ($grade_item->is_locked()) {
|
||||
debugging('Grading item is locked!');
|
||||
return GRADE_UPDATE_ITEM_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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue