MDL-59785 mod_book: all navigation styles must mark as completed

This commit is contained in:
Simey Lameze 2017-08-10 16:11:33 +08:00
parent 8146b1f06d
commit 1c729ff624

View File

@ -149,7 +149,6 @@ foreach ($chapters as $ch) {
$last = $ch->id;
}
$islastchapter = false;
if ($book->navstyle) {
$navprevicon = right_to_left() ? 'nav_next' : 'nav_prev';
$navnexticon = right_to_left() ? 'nav_prev' : 'nav_next';
@ -196,11 +195,15 @@ if ($book->navstyle) {
$chnavigation .= ' <a title="' . $navexit . '" class="bookexit" href="'.$returnurl.'">' .
'<span class="chaptername">' . $navexit . '&nbsp;' . $OUTPUT->uarrow() . '</span></a>';
}
$islastchapter = true;
}
}
// We need to discover if this is the last chapter to mark activity as completed.
$islastchapter = false;
if (!$nextid) {
$islastchapter = true;
}
book_view($book, $chapter, $islastchapter, $course, $cm, $context);
// =====================================================