Conversation
The package runtime seeds every gradable iDevice on a page with a score of 0. Once an attempt started, the tracker sent that seed for untouched iDevices too, so under "Last attempt" an iDevice the learner never answered dropped to 0. The tracker now remembers which .idevice_node each trusted interaction landed in and posts itemscores for those iDevices only. It keeps watching later pages after the attempt starts. Related to exelearning/exelearning#2481.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## hotfix/2458-empty-attempt-on-page-load #157 +/- ##
============================================================================
+ Coverage 93.95% 93.97% +0.01%
Complexity 810 810
============================================================================
Files 46 46
Lines 3576 3584 +8
============================================================================
+ Hits 3360 3368 +8
Misses 216 216
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
ingest() reports a debugging() divergence when cmi.core.score.raw differs from the overall recomputed from itemscores; CI treats it as an error.
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.
Summary
When a page has several gradable iDevices and the learner answers only one of them, the plugin also recorded the seeded 0 of every untouched iDevice. Under "Last attempt" that 0 replaced a grade the learner had already earned.
After this change, each visit records only the iDevices the learner actually interacted with. An untouched iDevice keeps its previous grade, or stays empty if it was never answered.
Original issue
Related to exelearning/exelearning#2481, reported by @jjdeharo. Thank you for the precise steps and the
track.phppayload: they pointed straight at the cause.This PR is stacked on PR 155 (base branch
hotfix/2458-empty-attempt-on-page-load). It picks up exactly the case PR 155 left out of scope. GitHub retargets it tomainwhen PR 155 merges.Root cause
On page load the package runtime writes every gradable iDevice into
cmi.suspend_datawithscore: 0. The tracker (js/scorm_tracker.js) captures those entries intoitemScores, and once the attempt starts (PR 155) it sends the whole map. The server stores every entry it receives as a real result:The seed and a real 0 are byte-identical, so the server cannot tell them apart. Only the browser knows which iDevice the learner touched.
Fix
noteInteraction()already finds the.idevice_nodea trusted pointer/touch/key event landed in. It now also remembers that node's id.send()postsitemscoresonly for those touched iDevices.itemscoreskeeps its grade under "Last attempt".TDD
RED
New Vitest suite only the iDevices the learner touched are graded, run on the PR 155 tracker:
GREEN
How to test
research/fixtures/elpx/actividad-evaluable.elpx(True/False + Guess on one page), grading per iDevice, method Last attempt.track.phprequest body carries only the iDevice you played.Screenshots
Same steps on
localhost(Moodle 5.0.7), attempts report as teacher.Before
The untouched True/False gets a 0 in attempts 1 and 3, and its "Last attempt" grade falls from 100 to 0.
After
Each attempt records only the iDevice that was played. True/False keeps its 100.
Notes
cmi.core.score.raw(the package's own overall score) is not filtered: it is the runtime's aggregate, not a per-iDevice value.version.php:2026092612(JavaScript source change), above PR 155's2026092611.Moodle Playground Preview
The changes in this pull request can be previewed and tested using a Moodle Playground instance.
ℹ️ The eXeLearning editor is fetched from the shared release and unpacked into the plugin when the playground boots, so the first load may take a few extra seconds. ELPX upload, viewer and preview work normally.