Description
Sometimes, when a user goes to resume their quiz attempt, they get a page saying "No questions found". The problem is that the url they get redirected to ( http://mymoodle.com/mod/quiz/attempt.php?attempt=564&page=28 ) has a non-existent page number. I've no idea where the 28 came from – there's only 3 pages in the quiz (10 questions each).
We've only seen this since moving from 2.2 to 2.3.
I haven't managed to make the problem recur, but have seen 3 independent instances of the issue.
I've put in a rather hacky fix in mod/quiz/attemptlib.php::get_slots() so that if it can't find the quiz page, it shows all, but the real fix should find where the incorrect page number comes from.
public function get_slots($page = 'all') {
//Hacky fix added by Mark to prevent noquesitonsfound error with non-existent page #s
if ($page !== 'all') {
if(!array_key_exists($page, $this->pagelayout))
}
if ($page === 'all') {
$numbers = array();
foreach ($this->pagelayout as $numbersonpage)
return $numbers;
} else
}
Refs:
http://moodle.org/mod/forum/discuss.php?d=206271
http://moodle.org/mod/forum/discuss.php?d=206272