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

SCORM activity completion not triggering under certain conditions

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • m43-mdl79967
    • mdl79967
    • Hide

      Prerequisites

      1. Check out the latest weekly release without the patch for this issue
      2. Create a course with completion tracking turned on.
      3. Create a SCORM package inside a course, using: RuntimeMinimumCalls_SCORM12.zip
      4. In the "completion conditions" section for this SCORM use the settings  "add requirements":
        1. Check "Require minimum score:" - a default score of 0 is fine.
        2. Check "Passed".
      5. Save the SCORM to the course.
      6. As the site admin, enable SCORM debugging by going to admin > plugins > activities > SCORM and setting "allowapidebug" to on.

      Test 1 (upgrade)

      Before patch
      1. Login as a student to the site and enter the SCORM.
        The SCORM debugger should generate a pop-up window (you may need to disable browser-based pop-up blocking if it does not launch.)
        1. In the SCORM debugger window, set "Select Data Model Element to Get or Set" to "cmi.core.lesson_status"
        2. In the value to set field put the text "failed" (all lowercase)
        3. Press the button "LMSSetValue()" to set this value.
        4. Press the "LMSCommit()" button to save this value to Moodle.
        5. In the SCORM debugger set "Select Data Model Element to Get or Set" to "cmi.core.score.raw"
        6. In the value to set field put the text "10"
        7. In the SCORM debugger set "Select Data Model Element to Get or Set" again to "cmi.core.score.raw"
        8. In the value to set field put the text "50"
        9. Press the "LMSCommit()" button to save this value to Moodle.
          • You'll get an General exception alert. Dismiss this.
        10. Set "Select Data Model Element to Get or Set" again to "cmi.core.lesson_status"
        11. In the value to set field put the text "passed" (all lowercase)
        12. Press the button "LMSSetValue()" to set this value.
        13. Press the "LMSCommit()" button to save this value to Moodle.
          • You'll get an General exception alert. Dismiss this.
        14. Press the button "LMSFinish()"
      2. Go back to the course homepage.
      3. You'll see that the SCORM activity is still marked as To Do.
      With the patch
      1. Check out the appropriate branch that you're testing with the patch applied.
      2. Login as an admin.
      3. Run through the upgrade step.
      4. Then run the ad-hoc tasks process by hitting the "run now" option on the ad-hoc task in the list of scheduled tasks.
        • Or on terminal, go to your moodle instance's root folder and run "php admin/cli/adhoc_task.php --execute"
      5. Login as the student used in the test above and navigate to the course home page.
      6. Confirm that the SCORM activity completion shows the activity as "Done" with the green checkmark.

      Test 2

      1. Login as a new student to the site and enter the same SCORM package.
        The SCORM debugger should generate a pop-up window (you may need to disable browser-based pop-up blocking.)
        1. In the SCORM debugger set "Select Data Model Element to Get or Set" to "cmi.core.lesson_status"
        2. In the value to set field put the text "failed" (all lowercase)
        3. Press the button "LMSSetValue()" to set this value.
        4. Press the "LMSCommit()" button to save this value back to Moodle.
        5. Make sure the debugger does not return an error like "LMSCommit Failed! Error # Code: 101 Error Description: General exception"
        6. in the SCORM debugger set "Select Data Model Element to Get or Set" to "cmi.core.score.raw"
        7. In the value to set field put the text "10"
        8. Press the "LMSCommit()" button to save this value back to Moodle.
        9. Make sure the debugger does not return an error like "LMSCommit Failed! Error Code: 101 Error Description: General exception"
        10. in the SCORM debugger set "Select Data Model Element to Get or Set" to "cmi.core.score.raw"
        11. In the value to set field put the text "50"
        12. Press the "LMSCommit()" button to save this value back to Moodle.
        13. Make sure the debugger does not return an error like "LMSCommit Failed! Error Code: 101 Error Description: General exception"
        14. in the SCORM debugger set "Select Data Model Element to Get or Set" to "cmi.core.lesson_status"
        15. In the value to set field put the text "passed" (all lower case)
        16. Press the button "LMSSetValue()" to set this value.
        17. Press the button "LMSFinish()"
      2. Return to the homepage of the course
      3. Confirm that the SCORM activity completion shows the activity as "Done" with the green checkmark.
      Show
      Prerequisites Check out the latest weekly release without the patch for this issue Create a course with completion tracking turned on. Create a SCORM package inside a course, using: RuntimeMinimumCalls_SCORM12.zip In the "completion conditions" section for this SCORM use the settings  "add requirements": Check "Require minimum score:" - a default score of 0 is fine. Check "Passed". Save the SCORM to the course. As the site admin, enable SCORM debugging by going to admin > plugins > activities > SCORM and setting " allowapidebug " to on. Test 1 (upgrade) Before patch Login as a student to the site and enter the SCORM. The SCORM debugger should generate a pop-up window (you may need to disable browser-based pop-up blocking if it does not launch.) In the SCORM debugger window, set "Select Data Model Element to Get or Set" to "cmi.core.lesson_status" In the value to set field put the text "failed" (all lowercase) Press the button "LMSSetValue()" to set this value. Press the "LMSCommit()" button to save this value to Moodle. In the SCORM debugger set "Select Data Model Element to Get or Set" to "cmi.core.score.raw" In the value to set field put the text "10" In the SCORM debugger set "Select Data Model Element to Get or Set" again to "cmi.core.score.raw" In the value to set field put the text "50" Press the "LMSCommit()" button to save this value to Moodle. You'll get an General exception alert. Dismiss this. Set "Select Data Model Element to Get or Set" again to "cmi.core.lesson_status" In the value to set field put the text "passed" (all lowercase) Press the button "LMSSetValue()" to set this value. Press the "LMSCommit()" button to save this value to Moodle. You'll get an General exception alert. Dismiss this. Press the button "LMSFinish()" Go back to the course homepage. You'll see that the SCORM activity is still marked as To Do. With the patch Check out the appropriate branch that you're testing with the patch applied. Login as an admin. Run through the upgrade step. Then run the ad-hoc tasks process by hitting the "run now" option on the ad-hoc task in the list of scheduled tasks. Or on terminal, go to your moodle instance's root folder and run " php admin/cli/adhoc_task.php --execute " Login as the student used in the test above and navigate to the course home page. Confirm that the SCORM activity completion shows the activity as "Done" with the green checkmark. Test 2 Login as a new student to the site and enter the same SCORM package. The SCORM debugger should generate a pop-up window (you may need to disable browser-based pop-up blocking.) In the SCORM debugger set "Select Data Model Element to Get or Set" to "cmi.core.lesson_status" In the value to set field put the text "failed" (all lowercase) Press the button "LMSSetValue()" to set this value. Press the "LMSCommit()" button to save this value back to Moodle. Make sure the debugger does not return an error like "LMSCommit Failed! Error # Code: 101 Error Description: General exception" in the SCORM debugger set "Select Data Model Element to Get or Set" to "cmi.core.score.raw" In the value to set field put the text "10" Press the "LMSCommit()" button to save this value back to Moodle. Make sure the debugger does not return an error like "LMSCommit Failed! Error Code: 101 Error Description: General exception" in the SCORM debugger set "Select Data Model Element to Get or Set" to "cmi.core.score.raw" In the value to set field put the text "50" Press the "LMSCommit()" button to save this value back to Moodle. Make sure the debugger does not return an error like "LMSCommit Failed! Error Code: 101 Error Description: General exception" in the SCORM debugger set "Select Data Model Element to Get or Set" to "cmi.core.lesson_status" In the value to set field put the text "passed" (all lower case) Press the button "LMSSetValue()" to set this value. Press the button "LMSFinish()" Return to the homepage of the course Confirm that the SCORM activity completion shows the activity as "Done" with the green checkmark.

      SCORM packages that previously marked activity completion correctly in 3.9.x, no longer mark activity completion in 4.3.x. 

      It appears to only impact SCORM packages with a graded outcome (rather than by learning objects).

      Looking at the SCORM debugger, at a certain point during the content, the following error appears:

      Fields list in snapshot record does not match fields list in 'scorm_scoes_value'. Record is missing fields: attemptid, elementid

      • line 863 of /lib/classes/event/base.php: call to debugging()
      • line 598 of /mod/scorm/locallib.php: call to core\event\base->add_record_snapshot()
      • line 70 of /mod/scorm/datamodel.php: call to scorm_insert_track()

      Then, when looking at the standard logs (for that user), the SCORM activity logging stops. In this scenario, even if a user completes the SCORM content, the passed/completed is never recorded in Moodle and the activity is never marked as complete.

      The above scenario was confirmed in a fresh install of Moodle 4.3 (Apache/MySQL) with the same content.

      I believe this is related to the recent fix here: https://tracker.moodle.org/browse/MDL-46279

       

            danmarsden Dan Marsden
            davidpesce David Pesce
            Mihail Geshoski Mihail Geshoski
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            9 Vote for this issue
            Watchers:
            25 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 hours, 25 minutes
                7h 25m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.