MDL-14835 - Grade not checked against valid range when manua grading

This commit is contained in:
tjhunt 2008-05-15 16:02:12 +00:00
parent 9c22b42ef7
commit 994c8c3509
5 changed files with 71 additions and 22 deletions

View file

@ -61,19 +61,23 @@
if ($data = data_submitted() and confirm_sesskey()) {
// the following will update the state and attempt
question_process_comment($question, $state, $attempt, $data->response['comment'], $data->response['grade']);
// If the state has changed save it and update the quiz grade
if ($state->changed) {
save_question_session($question, $state);
quiz_save_best_grade($quiz, $attempt->userid);
$error = question_process_comment($question, $state, $attempt, $data->response['comment'], $data->response['grade']);
if (is_string($error)) {
notify($error);
} else {
// If the state has changed save it and update the quiz grade
if ($state->changed) {
save_question_session($question, $state);
quiz_save_best_grade($quiz, $attempt->userid);
}
notify(get_string('changessaved'));
echo '<div class="boxaligncenter"><input type="button" onclick="window.opener.location.reload(1); self.close();return false;" value="' .
get_string('closewindow') . "\" /></div>";
print_footer();
exit;
}
notify(get_string('changessaved'));
echo '<div class="boxaligncenter"><input type="button" onclick="window.opener.location.reload(1); self.close();return false;" value="' .
get_string('closewindow') . "\" /></div>";
print_footer();
exit;
}
question_print_comment_box($question, $state, $attempt, $CFG->wwwroot.'/mod/quiz/comment.php');