]> git.mjollnir.org Git - moodle.git/commitdiff
OU bug 3463 - warnings when you start an attempt in 'each attempt builds on last...
authortjhunt <tjhunt>
Tue, 17 Jul 2007 15:27:59 +0000 (15:27 +0000)
committertjhunt <tjhunt>
Tue, 17 Jul 2007 15:27:59 +0000 (15:27 +0000)
lib/questionlib.php

index bb86cd72f51df0850053e2ea1581ddbd9753cc29..f118679e15716d89dc463186b769dcf8df226e0f 100644 (file)
@@ -1131,7 +1131,8 @@ function question_process_responses(&$question, &$state, $action, $cmoptions, &$
     // Check for unchanged responses (exactly unchanged, not equivalent).
     // We also have to catch questions that the student has not yet attempted
     $sameresponses = $QTYPES[$question->qtype]->compare_responses($question, $action, $state);
-    if ($state->last_graded->event == QUESTION_EVENTOPEN && question_isgradingevent($action->event)) {
+    if (!empty($state->last_graded) && $state->last_graded->event == QUESTION_EVENTOPEN &&
+            question_isgradingevent($action->event)) {
         $sameresponses = false;
     }