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

Completion conditions are caching until all conditions are met

    XMLWordPrintable

    Details

      Description

      It appears that custom completion conditions are caching, because we only refresh the data in the cache when overall activity completion is reached. A few examples of where this  can be reproduced are as follows:

      mod_scorm

      1. Set a limit of 1 attempt on the activity.
      2. Log in as a student and go through the activity.
      3. The "Do all parts of this activity" completion condition will display as "failed".
      4. Clear caches.
      5. Refresh the page and the "Do all parts of this activity" completion condition will display as "done" (expected behaviour).

      mod_forum

      1. Set completion conditions for minimum discussions, posts and replies (1 for each).
      2. Meet those requirements as a student.
      3. See that the relevant completion conditions still show as "to do" status.
      4. Clear caches.
      5. Refresh the page and those conditions will now display as "done".

      mod_glossary

      1. Set "Student must create entries [ 1 ]".
      2. Log in as a student and add an entry.
      3. The "Make entries: 1" completion condition will display as "todo".
      4. Clear caches.
      5. Refresh the page and the "Make entries: 1" completion condition will display as "done" (expected behaviour).

      After further investigation, it appears this would affect any activities with custom completion conditions, where it's possible for a student to have completed some, but not all conditions. I also noticed that forum was missing a call to update the cache when discussions are created, which also need correcting for this to work correctly.

      To automate tests for this, some extra completion status checks can be added to the relevant behats which landed as part of MDL-71162.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michaelh Michael Hawkins
              Reporter:
              michaelh Michael Hawkins
              Peer reviewer:
              Simey Lameze Simey Lameze
              Integrator:
              Jun Pataleta Jun Pataleta
              Tester:
              CiBoT CiBoT
              Participants:
              Component watchers:
              Sam Marshall, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/21

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 days, 2 hours, 41 minutes
                  4d 2h 41m