Browse files

Merge branch 'MDL-33030_m22' of git://github.com/rwijaya/moodle into …

…MOODLE_22_STABLE
  • Loading branch information...
2 parents 1c426ac + 06f52d3 commit 92e63062d4faa62edf5a6e74d16fa2c7f455a5c5 @danpoltawski danpoltawski committed Jul 9, 2012
Showing with 10 additions and 5 deletions.
  1. +10 −5 mod/lesson/renderer.php
View
15 mod/lesson/renderer.php
@@ -510,15 +510,20 @@ public function progress_bar(lesson $lesson) {
$ntries = 0; // may not be necessary
}
-
$viewedpageids = array();
- if ($attempts = $lesson->get_attempts($ntries, true)) {
- $viewedpageids = array_merge($viewedpageids, array_keys($attempts));
+ if ($attempts = $lesson->get_attempts($ntries, false)) {
+ foreach($attempts as $attempt) {
+ $viewedpageids[$attempt->pageid] = $attempt;
+ }
}
+ $viewedbranches = array();
// collect all of the branch tables viewed
- if ($viewedbranches = $DB->get_records("lesson_branch", array ("lessonid"=>$lesson->id, "userid"=>$USER->id, "retry"=>$ntries), 'timeseen DESC', 'id, pageid')) {
- $viewedpageids = array_merge($viewedpageids, array_keys($viewedbranches));
+ if ($branches = $DB->get_records("lesson_branch", array ("lessonid"=>$lesson->id, "userid"=>$USER->id, "retry"=>$ntries), 'timeseen ASC', 'id, pageid')) {
+ foreach($branches as $branch) {
+ $viewedbranches[$branch->pageid] = $branch;
+ }
+ $viewedpageids = array_merge($viewedpageids, $viewedbranches);
}
// Filter out the following pages:

0 comments on commit 92e6306

Please sign in to comment.