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

SCORM "Force new attempt" setting not always taken into account

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.5, 2.3.2
    • Fix Version/s: 2.5.6, 2.6.3
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide

      Create a SCORM package in your course and test with the following settings
      (use a scorm that provides a complete status - Fruit quiz is a good one)

      Test 1
      Use the following settings:
      Number of attempts: Unlimited
      Force new attempt: Yes
      Student skip content structure: Always
      Display package: New Window

      Enter the SCORM as a student (not admin/teacher)
      Complete the SCORM - make sure lesson_status is complete or passed.
      Enter the SCORM again and make sure it generates a new attempt.

      Test 2
      Use the following settings:
      Number of attempts: Unlimited
      Force new attempt: Yes
      Student skip content structure: First Access
      Display package: New Window

      Enter the SCORM as a student (not admin/teacher)
      On first entry it should open popup immediately - complete this attempt by answering all questions correctly and make sure it provides a lesson_status of complete or passed.
      Enter the SCORM again (If first entry was completed) it should display scorm/view.php to student with form to allow entry but no "checkbox" to "start new attempt", Enter SCORM and make sure it generates a new attempt.

      Test 3
      Use the following settings:
      Number of attempts: Unlimited
      Force new attempt: Yes
      Student skip content structure: Always
      Display package: current Window

      Enter the SCORM as a student (not admin/teacher)
      Complete the SCORM - make sure lesson_status is complete or passed.
      Enter the SCORM again and make sure it generates a new attempt.

      Test 4
      Use the following settings:
      Number of attempts: Unlimited
      Force new attempt: No
      Student skip content structure: Never
      Display package: current Window

      Enter the SCORM
      Complete the SCORM - make sure lesson_status is complete or passed.
      Enter the SCORM again, make sure the checkbox "start new attempt" is ticked and make sure it generates a new attempt.

      Test 5
      Use the following settings:
      Number of attempts: Unlimited
      Force new attempt: No
      Student skip content structure: Never
      Display package: current Window

      Enter the SCORM
      Complete the SCORM - make sure lesson_status is complete or passed.
      Enter the SCORM again, make sure the checkbox "start new attempt" is NOT ticked and make sure "review mode" is shown at the top of the TOC

      Test 6
      Use the Single Activity Course format and the following settings in your SCORM:
      Number of attempts: Unlimited
      Force new attempt: Yes
      Student skip content structure: First Access
      Display package: New Window

      Enter the SCORM as a student (not admin/teacher)
      On first entry it should open popup immediately - complete this attempt by answering all questions correctly and make sure it provides a lesson_status of complete or passed.
      Enter the SCORM again (If first entry was completed) it should display scorm/view.php to student with form to allow entry but no "checkbox" to "start new attempt", Enter SCORM and make sure it generates a new attempt.

      NOTE: The skipview setting only applies to students - if skipview is set and a teacher/admin is logged in it reacts as if skipview is set to never - this is historically because the view.php page was the only navigation point to allow a teacher to access SCORM reports.

      Show
      Create a SCORM package in your course and test with the following settings (use a scorm that provides a complete status - Fruit quiz is a good one) Test 1 Use the following settings: Number of attempts: Unlimited Force new attempt: Yes Student skip content structure: Always Display package: New Window Enter the SCORM as a student (not admin/teacher) Complete the SCORM - make sure lesson_status is complete or passed. Enter the SCORM again and make sure it generates a new attempt. Test 2 Use the following settings: Number of attempts: Unlimited Force new attempt: Yes Student skip content structure: First Access Display package: New Window Enter the SCORM as a student (not admin/teacher) On first entry it should open popup immediately - complete this attempt by answering all questions correctly and make sure it provides a lesson_status of complete or passed. Enter the SCORM again (If first entry was completed) it should display scorm/view.php to student with form to allow entry but no "checkbox" to "start new attempt", Enter SCORM and make sure it generates a new attempt. Test 3 Use the following settings: Number of attempts: Unlimited Force new attempt: Yes Student skip content structure: Always Display package: current Window Enter the SCORM as a student (not admin/teacher) Complete the SCORM - make sure lesson_status is complete or passed. Enter the SCORM again and make sure it generates a new attempt. Test 4 Use the following settings: Number of attempts: Unlimited Force new attempt: No Student skip content structure: Never Display package: current Window Enter the SCORM Complete the SCORM - make sure lesson_status is complete or passed. Enter the SCORM again, make sure the checkbox "start new attempt" is ticked and make sure it generates a new attempt. Test 5 Use the following settings: Number of attempts: Unlimited Force new attempt: No Student skip content structure: Never Display package: current Window Enter the SCORM Complete the SCORM - make sure lesson_status is complete or passed. Enter the SCORM again, make sure the checkbox "start new attempt" is NOT ticked and make sure "review mode" is shown at the top of the TOC Test 6 Use the Single Activity Course format and the following settings in your SCORM: Number of attempts: Unlimited Force new attempt: Yes Student skip content structure: First Access Display package: New Window Enter the SCORM as a student (not admin/teacher) On first entry it should open popup immediately - complete this attempt by answering all questions correctly and make sure it provides a lesson_status of complete or passed. Enter the SCORM again (If first entry was completed) it should display scorm/view.php to student with form to allow entry but no "checkbox" to "start new attempt", Enter SCORM and make sure it generates a new attempt. NOTE: The skipview setting only applies to students - if skipview is set and a teacher/admin is logged in it reacts as if skipview is set to never - this is historically because the view.php page was the only navigation point to allow a teacher to access SCORM reports.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull 2.6 Branch:
      m26_MDL-37733
    • Pull Master Branch:
      master_MDL-37733

      Description

      Set a SCORM package to "Force new attempt"

      • If using the Enter button on content structure page, the setting is properly used (parameter newattempt=on is shown on the URL)
      • If content structure page is skipped, and the SCORM package is directly launched from the course page, it works fine as well.
      • However, if the course structure is displayed on the entry page and that the student clicks on the link inside the structure treeview to enter the package (instead of the Enter button) then the parameter is not considered and the package starts in review mode.

      I think it should be consistent between the two options for entering the course. A workaround is to hide the structure on the entry page but some information is lost for the students. It has been reproduced with Chrome and Firefox.

      I actually tested it on 2.2.4 and 2.3.2.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            danmarsden Dan Marsden added a comment -

            thanks for the report - I've added this to the stable backlog - if you have time to work on this feel free to add a patch and I'll review it otherwise it's likely to sit in the tracker here for a while.

            Show
            danmarsden Dan Marsden added a comment - thanks for the report - I've added this to the stable backlog - if you have time to work on this feel free to add a patch and I'll review it otherwise it's likely to sit in the tracker here for a while.
            Hide
            qmtester Larry Kennedy added a comment -

            Dan: In some respects this sounds like it's related to mdl-32585. I tried dozens of variations to test the logic of the configuration options (highest attempt/last completed attempt; force new attempt yes or no; etc. and the logic seemed, well illogical. And I had the same experience as the writer. I also read some comments around the Moodle community where one person said they chose "never" and got a result they wanted; while another said they chose "always" because "never" created other problems. The patch suggested in mdl-32585 might solve all this.

            Show
            qmtester Larry Kennedy added a comment - Dan: In some respects this sounds like it's related to mdl-32585. I tried dozens of variations to test the logic of the configuration options (highest attempt/last completed attempt; force new attempt yes or no; etc. and the logic seemed, well illogical. And I had the same experience as the writer. I also read some comments around the Moodle community where one person said they chose "never" and got a result they wanted; while another said they chose "always" because "never" created other problems. The patch suggested in mdl-32585 might solve all this.
            Hide
            danmarsden Dan Marsden added a comment -

            thanks Larry - this particular issue is with the way force new attempt setting is checked and the different ways a user can enter the SCORM - this particular issue is with the TOC that is displayed on the SCORM entry page (view.php) when the SCORM is configured to display the TOC on the entry page the user can click the links in the TOC to launch specific scos within the SCORM - unfortunately when loaded this way the code doesn't check the force new attempt setting correctly so a fix to MDL-32585 won't change this behaviour at all.

            Show
            danmarsden Dan Marsden added a comment - thanks Larry - this particular issue is with the way force new attempt setting is checked and the different ways a user can enter the SCORM - this particular issue is with the TOC that is displayed on the SCORM entry page (view.php) when the SCORM is configured to display the TOC on the entry page the user can click the links in the TOC to launch specific scos within the SCORM - unfortunately when loaded this way the code doesn't check the force new attempt setting correctly so a fix to MDL-32585 won't change this behaviour at all.
            Hide
            tollstorff Niclas Tollstorff added a comment - - edited

            I have made a patch for this bug.
            The setting was enforced with a POST/GET parameter, which was not set in the link from the TOC. I don't think the issue here is that the link did not have that parameter, but rather that the code was so reliant on being passed the right parameters in the first place. Even without considering the issues regarding the TOC, this lack of validation poses a problem. It would seem easy to tamper with the POST request to always bypass the "force new attempt" setting.

            The patch fixes this specific problem, by checking that the value passed as a parameter actually makes sense in the context of the user's attempts and the module's settings.

            Patch repository: https://github.com/tollstorff/moodle
            The patch is residing in branch m26_MDL-37733, which is to be integrated into MOODLE_26_STABLE.

            Commit: https://github.com/tollstorff/moodle/commit/b2f90c6c335996cd5ec1d15eb7154fbc8afe555f

            Show
            tollstorff Niclas Tollstorff added a comment - - edited I have made a patch for this bug. The setting was enforced with a POST/GET parameter, which was not set in the link from the TOC. I don't think the issue here is that the link did not have that parameter, but rather that the code was so reliant on being passed the right parameters in the first place. Even without considering the issues regarding the TOC, this lack of validation poses a problem. It would seem easy to tamper with the POST request to always bypass the "force new attempt" setting. The patch fixes this specific problem, by checking that the value passed as a parameter actually makes sense in the context of the user's attempts and the module's settings. Patch repository: https://github.com/tollstorff/moodle The patch is residing in branch m26_ MDL-37733 , which is to be integrated into MOODLE_26_STABLE. Commit: https://github.com/tollstorff/moodle/commit/b2f90c6c335996cd5ec1d15eb7154fbc8afe555f
            Hide
            danmarsden Dan Marsden added a comment -

            Hi Niclas - thanks for working on this!

            I'd prefer to keep all the work inside the existing function scorm_check_mode - if you could modify your code to do that it would be great!

            Show
            danmarsden Dan Marsden added a comment - Hi Niclas - thanks for working on this! I'd prefer to keep all the work inside the existing function scorm_check_mode - if you could modify your code to do that it would be great!
            Hide
            tollstorff Niclas Tollstorff added a comment -

            Hi Dan,

            Thanks for the feedback.
            I see what you are saying - I considered that as well, but it did not seem quite right, to me, to broaden the responsibility of a function called "scorm_check_mode" to also check (and possibly change) the value of anything other than the mode.

            That is a minor detail though, so I will modify my code to do as requested.
            I expect to push an updated version tomorrow.

            Show
            tollstorff Niclas Tollstorff added a comment - Hi Dan, Thanks for the feedback. I see what you are saying - I considered that as well, but it did not seem quite right, to me, to broaden the responsibility of a function called "scorm_check_mode" to also check (and possibly change) the value of anything other than the mode. That is a minor detail though, so I will modify my code to do as requested. I expect to push an updated version tomorrow.
            Hide
            danmarsden Dan Marsden added a comment -

            Thanks - I wish it had been named differently too!

            We could probably change the name of the function in a change to the master branch and keep the old name in the stable branches..

            Show
            danmarsden Dan Marsden added a comment - Thanks - I wish it had been named differently too! We could probably change the name of the function in a change to the master branch and keep the old name in the stable branches..
            Hide
            tollstorff Niclas Tollstorff added a comment -

            Hi Dan,

            That sounds like a great idea. I have updated the patch in the repository linked above.

            Show
            tollstorff Niclas Tollstorff added a comment - Hi Dan, That sounds like a great idea. I have updated the patch in the repository linked above.
            Hide
            danmarsden Dan Marsden added a comment -

            I'm just taking another look at this now - I've tidied up the patch a bit here:
            https://github.com/danmarsden/moodle/compare/moodle:MOODLE_26_STABLE...m26_MDL-37733

            I think this patch breaks browse mode and is inefficient for browse mode - will see if I can fix that nicely here too.

            Show
            danmarsden Dan Marsden added a comment - I'm just taking another look at this now - I've tidied up the patch a bit here: https://github.com/danmarsden/moodle/compare/moodle:MOODLE_26_STABLE...m26_MDL-37733 I think this patch breaks browse mode and is inefficient for browse mode - will see if I can fix that nicely here too.
            Hide
            danmarsden Dan Marsden added a comment -

            heh - preview mode doesn't work correctly if force new attempt is set in old code either.

            Show
            danmarsden Dan Marsden added a comment - heh - preview mode doesn't work correctly if force new attempt is set in old code either.
            Hide
            cibot CiBoT added a comment -

            Results for MDL-37733

            • Remote repository: git://github.com/danmarsden/moodle.git
            Show
            cibot CiBoT added a comment - Results for MDL-37733 Remote repository: git://github.com/danmarsden/moodle.git Remote branch m25_ MDL-37733 to be integrated into upstream MOODLE_25_STABLE Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/1365 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/1365/artifact/work/smurf.html Remote branch m26_ MDL-37733 to be integrated into upstream MOODLE_26_STABLE Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/1366 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/1366/artifact/work/smurf.html Remote branch master_ MDL-37733 to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/1367 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/1367/artifact/work/smurf.html
            Hide
            cibot CiBoT added a comment -

            Results for MDL-37733

            • Remote repository: git://github.com/danmarsden/moodle.git
            Show
            cibot CiBoT added a comment - Results for MDL-37733 Remote repository: git://github.com/danmarsden/moodle.git Remote branch m25_ MDL-37733 to be integrated into upstream MOODLE_25_STABLE Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/1370 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/1370/artifact/work/smurf.html Remote branch m26_ MDL-37733 to be integrated into upstream MOODLE_26_STABLE Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/1371 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/1371/artifact/work/smurf.html Remote branch master_ MDL-37733 to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/1372 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/1372/artifact/work/smurf.html
            Hide
            danmarsden Dan Marsden added a comment -

            rebased and bouncing up for integration - I think we've waited long enough for peer review - thanks!

            Show
            danmarsden Dan Marsden added a comment - rebased and bouncing up for integration - I think we've waited long enough for peer review - thanks!
            Hide
            cibot CiBoT added a comment -

            Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

            Show
            cibot CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Thanks Dan this has been integrated now

            Show
            samhemelryk Sam Hemelryk added a comment - Thanks Dan this has been integrated now
            Hide
            dobedobedoh Andrew Nicols added a comment -

            I'm failing this because the testing instructions are incomplete/wrong and as such, I'm having some difficulty testing it:

            • The SCORM packages I have available to me (including the Fruit quizzes one suggested) aren't suitable. The Fruit quiz has broken JS when displayed in current window form - it tries to close a popup which isn't open and thus fails to save the details, which prevents me from testing 3, 4, and 5.
            • The option 'Student skip content structure: Always' does not exist for single activity course formats (or SCORM course format in 2.5) so I cannot test 6 - the only valid choices are 'Never', and 'First Access'

            At present, the following pass:

            • 1
            • 2
            • 7
            Show
            dobedobedoh Andrew Nicols added a comment - I'm failing this because the testing instructions are incomplete/wrong and as such, I'm having some difficulty testing it: The SCORM packages I have available to me (including the Fruit quizzes one suggested) aren't suitable. The Fruit quiz has broken JS when displayed in current window form - it tries to close a popup which isn't open and thus fails to save the details, which prevents me from testing 3, 4, and 5. The option 'Student skip content structure: Always' does not exist for single activity course formats (or SCORM course format in 2.5) so I cannot test 6 - the only valid choices are 'Never', and 'First Access' At present, the following pass: 1 2 7
            Hide
            danmarsden Dan Marsden added a comment -

            cool - thanks Andrew, removed 6 - that was a bad copy/paste on my part, looking at the others now.

            Show
            danmarsden Dan Marsden added a comment - cool - thanks Andrew, removed 6 - that was a bad copy/paste on my part, looking at the others now.
            Hide
            danmarsden Dan Marsden added a comment -

            a better SCORM package would be "ContentPackagingSingleSCO_SCORM12.zip" which is in the zip here:
            http://scorm.com/wp-content/assets/golf_examples/PIFS/AllGolfExamples.zip

            Note (with 6 removed, Test 7 has been renumbered as 6)

            Show
            danmarsden Dan Marsden added a comment - a better SCORM package would be "ContentPackagingSingleSCO_SCORM12.zip" which is in the zip here: http://scorm.com/wp-content/assets/golf_examples/PIFS/AllGolfExamples.zip Note (with 6 removed, Test 7 has been renumbered as 6)
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Thanks for amending the testing instructions and providing the additional scorm package Dan.

            Sending this back to testing now.

            Show
            samhemelryk Sam Hemelryk added a comment - Thanks for amending the testing instructions and providing the additional scorm package Dan. Sending this back to testing now.
            Hide
            dobedobedoh Andrew Nicols added a comment -

            Testing instructions for steps 4, and 5 have the same settings, but with different expectations. Pinging Dan Marsden for clarification.

            Show
            dobedobedoh Andrew Nicols added a comment - Testing instructions for steps 4, and 5 have the same settings, but with different expectations. Pinging Dan Marsden for clarification.
            Hide
            dobedobedoh Andrew Nicols added a comment -

            Also, ContentPackagingSingleSCO_SCORM12 gives an error when trying to run it:

            Not implemented yet

            See the runtime and sequencing examples for launchable courses

            Was this the correct package to use?

            Show
            dobedobedoh Andrew Nicols added a comment - Also, ContentPackagingSingleSCO_SCORM12 gives an error when trying to run it: Not implemented yet See the runtime and sequencing examples for launchable courses Was this the correct package to use?
            Hide
            dobedobedoh Andrew Nicols added a comment -

            Failing this again as I'm still unable to test. I've pinged Dan on Jabber but he's not around atm.

            Show
            dobedobedoh Andrew Nicols added a comment - Failing this again as I'm still unable to test. I've pinged Dan on Jabber but he's not around atm.
            Hide
            danmarsden Dan Marsden added a comment -

            Hi Andrew - 4 and 5 are same settings but last step is different - "start new attempt" checkbox ticked in one test, unticked in the other.

            I'll test that SCORM package again... sorry about that - I thought it worked correctly!

            Show
            danmarsden Dan Marsden added a comment - Hi Andrew - 4 and 5 are same settings but last step is different - "start new attempt" checkbox ticked in one test, unticked in the other. I'll test that SCORM package again... sorry about that - I thought it worked correctly!
            Hide
            danmarsden Dan Marsden added a comment -

            ah - yeah wrong package - we should be using "RuntimeBasicCalls_SCORM12.zip" from http://scorm.com/wp-content/assets/golf_examples/PIFS/AllGolfExamples.zip

            unfortunately it's a bit of a longer package to test than the fruit quiz sorry. - to get a lesson_status of passed you must skip to the last slide with the quiz and answer all questions correctly (the answer is given beside each question in blue) (also the exit button built into the SCORM package doesn't do anything - you need to hit the "exit activity" link in the top right of the player or just close the window/navigate away from the page normally.

            if we've run out of time and this is holding up the integration cycle please reject and we'll deal with it next week instead.

            Thanks Andrew!

            Show
            danmarsden Dan Marsden added a comment - ah - yeah wrong package - we should be using "RuntimeBasicCalls_SCORM12.zip" from http://scorm.com/wp-content/assets/golf_examples/PIFS/AllGolfExamples.zip unfortunately it's a bit of a longer package to test than the fruit quiz sorry. - to get a lesson_status of passed you must skip to the last slide with the quiz and answer all questions correctly (the answer is given beside each question in blue) (also the exit button built into the SCORM package doesn't do anything - you need to hit the "exit activity" link in the top right of the player or just close the window/navigate away from the page normally. if we've run out of time and this is holding up the integration cycle please reject and we'll deal with it next week instead. Thanks Andrew!
            Hide
            dobedobedoh Andrew Nicols added a comment -

            W00t. Working now
            Thanks Dan!

            Show
            dobedobedoh Andrew Nicols added a comment - W00t. Working now Thanks Dan!
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            The price of success is hard work,
            dedication to the job at hand,
            and the determination that whether we win or lose,
            we have applied the best of ourselves to the task at hand.

            Vince Lombardi

            This is now part of Moodle, your favorite non-frameworkial LMS, LOL. Thanks, closing!

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - The price of success is hard work, dedication to the job at hand, and the determination that whether we win or lose, we have applied the best of ourselves to the task at hand. Vince Lombardi This is now part of Moodle, your favorite non-frameworkial LMS, LOL. Thanks, closing! Ciao
            Hide
            ciaran.irvine@totaralms.com Ciaran Irvine added a comment -

            Hi folks, we've come across a scorm problem that we suspect might be related to this patch - though it may just be a coincidence that it was noticed the day after we merged in 2.5.6

            Below is the report to reproduce from one of our developers:

            1. Create a course
            2. Create a SCORM activity - a quiz-type scorm with internal pass/fail score is good
            Settings:
            Number of attempts: Unlimited
            Attempts grading: Highest attempt
            3. As admin you open the SCORM in mode: Normal
            4. Fail the scorm
            5. Click the "Exit activity " link at the top of the page.
            6. Enter again as the admin and open the SCORM in mode: Normal
            7. Attempt to pass the second time.
            8. You should see that the new score is not reflected in the second attempt. It should have been, but it isn't because the mode was changed internally to 'review' inside the scorm_check_mode function.
            9. You can also see the number of attempts in the scorm view was not changed.

            The culprit again (I think) is the scorm_check_mode function.

            Even if the "force new attempt" setting is set to yes it doesn't change because there is a conditional (line 1566) where the number of attempt should be different from 1 and $attempt is defined as follow $attempt = scorm_get_last_attempt($scorm->id, $USER->id); (mod/scorm/player.php line 67) if not record is present then it returns 1 and if the record exists and was the first attempt it also return 1.

            We're looking into it ourselves but one of you, with more familiarity with the scorm code, may see the solution immediately.

            If this is confirmed but needs to be a new bug report just let me know.

            Show
            ciaran.irvine@totaralms.com Ciaran Irvine added a comment - Hi folks, we've come across a scorm problem that we suspect might be related to this patch - though it may just be a coincidence that it was noticed the day after we merged in 2.5.6 Below is the report to reproduce from one of our developers: 1. Create a course 2. Create a SCORM activity - a quiz-type scorm with internal pass/fail score is good Settings: Number of attempts: Unlimited Attempts grading: Highest attempt 3. As admin you open the SCORM in mode: Normal 4. Fail the scorm 5. Click the "Exit activity " link at the top of the page. 6. Enter again as the admin and open the SCORM in mode: Normal 7. Attempt to pass the second time. 8. You should see that the new score is not reflected in the second attempt. It should have been, but it isn't because the mode was changed internally to 'review' inside the scorm_check_mode function. 9. You can also see the number of attempts in the scorm view was not changed. The culprit again (I think) is the scorm_check_mode function. Even if the "force new attempt" setting is set to yes it doesn't change because there is a conditional (line 1566) where the number of attempt should be different from 1 and $attempt is defined as follow $attempt = scorm_get_last_attempt($scorm->id, $USER->id); (mod/scorm/player.php line 67) if not record is present then it returns 1 and if the record exists and was the first attempt it also return 1. We're looking into it ourselves but one of you, with more familiarity with the scorm code, may see the solution immediately. If this is confirmed but needs to be a new bug report just let me know.
            Hide
            ciaran.irvine@totaralms.com Ciaran Irvine added a comment -

            I suspect it is line 1566 (in 2.5)

            } else if (($attempt !== '1') && !empty($scorm->forcenewattempt))

            { At this point $attempt == 1 for the first attempt *and the second*, but the else means we can only be here if the first attempt is complete (though, possibly, failed) So for a second attempt at a failed scorm, newattempt is never set to 'on' and attempts after the first are never recorded. I guess the line should incorporate the logic from L1571: }

            else if ((($attempt < $scorm->maxattempt) || ($scorm->maxattempt == 0)) || !empty($scorm->forcenewattempt)) {

            So...if we have a complete attempt already, but the user is allowed unlimited/more attempts, OR forcenewattempt is on, make it a new attempt

            then 1571 just needs to be

            if ($newattempt == 'on') {

            Show
            ciaran.irvine@totaralms.com Ciaran Irvine added a comment - I suspect it is line 1566 (in 2.5) } else if (($attempt !== '1') && !empty($scorm->forcenewattempt)) { At this point $attempt == 1 for the first attempt *and the second*, but the else means we can only be here if the first attempt is complete (though, possibly, failed) So for a second attempt at a failed scorm, newattempt is never set to 'on' and attempts after the first are never recorded. I guess the line should incorporate the logic from L1571: } else if ((($attempt < $scorm->maxattempt) || ($scorm->maxattempt == 0)) || !empty($scorm->forcenewattempt)) { So...if we have a complete attempt already, but the user is allowed unlimited/more attempts, OR forcenewattempt is on, make it a new attempt then 1571 just needs to be if ($newattempt == 'on') {
            Hide
            danmarsden Dan Marsden added a comment -

            Hi Ciaran - a quick comment without looking at your full comments there:
            The SCORM spec states that a SCORM attempt is finished if the lesson_status is set to "completed", "passed" or "failed" - a re-entry of that same attempt will result in review mode as per the spec.

            To allow re-entry and to continue a pre-existing attempt the lesson_status should be: 'incomplete', 'browsed' or 'notattempted'

            Show
            danmarsden Dan Marsden added a comment - Hi Ciaran - a quick comment without looking at your full comments there: The SCORM spec states that a SCORM attempt is finished if the lesson_status is set to "completed", "passed" or "failed" - a re-entry of that same attempt will result in review mode as per the spec. To allow re-entry and to continue a pre-existing attempt the lesson_status should be: 'incomplete', 'browsed' or 'notattempted'
            Hide
            danmarsden Dan Marsden added a comment -

            so... if the lesson_status is set to "failed" and force new attempt is set it should generate a new attempt - if it's not doing that it's a bug.

            Show
            danmarsden Dan Marsden added a comment - so... if the lesson_status is set to "failed" and force new attempt is set it should generate a new attempt - if it's not doing that it's a bug.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/May/14