Reputation: 17
I have very simple SCO, containing empty html page. Using chrome dev tools I use pipwerks scorm api wrapper to initialize LMS connection, set cmi.completion_status to "completed" and cmi.success_status to "failed" (according to scorm runtime reference ), save and exit. When I return back to LMS web page my attempt is not considered "completed". If I try and set success status to "passed" everything is good, SCO is considered completed and I'm able to close it. I guess it's some imsmanifest.xml option I'm missing to get this done.
This is my imsmanifest.xml file:
<?xml version="1.0" standalone="no" ?>
<manifest identifier="com.scorm.golfsamples.contentpackaging.singlesco.20043rd" version="1"
xmlns="http://www.imsglobal.org/xsd/imscp_v1p1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_v1p3"
xmlns:adlseq="http://www.adlnet.org/xsd/adlseq_v1p3"
xmlns:adlnav="http://www.adlnet.org/xsd/adlnav_v1p3"
xmlns:imsss="http://www.imsglobal.org/xsd/imsss"
xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 imscp_v1p1.xsd
http://www.adlnet.org/xsd/adlcp_v1p3 adlcp_v1p3.xsd
http://www.adlnet.org/xsd/adlseq_v1p3 adlseq_v1p3.xsd
http://www.adlnet.org/xsd/adlnav_v1p3 adlnav_v1p3.xsd
http://www.imsglobal.org/xsd/imsss imsss_v1p0.xsd">
<metadata>
<schema>ADL SCORM</schema>
<schemaversion>2004 3rd Edition</schemaversion>
</metadata>
<organizations default="golf_sample_default_org">
<organization identifier="golf_sample_default_org">
<title>Single SCO</title>
<item identifier="item_1" identifierref="resource_1">
<title>Single SCO</title>
</item>
</organization>
</organizations>
<resources>
<resource identifier="resource_1" type="webcontent" adlcp:scormType="sco" href="index.html">
<file href = "index.html"/>
<file href = "SCORM_API_WRAPPER.js"/>
</resource>
</resources>
</manifest>
HTML page I'm using:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Single SCO</title>
<script src="SCORM_API_wrapper.js"></script>
<script>
function loadPage() {
pipwerks.SCORM.init();
pipwerks.SCORM.set("cmi.completion_status", "completed");
pipwerks.SCORM.set("cmi.success_status", "failed");
pipwerks.SCORM.set("cmi.score.raw", "50");
pipwerks.SCORM.set("cmi.score.min", "0");
pipwerks.SCORM.set("cmi.score.max", "100");
pipwerks.SCORM.save();
}
</script>
</head>
<body onload="loadPage()">
</body>
</html>
UPD: I modified html page to automatically make these calls.
Upvotes: 0
Views: 575
Reputation: 2938
Looks like you're forgetting to set the exit status so you can re-load the same data -
pipwerks.SCORM.set("cmi.exit", "suspend");
Without the suspend state the next time you load it'll treat it as a new attempt, so the previous state won't get supplied to the API.
Upvotes: 0