]> git.mjollnir.org Git - moodle.git/commitdiff
Add a javascript confirmation when submitting a quiz attempt
authormoodler <moodler>
Mon, 9 Dec 2002 08:20:19 +0000 (08:20 +0000)
committermoodler <moodler>
Mon, 9 Dec 2002 08:20:19 +0000 (08:20 +0000)
lang/en/quiz.php
mod/quiz/lib.php

index ba4753a0a534c1fe371e7077c0a89f59e42f506f..220250fa102fa1ac0b0d43473bcad28eb4eabd44 100644 (file)
@@ -77,6 +77,7 @@ $string['quizclosed'] = "This quiz closed on \$a";
 $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";
index 8afa78dcf1945774bbef5bc80fd5f0cfd0d6aad5..03fa2d6989dabf44b58920120c9413bc90f5ee02 100644 (file)
@@ -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) {