Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.8.1
-
MOODLE_28_STABLE
-
MOODLE_29_STABLE
-
Description
Course lessons that do not have questions, and have a "View" completion requirement are marked as complete after the first page is viewed. While this is probably okay by most standards, it doesn't clearly indicate that a user has at least been exposed to every page in the lesson. This can be problematic if the lesson is something like mandatory training for legal compliance. In a dispute, a user could make the case that they simply never saw the screen.
The steps to reproduce this are here:
1) create a lesson with several pages and no questions
2) give it a "viewed" completion requirement
3) as a student, view the first page of the lesson
4) return to the course and refresh (possibly relogging in first to clear cache)
the lesson will be incorrectly shown as complete.
The patch I've created resolves two issues:
1) there currently is only a completion_info::set_module_viewed() method which both marks a lesson as viewed, and - through relatively complex and nested logic - also marks it as complete. This really should be separated into two distinct commands: set_module_viewed() and set_module_completion(). The later being the function that sets the completion status of a lesson module.
2) when the course is being presented, a check for LESSON_EOL takes place and marks the lesson as completed at that point (regardless of pass/fail - in the same vein as it presently works) using the set_module_completion() method and passing in a COMPLETION_COMPLETE value.