Skip to content

Fix: Show full correct range and improve post-submit slider state (fixes #184)#240

Open
swashbuck wants to merge 2 commits into
masterfrom
issue/184
Open

Fix: Show full correct range and improve post-submit slider state (fixes #184)#240
swashbuck wants to merge 2 commits into
masterfrom
issue/184

Conversation

@swashbuck

@swashbuck swashbuck commented May 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #184

Fix

  1. Number range: When a range-based slider is answered correctly, the full correct range is now shown. Previously, only the learner's single chosen value was indicated. _canShowModelAnswer must be true.
Screenshot 2026-05-28 at 10 57 05 AM
  1. Visible thumb after submission: The slider thumb now stays visible after a correct submit (marks the learner's pick). It is hidden only during the "show correct answer" view for an incorrect submission. is-disabled keeps cursor: default to signal the control is non-interactive.

  2. Fill bar issue: Fixed the fill bar during "show correct answer": it now spans the actual correct range instead of running from the scale start to the range midpoint. Previously a 5-9 range highlighted 5-9 but filled 1-7, which was misleading.

Previous:
Screenshot 2026-05-27 at 3 41 35 PM

Fixed:
Screenshot 2026-05-27 at 3 40 40 PM

  1. Correct-range colour: The widget now adds the show-correct-answer class whenever the correct range is shown (including on a correct submit), so the existing Vanilla theme rules colour the range circles and fill with the validation/success colour. No companion theme change required. The thumb-hide rule was scoped to .show-correct-answer.is-incorrect so the thumb stays visible on a correct submit.

Testing

  1. Use a slider with a _correctRange (e.g. _bottom: 5, _top: 9) and _canShowModelAnswer: true.
  2. Answer correctly (e.g. 7) and submit. Expect: the full 5-9 range is highlighted in the validation/success colour, the thumb stays visible at your chosen value, and the fill runs to your value.
  3. Reset, answer incorrectly (e.g. 2) and submit, then select "Show correct answer". Expect: the 5-9 range is highlighted, no thumb is shown, and the fill spans 5-9 (not 1-7).
  4. Toggle "Show your answer" / "Show correct answer" and confirm the views switch correctly.

Companion issue to create

Hiding the handle in Confidence Slider - adapt-contrib-confidenceSlider extends SliderView and reuses the same slider__widget / slider__item markup, so it shares slider's compiled thumb CSS. Because confidenceSlider never applies show-correct-answer, the changes here leave its handle visible after submit (it was previously hidden). If we want to retain the previous behaviour, confidenceSlider should add its own thumb-hide rule or be updated to decouple from slider's .show-correct-answer gating.

After submit:
Screenshot 2026-05-27 at 4 01 57 PM

Posted via collaboration with Claude Code

@swashbuck swashbuck moved this from Assigned to Needs Reviewing in adapt_framework: The TODO Board May 28, 2026
@swashbuck swashbuck changed the title Fix: Show full correct range on a correct answer (fixes #184) Fix: Show full correct range and improve post-submit slider state (fixes #184) May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Needs Reviewing

Development

Successfully merging this pull request may close these issues.

Inconsistency with displaying correct range

3 participants