Repository navigation
feat(progress): show learners what completion requires; honest quiz ticks; header progress bar - #10
Merged
Merged
Conversation
…icks; header progress bar
Learners could not tell how far through the course they were or whether
they had done what the LMS needs. The contents-page tick only meant a page
had been opened, and SCORM 1.2 gives the LMS nothing but
incomplete/passed/failed, so Moodle's "Learning objects" grade sits at 0%
until the very end.
The LMS side is structural, so make the course itself honest:
- Status panel: the root script fills every `.xtStatusPanel` element (one
in the menu text of the contents page, one at the top of the Course
complete page) with required pages done out of 43, the pages still to
visit, each quiz result or "not yet submitted", the weighted score against
the pass mark, and the exact status the LMS currently holds, in plain
language. Refreshed on page load, menu tick updates, page exits and quiz
submission.
- Quiz ticks mean "submitted": XTSetPageScore (the quiz results screen) now
marks the page interaction complete; the flag is persisted as a sixth
element of each xtPages row and restored on resume (older records infer
it from a non-zero score). An opened-but-unsubmitted quiz shows a
half-filled circle with an explanatory label instead of a tick.
- Header progress bar (Xerte's own): progressBarType="header2" with a
milestone marker on each quiz page and the label "{x}% of pages viewed".
header1 inserts after the header logo, which this course lacks, so it
built nothing.
- Welcome page explains the indicators; Course complete no longer claims
the result "has been recorded" unconditionally.
Docs: README section on what learners and the LMS see, with the Moodle
SCORM activity settings that matter (grading method, completion tracking,
attempt status display) and why SCORM 2004 / multi-SCO do not help;
PROJECT_CONTEXT section on the mechanism and what was deliberately left
unchanged (which pages are required; the strict > pass check).
Tests: four new tracking tests plus panel assertions in the full
walkthrough; 22/22 pass against the released package with the new
template.xml.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MfWFRfRw3sR98Vq48EKEYa
📖 Course content previewDownload the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Learners cannot tell how far through the course they are, or whether they have done what completion requires:
x_pageLoaded()setsx_pageInfo[i].viewedthe moment a page loads, andtickViewed()draws from that flag alone. A quiz ticks before a single question is answered.getSuccessStatus()reportsincompleteuntil every one of the 43 tracked pages has been left, thenpassed/failed. Moodle's default "Learning objects" grading method counts SCOs with status completed/passed; this package is one SCO, so the grade is 0 then 1.incompleteforever.The LMS side is structural (see the README for why SCORM 2004 and multi-SCO do not help with Moodle), so this PR makes the course itself honest. All changes are content-level: no engine patch.
Changes
Status panel (
source/scorm_progress.js, part 5). Every.xtStatusPanelelement is filled with: required pages completed out of 43, the names of the pages still to visit (capped at 6), each quiz's result or "not yet submitted", the weighted score against the pass mark, and the exact status the LMS currently holds, in plain language. Two placeholders: the rootmenuText(text column of the contents page) and a<div>at the top of the Course complete page. Refreshed fromx_pageLoaded,XENITH.PAGEMENU.tickViewed,XTExitPage,XTExitInteractionandXTSetPageScore. Outside an LMS it says tracking is not active.Quiz ticks mean "submitted".
XTSetPageScore(only called by the quiz results screen) now sets the page interaction's unusedcompletefield. It is persisted as a sixth element of eachxtPagesrow and restored on resume; records from older builds infer it from a non-zero score. AftertickViewed, an opened-but-unsubmitted quiz gets a half-filled circle (fa-adjust, classxtPending, label "Opened, quiz not yet submitted") instead of a tick.Header progress bar (Xerte's own, editor-supported):
progressBarType="header2",progressSub="milestones", amilestone="true"on each of the 8 quiz pages, label{x}% of pages viewed. Noteheader1("above titles") inserts after the header logo icon; this course has no logo, so it silently built nothing.Content: the Welcome page explains the three indicators and that every page from Welcome to the final quiz must be visited and every quiz submitted. The Course complete page opens with the panel and no longer claims the result "has been recorded" unconditionally.
Docs: README section "Progress and completion: what learners and the LMS see" with the Moodle SCORM activity settings that matter (Grading method, Completion tracking, Display attempt status) and why SCORM 2004 / multi-SCO were rejected. PROJECT_CONTEXT section on the mechanism.
Deliberately not changed
unmarkForCompletionon page N actually exempts page N-1. The clean route is for the root script to rebuildstate.toCompletePagesfrom the live page list beforeXTInitialise. Happy to do that as a follow-up if reference pages should not block completion.failedwhile the Welcome page says the pass mark is 80%. Moodle applies no mastery override (the Xerte manifest has noadlcp:masteryscore). Flagging rather than changing scoring semantics in this PR.Tests
Four new tests in
tests/test_scorm_tracking.pyplus panel assertions at the end of the full walkthrough:test_status_panel_tells_the_learner_what_is_lefttest_quiz_tick_means_submitted_not_opened(including across a resume, and the persisted flag)test_older_records_infer_submission_from_the_scoretest_header_progress_bar_counts_viewed_pagesRun locally against the v0.0.7 release package with the new
data.xmlastemplate.xml(the export copiesdata.xmlverbatim apart from the build version, and the release's engine files are identical to the currentdocker-containerbranch): 22/22 pass. The CI workflow builds through a real XOT container and is the authoritative run.Screenshots
Contents page: header bar with quiz milestones, half-filled circle on the opened-but-unsubmitted Theme 1 Quiz, status panel in the text column. Course complete page: panel showing 3 of 43 required pages, one quiz at 100%, LMS status incomplete.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MfWFRfRw3sR98Vq48EKEYa
Generated by Claude Code