1.9 Workaround for "Force New Attempt"

1.9 Workaround for "Force New Attempt"

by Jeff Snyder -
Number of replies: 2

I recently had to try to force a user to take a new attempt of a SCORM using M1.9.6.  Unfortunately, the "Force New Attempt" option wasn't available until M2.x.  I asked for help here, and scoured the forums.  I ended up figuring it out on my own, and decided to share it here in case there are others in the same boat.  See the original post here .

 

The fix I found is to force the checkbox to stay checked for "Start a new attempt"  this was done by modifying:

<input type="checkbox" id="a" name="newattempt" /> 

to

<input type="checkbox" id="a" name="newattempt" checked="checked" onclick="return false" />

in mod\scorm\locallib.php.  The box appears with a checked value, and is unable to be unchecked.

And, to force the user to use the Enter button and actually start a new attempt everytime, I modified:

$result->toc .= $statusicon.'&nbsp;'.$startbold.'<a href="'.$url.'">'.format_string($sco->title).'</a>'.$score.$endbold."</li>\n";

to 

$result->toc .= $statusicon.'&nbsp;'.$score.$endbold."</li>\n";

in mod\scorm\datamodels\scorm_12lib.php.

 

I hope this helps someone else!

 

Jeff

Average of ratings: -
In reply to Jeff Snyder

Re: 1.9 Workaround for "Force New Attempt"

by Paul Lynch -

Thanks Jeff! Helped alot! Been trying to find a fix for this for ages! You wouldn't happen to know how to disable the course links in Moodle 2.0 would you? I cannot find the line:

$result->toc .= $statusicon.'&nbsp;'.$startbold.'<a href="'.$url.'">'.format_string($sco->title).'</a>'.$score.$endbold."</li>\n";

in mod\scorm\datamodels\scorm_12lib.php in Moodle 2.0.

In reply to Jeff Snyder

Re: 1.9 Workaround for "Force New Attempt"

by Paul Drayton -

Jeff! You're a life saver. Works great, and was so quick, saved my so much pain.... smile


Paul