MDL-31775 Lesson Module: fixed start at last page seen bug

This commit is contained in:
Rossiani Wijaya 2012-03-20 17:36:21 +08:00
parent 832626da76
commit 9530780571

View file

@ -194,7 +194,7 @@ if (empty($pageid)) {
// if there are any questions have been answered correctly in this attempt
$corrrectattempts = $lesson->get_attempts($retries, true);
if ($corrrectattempts>0) {
foreach ($corrrectattempts as $attempt) {
$attempt = end($corrrectattempts);
$jumpto = $DB->get_field('lesson_answers', 'jumpto', array('id' => $attempt->answerid));
// convert the jumpto to a proper page id
if ($jumpto == 0) { // unlikely value!
@ -207,8 +207,6 @@ if (empty($pageid)) {
} else {
$lastpageseen = $jumpto;
}
break; // only look at the latest correct attempt
}
}
if ($branchtables = $DB->get_records('lesson_branch', array("lessonid"=>$lesson->id, "userid"=>$USER->id, "retry"=>$retries), 'timeseen DESC')) {