-
Bug
-
Resolution: Fixed
-
Minor
-
2.4
-
MOODLE_24_STABLE
-
MOODLE_24_STABLE
-
master_
MDL-36853
Replication steps:-
- Delpoy attached pack
- Attempt the two question as student, donot click "finish".
- Click "exist activity" instead
- Go back and restart your attempt to see the error.
Copying my comment from the linked issue:- - 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.
- There is no error when you finish attempt in the middle of the pack and restart it later.
- 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.
- 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¤torg=ORG-D0F45010CE879ED4C2A2CFD700E3F8F4&attempt=1"><img src="http://ankit.moodle.local/int/master/moodle/theme/image.php/standard/scorm/1353901637/incomplete" alt="Incomplete" title="Incomplete" /> Start Quiz </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
)
- 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¤torg=ORG-D0F45010CE879ED4C2A2CFD700E3F8F4&attempt=2"><img src="http://ankit.moodle.local/int/master/moodle/theme/image.php/standard/scorm/1353901637/failed" alt="Failed" title="Failed" /> Start Quiz (Score: 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¤torg=ORG-D0F45010CE879ED4C2A2CFD700E3F8F4&attempt=2
[incomplete] =>
)
)
[prerequisites] => 1
[incomplete] =>
[attemptleft] => 1
)
- As pointed out earlier this doesnt seem to have to do anything with the issue in hand, this is a whole different context.
Thanks