Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix notice. Merged from MOODLE_17_STABLE.

  • Loading branch information...
commit 3849917982cbe2d539e0b468bc859c4e9c4b2a57 1 parent ae4d27e
tjhunt authored
Showing with 5 additions and 2 deletions.
  1. +3 −1 lib/questionlib.php
  2. +2 −1  mod/quiz/attempt.php
View
4 lib/questionlib.php
@@ -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
View
3  mod/quiz/attempt.php
@@ -285,7 +285,8 @@
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)) {
Please sign in to comment.
Something went wrong with that request. Please try again.