Fix missing overall feedback and score bar on result screen#184
Fix missing overall feedback and score bar on result screen#184tammets wants to merge 2 commits into
Conversation
…nder The refactor to H5P.Components.ResultScreen stopped emitting the .feedback-section / .feedback-scorebar / .feedback-text elements, but _displayEndGame still populates them via jQuery selectors. As a result the overall feedback text and score bar were computed but never rendered. Re-adds the feedback-section wrapper inside the result page so the existing append logic has real targets again. Fixes h5p#183
There was a problem hiding this comment.
Pull request overview
Reintroduces the missing result-screen DOM wrapper needed by legacy jQuery append logic so the Overall Feedback text and score bar render again on the Question Set end screen after the H5P.Components.ResultScreen refactor.
Changes:
- Add back the
.feedback-sectioncontainer with.feedback-scorebarand.feedback-textinside the result page markup.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self.$feedbackSection = $( | ||
| '<div class="feedback-section">' + | ||
| '<div class="feedback-scorebar"></div>' + | ||
| '<div class="feedback-text"></div>' + | ||
| '</div>' | ||
| ).appendTo(self.$resultPage); |
There was a problem hiding this comment.
self.$feedbackSection is assigned here but never read anywhere else in the file. Consider not storing this on self (just append the wrapper), or store it in a local variable if you need it later; otherwise it looks like leftover state and can confuse future maintenance. Also, to match surrounding code (e.g. self.$resultPage, self.$buttonsContainer), consider building the wrapper via $("<div>", { class: ... }) rather than concatenating an HTML string.
| self.$feedbackSection = $( | |
| '<div class="feedback-section">' + | |
| '<div class="feedback-scorebar"></div>' + | |
| '<div class="feedback-text"></div>' + | |
| '</div>' | |
| ).appendTo(self.$resultPage); | |
| $('<div>', { | |
| class: 'feedback-section', | |
| append: [ | |
| $('<div>', { class: 'feedback-scorebar' }), | |
| $('<div>', { class: 'feedback-text' }) | |
| ], | |
| appendTo: self.$resultPage | |
| }); |
Summary
H5P.Components.ResultScreenrefactor (VA-460, 2c3e287)..feedback-section/.feedback-scorebar/.feedback-textwrapper, but_displayEndGamestill tries to fill those selectors via jQuery — both matched zero elements, so the computedscoreStringand score bar were silently dropped.Fixes #183
Test plan
Overall Feedbackranges (e.g. 0–49% "Try again", 50–100% "Well done").elsebranch atjs/questionset.js:748now actually removes.feedback-section).