Affects Version/s: 1.9.8
Fix Version/s: None
Currently, the progress bar calculates a completion percentage based on the total number of pages in the lesson. If the user restarts the lesson, the progress bar doesn't reset. In other words, once the user views all the pages, the progress bar will always be completely green. In some cases, this is the desired behavior. In other cases, course designers want one of the following instead:
Progress bar represents the position of the current page in the lesson, rather than a completion percentage. For example, page 2 of 10, rather than 20%. Resetting the progress bar isn't an issue in this case.
Progress bar represents a completion percentage, but it resets when the user restarts the lesson. This may not be as important, because in this case, what they really want is probably the position, not the percentage.
Ideally, the behavior of the progress bar would be configurable within the UI. Instead of just turning the progress bar on or off, the course designer would specify a certain behavior (non-resetting completion percentage, resetting completion percentage, or page position).
This behavior comes from the lesson_print_progress_bar() function in \mod\lesson\locallib.php
The current calculation is count($viewedpageids)/count($validpages).
To show the position of the current page, it would need the position instead of count($viewedpageids). Apparently the position comes from prevpageid and nextpageid in mdl_lesson_pages.
To show a completion percentage that resets, it would perform the same calculation, but count($viewedpageids) would need to be based on the current session, not the life of the lesson.