Skip to content

SCORM 2004, a pass mark and completion as 100, as options - #140

Merged
alekswebnet merged 1 commit into
feat/scorm-page-stepsfrom
feat/scorm-options
Nov 5, 2026
Merged

alekswebnet merged 1 commit into
feat/scorm-page-stepsfrom
feat/scorm-options

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #138.

Stacked on #139, whose page this adds a step to, so the base is feat/scorm-page-steps. I'll retarget it to main once #139 merges.

What changes

Three options, each off unless asked for. A zip written with none is the SCORM 1.2 zip from before. Comparing main's code and this branch's on the quiz and on the formulas export, every entry is byte-identical except scorm.js: the manifest, the launch page and the notice are unchanged. The bridge plays a page that names no option exactly as before, and the existing LMS tests still hold it to that.

  • SCORM 2004 4th Edition (--scorm-version 2004, scormVersion: '2004')
    • Manifest: the 2004 manifest (imscp_v1p1, adlcp_v1p3, imsss, schemaversion 2004 4th Edition, adlcp:scormType).
    • API: the bridge finds API_1484_11 and uses one set of calls for both versions.
    • Status and score: completion_status and success_status are written separately, and score.scaled is written alongside raw, min and max.
    • Answers: each one gets a urn:uuid: id and the question's words in description, decoded to plain text (’ becomes ’). The response goes in learner_response, and a wrong answer is incorrect.
    • Times: the session time, each latency and each timestamp are ISO 8601, to the hundredth of a second.
    • Saved state: up to 64,000 characters, still compressed.
  • A pass mark (--pass-mark <0-100>, passMark)
    • In the manifest: in 1.2 it is the item's adlcp:masteryscore. In 2004 it is the item's primary objective, with satisfiedByMeasure and minNormalizedMeasure set to mark/100.
    • In the bridge: at launch it reads the LMS's mark (cmi.student_data.mastery_score or cmi.scaled_passing_score), falling back to the page's. It then holds the score as written to that mark, in place of the content's own pass or fail.
    • No score: a result with no score gets no verdict from the mark.
  • Completion as 100 (--completion-score, completionScore)
    • A finish with no score is recorded as 100 (scaled 1) next to completed, and passes a mark.
  • How the options reach the zip:
    • Launch page: the bridge reads them from <meta> tags that are written only for options that are set.
    • Old templates: if an option is set and the page bundles a launch template from 1.5, which has no %SCORM% slot, the build is refused.
    • Validation: scormOptions checks the options for both writers.
    • Results: they gain a scormVersion field.
  • The page: a ③ Options step for all files, so Download becomes ④.
    • It has radios for the version, a pass mark field (0–100), and a checkbox for completion as 100.
    • Changing an option withdraws the zips already built.
    • An invalid mark disables Build and says why.
    • The checked-LMS table gets a 2004 column.

One change from the issue text: a 2004 session always ends suspend. The issue said suspend or normal; I measured both in Moodle 4.5.

  • With normal after a finish, Moodle handed the next launch an empty data model within the same attempt (entry ab-initio, completion unknown, no saved state). The incomplete the bridge writes at launch then overwrote the stored completed, and the content started over.
  • With suspend, the relaunch resumed: completed and passed were kept, and the content came back on its result screen.

1.2 keeps its old behaviour.

Reused: scormTitle, readPackage and the plan/write split from #139, addStored, and dependenciesIn from the player's ./plan. No other package changed.

Docs: design/scorm.md has a new bullet covering the 2004 data model, why sessions end suspend, and each LMS check with its numbers. The embed README gets Options of the zip, the flags, and the 2004 column. docs/compatibility.md and both pages' text are updated too.

