Skip to content

Commit

Permalink
Add a javascript confirmation when submitting a quiz attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Dec 9, 2002
1 parent 776dc27 commit 9307692
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lang/en/quiz.php
Expand Up @@ -77,6 +77,7 @@
$string['quizopen'] = "Open the quiz";
$string['quiznotavailable'] = "The quiz will not be available until: \$a";
$string['random'] = "Random set";
$string['readytosend'] = "You are about to send your whole quiz to be graded. Are you sure you want to continue?";
$string['regrade'] = "Regrade all attempts";
$string['regradecomplete'] = "All attempts have been regraded";
$string['regradecount'] = "\$a->changed out of \$a->attempt grades were changed";
Expand Down
4 changes: 3 additions & 1 deletion mod/quiz/lib.php
Expand Up @@ -411,7 +411,9 @@ function quiz_print_quiz_questions($quiz, $results=NULL) {
return false;
}

echo "<FORM METHOD=POST ACTION=attempt.php>";
$strconfirmattempt = addslashes(get_string("readytosend", "quiz"));

echo "<FORM METHOD=POST ACTION=attempt.php onsubmit=\"return confirm('$strconfirmattempt');\">";
echo "<INPUT TYPE=hidden NAME=q VALUE=\"$quiz->id\">";

foreach ($questions as $key => $questionid) {
Expand Down

0 comments on commit 9307692

Please sign in to comment.