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

PHP warnings when returning to an existing attempt

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4
    • 2.4.2
    • SCORM

    Description

      Replication steps:-

      1. Delpoy attached pack
      2. Attempt the two question as student, donot click "finish".
      3. Click "exist activity" instead
      4. Go back and restart your attempt to see the error.
        Copying my comment from the linked issue:-
      5. I dug a little deeper. The problem happens when you attempt the package, exit the activity after finishing both question but donot click "finish". And than restart the attempt.
      6. There is no error when you finish attempt in the middle of the pack and restart it later.
      7. The error is basically since $result->sco is returned as an array containing a sco object where as the code expects it do be the sco object itself.
      8. Dump of $result without error case:-

        stdClass Object
        (
            [toc] => <div id="scorm_layout">
        <div id="scorm_toc">
        <div id="scorm_tree">
        <ul>
        	<li>
        <a title="a=7&scoid=23&currentorg=ORG-D0F45010CE879ED4C2A2CFD700E3F8F4&attempt=1"><img src="http://ankit.moodle.local/int/master/moodle/theme/image.php/standard/scorm/1353901637/incomplete" alt="Incomplete" title="Incomplete" />&nbsp;Start Quiz&nbsp;</a>	</li>
        </ul>
        </div></div></div>
        <div id="scorm_navpanel"></div>
         
            [toctitle] => Flash Custom (Single SCO)
            [sco] => stdClass Object
                (
                    [id] => 23
                    [scorm] => 7
                    [manifest] => MANIFEST-3A3A393295D01FA6530767F976AF706A
                    [organization] => ORG-D0F45010CE879ED4C2A2CFD700E3F8F4
                    [parent] => ORG-D0F45010CE879ED4C2A2CFD700E3F8F4
                    [identifier] => ITEM-0B4EA308CA525F05ACA9283381611BD9
                    [launch] => test.html
                    [scormtype] => sco
                    [title] => Start Quiz
                    [isvisible] => true
                    [parameters] => 
                    [maxtimeallowed] => 0000:30:00:00
                    [timelimitaction] => continue,no message
                    [masteryscore] => 80
                )
         
            [prerequisites] => 1
            [incomplete] => 1
            [attemptleft] => 1
        )
        

      9. Dump of $result during the error:-

        stdClass Object
        (
            [toc] => <div id="scorm_layout">
        <div id="scorm_toc">
        <div id="scorm_tree">
        <ul>
        	<li>
        <a title="a=6&scoid=21&currentorg=ORG-D0F45010CE879ED4C2A2CFD700E3F8F4&attempt=2"><img src="http://ankit.moodle.local/int/master/moodle/theme/image.php/standard/scorm/1353901637/failed" alt="Failed" title="Failed" />&nbsp;Start Quiz&nbsp;(Score:&nbsp;50)</a>	</li>
        </ul>
        </div></div></div>
        <div id="scorm_navpanel"></div>
         
            [toctitle] => Flash Custom (Single SCO)
            [sco] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => 21
                            [scorm] => 6
                            [manifest] => MANIFEST-3A3A393295D01FA6530767F976AF706A
                            [organization] => ORG-D0F45010CE879ED4C2A2CFD700E3F8F4
                            [parent] => ORG-D0F45010CE879ED4C2A2CFD700E3F8F4
                            [identifier] => ITEM-0B4EA308CA525F05ACA9283381611BD9
                            [launch] => test.html
                            [scormtype] => sco
                            [title] => Start Quiz
                            [isvisible] => 1
                            [parameters] => 
                            [maxtimeallowed] => 0000:30:00:00
                            [timelimitaction] => continue,no message
                            [masteryscore] => 80
                            [prereq] => 1
                            [statusicon] => <img src="http://ankit.moodle.local/int/master/moodle/theme/image.php/standard/scorm/1353901637/failed" alt="Failed" title="Failed" />
                            [url] => a=6&scoid=21&currentorg=ORG-D0F45010CE879ED4C2A2CFD700E3F8F4&attempt=2
                            [incomplete] => 
                        )
         
                )
         
            [prerequisites] => 1
            [incomplete] => 
            [attemptleft] => 1
        )
        

      10. As pointed out earlier this doesnt seem to have to do anything with the issue in hand, this is a whole different context.

      Thanks

      Attachments

        Issue Links

          Activity

            People

              danmarsden Dan Marsden
              ankit_frenz Ankit Agarwal
              Ankit Agarwal Ankit Agarwal
              Dan Poltawski Dan Poltawski
              Michael de Raadt Michael de Raadt
              Dan Marsden, Matteo Scaramuccia, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Mar/13