Add a javascript confirmation when submitting a quiz attempt
This commit is contained in:
@@ -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";
|
||||
|
||||
+3
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user