Skip to content

Commit

Permalink
Merge branch 'MDL-33030_m22' of git://github.com/rwijaya/moodle into …
Browse files Browse the repository at this point in the history
…MOODLE_22_STABLE
  • Loading branch information
danpoltawski committed Jul 9, 2012
2 parents 1c426ac + 06f52d3 commit 92e6306
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mod/lesson/renderer.php
Expand Up @@ -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:
Expand Down

0 comments on commit 92e6306

Please sign in to comment.