Testing

  • Automated:
    • pnpm -r typecheck is clean.
    • The embed suite passes: 78 tests, 11 of them new.
      • In Node: no options are written unless asked; the pass mark appears as the 1.2 mastery score and as the 2004 objective; bad options are refused, by both the function and the command; the page builder produces the command's zip entry for entry with options; a 1.5 template is refused when an option is set.
      • In the stand-in LMS, in Chromium:
        • a mark of 80 fails the quiz's 66.67, even though the content counts it as a pass;
        • an LMS mark of 60 wins over the zip's;
        • completion as 100 passes the mark.
      • In a new 2004 stand-in LMS:
        • the quiz played to the end, with its answers;
        • a session suspended and resumed with the result kept;
        • a 6,000-character state kept;
        • the score held to the LMS's passing score.
    • The page test covers the Options step: the defaults, a mark of 120 refused, a 2004 zip with a mark of 80, and changing an option withdrawing the zips.
  • Moodle 4.5.15, in Docker:
    • Import: Moodle read the 2004 zips as SCORM_1.3, kept the objective (0.8, satisfied by measure), and kept the 1.2 mastery score of 80.
    • The quiz in 2004:
      • session 2 resumed on question 2;
      • the finish recorded completed and passed, raw 66.67, scaled 0.6667, and the gradebook shows 66.67;
      • the total time is the sum of both sessions, and all 4 answers have ids and descriptions;
      • a relaunch after finishing kept the result.
    • Mark of 80: 66.67 failed in both 2004 and 1.2, and the gradebook shows 66.67.
    • Completion as 100, in the zips that also held the mark of 80: a finish with no score recorded 100, passed, with 100 in the gradebook, in both versions.
  • SCORM Cloud:
    • Import: both 2004 zips came in as SCORM20044THEDITION, with no parser warnings.
    • The quiz: the same two sessions resumed on question 2. The registration ended COMPLETED and PASSED at 66.67, and a relaunch after finishing kept that.
    • Mark of 80:
      • 2004 recorded FAILED at 66.67, with completion still COMPLETED;
      • 1.2 recorded failed at 66.67. The registration shows INCOMPLETE, which is how SCORM Cloud records any failed 1.2 attempt, with or without a mark.
    • Completion as 100, in the zip that also held the mark of 80: a finish with no score was recorded COMPLETED and PASSED at 100.

Not verified

  • SCORM 2004 and the grading options in ILIAS, OpenOLAT, Chamilo and Frappe LMS. The pages and README say they are checked in Moodle and SCORM Cloud only.
  • Whether the zip's pass mark can replace the pass mark OpenOLAT and Frappe LMS ask the teacher to set.
  • Content that really finishes without a score, in an LMS. In both LMSs that finish was the element's finished event dispatched in the SCO's frame, as the tests do.
  • Completion as 100 without a pass mark, in an LMS. Without a mark it records completed and 100, and in 2004 leaves success unknown, as a test holds it. (Corrected after the merge, in SCORM zip and page: six points from the self-review of #139 and #140 #142: this body first said the no-score finishes passed without naming the mark.)
  • Firefox and Safari.

Release

An embed minor release, which can go out as 1.6.0 together with #139. A zip built with these options needs the bridge from this version; zips without options are the same as before.

A zip written with none of them is the SCORM 1.2 zip written before: its manifest, launch page and
notice are unchanged, and only the bridge is new code, which plays such a page as it did.

- SCORM 2004 4th Edition (--scorm-version 2004): its manifest, API_1484_11, completion and
  success apart, the scaled score, each answer with its words as the description and a urn:uuid
  id, ISO 8601 times, 64,000 characters of saved state. A 2004 session always ends suspended:
  ended normal after a finish, Moodle 4.5 handed the next launch an empty data model within the
  same attempt, and the completion it kept was written over.
- A pass mark (--pass-mark): 1.2's mastery score or 2004's objective measure; the bridge holds the
  score to the LMS's mark, else the zip's, in place of the content's own pass.
- Completion as 100 (--completion-score): content that finishes without a score records 100.

The page gets an Options step for all three, page-wide. Checked in Moodle 4.5 and SCORM Cloud.
@alekswebnet alekswebnet added the enhancement New feature or request label Nov 5, 2026
@alekswebnet
alekswebnet added this pull request to stack #141 November 5, 2026 19:46
@alekswebnet alekswebnet self-assigned this Nov 5, 2026
@alekswebnet
alekswebnet merged commit dbaee70 into main Nov 5, 2026
8 checks passed
alekswebnet added a commit that referenced this pull request Nov 5, 2026
fix(scorm): six points from the review of #139 and #140
@alekswebnet
alekswebnet deleted the feat/scorm-options branch November 6, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SCORM options: SCORM 2004, a pass mark, and completion as 100, with today's zip as the default

1 participant