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

Default value of some CMI elements is not computed correctly.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2, 2.3
    • Fix Version/s: 2.2.1
    • Component/s: SCORM
    • Testing Instructions:
      Hide

      It can be tested by running the SCORM Test Harness for DMI package - Data Model Implementation Test 1.
      1. Download the DMI Test package.
      2. Run the SCORM Test Harness for DMI as specified here - SCORM Test Harness
      3. Check the Log to make sure these errors do not show:
      (for Resumed Activity 1)
      ERROR: Evaluating GetValue("cmi.progress_measure") - Expected: "0.9" - LMS Returned: ""
      ERROR: Evaluating GetLastError("") - Expected: "0" - LMS Returned: "403"

      (for Resumed Activity 4)
      ERROR: Evaluating GetValue("cmi.learner_preference.audio_level") - Expected: "50.9" - LMS Returned: "1"
      Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"
      ERROR: Evaluating GetValue("cmi.learner_preference.language") - Expected: "zh-xiang" - LMS Returned: ""
      Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"
      ERROR: Evaluating GetValue("cmi.learner_preference.delivery_speed") - Expected: "50.9" - LMS Returned: "1"
      Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"

      NOTE: Many other errors are reported by this test package - this patch only addresses the issues mentioned.

      Show
      It can be tested by running the SCORM Test Harness for DMI package - Data Model Implementation Test 1. 1. Download the DMI Test package. 2. Run the SCORM Test Harness for DMI as specified here - SCORM Test Harness 3. Check the Log to make sure these errors do not show: (for Resumed Activity 1) ERROR: Evaluating GetValue("cmi.progress_measure") - Expected: "0.9" - LMS Returned: "" ERROR: Evaluating GetLastError("") - Expected: "0" - LMS Returned: "403" (for Resumed Activity 4) ERROR: Evaluating GetValue("cmi.learner_preference.audio_level") - Expected: "50.9" - LMS Returned: "1" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" ERROR: Evaluating GetValue("cmi.learner_preference.language") - Expected: "zh-xiang" - LMS Returned: "" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" ERROR: Evaluating GetValue("cmi.learner_preference.delivery_speed") - Expected: "50.9" - LMS Returned: "1" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" NOTE: Many other errors are reported by this test package - this patch only addresses the issues mentioned.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull Master Branch:
      master_MDL-30645

      Description

      The default value of the following CMI elements is not computed correctly -

      • cmi.learner_preference.audio_level,
      • cmi.learner_preference.language,
      • cmi.learner_preference.delivery_speed,
      • cmi.learner_preference.audio_captioning,
      • cmi.progress_measure.

      This causes the above elements to have an incorrect value when the SCO is resumed after a suspended state.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            mayank_gupta2005 Mayank Gupta added a comment -

            Hi,

            This patch -
            https://github.com/mayankgupta/moodle/commit/be054f8e30bc1539800b28437ce0c711dd9a6173

            fixes the evaluation of 'defaultvalue' of cmi.learner_preference.audio_level, cmi.learner_preference.language, cmi.learner_preference.delivery_speed, cmi.learner_preference.audio_captioning, cmi.progress_measure.

            Before applying Patch -
            Resume of Activity 1 - DMI package-

            ERROR: Evaluating GetValue("cmi.progress_measure") - Expected: "0.9" - LMS Returned: ""
            ERROR: Evaluating GetLastError("") - Expected: "0" - LMS Returned: "403"

            Resume of Activity 4 - DMI package-
            ERROR: Evaluating GetValue("cmi.learner_preference.audio_level") - Expected: "50.9" - LMS Returned: "1"
            Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"
            ERROR: Evaluating GetValue("cmi.learner_preference.language") - Expected: "zh-xiang" - LMS Returned: ""
            Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"
            ERROR: Evaluating GetValue("cmi.learner_preference.delivery_speed") - Expected: "50.9" - LMS Returned: "1"
            Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"
            Evaluating GetValue("cmi.learner_preference.audio_captioning") - Expected: "0" - LMS Returned: "0"
            Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"

            After patch -
            Resume of Activity 1 - DMI package-

            Evaluating GetValue("cmi.progress_measure") - Expected: "0.9" - LMS Returned: "0.9"
            Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"

            Resume of Activity 4 - DMI package-

            Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"
            Evaluating GetValue("cmi.learner_preference.audio_level") - Expected: "50.9" - LMS Returned: "50.9"
            Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"
            Evaluating GetValue("cmi.learner_preference.language") - Expected: "zh-xiang" - LMS Returned: "zh-xiang"
            Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"
            Evaluating GetValue("cmi.learner_preference.delivery_speed") - Expected: "50.9" - LMS Returned: "50.9"
            Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"
            Evaluating GetValue("cmi.learner_preference.audio_captioning") - Expected: "0" - LMS Returned: "0"
            Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0"

            NOTE For Integrator - The fix for MDL-30579 should be integrated before integrating this one - otherwise, cmi.progress_measure defaultvalue evaluation would not be fixed.

            Thanks,
            Mayank Gupta.

            Show
            mayank_gupta2005 Mayank Gupta added a comment - Hi, This patch - https://github.com/mayankgupta/moodle/commit/be054f8e30bc1539800b28437ce0c711dd9a6173 fixes the evaluation of 'defaultvalue' of cmi.learner_preference.audio_level, cmi.learner_preference.language, cmi.learner_preference.delivery_speed, cmi.learner_preference.audio_captioning, cmi.progress_measure. Before applying Patch - Resume of Activity 1 - DMI package- ERROR: Evaluating GetValue("cmi.progress_measure") - Expected: "0.9" - LMS Returned: "" ERROR: Evaluating GetLastError("") - Expected: "0" - LMS Returned: "403" Resume of Activity 4 - DMI package- ERROR: Evaluating GetValue("cmi.learner_preference.audio_level") - Expected: "50.9" - LMS Returned: "1" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" ERROR: Evaluating GetValue("cmi.learner_preference.language") - Expected: "zh-xiang" - LMS Returned: "" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" ERROR: Evaluating GetValue("cmi.learner_preference.delivery_speed") - Expected: "50.9" - LMS Returned: "1" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" Evaluating GetValue("cmi.learner_preference.audio_captioning") - Expected: "0" - LMS Returned: "0" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" After patch - Resume of Activity 1 - DMI package- Evaluating GetValue("cmi.progress_measure") - Expected: "0.9" - LMS Returned: "0.9" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" Resume of Activity 4 - DMI package- Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" Evaluating GetValue("cmi.learner_preference.audio_level") - Expected: "50.9" - LMS Returned: "50.9" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" Evaluating GetValue("cmi.learner_preference.language") - Expected: "zh-xiang" - LMS Returned: "zh-xiang" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" Evaluating GetValue("cmi.learner_preference.delivery_speed") - Expected: "50.9" - LMS Returned: "50.9" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" Evaluating GetValue("cmi.learner_preference.audio_captioning") - Expected: "0" - LMS Returned: "0" Evaluating GetLastError("") - Expected: "0" - LMS Returned: "0" NOTE For Integrator - The fix for MDL-30579 should be integrated before integrating this one - otherwise, cmi.progress_measure defaultvalue evaluation would not be fixed. Thanks, Mayank Gupta.
            Hide
            danmarsden Dan Marsden added a comment -

            Thanks Mayank - looks good - NOTE TO INTEGRATOR - MASTER ONLY - SCORM 2004 fixes are only applied to Master branch.

            Show
            danmarsden Dan Marsden added a comment - Thanks Mayank - looks good - NOTE TO INTEGRATOR - MASTER ONLY - SCORM 2004 fixes are only applied to Master branch.
            Hide
            nebgor Aparup Banerjee added a comment -

            Hi Mayank, Dan,
            Sorry this has had conflicts with the current integration, I've tried to have a quick look to resolve this but the code is rather cramped up in there .

            Rather than risk making mistakes, I'm reopening this so that you can submit it next week after resolving those conflicts.
            cheers - Apu

            Show
            nebgor Aparup Banerjee added a comment - Hi Mayank, Dan, Sorry this has had conflicts with the current integration, I've tried to have a quick look to resolve this but the code is rather cramped up in there . Rather than risk making mistakes, I'm reopening this so that you can submit it next week after resolving those conflicts. cheers - Apu
            Hide
            mayank_gupta2005 Mayank Gupta added a comment -

            Hi Aparup,

            Sorry for the conflict, I believe it is because the patch is expecting line 222 of scorm_13.js.php as -

            'cmi.progress_measure':{'defaultvalue':<?php echo isset($userdata->{'cmi.progess_measure'})?'\''.$userdata->{'cmi.progress_measure'}.'\'':'null' ?>, 'format':CMIDecimal, 'range':progress_range, 'mod':'rw'},

            but as you have already integrated - MDL-30579 line 222 has been changed to -

            'cmi.progress_measure':{'defaultvalue':<?php echo !empty($userdata->{'cmi.progess_measure'})?'\''.$userdata->{'cmi.progress_measure'}.'\'':'null' ?>, 'format':CMIDecimal, 'range':progress_range, 'mod':'rw'},

            Apologies - Should have given it a thought earlier, will add the patch to the updated code and start the cycle again.

            Thanks,
            Mayank.

            Show
            mayank_gupta2005 Mayank Gupta added a comment - Hi Aparup, Sorry for the conflict, I believe it is because the patch is expecting line 222 of scorm_13.js.php as - 'cmi.progress_measure':{'defaultvalue':<?php echo isset($userdata->{'cmi.progess_measure'})?'\''.$userdata->{'cmi.progress_measure'}.'\'':'null' ?>, 'format':CMIDecimal, 'range':progress_range, 'mod':'rw'}, but as you have already integrated - MDL-30579 line 222 has been changed to - 'cmi.progress_measure':{'defaultvalue':<?php echo !empty($userdata->{'cmi.progess_measure'})?'\''.$userdata->{'cmi.progress_measure'}.'\'':'null' ?>, 'format':CMIDecimal, 'range':progress_range, 'mod':'rw'}, Apologies - Should have given it a thought earlier, will add the patch to the updated code and start the cycle again. Thanks, Mayank.
            Hide
            danmarsden Dan Marsden added a comment -

            hehe - easy to do! - I run into this sort of issue every now and then too - let me know when you've updated and I'll re-submit - thanks Mayank!

            Show
            danmarsden Dan Marsden added a comment - hehe - easy to do! - I run into this sort of issue every now and then too - let me know when you've updated and I'll re-submit - thanks Mayank!
            Hide
            mayank_gupta2005 Mayank Gupta added a comment -

            Hi Dan,
            I have updated the master_MDL-30645 git branch. It should not conflict now. Please resubmit it!

            commit - https://github.com/mayankgupta/moodle/commit/5c10a3215089fd5bd5f8c5f4af144776cd3552b8

            Thanks,
            Mayank Gupta

            Show
            mayank_gupta2005 Mayank Gupta added a comment - Hi Dan, I have updated the master_ MDL-30645 git branch. It should not conflict now. Please resubmit it! commit - https://github.com/mayankgupta/moodle/commit/5c10a3215089fd5bd5f8c5f4af144776cd3552b8 Thanks, Mayank Gupta
            Hide
            nebgor Aparup Banerjee added a comment -

            Thank Mayank , i've picked that commit into master and 2.2.x. Its up for testing now

            Show
            nebgor Aparup Banerjee added a comment - Thank Mayank , i've picked that commit into master and 2.2.x. Its up for testing now
            Hide
            abgreeve Adrian Greeve added a comment -

            None of the error strings mentioned appeared. Test passed.

            Show
            abgreeve Adrian Greeve added a comment - None of the error strings mentioned appeared. Test passed.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Whoever decided one week was worth 14 days had really one bad idea. Anyway, the nightmare is over, so thanks for your, once again, amazing contributions. Many, many thanks!

            Now... disconnect, relax and enjoy the next days, yay!

            Closing...ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Whoever decided one week was worth 14 days had really one bad idea. Anyway, the nightmare is over, so thanks for your, once again, amazing contributions. Many, many thanks! Now... disconnect, relax and enjoy the next days, yay! Closing...ciao
            Hide
            mayank_gupta2005 Mayank Gupta added a comment -

            Thanks Dan, Aparup, Adrian, Eloy for reviewing, resubmitting, integrating, testing and closing this issue.

            -Mayank.

            Show
            mayank_gupta2005 Mayank Gupta added a comment - Thanks Dan, Aparup, Adrian, Eloy for reviewing, resubmitting, integrating, testing and closing this issue. -Mayank.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jan/12