fix(quiz): question images, mtf connectors, response column and passPercentage - #704
Merged
Merged
Conversation
…sponse column
Three defects in the quiz viewer, all verified against the live quiz artifact for
do_1146265771989319681410.
Question images never loaded. The image path resolver stripped the `src="` prefix
with `.replace('src="/', '')`, which only matches paths starting with `/`. An
absolute `src="https://…"` therefore kept its prefix and became `src=https://…`,
which Angular's sanitizer rewrote to `unsafe:src=https://…`. 11 of the 17
questions in that quiz carry absolute image URLs. Absolute and data: URLs are now
left as authored; relative paths still resolve against the artifact URL.
Match-the-following connectors drifted away from their boxes on scroll. jsPlumb
was created without a Container, so it appended its SVGs to document.body and
positioned them in page coordinates while the boxes lived inside the scrolling
dialog. The connectors now share a container with the boxes, so both move
together — no repaint needed.
The Response column of the mtf review table was always empty:
- the guard tested `connections[i]`, indexing the connection list by option
position, so rows past the number of connections were blanked even when
answered
- it compared `source.innerText` against `option.text` directly. innerText is the
*rendered* text and CSS collapses whitespace runs; authored option text
frequently contains double spaces and , so the two never matched. 5 of 6
options in question 10 are affected
Note: project/ and library/ are excluded from jest via testPathIgnorePatterns, so
these paths carry no unit coverage. Verified by simulating the old and new logic
against the real artifact JSON instead.
A quiz publishing with passPercentage 0 was taken at face value, so every attempt counted as a pass. Only a missing property fell back to the 60% default. Zero is now treated the same as absent, in both the TOC assessment detail and the viewer's quiz route.
The overview ref was only cleared by a commented-out line at the end of the afterClosed handler, so the `!this.dialogOverview` guard turned every later call into a no-op for the life of the component and "Yes, Restart" never reopened the overview. Clear it as soon as the dialog closes.
…a card The asha learning card asked for `COMPETENCY`, which is present in en.json but missing from hi.json, so Hindi users saw the raw key. Point it at `Competency` and `Completed`, both of which exist in each locale, and add the missing `LEVELS` entry to hi.json.
vpPavithra
approved these changes
Aug 3, 2026
Ajoymaity
approved these changes
Aug 3, 2026
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.
Repairs three visible defects in the quiz player, plus two smaller correctness issues and one i18n gap. Release notes for 4.2.9 ride along on this branch.
Fixes
src="prefix with a replace that only matched paths beginning with/, so an absolutesrc="https://…"becamesrc=https://…and Angular's sanitizer rewrote it tounsafe:src=https://…. 11 of the 17 questions in the sampled quiz use absolute URLs. Absolute anddata:URLs are now left as authored; relative paths still resolve against the artifact URL.Container, so it appended its SVG connectors todocument.bodyin page coordinates while the boxes sat inside the scrolling dialog. Both now share a container and move together.innerTextagainst raw option text, which never matched because CSS collapses the double spaces and in the authored content.passPercentage: 0was taken literally, so every attempt counted as a pass. Zero is now treated as unset and falls back to 60%.COMPETENCY, which exists inen.jsonbut nothi.json.Verification
yarn run build:local, exit 0).do_1146265771989319681410.Risk
All five code fixes live under
project/ws/viewerandproject/ws/app, whichjest.config.jsexcludes viatestPathIgnorePatterns— so they carry no unit test coverage and the build is the only automated gate.The connector-drift and restart fixes are reasoned from the DOM and dialog lifecycle but were not confirmed in a browser. Smoke-testing is marked required in the release notes: open a quiz with image questions, answer a match-the-following question while scrolling, check the Response column after submit, and confirm "Yes, Restart" reopens the overview.