Skip to content

Commit

Permalink
Fix notice. Merged from MOODLE_17_STABLE.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhunt committed Mar 30, 2007
1 parent ae4d27e commit 3849917
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/questionlib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -634,8 +634,10 @@ function get_question_options(&$questions) {
* @param object $cmoptions * @param object $cmoptions
* @param object $attempt The attempt for which the question sessions are * @param object $attempt The attempt for which the question sessions are
* to be restored or created. * 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; global $CFG, $QTYPES;


// get the question ids // get the question ids
Expand Down
3 changes: 2 additions & 1 deletion mod/quiz/attempt.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@
error('Could not load question options'); 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) { if ($newattempt and $attempt->attempt > 1 and $quiz->attemptonlast and !$attempt->preview) {
// Find the previous attempt // Find the previous attempt
if (!$lastattemptid = get_field('quiz_attempts', 'uniqueid', 'quiz', $attempt->quiz, 'userid', $attempt->userid, 'attempt', $attempt->attempt-1)) { if (!$lastattemptid = get_field('quiz_attempts', 'uniqueid', 'quiz', $attempt->quiz, 'userid', $attempt->userid, 'attempt', $attempt->attempt-1)) {
Expand Down

0 comments on commit 3849917

Please sign in to comment.