refactor: share QuestionShell across question widgets; de-dup adapter labels#71
Merged
Merged
Conversation
… 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>
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.
Summary
Code-review cleanups, all internal — no author-facing behavior or markup changes.
QuestionShellcomponent.MultipleChoice,FillInTheBlank,Matching, andSortingeach reimplemented the same standalone-vs-quiz dual render (inline when standalone; a snippet the Quiz shell renders when inside a quiz), theLockedBannerplacement, thesetRenderregistration, and a.tessera-<type> { padding }wrapper rule. Extracted into oneQuestionShell(~35 lines), removing ~90 lines of duplication. The wrapper now carriesclass="tessera-question-shell tessera-<type>"— additive, so author CSS targeting.tessera-mcetc. still matches.createAdapter: the per-standard names lived in both the adapter registry andmissingApiError; now a single source. Output strings unchanged (verified againstadapter-selection.test.ts).contextTemplatethrough its declaredCMI5LaunchDatatypes instead of widening toRecord<string, unknown>and re-narrowing. Pure type-level change.scorm12.tstypeValue: (t) => scorm12Type(t)→typeValue: scorm12Type.Verification
pnpm build✓svelte-check: 0 errors / 0 warnings ✓prettier --check+eslint: clean ✓