You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(scorm): mark Welcome page unmarkForCompletion so LMS completion reports (#5)
The 0.0.3 release reported 0% completion to an LMS even
though the learner finished every quiz. Root cause, traced through the
HAR of a real attempt plus Xerte's xttracking_scorm1.2.js + xenith.js:
with navigation="Menu with Page Controls", Xerte inserts a built-in
Table-of-Contents page as x_pages[0] AFTER toCompletePages is built
from currActPage over the 43 content nodes. So every content page's
page_nr (used by exitInteraction to mark completedPages[i]) is
currActPage + 1 -- a systematic off-by-one:
- toCompletePages[0] == 0 could only be matched by page_nr == 0 (the
menu), which is never exited (menu pages are excluded from
x_endPageTracking), so completedPages[0] (the first content page,
"Welcome") stayed false forever.
- getSuccessStatus() returns 'incomplete' whenever any completedPages[i]
is false, so finishTracking() set cmi.core.lesson_status='incomplete'
(a no-op against Moodle's pre-set 'incomplete'), and the LMS never
left the incomplete state. cmi.core.score.raw WAS being sent (75, then
100) but never mattered to the displayed completion.
Changes to source/data.xml + source/preview.xml (identical):
- unmarkForCompletion="true" on the Welcome page
(linkID="PG1781882348053"). This makes markedPages skip currActPage
== 0, so toCompletePages becomes [1,2,...,42], aligning with the
content pages' page_nr values. completedPages[0] (Welcome) is now
marked true when the learner leaves it.
Validated end-to-end through a running XOT (docker-container branch)
instance on host port 8088:
- Pushed source/data.xml + source/preview.xml into the container; both
carry unmarkForCompletion="true" on the Welcome page and are
byte-identical to the repo source.
- play.php?template_id=1 returns 200; HTML5 editor opens.
- SCORM export is valid SCORM 1.2 (one SCO, 13 MB) and the exported
template.xml carries unmarkForCompletion="true", trackingMode="full",
trackingWeight 1x7 + 21, trackingPassed="80%", 45 questions, 8
quizzes, 0 empty options -- all unchanged from 0.0.3 except the fix.
- Drove the exported package against a SCORM 1.2 mock API: a completed
run sends cmi.core.lesson_status="passed" (score.raw=100), a failing
run sends lesson_status="failed" (score.raw=62.5), and an incomplete
run sends lesson_status="incomplete" + cmi.core.exit="suspend".
Before the fix the completed run reported "incomplete".
Trade-off: the Final quiz (page_nr == 43) is still outside
toCompletePages (no index 43), so its completion is not tracked in
completedPages -- but its score is still tracked via its interactions
and trackingWeight="21", so the LMS grade and pass/fail are correct.
The Welcome page is no longer "required" for completion, which is
acceptable for an intro page. A proper fix would be in the Xerte engine
(xenith.js: build toCompletePages from page_nr after the menu is
inserted), but that would not survive XOT rebuilds; this content-level
workaround is used because the release workflow builds from the XOT
engine. Do not remove unmarkForCompletion="true" from the Welcome page
without a replacement fix -- re-introducing the off-by-one will silently
break LMS completion reporting again.
Guidance updates:
- docs/PROJECT_CONTEXT.md: added "SCORM completion bug fix" section
documenting the root cause, fix, and trade-off; noted the Welcome
page carries unmarkForCompletion="true" in the current-state list.
- docs/COURSE_VERIFICATION.md: added "LMS completion fix (post-0.0.3)"
section with the HAR evidence, root cause, fix, and validation
results.
Generated with pi 0.80.3 and GLM 5.2
Co-authored-by: Robot <robosan@Robots-Virtual-Machine.local>
Copy file name to clipboardExpand all lines: source/data.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
<?xml version="1.0"?>
2
-
<learningObjecteditorVersion="3"targetFolder="Nottingham"name="Secure code development"language="en-GB"navigation="Menu with Page Controls"textSize="12"theme="default"themeIcons="false"displayMode="fill window"responsive="true"trackingMode="full"trackingPassed="80%"trackingPageTimeout="0"forceTrackingMode="false"restartOptions="ask"hideSaveSession="false"saveSessionLabel="Save Session"closeSessionLabel="Close Session"saveSessionIc="false"saveSessionIcon="fas fa-save"><textlinkID="PG1781882348053"name="Welcome &amp; how to use this course"><![CDATA[<h2>Welcome to Secure code development</h2>
2
+
<learningObjecteditorVersion="3"targetFolder="Nottingham"name="Secure code development"language="en-GB"navigation="Menu with Page Controls"textSize="12"theme="default"themeIcons="false"displayMode="fill window"responsive="true"trackingMode="full"trackingPassed="80%"trackingPageTimeout="0"forceTrackingMode="false"restartOptions="ask"hideSaveSession="false"saveSessionLabel="Save Session"closeSessionLabel="Close Session"saveSessionIc="false"saveSessionIcon="fas fa-save"><textunmarkForCompletion="true"linkID="PG1781882348053"name="Welcome &amp; how to use this course"><![CDATA[<h2>Welcome to Secure code development</h2>
3
3
4
4
<p>This course is for <strong>engineers building software with agents</strong> and for <strong>engineers building agents</strong>. Whether you are designing agentic systems, integrating LLMs, or writing the services that agents call, secure code development matters.</p>
Copy file name to clipboardExpand all lines: source/preview.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
<?xml version="1.0"?>
2
-
<learningObjecteditorVersion="3"targetFolder="Nottingham"name="Secure code development"language="en-GB"navigation="Menu with Page Controls"textSize="12"theme="default"themeIcons="false"displayMode="fill window"responsive="true"trackingMode="full"trackingPassed="80%"trackingPageTimeout="0"forceTrackingMode="false"restartOptions="ask"hideSaveSession="false"saveSessionLabel="Save Session"closeSessionLabel="Close Session"saveSessionIc="false"saveSessionIcon="fas fa-save"><textlinkID="PG1781882348053"name="Welcome &amp; how to use this course"><![CDATA[<h2>Welcome to Secure code development</h2>
2
+
<learningObjecteditorVersion="3"targetFolder="Nottingham"name="Secure code development"language="en-GB"navigation="Menu with Page Controls"textSize="12"theme="default"themeIcons="false"displayMode="fill window"responsive="true"trackingMode="full"trackingPassed="80%"trackingPageTimeout="0"forceTrackingMode="false"restartOptions="ask"hideSaveSession="false"saveSessionLabel="Save Session"closeSessionLabel="Close Session"saveSessionIc="false"saveSessionIcon="fas fa-save"><textunmarkForCompletion="true"linkID="PG1781882348053"name="Welcome &amp; how to use this course"><![CDATA[<h2>Welcome to Secure code development</h2>
3
3
4
4
<p>This course is for <strong>engineers building software with agents</strong> and for <strong>engineers building agents</strong>. Whether you are designing agentic systems, integrating LLMs, or writing the services that agents call, secure code development matters.</p>
0 commit comments