New: Support structured feedback objects (fixes: #251)#252
Open
joe-replin wants to merge 4 commits intomasterfrom
Open
New: Support structured feedback objects (fixes: #251)#252joe-replin wants to merge 4 commits intomasterfrom
joe-replin wants to merge 4 commits intomasterfrom
Conversation
Introduce a structured feedback object format for MCQ items and component-level feedback. Updates README and example.json to document the new shape (per-item feedback: title, altTitle, body, _classes, _imageAlignment, _graphic; component _feedback: _correct, _incorrectFinal, _incorrectNotFinal, _partlyCorrectFinal, _partlyCorrectNotFinal, _classes, altTitle, etc.). Update properties.schema and schema/component.schema.json to change feedback from string to object and add the new fields. Add migration tests to (a) add a default _feedback.altTitle for older plugin versions and (b) convert legacy flat feedback keys (correct, _incorrect, _partlyCorrect) to the expanded per-state objects. Also fix an updatePlugin version typo in the migrations.
oliverfoster
requested changes
Mar 2, 2026
Member
oliverfoster
left a comment
There was a problem hiding this comment.
The existing readme language is quite ambiguous about the flexibility with which these two format can be used together. Please clarify.
In the readme, call flat strings "legacy" and the object format "standard", please don't make the new format sound extended or optional.
As soon as this pr is accepted, the old format effectively dies for this component.
There are no circumstances in which we will be returning to or continuing to support legacy format. We would not recommend that both formats be used in the same course.
Contributor
Author
|
This wasn't ready for review yet but thanks for the review! :) |
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.
Fixes #251
Reference: Structured Feedback Objects
Update
component.schema.jsonandproperties.schema— removed legacycorrect,_incorrect,_partlyCorrectproperties from_feedback; replaced with the five per-state objects._items[n].feedbacktype updated from string to object.example.json— item feedback updated to the new object format;altTextadded to all items for consistency.README.md— documents the new_items[n].feedbackobject sub-properties with a note that a plain string is still accepted; marksfeedbackas optional in the_itemsdescription.New
_feedback:_correct,_incorrectFinal,_incorrectNotFinal,_partlyCorrectFinal,_partlyCorrectNotFinal. Each acceptstitle,altTitle,body,_classes,_imageAlignment, and_graphic(_src,alt,attribution)._feedback._classesfor a CSS class applied to the feedback panel across all states._items[n].feedbacknow supports the full feedbackState object shape (previously only a plain string). The plain string form is still accepted.Testing
correct+_incorrect+_partlyCorrect) and confirm all three are converted to the new per-state objects._incorrector_partlyCorrect(nocorrect) and confirm it is picked up and converted._incorrectFinalfeedback displays; with attempts remaining confirm_incorrectNotFinalfalls back to_incorrectFinalwhen body is empty._selectable: 1and configure_items[n].feedbackas an object; select the item and confirm the item-level feedback overrides the component-level state.