On the end/result screen of a Question Set, the Overall Feedback text (from the defined score ranges) and the score bar never appear, even when Display results is enabled and overallFeedback ranges are configured in the editor.
Affected version
H5P.QuestionSet 1.21.x (current master, observed after commit 2c3e287 — VA-460 Use the component library for the result screen).
Expected behaviour
When the quiz ends with Display results on, the result screen should show:
- the computed score bar,
- the overall feedback string matching the achieved score range (e.g. "Great job!" for 80–100%).
Actual behaviour
- Score bar is not rendered.
- Overall feedback text is not rendered.
- Per-question list, header and score summary are shown correctly.
Root cause (from the code)
Before 2c3e287, the result screen template included:
<div class="feedback-section">
<div class="feedback-scorebar"></div>
<div class="feedback-text"></div>
</div>
After the refactor, the result screen is produced by H5P.Components.ResultScreen(...), which does not emit .feedback-section, .feedback-scorebar or .feedback-text.
However, js/questionset.js still contains the old append logic (around lines 726–745):
if (params.endGame.showResultPage) {
if (scoreBar === undefined) {
scoreBar = H5P.JoubelUI.createScoreBar(totals);
}
scoreBar.appendTo($('.feedback-scorebar', $myDom)); // matches 0 elements
$('.feedback-text', $myDom).html(scoreString); // matches 0 elements
...
}
Both selectors match nothing, so scoreString (computed via H5P.Question.determineOverallFeedback(...) at line 642) and the score bar are silently dropped.
The else branch at line 748 removing .feedback-section is also a no-op for the same reason, and css/questionset.css (lines 105–147) still styles the missing selectors.
Reproduction
- Create an H5P Question Set with 2+ questions.
- In Quiz finished / end game settings, define
Overall Feedback ranges (e.g. 0–49% "Try again", 50–100% "Well done").
- Leave Display results enabled (default).
- Complete the quiz.
- Observe the result screen: per-question list is shown, but no score bar and no overall feedback text.
Inspecting the DOM confirms that .feedback-section, .feedback-scorebar and .feedback-text are absent from .questionset-results.
On the end/result screen of a Question Set, the Overall Feedback text (from the defined score ranges) and the score bar never appear, even when Display results is enabled and
overallFeedbackranges are configured in the editor.Affected version
H5P.QuestionSet 1.21.x(current master, observed after commit2c3e287— VA-460 Use the component library for the result screen).Expected behaviour
When the quiz ends with Display results on, the result screen should show:
Actual behaviour
Root cause (from the code)
Before
2c3e287, the result screen template included:After the refactor, the result screen is produced by
H5P.Components.ResultScreen(...), which does not emit.feedback-section,.feedback-scorebaror.feedback-text.However,
js/questionset.jsstill contains the old append logic (around lines 726–745):Both selectors match nothing, so
scoreString(computed viaH5P.Question.determineOverallFeedback(...)at line 642) and the score bar are silently dropped.The
elsebranch at line 748 removing.feedback-sectionis also a no-op for the same reason, andcss/questionset.css(lines 105–147) still styles the missing selectors.Reproduction
Overall Feedbackranges (e.g. 0–49% "Try again", 50–100% "Well done").Inspecting the DOM confirms that
.feedback-section,.feedback-scorebarand.feedback-textare absent from.questionset-results.