Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-48244

Lessons with no questions show completed after the first page is viewed

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      • At site level enable completion tracking
      • create a course and enable completion tracking
      • create a lesson with setting Completion tracking set to "Show activity as complete when conditions are met" and check "Require end reached'
      • add some content pages to the lesson
      • as a student attempt the lesson and verify it is marked as completed if and only if you see the end of lesson page (the one with "Congratulations ..."
      • as an administrator verify that the completion setting for the lesson is correctly preseved by backup and restore
      • verify that an old backup with a lesson without this setting is correctly restored without any error or warning
      Show
      At site level enable completion tracking create a course and enable completion tracking create a lesson with setting Completion tracking set to "Show activity as complete when conditions are met" and check "Require end reached' add some content pages to the lesson as a student attempt the lesson and verify it is marked as completed if and only if you see the end of lesson page (the one with "Congratulations ..." as an administrator verify that the completion setting for the lesson is correctly preseved by backup and restore verify that an old backup with a lesson without this setting is correctly restored without any error or warning
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull Master Branch:

      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.

        Attachments

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/May/15