Skip to content

Commit 2b488ec

Browse files
committed
Merge branch 'PIE-569' into develop
2 parents 5e4e2ff + 9260140 commit 2b488ec

132 files changed

Lines changed: 6506 additions & 698 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@pie-qti/player-elements",
1919
"@pie-qti/qti-common",
2020
"@pie-qti/qti-processing",
21+
"@pie-qti/source-profiles",
2122
"@pie-qti/storage",
2223
"@pie-qti/test-utils",
2324
"@pie-qti/to-pie",

apps/demo/src/lib/a11y/fixtures.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ export interface A11yFixture {
2727
}
2828

2929
export const A11Y_FIXTURES: A11yFixture[] = [
30-
{ id: 'sortable-list', title: 'SortableList (item-player)' },
31-
{ id: 'match-drag-drop', title: 'MatchDragDrop (item-player)' },
32-
{ id: 'graphic-gap-match', title: 'GraphicGapMatch (item-player)' },
33-
{ id: 'inline-interaction-renderer', title: 'InlineInteractionRenderer (item-player)' },
34-
{ id: 'file-upload', title: 'FileUpload (item-player)' },
35-
{ id: 'drawing-canvas', title: 'DrawingCanvas (item-player)' },
36-
{ id: 'custom-interaction-fallback', title: 'CustomInteractionFallback (item-player)' },
37-
{ id: 'choice-interaction', title: 'ChoiceInteraction (item-player)' },
38-
{ id: 'slider-interaction', title: 'SliderInteraction (item-player)' },
39-
{ id: 'hotspot-interaction', title: 'HotspotInteraction (item-player)' },
40-
{ id: 'hottext-interaction', title: 'HottextInteraction (item-player)' },
41-
{ id: 'extended-text-interaction', title: 'ExtendedTextInteraction (item-player)' },
42-
{ id: 'associate-interaction', title: 'AssociateInteraction (item-player)' },
43-
{ id: 'media-interaction', title: 'MediaInteraction (item-player)' },
44-
{ id: 'modal-feedback', title: 'ModalFeedbackDisplay (item-player)' },
30+
{ id: 'sortable-list', title: 'SortableList component fixture' },
31+
{ id: 'match-drag-drop', title: 'MatchDragDrop component fixture' },
32+
{ id: 'graphic-gap-match', title: 'GraphicGapMatch component fixture' },
33+
{ id: 'inline-interaction-renderer', title: 'Inline interactions through ItemBody' },
34+
{ id: 'file-upload', title: 'FileUpload component fixture' },
35+
{ id: 'drawing-canvas', title: 'DrawingCanvas component fixture' },
36+
{ id: 'custom-interaction-fallback', title: 'CustomInteractionFallback component fixture' },
37+
{ id: 'choice-interaction', title: 'ChoiceInteraction through ItemBody' },
38+
{ id: 'slider-interaction', title: 'SliderInteraction through ItemBody' },
39+
{ id: 'hotspot-interaction', title: 'HotspotInteraction through ItemBody' },
40+
{ id: 'hottext-interaction', title: 'HottextInteraction through ItemBody' },
41+
{ id: 'extended-text-interaction', title: 'ExtendedTextInteraction through ItemBody' },
42+
{ id: 'associate-interaction', title: 'AssociateInteraction through ItemBody' },
43+
{ id: 'media-interaction', title: 'MediaInteraction through ItemBody' },
44+
{ id: 'modal-feedback', title: 'ModalFeedbackDisplay component fixture' },
4545
{ id: 'assessment-navigation-bar', title: 'NavigationBar (assessment-player)' },
4646
{ id: 'assessment-section-menu', title: 'SectionMenu (assessment-player)' },
4747
{ id: 'assessment-rubric-display', title: 'RubricDisplay (assessment-player)' },

apps/demo/src/lib/a11y/fixtures/AssociateInteractionFixture.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
// @ts-expect-error - Svelte-check can't resolve workspace subpath exports, but runtime works correctly
32
import { ItemBody } from '@pie-qti/item-player/components';
43
import { Player } from '@pie-qti/item-player';
54
import type { InteractionResponseValue } from '@pie-qti/item-player/web-components';

apps/demo/src/lib/a11y/fixtures/ChoiceInteractionFixture.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
// @ts-expect-error - Svelte-check can't resolve workspace subpath exports, but runtime works correctly
32
import { ItemBody } from '@pie-qti/item-player/components';
43
import { Player } from '@pie-qti/item-player';
54
import type { InteractionResponseValue } from '@pie-qti/item-player/web-components';

apps/demo/src/lib/a11y/fixtures/ExtendedTextInteractionFixture.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
// @ts-expect-error - Svelte-check can't resolve workspace subpath exports, but runtime works correctly
32
import { ItemBody } from '@pie-qti/item-player/components';
43
import { Player } from '@pie-qti/item-player';
54
import type { InteractionResponseValue } from '@pie-qti/item-player/web-components';

apps/demo/src/lib/a11y/fixtures/HotspotInteractionFixture.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
// @ts-expect-error - Svelte-check can't resolve workspace subpath exports, but runtime works correctly
32
import { ItemBody } from '@pie-qti/item-player/components';
43
import { Player } from '@pie-qti/item-player';
54
import type { InteractionResponseValue } from '@pie-qti/item-player/web-components';

apps/demo/src/lib/a11y/fixtures/HottextInteractionFixture.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
// @ts-expect-error - Svelte-check can't resolve workspace subpath exports, but runtime works correctly
32
import { ItemBody } from '@pie-qti/item-player/components';
43
import { Player } from '@pie-qti/item-player';
54
import type { InteractionResponseValue } from '@pie-qti/item-player/web-components';

apps/demo/src/lib/a11y/fixtures/InlineInteractionRendererFixture.svelte

Lines changed: 49 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,60 @@
11
<script lang="ts">
2-
import InlineInteractionRenderer from '@pie-qti/default-components/shared/components/InlineInteractionRenderer.svelte';
2+
import { ItemBody } from '@pie-qti/item-player/components';
3+
import { Player } from '@pie-qti/item-player';
4+
import type { InteractionResponseValue } from '@pie-qti/item-player/web-components';
5+
import { onMount } from 'svelte';
36
4-
const html =
5-
'<p>Enter <strong>one</strong> value:</p> [TEXTENTRY:R1] <p>and pick:</p> [INLINECHOICE:R2]';
7+
type FixtureResponseValue = InteractionResponseValue | null;
8+
type FixtureResponseMap = Record<string, FixtureResponseValue>;
69
7-
const interactions = [
8-
{ responseId: 'R1', expectedLength: 10 },
9-
{
10-
responseId: 'R2',
11-
choices: [
12-
{ identifier: 'c1', text: 'First' },
13-
{ identifier: 'c2', text: 'Second' },
14-
],
15-
},
16-
];
10+
const qtiXml = `<?xml version="1.0" encoding="UTF-8"?>
11+
<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p2"
12+
identifier="inline-a11y-fixture"
13+
title="Inline Interaction A11y Fixture"
14+
adaptive="false"
15+
timeDependent="false">
16+
<responseDeclaration identifier="R1" cardinality="single" baseType="string"/>
17+
<responseDeclaration identifier="R2" cardinality="single" baseType="identifier"/>
18+
<itemBody>
19+
<p>
20+
Enter <strong>one</strong> value:
21+
<textEntryInteraction responseIdentifier="R1" expectedLength="10"/>
22+
and pick:
23+
<inlineChoiceInteraction responseIdentifier="R2">
24+
<inlineChoice identifier="c1">First</inlineChoice>
25+
<inlineChoice identifier="c2">Second</inlineChoice>
26+
</inlineChoiceInteraction>
27+
</p>
28+
</itemBody>
29+
</assessmentItem>`;
1730
18-
let responses = $state<Record<string, string | null>>({ R1: '', R2: '' });
31+
let player = $state<Player | null>(null);
32+
let responses = $state<FixtureResponseMap>({ R1: null, R2: null });
33+
let mounted = $state(false);
34+
35+
onMount(() => {
36+
player = new Player({
37+
itemXml: qtiXml,
38+
role: 'candidate',
39+
});
40+
mounted = true;
41+
});
1942
</script>
2043

2144
<div class="space-y-3">
2245
<p class="text-sm text-base-content/70">
23-
Fixture for inline native controls (text input + select) embedded in HTML.
46+
Fixture for inline native controls (text input + select) rendered through ItemBody.
2447
</p>
2548

26-
<InlineInteractionRenderer
27-
{html}
28-
{interactions}
29-
{responses}
30-
onResponseChange={(id, value) => (responses = { ...responses, [id]: value })}
31-
/>
49+
{#if mounted && player}
50+
<div class="qti-item-player">
51+
<ItemBody
52+
{player}
53+
{responses}
54+
disabled={false}
55+
onResponseChange={(id: string, value: FixtureResponseValue) =>
56+
(responses = { ...responses, [id]: value })}
57+
/>
58+
</div>
59+
{/if}
3260
</div>
33-
34-

apps/demo/src/lib/a11y/fixtures/MediaInteractionFixture.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
// @ts-expect-error - Svelte-check can't resolve workspace subpath exports, but runtime works correctly
32
import { ItemBody } from '@pie-qti/item-player/components';
43
import { Player } from '@pie-qti/item-player';
54
import type { InteractionResponseValue } from '@pie-qti/item-player/web-components';

apps/demo/src/lib/a11y/fixtures/PnpCatalogStimulusFixture.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
// @ts-expect-error - Svelte-check can't resolve workspace subpath exports, but runtime works correctly
32
import { ItemBody } from '@pie-qti/item-player/components';
43
import { Player, type PnpProfile } from '@pie-qti/item-player';
54
import type { InteractionResponseValue } from '@pie-qti/item-player/web-components';

0 commit comments

Comments
 (0)