Subject of the issue/enhancement/features
When _hasItemScoring: true is set on an MCQ, setScore() always stores 0 or _questionWeight based on correctness, ignoring the selected item's _score value. A get score() getter exists that sums active item scores correctly, but setScore() was never updated to use it. Plugins that read model.get('_score') directly — including SCORM tracking and custom scoring extensions — receive the wrong value.
Your environment
- adapt-contrib-core v6.73.0
- All modern browsers
- All operating systems
Steps to reproduce
- Create an MCQ with
_hasItemScoring: true and _selectable: 1
- Give items fractional
_score values, e.g. 0, 0.25, 0.75, 1.0
- Mark one item
_shouldBeSelected: true
- Submit the question by selecting a different item — one with
_shouldBeSelected: false and _score: 0.25
- After submission, run in the browser console:
Adapt.components.findWhere({ _id: 'your-component-id' }).get('_score')
Expected behaviour
model.get('_score') returns 0.25 — the selected item's _score value.
Actual behaviour
model.get('_score') returns 0. setScore() treats the question as incorrect and stores 0, regardless of the selected item's _score.
Suggested Fix (if known)
Replace setScore() in ItemsQuestionModel with:
setScore() {
this.set('_score', this.score);
}
The existing get score() getter already handles _hasItemScoring correctly. setScore() should sync the stored attribute to it rather than recalculate independently.
Subject of the issue/enhancement/features
When
_hasItemScoring: trueis set on an MCQ,setScore()always stores0or_questionWeightbased on correctness, ignoring the selected item's_scorevalue. Aget score()getter exists that sums active item scores correctly, butsetScore()was never updated to use it. Plugins that readmodel.get('_score')directly — including SCORM tracking and custom scoring extensions — receive the wrong value.Your environment
Steps to reproduce
_hasItemScoring: trueand_selectable: 1_scorevalues, e.g.0,0.25,0.75,1.0_shouldBeSelected: true_shouldBeSelected: falseand_score: 0.25Expected behaviour
model.get('_score')returns0.25— the selected item's_scorevalue.Actual behaviour
model.get('_score')returns0.setScore()treats the question as incorrect and stores0, regardless of the selected item's_score.Suggested Fix (if known)
Replace
setScore()inItemsQuestionModelwith:The existing
get score()getter already handles_hasItemScoringcorrectly.setScore()should sync the stored attribute to it rather than recalculate independently.