Moodle
  1. Moodle
  2. MDL-34644

View activity criteria not being marked as complete

    Details

    • Testing Instructions:
      Hide
      1. Add a scorm package and set activity completion to "when the conditions are met" and "user must view activity" (no other settings should be activated)
      2. View the activity as the user
      3. exit the SCORM before making any selections inside the SCORM package
      4. The activity completion report should show them as complete
      Show
      Add a scorm package and set activity completion to "when the conditions are met" and "user must view activity" (no other settings should be activated) View the activity as the user exit the SCORM before making any selections inside the SCORM package The activity completion report should show them as complete
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      master_MDL-34644

      Description

      We've had a case reported where a particular scorm activity wasn't getting marked as complete after viewing it when "user must view this activity" was the only criteria.

      To reproduce:

      1. Create a course
      2. Add a scorm activity
      3. Add a scorm package and set activity completion to "when the conditions are met" and "user must view activity"
      4. View the activity as the user
      5. The activity completion report should show them as complete, but they are shown as not complete.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Simon Coggins added a comment -

            Patch to fix this issue

            Show
            Simon Coggins added a comment - Patch to fix this issue
            Hide
            Simon Coggins added a comment -

            Looks like my patch causes some unit tests to break - the attached file includes fixes for the tests too.

            Show
            Simon Coggins added a comment - Looks like my patch causes some unit tests to break - the attached file includes fixes for the tests too.
            Hide
            Michael de Raadt added a comment -

            Hi, Simon.

            There has been some recent changes involving SCORM and activity completion. The changes were applied to 2.3 only. I'm not sure if those changes would involve viewing of SCORM activities specifically. There were no unit test modifications in MDL-27469.

            Dan: could you please look at this and comment?

            Show
            Michael de Raadt added a comment - Hi, Simon. There has been some recent changes involving SCORM and activity completion. The changes were applied to 2.3 only. I'm not sure if those changes would involve viewing of SCORM activities specifically. There were no unit test modifications in MDL-27469 . Dan: could you please look at this and comment?
            Hide
            Dan Marsden added a comment -

            thanks Michael - I don't actually think this is SCORM specific but could be a problem with other modules as well? - I haven't had a chance to check it quite yet.

            Show
            Dan Marsden added a comment - thanks Michael - I don't actually think this is SCORM specific but could be a problem with other modules as well? - I haven't had a chance to check it quite yet.
            Hide
            Amir Elion added a comment -

            Hi Dan,
            As far as we tested, view condition works fine with other modules, does not work only for SCORM.
            SCORM seems to work OK with other conditions (e.g. completed, or passed) but not with the view condition.

            Show
            Amir Elion added a comment - Hi Dan, As far as we tested, view condition works fine with other modules, does not work only for SCORM. SCORM seems to work OK with other conditions (e.g. completed, or passed) but not with the view condition.
            Hide
            Dan Marsden added a comment -

            just confirming this only affects Moodle 2.3 and higher as scorm_get_completion_state doesn't exist before 2.3

            Show
            Dan Marsden added a comment - just confirming this only affects Moodle 2.3 and higher as scorm_get_completion_state doesn't exist before 2.3
            Hide
            Dan Marsden added a comment -

            new patch from Simon - pushing up for peer review.

            Show
            Dan Marsden added a comment - new patch from Simon - pushing up for peer review.
            Hide
            Simon Coggins added a comment -

            Thanks Dan, please ignore the attached patch files, the patch on github replaces them both.

            Show
            Simon Coggins added a comment - Thanks Dan, please ignore the attached patch files, the patch on github replaces them both.
            Hide
            Ankit Agarwal added a comment -

            Hi guys,
            With the patch in place, I see the scorm being marked as complete for every single user. I tried even creating a new user and as soon as the user was enrolled in the course, the activity was marked as complete for him.
            It may be because we are simply returning $type in such cases, may be there is something I am missing?

            Thanks

            Show
            Ankit Agarwal added a comment - Hi guys, With the patch in place, I see the scorm being marked as complete for every single user. I tried even creating a new user and as soon as the user was enrolled in the course, the activity was marked as complete for him. It may be because we are simply returning $type in such cases, may be there is something I am missing? Thanks
            Hide
            Dan Marsden added a comment -

            sounds weird - Simon/Amir does this occur for you too?

            looking at the completion code - internal_get_state() seems responsible for checking the "viewed" state - and if set but the user hasn't viewed it should return COMPLETION_INCOMPLETE before checking via scorm_get_completion_state()

            quick question - are you using loginas functionality? or logging in as a real user?

            Show
            Dan Marsden added a comment - sounds weird - Simon/Amir does this occur for you too? looking at the completion code - internal_get_state() seems responsible for checking the "viewed" state - and if set but the user hasn't viewed it should return COMPLETION_INCOMPLETE before checking via scorm_get_completion_state() quick question - are you using loginas functionality? or logging in as a real user?
            Hide
            Ankit Agarwal added a comment -

            I didnt even login with that account...as admin I created the account and than went to course>report>activity completion.

            I will give it another try tomorrow.
            Thanks

            Show
            Ankit Agarwal added a comment - I didnt even login with that account...as admin I created the account and than went to course>report>activity completion. I will give it another try tomorrow. Thanks
            Hide
            Simon Coggins added a comment -

            I've retested on dan's branch above and I can't reproduce that problem - I can view and get marked as complete for one user and other enrolled users are unaffected.

            Simon

            Show
            Simon Coggins added a comment - I've retested on dan's branch above and I can't reproduce that problem - I can view and get marked as complete for one user and other enrolled users are unaffected. Simon
            Hide
            Ankit Agarwal added a comment -

            Sorry this missed my radar somehow. Anyways I Rosie tested it and seems it is working fine. Was something with the caching I guess.
            +1 for integration.
            Thanks

            Show
            Ankit Agarwal added a comment - Sorry this missed my radar somehow. Anyways I Rosie tested it and seems it is working fine. Was something with the caching I guess. +1 for integration. Thanks
            Hide
            Eloy Lafuente (stronk7) added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            Dan Poltawski added a comment -

            Thanks Simon & Dan, i've integrated this now.

            Show
            Dan Poltawski added a comment - Thanks Simon & Dan, i've integrated this now.
            Hide
            Frédéric Massart added a comment -

            Test successful on 2.3 and master. Cheers!

            Show
            Frédéric Massart added a comment - Test successful on 2.3 and master. Cheers!
            Hide
            Dan Poltawski added a comment -

            Congratulations, you've done it!

            Thanks, this change is now in the latest weekly release!

            Join the crowds of people tomorrow from 8am and download this Moodle release from your local apple store!

            Show
            Dan Poltawski added a comment - Congratulations, you've done it! Thanks, this change is now in the latest weekly release! Join the crowds of people tomorrow from 8am and download this Moodle release from your local apple store!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: