]> git.mjollnir.org Git - moodle.git/commitdiff
Fix notice. Merged from MOODLE_17_STABLE.
authortjhunt <tjhunt>
Fri, 30 Mar 2007 09:34:05 +0000 (09:34 +0000)
committertjhunt <tjhunt>
Fri, 30 Mar 2007 09:34:05 +0000 (09:34 +0000)
lib/questionlib.php
mod/quiz/attempt.php

index 008373659ec1d5c55d1abda9488b9d3206c2e01c..fd53272d0e80b96271942343e8156a83dffba7ba 100644 (file)
@@ -634,8 +634,10 @@ function get_question_options(&$questions) {
 * @param object $cmoptions
 * @param object $attempt  The attempt for which the question sessions are
 *                         to be restored or created.
+* @param mixed either the id of a previous attempt, if this attmpt is
+*                         building on a previous one, or false for a clean attempt.
 */
-function get_question_states(&$questions, $cmoptions, $attempt, $lastattemptid=null) {
+function get_question_states(&$questions, $cmoptions, $attempt, $lastattemptid = false) {
     global $CFG, $QTYPES;
 
     // get the question ids
index 7ed0978b6a2f0c44f0dc86a11b27839fccf8591f..618148e6e7be9383855639173fe1b3801f02e97f 100644 (file)
         error('Could not load question options');
     }
 
-    // If the new attempt is to be based on a previous attempt find its id 
+    // If the new attempt is to be based on a previous attempt find its id
+    $lastattemptid = false;
     if ($newattempt and $attempt->attempt > 1 and $quiz->attemptonlast and !$attempt->preview) {
         // Find the previous attempt
         if (!$lastattemptid = get_field('quiz_attempts', 'uniqueid', 'quiz', $attempt->quiz, 'userid', $attempt->userid, 'attempt', $attempt->attempt-1)) {