]> git.mjollnir.org Git - moodle.git/commitdiff
Error with submitting quizzes - regression caused by MDL-15542.
authortjhunt <tjhunt>
Tue, 22 Jul 2008 11:01:56 +0000 (11:01 +0000)
committertjhunt <tjhunt>
Tue, 22 Jul 2008 11:01:56 +0000 (11:01 +0000)
mod/quiz/accessrules.php
mod/quiz/processattempt.php

index 82a8e40ee1de7c4a100800b30d77911b8cddfd5a..0c91c6d3f4aea67e0ff727d6864d8da0e0f05978 100644 (file)
@@ -631,11 +631,13 @@ class password_access_rule extends quiz_access_rule_base {
     /// Print the password entry form.
         $output .= '<p>' . get_string('requirepasswordmessage', 'quiz') . "</p>\n";
         $output .= '<form id="passwordform" method="post" action="' . $CFG->wwwroot .
-                '/mod/quiz/startattempt.php?q=' . $this->_quiz->id .
-                '" onclick="this.autocomplete=\'off\'">' . "\n";
+                '/mod/quiz/startattempt.php" onclick="this.autocomplete=\'off\'">' . "\n";
         $output .= "<div>\n";
         $output .= '<label for="quizpassword">' . get_string('password') . "</label>\n";
         $output .= '<input name="quizpassword" id="quizpassword" type="password" value=""/>' . "\n";
+        $output .= '<input name="cmid" type="hidden" value="' .
+                $this->_quizobj->get_cmid() . '"/>' . "\n";
+        $output .= '<input name="sesskey" type="hidden" value="' . sesskey() . '"/>' . "\n";
         $output .= '<input type="submit" value="' . get_string('ok') . '" />';
         $output .= '<input type="submit" name="cancelpassword" value="' .
                 get_string('cancel') . '" />' . "\n";
index bf86e505c12228a183565619b6a55aab68ae7644..f82383a04d21273850c5afce496cc63df686d077 100644 (file)
@@ -51,7 +51,7 @@ if (optional_param('gotosummary', false, PARAM_BOOL)) {
 if ($nextpage == -1) {
     $nexturl = $attemptobj->summary_url();
 } else {
-    $nexturl = $attemptobj->attempt_url($nextpage);
+    $nexturl = $attemptobj->attempt_url(0, $nextpage);
 }
 
 /// We treat automatically closed attempts just like normally closed attempts