Merge branch 'MDL-32318' of git://github.com/timhunt/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 10 Apr 2012 02:26:49 +0000 (10:26 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 10 Apr 2012 02:26:49 +0000 (10:26 +0800)
mod/quiz/accessrule/delaybetweenattempts/rule.php
question/engine/questionusage.php

index 947b91f..c5153aa 100644 (file)
@@ -81,7 +81,7 @@ class quizaccess_delaybetweenattempts extends quiz_access_rule_base {
         $lastattemptfinish = $lastattempt->timefinish;
         if ($this->quiz->timelimit > 0) {
             $lastattemptfinish = min($lastattemptfinish,
-            $lastattempt->timestart + $this->quiz->timelimit);
+                    $lastattempt->timestart + $this->quiz->timelimit);
         }
 
         if ($numprevattempts == 1 && $this->quiz->delay1) {
index 8c59bb9..8d7ffa9 100644 (file)
@@ -171,8 +171,8 @@ class question_usage_by_activity {
         } else {
             $this->questionattempts[] = $qa;
         }
-        $ids = array_keys($this->questionattempts);
-        $qa->set_slot(end($ids));
+        end($this->questionattempts); // Ready to get the last key on the next line.
+        $qa->set_slot(key($this->questionattempts));
         $this->observer->notify_attempt_added($qa);
         return $qa->get_slot();
     }