Browse files

Merge branch 'MDL-34403-MOODLE_23_STABLE' of https://github.com/mpetr…

…owi/moodle into MOODLE_23_STABLE
  • Loading branch information...
2 parents 161f4e0 + c8b33aa commit 092f45148a836c9ab65d46be31b90618255935d6 @danpoltawski danpoltawski committed Apr 25, 2013
Showing with 13 additions and 12 deletions.
  1. +13 −12 mod/quiz/lib.php
View
25 mod/quiz/lib.php
@@ -729,18 +729,19 @@ function quiz_grade_item_update($quiz, $grades = null) {
// NOTE: this is an extremely nasty hack! It is not a bug if this confirmation fails badly. --skodak.
$confirm_regrade = optional_param('confirm_regrade', 0, PARAM_INT);
if (!$confirm_regrade) {
- $message = get_string('gradeitemislocked', 'grades');
- $back_link = $CFG->wwwroot . '/mod/quiz/report.php?q=' . $quiz->id .
- '&mode=overview';
- $regrade_link = qualified_me() . '&confirm_regrade=1';
- echo $OUTPUT->box_start('generalbox', 'notice');
- echo '<p>'. $message .'</p>';
- echo $OUTPUT->container_start('buttons');
- echo $OUTPUT->single_button($regrade_link, get_string('regradeanyway', 'grades'));
- echo $OUTPUT->single_button($back_link, get_string('cancel'));
- echo $OUTPUT->container_end();
- echo $OUTPUT->box_end();
-
+ if (!AJAX_SCRIPT) {
+ $message = get_string('gradeitemislocked', 'grades');
+ $back_link = $CFG->wwwroot . '/mod/quiz/report.php?q=' . $quiz->id .
+ '&amp;mode=overview';
+ $regrade_link = qualified_me() . '&amp;confirm_regrade=1';
+ echo $OUTPUT->box_start('generalbox', 'notice');
+ echo '<p>'. $message .'</p>';
+ echo $OUTPUT->container_start('buttons');
+ echo $OUTPUT->single_button($regrade_link, get_string('regradeanyway', 'grades'));
+ echo $OUTPUT->single_button($back_link, get_string('cancel'));
+ echo $OUTPUT->container_end();
+ echo $OUTPUT->box_end();
+ }
return GRADE_UPDATE_ITEM_LOCKED;
}
}

0 comments on commit 092f451

Please sign in to comment.