Skip to content

refactor: share QuestionShell across question widgets; de-dup adapter labels#71

Merged
redmodd merged 1 commit into
mainfrom
refactor/question-shell-and-adapter-dedup
Jun 4, 2026
Merged

refactor: share QuestionShell across question widgets; de-dup adapter labels#71
redmodd merged 1 commit into
mainfrom
refactor/question-shell-and-adapter-dedup

Conversation

@redmodd
Copy link
Copy Markdown
Owner

@redmodd redmodd commented Jun 4, 2026

Summary

Code-review cleanups, all internal — no author-facing behavior or markup changes.

  • Shared QuestionShell component. MultipleChoice, FillInTheBlank, Matching, and Sorting each reimplemented the same standalone-vs-quiz dual render (inline when standalone; a snippet the Quiz shell renders when inside a quiz), the LockedBanner placement, the setRender registration, and a .tessera-<type> { padding } wrapper rule. Extracted into one QuestionShell (~35 lines), removing ~90 lines of duplication. The wrapper now carries class="tessera-question-shell tessera-<type>" — additive, so author CSS targeting .tessera-mc etc. still matches.
  • De-duplicated LMS adapter labels in createAdapter: the per-standard names lived in both the adapter registry and missingApiError; now a single source. Output strings unchanged (verified against adapter-selection.test.ts).
  • Trimmed redundant casts in the cmi5 context builder — it now reads contextTemplate through its declared CMI5LaunchData types instead of widening to Record<string, unknown> and re-narrowing. Pure type-level change.
  • Minor: scorm12.ts typeValue: (t) => scorm12Type(t)typeValue: scorm12Type.

Verification

  • pnpm build
  • svelte-check: 0 errors / 0 warnings ✓
  • Unit tests: 884 passed ✓
  • prettier --check + eslint: clean ✓
  • Playwright e2e: 105 passed ✓

… labels

Extract a shared QuestionShell component for the standalone-vs-quiz dual
render reused by MultipleChoice, FillInTheBlank, Matching, and Sorting,
removing the duplicated scaffold and per-component wrapper padding rule.
Also fold the per-standard LMS labels into a single registry in
createAdapter and drop redundant type casts in the cmi5 context builder.
No author-facing behavior or markup changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@redmodd redmodd merged commit 701a18d into main Jun 4, 2026
8 checks passed
@redmodd redmodd deleted the refactor/question-shell-and-adapter-dedup branch June 4, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant