@citolab/qti-components 7.17.0 → 7.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +14 -18
- package/custom-elements.json +21 -1627
- package/dist/{chunk-O4XIWHTF.js → chunk-3IHVFNP6.js} +5 -8
- package/dist/chunk-3IHVFNP6.js.map +1 -0
- package/dist/{chunk-W4SQRNWO.js → chunk-3PDF4K62.js} +2 -6
- package/dist/{chunk-W4SQRNWO.js.map → chunk-3PDF4K62.js.map} +1 -1
- package/dist/{chunk-352OTVTY.js → chunk-ERONHL4R.js} +35 -23
- package/dist/chunk-ERONHL4R.js.map +1 -0
- package/dist/{chunk-2DOYPVF5.js → chunk-LAMJZ533.js} +2 -2
- package/dist/elements.js +1 -1
- package/dist/index.js +4 -4
- package/dist/item.css +1 -5
- package/dist/item.js +2 -2
- package/dist/qti-components-jsx.d.ts +1173 -1173
- package/dist/test.d.ts +21 -21
- package/dist/test.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-352OTVTY.js.map +0 -1
- package/dist/chunk-O4XIWHTF.js.map +0 -1
- package/dist/vscode.css-custom-data.json +0 -11
- package/dist/vscode.html-custom-data.json +0 -960
- /package/dist/{chunk-2DOYPVF5.js.map → chunk-LAMJZ533.js.map} +0 -0
package/custom-elements.json
CHANGED
|
@@ -6690,110 +6690,6 @@
|
|
|
6690
6690
|
}
|
|
6691
6691
|
]
|
|
6692
6692
|
},
|
|
6693
|
-
{
|
|
6694
|
-
"kind": "javascript-module",
|
|
6695
|
-
"path": "packages/qti-item/src/components/item-container/item-container.stories.ts",
|
|
6696
|
-
"declarations": [
|
|
6697
|
-
{
|
|
6698
|
-
"kind": "variable",
|
|
6699
|
-
"name": "ItemDoc",
|
|
6700
|
-
"type": {
|
|
6701
|
-
"text": "Story"
|
|
6702
|
-
},
|
|
6703
|
-
"default": "{ render: (_, { loaded: { itemDoc } }) => { return html` <qti-item> <item-container .itemDoc=${itemDoc}></item-container> </qti-item> `; }, loaders: [ async ({ args }) => { const itemDoc = qtiTransformItem() .load(args['item-url']) .then(api => api.htmlDoc()); return { itemDoc }; } ], play: ItemURL.play, tags: ['!autodocs'] }"
|
|
6704
|
-
},
|
|
6705
|
-
{
|
|
6706
|
-
"kind": "variable",
|
|
6707
|
-
"name": "ItemURL",
|
|
6708
|
-
"type": {
|
|
6709
|
-
"text": "Story"
|
|
6710
|
-
},
|
|
6711
|
-
"default": "{ render: args => { return html`<qti-item>${template(args)}</qti-item>`; }, play: async ({ canvasElement }) => { const assessmentItem = await getAssessmentItemFromItemContainer(canvasElement); expect(assessmentItem).toBeInTheDocument(); } }"
|
|
6712
|
-
},
|
|
6713
|
-
{
|
|
6714
|
-
"kind": "variable",
|
|
6715
|
-
"name": "ItemWithTemplate",
|
|
6716
|
-
"type": {
|
|
6717
|
-
"text": "Story"
|
|
6718
|
-
},
|
|
6719
|
-
"default": "{ render: args => { return html` <qti-item> <item-container item-url=${args['item-url']}> <template> <style> qti-simple-choice { border: 2px solid blue; } </style> </template> </item-container> </qti-item> `; }, play: ItemURL.play, tags: ['!autodocs'] }"
|
|
6720
|
-
},
|
|
6721
|
-
{
|
|
6722
|
-
"kind": "variable",
|
|
6723
|
-
"name": "ItemWithTemplateScale",
|
|
6724
|
-
"type": {
|
|
6725
|
-
"text": "Story"
|
|
6726
|
-
},
|
|
6727
|
-
"default": "{ render: args => { return html` <qti-item> <item-container item-url=${args['item-url']}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> </qti-item> `; }, play: ItemURL.play, tags: ['!autodocs'] }"
|
|
6728
|
-
},
|
|
6729
|
-
{
|
|
6730
|
-
"kind": "variable",
|
|
6731
|
-
"name": "ItemXML",
|
|
6732
|
-
"type": {
|
|
6733
|
-
"text": "Story"
|
|
6734
|
-
},
|
|
6735
|
-
"default": "{ render: (_, { loaded: { itemXML } }) => { return html` <qti-item> <item-container .itemXML=${itemXML}></item-container> </qti-item> `; }, loaders: [ async ({ args }) => { const itemXML = await qtiTransformItem() .load(args['item-url']) .then(api => api.xml()); return { itemXML }; } ], play: ItemURL.play, tags: ['!autodocs'] }"
|
|
6736
|
-
},
|
|
6737
|
-
{
|
|
6738
|
-
"kind": "variable",
|
|
6739
|
-
"name": "meta",
|
|
6740
|
-
"type": {
|
|
6741
|
-
"text": "Meta<typeof ItemContainer & { 'item-url': string }>"
|
|
6742
|
-
},
|
|
6743
|
-
"default": "{ component: 'item-container', args: { ...args, 'item-url': 'assets/qti-item/example-choice-item.xml' }, argTypes, parameters: { actions: { handles: events } } // tags: ['autodocs', 'new'] }"
|
|
6744
|
-
}
|
|
6745
|
-
],
|
|
6746
|
-
"exports": [
|
|
6747
|
-
{
|
|
6748
|
-
"kind": "js",
|
|
6749
|
-
"name": "default",
|
|
6750
|
-
"declaration": {
|
|
6751
|
-
"name": "meta",
|
|
6752
|
-
"module": "packages/qti-item/src/components/item-container/item-container.stories.ts"
|
|
6753
|
-
}
|
|
6754
|
-
},
|
|
6755
|
-
{
|
|
6756
|
-
"kind": "js",
|
|
6757
|
-
"name": "ItemDoc",
|
|
6758
|
-
"declaration": {
|
|
6759
|
-
"name": "ItemDoc",
|
|
6760
|
-
"module": "packages/qti-item/src/components/item-container/item-container.stories.ts"
|
|
6761
|
-
}
|
|
6762
|
-
},
|
|
6763
|
-
{
|
|
6764
|
-
"kind": "js",
|
|
6765
|
-
"name": "ItemURL",
|
|
6766
|
-
"declaration": {
|
|
6767
|
-
"name": "ItemURL",
|
|
6768
|
-
"module": "packages/qti-item/src/components/item-container/item-container.stories.ts"
|
|
6769
|
-
}
|
|
6770
|
-
},
|
|
6771
|
-
{
|
|
6772
|
-
"kind": "js",
|
|
6773
|
-
"name": "ItemWithTemplate",
|
|
6774
|
-
"declaration": {
|
|
6775
|
-
"name": "ItemWithTemplate",
|
|
6776
|
-
"module": "packages/qti-item/src/components/item-container/item-container.stories.ts"
|
|
6777
|
-
}
|
|
6778
|
-
},
|
|
6779
|
-
{
|
|
6780
|
-
"kind": "js",
|
|
6781
|
-
"name": "ItemWithTemplateScale",
|
|
6782
|
-
"declaration": {
|
|
6783
|
-
"name": "ItemWithTemplateScale",
|
|
6784
|
-
"module": "packages/qti-item/src/components/item-container/item-container.stories.ts"
|
|
6785
|
-
}
|
|
6786
|
-
},
|
|
6787
|
-
{
|
|
6788
|
-
"kind": "js",
|
|
6789
|
-
"name": "ItemXML",
|
|
6790
|
-
"declaration": {
|
|
6791
|
-
"name": "ItemXML",
|
|
6792
|
-
"module": "packages/qti-item/src/components/item-container/item-container.stories.ts"
|
|
6793
|
-
}
|
|
6794
|
-
}
|
|
6795
|
-
]
|
|
6796
|
-
},
|
|
6797
6693
|
{
|
|
6798
6694
|
"kind": "javascript-module",
|
|
6799
6695
|
"path": "packages/qti-item/src/components/item-container/item-container.ts",
|
|
@@ -6998,94 +6894,6 @@
|
|
|
6998
6894
|
}
|
|
6999
6895
|
]
|
|
7000
6896
|
},
|
|
7001
|
-
{
|
|
7002
|
-
"kind": "javascript-module",
|
|
7003
|
-
"path": "packages/qti-item/src/components/item-print-variables/item-print-variables.stories.ts",
|
|
7004
|
-
"declarations": [
|
|
7005
|
-
{
|
|
7006
|
-
"kind": "variable",
|
|
7007
|
-
"name": "Default",
|
|
7008
|
-
"type": {
|
|
7009
|
-
"text": "Story"
|
|
7010
|
-
},
|
|
7011
|
-
"default": "{ render: args => html` <qti-item> <div style=\"display: flex; gap: 1rem;\"> <item-container style=\"width: 400px\" item-url=${args['item-url']}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-print-variables></item-print-variables> </div> </qti-item>` }"
|
|
7012
|
-
},
|
|
7013
|
-
{
|
|
7014
|
-
"kind": "variable",
|
|
7015
|
-
"name": "GraphicMatch",
|
|
7016
|
-
"type": {
|
|
7017
|
-
"text": "Story"
|
|
7018
|
-
},
|
|
7019
|
-
"default": "{ args: { 'item-url': '/qti-test-package/items/graphic_gap_match.xml' // Set the new item URL here }, render: args => html` <qti-item> <div style=\"display: flex; gap: 1rem;\"> <item-container style=\"width: 400px\" item-url=${args['item-url']}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-print-variables></item-print-variables> </div> </qti-item>` }"
|
|
7020
|
-
},
|
|
7021
|
-
{
|
|
7022
|
-
"kind": "variable",
|
|
7023
|
-
"name": "Match",
|
|
7024
|
-
"type": {
|
|
7025
|
-
"text": "Story"
|
|
7026
|
-
},
|
|
7027
|
-
"default": "{ args: { 'item-url': '/qti-item/example-match.xml' // Set the new item URL here }, render: args => html` <qti-item> <div style=\"display: flex; gap: 1rem;\"> <item-container style=\"width: 400px\" item-url=${args['item-url']}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-print-variables></item-print-variables> </div> </qti-item>` }"
|
|
7028
|
-
},
|
|
7029
|
-
{
|
|
7030
|
-
"kind": "variable",
|
|
7031
|
-
"name": "meta",
|
|
7032
|
-
"type": {
|
|
7033
|
-
"text": "Meta<typeof ItemContainer & { 'item-url': string }>"
|
|
7034
|
-
},
|
|
7035
|
-
"default": "{ component: 'item-container', args: { ...args, 'item-url': '/qti-item/example-choice-item.xml' }, argTypes, parameters: { actions: { handles: events } } // tags: ['autodocs', 'new'] }"
|
|
7036
|
-
},
|
|
7037
|
-
{
|
|
7038
|
-
"kind": "variable",
|
|
7039
|
-
"name": "MultipleResponse",
|
|
7040
|
-
"type": {
|
|
7041
|
-
"text": "Story"
|
|
7042
|
-
},
|
|
7043
|
-
"default": "{ args: { 'item-url': '/qti-item/example-choice-multiple-item.xml' // Set the new item URL here }, render: args => html` <qti-item> <div style=\"display: flex; gap: 1rem;\"> <item-container style=\"width: 400px\" item-url=${args['item-url']}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-print-variables></item-print-variables> </div> </qti-item>` }"
|
|
7044
|
-
}
|
|
7045
|
-
],
|
|
7046
|
-
"exports": [
|
|
7047
|
-
{
|
|
7048
|
-
"kind": "js",
|
|
7049
|
-
"name": "default",
|
|
7050
|
-
"declaration": {
|
|
7051
|
-
"name": "meta",
|
|
7052
|
-
"module": "packages/qti-item/src/components/item-print-variables/item-print-variables.stories.ts"
|
|
7053
|
-
}
|
|
7054
|
-
},
|
|
7055
|
-
{
|
|
7056
|
-
"kind": "js",
|
|
7057
|
-
"name": "Default",
|
|
7058
|
-
"declaration": {
|
|
7059
|
-
"name": "Default",
|
|
7060
|
-
"module": "packages/qti-item/src/components/item-print-variables/item-print-variables.stories.ts"
|
|
7061
|
-
}
|
|
7062
|
-
},
|
|
7063
|
-
{
|
|
7064
|
-
"kind": "js",
|
|
7065
|
-
"name": "GraphicMatch",
|
|
7066
|
-
"declaration": {
|
|
7067
|
-
"name": "GraphicMatch",
|
|
7068
|
-
"module": "packages/qti-item/src/components/item-print-variables/item-print-variables.stories.ts"
|
|
7069
|
-
}
|
|
7070
|
-
},
|
|
7071
|
-
{
|
|
7072
|
-
"kind": "js",
|
|
7073
|
-
"name": "Match",
|
|
7074
|
-
"declaration": {
|
|
7075
|
-
"name": "Match",
|
|
7076
|
-
"module": "packages/qti-item/src/components/item-print-variables/item-print-variables.stories.ts"
|
|
7077
|
-
}
|
|
7078
|
-
},
|
|
7079
|
-
{
|
|
7080
|
-
"kind": "js",
|
|
7081
|
-
"name": "MultipleResponse",
|
|
7082
|
-
"declaration": {
|
|
7083
|
-
"name": "MultipleResponse",
|
|
7084
|
-
"module": "packages/qti-item/src/components/item-print-variables/item-print-variables.stories.ts"
|
|
7085
|
-
}
|
|
7086
|
-
}
|
|
7087
|
-
]
|
|
7088
|
-
},
|
|
7089
6897
|
{
|
|
7090
6898
|
"kind": "javascript-module",
|
|
7091
6899
|
"path": "packages/qti-item/src/components/item-print-variables/item-print-variables.ts",
|
|
@@ -7136,174 +6944,6 @@
|
|
|
7136
6944
|
}
|
|
7137
6945
|
]
|
|
7138
6946
|
},
|
|
7139
|
-
{
|
|
7140
|
-
"kind": "javascript-module",
|
|
7141
|
-
"path": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts",
|
|
7142
|
-
"declarations": [
|
|
7143
|
-
{
|
|
7144
|
-
"kind": "variable",
|
|
7145
|
-
"name": "Default",
|
|
7146
|
-
"type": {
|
|
7147
|
-
"text": "Story"
|
|
7148
|
-
},
|
|
7149
|
-
"default": "{ render: args => { return html`<qti-item> <!-- <div style=\"display: flex; flex-direction: column; gap: 1rem;\"> --> <item-container style=\"width: 400px; height: 350px; display: block;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-candidate-correction ${spread(args)}></item-show-candidate-correction> <!-- </div> --> </qti-item>`; }, play: async ({ canvasElement, step }) => { // wait for qti-simple-choice to be rendered const canvas = within(canvasElement); // const choices = await canvas.findAllByShadowRole('radio'); const choiceA: QtiSimpleChoice = await canvas.findByShadowText('You must stay with your luggage at all times.'); const choiceB: QtiSimpleChoice = await canvas.findByShadowText('Do not let someone else look after your luggage.'); const choiceC: QtiSimpleChoice = await canvas.findByShadowText('Remember your luggage when you leave.'); const showCorrectButton = canvas.getAllByShadowText(/Show candidate correction/i)[0]; await step('Click on the Show candidate correction button', async () => { await choiceA.click(); await showCorrectButton.click(); await step('Verify candidate correction is applied', async () => { expect(choiceA.internals.states.has('candidate-correct')).toBe(true); expect(choiceB.internals.states.has('candidate-correct')).toBe(false); expect(choiceC.internals.states.has('candidate-correct')).toBe(false); expect(choiceA.internals.states.has('candidate-incorrect')).toBe(false); expect(choiceB.internals.states.has('candidate-incorrect')).toBe(false); expect(choiceC.internals.states.has('candidate-incorrect')).toBe(false); }); await step('Click on the Show Candidate Correction again', async () => { expect(canvas.queryByShadowText(/Show candidate correction/i)).toBeNull(); expect(canvas.getAllByShadowText(/Hide candidate correction/i).length).toBe(1); await showCorrectButton.click(); await choiceA.click(); // Deselect option expect(choiceA.internals.states.has('candidate-correct')).toBe(false); expect(choiceB.internals.states.has('candidate-correct')).toBe(false); expect(choiceC.internals.states.has('candidate-correct')).toBe(false); expect(choiceA.internals.states.has('candidate-incorrect')).toBe(false); expect(choiceB.internals.states.has('candidate-incorrect')).toBe(false); expect(choiceC.internals.states.has('candidate-incorrect')).toBe(false); }); await step('Change answer after showing Candidate Correction', async () => { expect(canvas.getAllByShadowText(/Show candidate correction/i).length).toBe(1); await choiceA.click(); await showCorrectButton.click(); await choiceB.click(); expect(choiceA.internals.states.has('candidate-correct')).toBe(false); expect(choiceB.internals.states.has('candidate-correct')).toBe(false); expect(choiceC.internals.states.has('candidate-correct')).toBe(false); expect(choiceA.internals.states.has('candidate-incorrect')).toBe(false); expect(choiceB.internals.states.has('candidate-incorrect')).toBe(false); expect(choiceC.internals.states.has('candidate-incorrect')).toBe(false); expect(canvas.queryByShadowText(/Hide candidate correction/i)).toBeNull(); await choiceB.click(); // Deselect option }); }); } }"
|
|
7150
|
-
},
|
|
7151
|
-
{
|
|
7152
|
-
"kind": "variable",
|
|
7153
|
-
"name": "GapMatch",
|
|
7154
|
-
"type": {
|
|
7155
|
-
"text": "Story"
|
|
7156
|
-
},
|
|
7157
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/gap_match.xml' }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-candidate-correction></item-show-candidate-correction> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const canvas = within(canvasElement); const interaction = await getAssessmentItemFromItemContainer(canvasElement); const showCorrectButton = await canvas.findByShadowText(/Show candidate correction/i); const matchItem1 = (await canvas.findByShadowText('winter')) as QtiGapMatchInteraction; const matchItem2 = (await canvas.findByShadowText('spring')) as QtiGapMatchInteraction; const dropZones = interaction.querySelectorAll(`qti-gap`); const dropZone1 = dropZones[0]; const dropZone2 = dropZones[1]; await step('Drag and drop match interaction items', async () => { await drag(matchItem1, { to: dropZone1 }); await drag(matchItem2, { to: dropZone2 }); await showCorrectButton.click(); await step('Verify candidate correction state is applied', async () => { const matchItem1List = Array.from(await canvas.findAllByShadowText('winter')); const matchItem1CandidateResponse = matchItem1List[1] as QtiGapMatchInteraction; const matchItem2List = Array.from(await canvas.findAllByShadowText('spring')); const matchItem2CandidateResponse = matchItem2List[1] as QtiGapMatchInteraction; expect(matchItem1CandidateResponse.internals.states.has('candidate-correct')).toBe(true); expect(matchItem2CandidateResponse.internals.states.has('candidate-correct')).toBe(false); expect(matchItem1CandidateResponse.internals.states.has('candidate-incorrect')).toBe(false); expect(matchItem2CandidateResponse.internals.states.has('candidate-incorrect')).toBe(true); }); }); } }"
|
|
7158
|
-
},
|
|
7159
|
-
{
|
|
7160
|
-
"kind": "variable",
|
|
7161
|
-
"name": "InlineChoice",
|
|
7162
|
-
"type": {
|
|
7163
|
-
"text": "Story"
|
|
7164
|
-
},
|
|
7165
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-inline-choice.xml' }, render: args => html` <qti-item> <div> <item-container style=\"display: block; width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-candidate-correction></item-show-candidate-correction> </div> </qti-item> `, play: async ({ canvasElement, step }) => { const canvas = within(canvasElement); const item = await getAssessmentItemFromItemContainer(canvasElement); const interaction = await waitFor(() => { const el = item.querySelector('qti-inline-choice-interaction'); if (!el) throw new Error('inline-choice interaction not found'); return el; }); const selectElement = await waitFor(() => { const select = interaction.shadowRoot?.querySelector<HTMLSelectElement>('select'); if (!select) throw new Error('select element not yet available'); return select; }); const showButton = await canvas.findByShadowText(/Show candidate correction/i); await step('Select an inline choice option', async () => { selectElement.value = 'Y'; // de correcte identifier (York) selectElement.dispatchEvent(new Event('change', { bubbles: true })); }); await step('Click on the Show Candidate Correction button', async () => { await showButton.click(); await step('Verify candidate correction by checking selected option', async () => { const selectedOption = Array.from(selectElement.options).find(opt => opt.selected); expect(selectedOption).not.toBeUndefined(); expect(selectedOption.value).toBe('Y'); expect(selectedOption.textContent.trim()).toBe('York'); }); }); } }"
|
|
7166
|
-
},
|
|
7167
|
-
{
|
|
7168
|
-
"kind": "variable",
|
|
7169
|
-
"name": "Match",
|
|
7170
|
-
"type": {
|
|
7171
|
-
"text": "Story"
|
|
7172
|
-
},
|
|
7173
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/match.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-candidate-correction></item-show-candidate-correction> </div> </qti-item>`, play: async ({ canvasElement, step }) => { // wait for qti-simple-choice to be rendered const canvas = within(canvasElement); const showCorrectButton = await canvas.findByShadowText(/Show candidate correction/i); const matchItem1 = (await canvas.findByShadowText('Prospero')) as QtiSimpleAssociableChoice; const matchItem2 = (await canvas.findByShadowText('Capulet')) as QtiSimpleAssociableChoice; const matchItem3 = (await canvas.findByShadowText('Demetrius')) as QtiSimpleAssociableChoice; const dropZone1 = await canvas.findByShadowText('The Tempest'); const dropZone2 = await canvas.findByShadowText(\"A Midsummer-Night's Dream\"); const dropZone3 = await canvas.findByShadowText('Romeo and Juliet'); await step('Drag and drop match interaction items', async () => { await drag(matchItem1, { to: dropZone1 }); await drag(matchItem2, { to: dropZone2 }); await drag(matchItem3, { to: dropZone3 }); await showCorrectButton.click(); await step('Verify candidate correction state is applied', async () => { const matchItem1List = Array.from(await canvas.findAllByShadowText('Prospero')); const matchItem1CandidateResponse = matchItem1List[1] as QtiSimpleAssociableChoice; const matchItem2List = Array.from(await canvas.findAllByShadowText('Capulet')); const matchItem2CandidateResponse = matchItem2List[1] as QtiSimpleAssociableChoice; const matchItem3List = Array.from(await canvas.findAllByShadowText('Demetrius')); const matchItem3CandidateResponse = matchItem3List[1] as QtiSimpleAssociableChoice; expect(matchItem1CandidateResponse.internals.states.has('candidate-correct')).toBe(true); expect(matchItem2CandidateResponse.internals.states.has('candidate-correct')).toBe(false); expect(matchItem3CandidateResponse.internals.states.has('candidate-correct')).toBe(false); expect(matchItem1CandidateResponse.internals.states.has('candidate-incorrect')).toBe(false); expect(matchItem2CandidateResponse.internals.states.has('candidate-incorrect')).toBe(true); expect(matchItem3CandidateResponse.internals.states.has('candidate-incorrect')).toBe(true); }); }); } }"
|
|
7174
|
-
},
|
|
7175
|
-
{
|
|
7176
|
-
"kind": "variable",
|
|
7177
|
-
"name": "MatchAllToOneZone",
|
|
7178
|
-
"type": {
|
|
7179
|
-
"text": "Story"
|
|
7180
|
-
},
|
|
7181
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/match.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-candidate-correction></item-show-candidate-correction> </div> </qti-item>`, play: async ({ canvasElement, step }) => { // wait for qti-simple-choice to be rendered - fresh UI state const canvas = within(canvasElement); const showCorrectButton = await canvas.findByShadowText(/Show candidate correction/i); const matchItem1 = (await canvas.findByShadowText('Prospero')) as QtiSimpleAssociableChoice; const matchItem2 = (await canvas.findByShadowText('Lysander')) as QtiSimpleAssociableChoice; const matchItem3 = (await canvas.findByShadowText('Demetrius')) as QtiSimpleAssociableChoice; const dropZone1 = await canvas.findByShadowText('The Tempest'); await step('Drag and drop all match interaction items to single dropzone', async () => { await drag(matchItem1, { to: dropZone1 }); await drag(matchItem2, { to: dropZone1 }); await drag(matchItem3, { to: dropZone1 }); await showCorrectButton.click(); await step('Verify candidate correction state is applied', async () => { const matchItem1List = Array.from(await canvas.findAllByShadowText('Prospero')); const matchItem1CandidateResponse = matchItem1List[1] as QtiSimpleAssociableChoice; const matchItem2List = Array.from(await canvas.findAllByShadowText('Lysander')); const matchItem2CandidateResponse = matchItem2List[1] as QtiSimpleAssociableChoice; const matchItem3List = Array.from(await canvas.findAllByShadowText('Demetrius')); const matchItem3CandidateResponse = matchItem3List[1] as QtiSimpleAssociableChoice; expect(matchItem1CandidateResponse.internals.states.has('candidate-correct')).toBe(true); expect(matchItem2CandidateResponse.internals.states.has('candidate-correct')).toBe(false); expect(matchItem3CandidateResponse.internals.states.has('candidate-correct')).toBe(false); expect(matchItem1CandidateResponse.internals.states.has('candidate-incorrect')).toBe(false); expect(matchItem2CandidateResponse.internals.states.has('candidate-incorrect')).toBe(true); expect(matchItem3CandidateResponse.internals.states.has('candidate-incorrect')).toBe(true); }); }); } }"
|
|
7182
|
-
},
|
|
7183
|
-
{
|
|
7184
|
-
"kind": "variable",
|
|
7185
|
-
"name": "meta",
|
|
7186
|
-
"type": {
|
|
7187
|
-
"text": "Meta<typeof ItemContainer & { 'item-url': string }>"
|
|
7188
|
-
},
|
|
7189
|
-
"default": "{ component: 'item-container', args: { ...args, 'item-url': 'assets/qti-item/example-choice-item.xml' }, argTypes, parameters: { actions: { handles: events } } // tags: ['autodocs', 'new'] }"
|
|
7190
|
-
},
|
|
7191
|
-
{
|
|
7192
|
-
"kind": "variable",
|
|
7193
|
-
"name": "MultipleResponse",
|
|
7194
|
-
"type": {
|
|
7195
|
-
"text": "Story"
|
|
7196
|
-
},
|
|
7197
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-choice-multiple-item.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-candidate-correction ${spread(args)}></item-show-candidate-correction> </div> </qti-item>`, play: async ({ canvasElement, step }) => { // wait for qti-simple-choice to be rendered const canvas = within(canvasElement); // const choices = await canvas.findAllByShadowRole('radio'); const choiceA: QtiSimpleChoice = await canvas.findByShadowText('This is correct.'); const choiceB: QtiSimpleChoice = await canvas.findByShadowText('This is also correct.'); const choiceC: QtiSimpleChoice = await canvas.findByShadowText('This is wrong.'); const showCorrectButton = canvas.getAllByShadowText(/Show candidate correction/i)[0]; await step('Click on the Show Correct button', async () => { await choiceA.click(); await choiceC.click(); await showCorrectButton.click(); await step('Verify candidate correction state is applied', async () => { expect(choiceA.internals.states.has('candidate-correct')).toBe(true); expect(choiceB.internals.states.has('candidate-correct')).toBe(false); expect(choiceC.internals.states.has('candidate-correct')).toBe(false); expect(choiceA.internals.states.has('candidate-incorrect')).toBe(false); expect(choiceB.internals.states.has('candidate-incorrect')).toBe(false); expect(choiceC.internals.states.has('candidate-incorrect')).toBe(true); }); }); await step('Click on the Hide Correct button and deselect options', async () => { await showCorrectButton.click(); await step('Verify candidate correction state is removed', async () => { expect(choiceA.internals.states.has('candidate-correct')).toBe(false); expect(choiceB.internals.states.has('candidate-correct')).toBe(false); expect(choiceC.internals.states.has('candidate-correct')).toBe(false); expect(choiceA.internals.states.has('candidate-incorrect')).toBe(false); expect(choiceB.internals.states.has('candidate-incorrect')).toBe(false); expect(choiceC.internals.states.has('candidate-incorrect')).toBe(false); }); await choiceA.click(); await choiceC.click(); }); } }"
|
|
7198
|
-
},
|
|
7199
|
-
{
|
|
7200
|
-
"kind": "variable",
|
|
7201
|
-
"name": "NoCorrectResponse",
|
|
7202
|
-
"type": {
|
|
7203
|
-
"text": "Story"
|
|
7204
|
-
},
|
|
7205
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-choice-nocorrect-item.xml' // Set the new item URL here }, render: args => html` <qti-item> <item-container style=\"width: 400px; height: 350px; display: block;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-candidate-correction ${spread(args)}></item-show-candidate-correction> <!-- </div> --> </qti-item>`, play: async ({ canvasElement, step }) => { // // wait for qti-simple-choice to be rendered const canvas = within(canvasElement); await canvas.findByShadowText('You must stay with your luggage at all times.'); const _ = canvas.getAllByShadowText(/No correct response specified/i)[0]; const itemShowCorrect = canvasElement.querySelector('item-show-candidate-correction'); await step('Verify the Show Correct button is disabled', async () => { expect(itemShowCorrect.disabled).toBe(true); }); } }"
|
|
7206
|
-
},
|
|
7207
|
-
{
|
|
7208
|
-
"kind": "variable",
|
|
7209
|
-
"name": "SelectPoint",
|
|
7210
|
-
"type": {
|
|
7211
|
-
"text": "Story"
|
|
7212
|
-
},
|
|
7213
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/select_point.xml' }, render: args => html` <qti-item> <div> <item-container style=\"display: block; width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-candidate-correction></item-show-candidate-correction> </div> </qti-item> `, play: async ({ canvasElement, step }) => { const canvas = within(canvasElement); const showButton = await canvas.findByShadowText(/Show candidate correction/i); const image = await canvas.findByShadowAltText('UK Map'); await step('Click on correct point in the image', async () => { const rect = image.getBoundingClientRect(); await fireEvent.click(image, { clientX: rect.left + rect.width * 0.5, clientY: rect.top + rect.height * 0.4 }); }); await step('Click on incorrect points in the image', async () => { const rect = image.getBoundingClientRect(); await fireEvent.click(image, { clientX: rect.left + rect.width * 0.5, clientY: rect.top + rect.height * 0.6 }); await fireEvent.click(image, { clientX: rect.left + rect.width * 0.55, clientY: rect.top + rect.height * 0.65 }); }); await step('Click on the Show Candidate Correction button', async () => { await showButton.click(); await step('Verify candidate correction by checking selected options', async () => { const item = await getAssessmentItemFromItemContainer(canvasElement); const interaction: QtiSelectPointInteraction = item.querySelector('qti-select-point-interaction'); const buttonsCorrect = interaction.shadowRoot?.querySelectorAll<HTMLButtonElement>('button[part=\"point correct\"]'); const buttonsIncorrect = interaction.shadowRoot?.querySelectorAll<HTMLButtonElement>( 'button[part=\"point incorrect\"]' ); expect(buttonsCorrect).toHaveLength(1); expect(buttonsIncorrect).toHaveLength(2); }); }); } }"
|
|
7214
|
-
},
|
|
7215
|
-
{
|
|
7216
|
-
"kind": "variable",
|
|
7217
|
-
"name": "TextEntry",
|
|
7218
|
-
"type": {
|
|
7219
|
-
"text": "Story"
|
|
7220
|
-
},
|
|
7221
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-text-entry.xml' }, render: args => html` <qti-item> <div> <item-container style=\"display: block; width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-candidate-correction></item-show-candidate-correction> </div> </qti-item> `, play: async ({ canvasElement, step }) => { const canvas = within(canvasElement); const showButton = await canvas.findByShadowText(/Show candidate correction/i); const item = await getAssessmentItemFromItemContainer(canvasElement); const interaction: QtiTextEntryInteraction = item.querySelector('qti-text-entry-interaction'); const input = interaction.shadowRoot?.querySelector<HTMLInputElement>('input'); await step('Type in the correct answer text entry interaction', async () => { input.value = 'York'; input.dispatchEvent(new Event('input', { bubbles: true })); input.dispatchEvent(new Event('change', { bubbles: true })); }); await step('Click on the Show Candidate Correction button', async () => { await showButton.click(); await step('Verify candidate correction by checking selected option', async () => { expect(interaction.internals.states.has('candidate-correct')).toBe(true); expect(interaction.internals.states.has('candidate-incorrect')).toBe(false); expect(interaction.internals.states.has('candidate-partially-correct')).toBe(false); }); }); await step('Type in the partially correct answer text entry interaction', async () => { input.value = 'york'; input.dispatchEvent(new Event('input', { bubbles: true })); input.dispatchEvent(new Event('change', { bubbles: true })); }); await step('Click on the Show Candidate Correction button', async () => { await showButton.click(); await step('Verify candidate correction by checking selected option', async () => { const interactionResponse: QtiTextEntryInteraction = item.querySelector('qti-text-entry-interaction'); expect(interactionResponse.internals.states.has('candidate-correct')).toBe(false); expect(interactionResponse.internals.states.has('candidate-incorrect')).toBe(false); expect(interactionResponse.internals.states.has('candidate-partially-correct')).toBe(true); }); }); await step('Type in the incorrect answer text entry interaction', async () => { input.value = 'bla'; input.dispatchEvent(new Event('input', { bubbles: true })); input.dispatchEvent(new Event('change', { bubbles: true })); }); await step('Click on the Show Candidate Correction button', async () => { await showButton.click(); await step('Verify candidate correction by checking selected option', async () => { const interactionResponse: QtiTextEntryInteraction = item.querySelector('qti-text-entry-interaction'); expect(interactionResponse.internals.states.has('candidate-correct')).toBe(false); expect(interactionResponse.internals.states.has('candidate-incorrect')).toBe(true); expect(interactionResponse.internals.states.has('candidate-partially-correct')).toBe(false); }); }); } }"
|
|
7222
|
-
}
|
|
7223
|
-
],
|
|
7224
|
-
"exports": [
|
|
7225
|
-
{
|
|
7226
|
-
"kind": "js",
|
|
7227
|
-
"name": "default",
|
|
7228
|
-
"declaration": {
|
|
7229
|
-
"name": "meta",
|
|
7230
|
-
"module": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts"
|
|
7231
|
-
}
|
|
7232
|
-
},
|
|
7233
|
-
{
|
|
7234
|
-
"kind": "js",
|
|
7235
|
-
"name": "Default",
|
|
7236
|
-
"declaration": {
|
|
7237
|
-
"name": "Default",
|
|
7238
|
-
"module": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts"
|
|
7239
|
-
}
|
|
7240
|
-
},
|
|
7241
|
-
{
|
|
7242
|
-
"kind": "js",
|
|
7243
|
-
"name": "GapMatch",
|
|
7244
|
-
"declaration": {
|
|
7245
|
-
"name": "GapMatch",
|
|
7246
|
-
"module": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts"
|
|
7247
|
-
}
|
|
7248
|
-
},
|
|
7249
|
-
{
|
|
7250
|
-
"kind": "js",
|
|
7251
|
-
"name": "InlineChoice",
|
|
7252
|
-
"declaration": {
|
|
7253
|
-
"name": "InlineChoice",
|
|
7254
|
-
"module": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts"
|
|
7255
|
-
}
|
|
7256
|
-
},
|
|
7257
|
-
{
|
|
7258
|
-
"kind": "js",
|
|
7259
|
-
"name": "Match",
|
|
7260
|
-
"declaration": {
|
|
7261
|
-
"name": "Match",
|
|
7262
|
-
"module": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts"
|
|
7263
|
-
}
|
|
7264
|
-
},
|
|
7265
|
-
{
|
|
7266
|
-
"kind": "js",
|
|
7267
|
-
"name": "MatchAllToOneZone",
|
|
7268
|
-
"declaration": {
|
|
7269
|
-
"name": "MatchAllToOneZone",
|
|
7270
|
-
"module": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts"
|
|
7271
|
-
}
|
|
7272
|
-
},
|
|
7273
|
-
{
|
|
7274
|
-
"kind": "js",
|
|
7275
|
-
"name": "MultipleResponse",
|
|
7276
|
-
"declaration": {
|
|
7277
|
-
"name": "MultipleResponse",
|
|
7278
|
-
"module": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts"
|
|
7279
|
-
}
|
|
7280
|
-
},
|
|
7281
|
-
{
|
|
7282
|
-
"kind": "js",
|
|
7283
|
-
"name": "NoCorrectResponse",
|
|
7284
|
-
"declaration": {
|
|
7285
|
-
"name": "NoCorrectResponse",
|
|
7286
|
-
"module": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts"
|
|
7287
|
-
}
|
|
7288
|
-
},
|
|
7289
|
-
{
|
|
7290
|
-
"kind": "js",
|
|
7291
|
-
"name": "SelectPoint",
|
|
7292
|
-
"declaration": {
|
|
7293
|
-
"name": "SelectPoint",
|
|
7294
|
-
"module": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts"
|
|
7295
|
-
}
|
|
7296
|
-
},
|
|
7297
|
-
{
|
|
7298
|
-
"kind": "js",
|
|
7299
|
-
"name": "TextEntry",
|
|
7300
|
-
"declaration": {
|
|
7301
|
-
"name": "TextEntry",
|
|
7302
|
-
"module": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.stories.ts"
|
|
7303
|
-
}
|
|
7304
|
-
}
|
|
7305
|
-
]
|
|
7306
|
-
},
|
|
7307
6947
|
{
|
|
7308
6948
|
"kind": "javascript-module",
|
|
7309
6949
|
"path": "packages/qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.ts",
|
|
@@ -7484,382 +7124,6 @@
|
|
|
7484
7124
|
}
|
|
7485
7125
|
]
|
|
7486
7126
|
},
|
|
7487
|
-
{
|
|
7488
|
-
"kind": "javascript-module",
|
|
7489
|
-
"path": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts",
|
|
7490
|
-
"declarations": [
|
|
7491
|
-
{
|
|
7492
|
-
"kind": "variable",
|
|
7493
|
-
"name": "ChoiceFullCorrectResponse",
|
|
7494
|
-
"type": {
|
|
7495
|
-
"text": "Story"
|
|
7496
|
-
},
|
|
7497
|
-
"default": "{ render: args => { return html`<qti-item> <div style=\"display: flex; flex-direction: column; gap: 1rem; align-items: start\"> <item-container style=\"width: 400px; height: 350px; display: block;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`; }, play: async ({ canvasElement, step }) => { const item = document.querySelector('qti-item'); item.configContext = { correctResponseMode: 'full', fullCorrectResponseOnlyWhenIncorrect: false }; const canvas = within(canvasElement); const showCorrectButton = await canvas.findByShadowText(/Show correct/i); const choiceA: QtiSimpleChoice = await canvas.findByShadowText('You must stay with your luggage at all times.'); await step('Click on the Show Correct button', async () => { await choiceA.click(); await fireEvent.click(showCorrectButton); await step('Verify correct response state is applied', async () => { const fullCorrectResponse = await canvas.findByShadowRole('full-correct-response'); expect(fullCorrectResponse).toBeVisible(); const interaction = fullCorrectResponse.querySelector('qti-choice-interaction'); const choices = Array.from(interaction.querySelectorAll('qti-simple-choice')); await interaction.updateComplete; expect(choices[0].internals.states.has('--checked')).toBe(true); expect(choices[1].internals.states.has('--checked')).toBe(false); expect(choices[2].internals.states.has('--checked')).toBe(false); }); }); } }"
|
|
7498
|
-
},
|
|
7499
|
-
{
|
|
7500
|
-
"kind": "variable",
|
|
7501
|
-
"name": "ChoiceFullCorrectResponseOnlyWhenIncorrect",
|
|
7502
|
-
"type": {
|
|
7503
|
-
"text": "Story"
|
|
7504
|
-
},
|
|
7505
|
-
"default": "{ render: args => { return html`<qti-item> <div style=\"display: flex; flex-direction: column; gap: 1rem; align-items: start\"> <item-container style=\"width: 400px; height: 350px; display: block;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`; }, play: async ({ canvasElement, step }) => { const item = document.querySelector('qti-item'); item.configContext = { correctResponseMode: 'full', fullCorrectResponseOnlyWhenIncorrect: true }; const canvas = within(canvasElement); const showCorrectButton = await canvas.findByShadowText(/Show correct/i); const choiceA: QtiSimpleChoice = await canvas.findByShadowText('You must stay with your luggage at all times.'); await step('Click on the Show Correct button', async () => { await choiceA.click(); await fireEvent.click(showCorrectButton); await step('Verify correct full correct response is not visible', async () => { const fullCorrectResponse = await canvas.queryByShadowRole('full-correct-response'); expect(fullCorrectResponse).toBeNull(); }); }); } }"
|
|
7506
|
-
},
|
|
7507
|
-
{
|
|
7508
|
-
"kind": "variable",
|
|
7509
|
-
"name": "ChoiceInternalCorrectResponse",
|
|
7510
|
-
"type": {
|
|
7511
|
-
"text": "Story"
|
|
7512
|
-
},
|
|
7513
|
-
"default": "{ render: args => { return html`<qti-item> <div style=\"display: flex; flex-direction: column; gap: 1rem; align-items: start\"> <item-container style=\"width: 400px; height: 350px; display: block;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`; }, play: async ({ canvasElement, step }) => { const item = document.querySelector('qti-item'); item.configContext = { correctResponseMode: 'internal' }; // wait for qti-simple-choice to be rendered const canvas = within(canvasElement); // const choices = await canvas.findAllByShadowRole('radio'); const choiceA: QtiSimpleChoice = await canvas.findByShadowText('You must stay with your luggage at all times.'); const choiceB: QtiSimpleChoice = await canvas.findByShadowText('Do not let someone else look after your luggage.'); const choiceC: QtiSimpleChoice = await canvas.findByShadowText('Remember your luggage when you leave.'); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); await step('Verify correct response state is applied', async () => { expect(choiceA.internals.states.has('correct-response')).toBe(true); expect(choiceB.internals.states.has('correct-response')).toBe(false); expect(choiceC.internals.states.has('correct-response')).toBe(false); expect(choiceA.internals.states.has('incorrect-response')).toBe(false); expect(choiceB.internals.states.has('incorrect-response')).toBe(true); expect(choiceC.internals.states.has('incorrect-response')).toBe(true); }); }); } }"
|
|
7514
|
-
},
|
|
7515
|
-
{
|
|
7516
|
-
"kind": "variable",
|
|
7517
|
-
"name": "Default",
|
|
7518
|
-
"type": {
|
|
7519
|
-
"text": "Story"
|
|
7520
|
-
},
|
|
7521
|
-
"default": "{ render: args => { return html`<qti-item> <div style=\"display: flex; flex-direction: column; gap: 1rem; align-items: start\"> <item-container style=\"width: 400px; height: 350px; display: block;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-correct-response-mode></item-correct-response-mode> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`; }, play: async ({ canvasElement, step }) => { // wait for qti-simple-choice to be rendered const canvas = within(canvasElement); // const choices = await canvas.findAllByShadowRole('radio'); const choiceA: QtiSimpleChoice = await canvas.findByShadowText('You must stay with your luggage at all times.'); const choiceB: QtiSimpleChoice = await canvas.findByShadowText('Do not let someone else look after your luggage.'); const choiceC: QtiSimpleChoice = await canvas.findByShadowText('Remember your luggage when you leave.'); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); await step('Verify correct response state is applied', async () => { expect(choiceA.internals.states.has('correct-response')).toBe(true); expect(choiceB.internals.states.has('correct-response')).toBe(false); expect(choiceC.internals.states.has('correct-response')).toBe(false); expect(choiceA.internals.states.has('incorrect-response')).toBe(false); expect(choiceB.internals.states.has('incorrect-response')).toBe(true); expect(choiceC.internals.states.has('incorrect-response')).toBe(true); }); await step('Click on the Show Correct button again', async () => { expect(canvas.queryByShadowText(/Show correct/i)).toBeNull(); expect(canvas.getAllByShadowText(/Hide correct/i).length).toBe(1); await showCorrectButton.click(); expect(choiceA.internals.states.has('correct-response')).toBe(false); expect(choiceB.internals.states.has('correct-response')).toBe(false); expect(choiceC.internals.states.has('correct-response')).toBe(false); expect(choiceA.internals.states.has('incorrect-response')).toBe(false); expect(choiceB.internals.states.has('incorrect-response')).toBe(false); expect(choiceC.internals.states.has('incorrect-response')).toBe(false); }); }); } }"
|
|
7522
|
-
},
|
|
7523
|
-
{
|
|
7524
|
-
"kind": "variable",
|
|
7525
|
-
"name": "GapMatch",
|
|
7526
|
-
"type": {
|
|
7527
|
-
"text": "Story"
|
|
7528
|
-
},
|
|
7529
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/gap_match.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const canvas = within(canvasElement); const interaction = await getAssessmentItemFromItemContainer(canvasElement); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); const correctOptions = interaction.querySelectorAll(`[class=\"correct-option\"]`); expect(correctOptions.length).toBe(2); expect(correctOptions[0].textContent).toBe('winter'); expect(correctOptions[1].textContent).toBe('summer'); }); } }"
|
|
7530
|
-
},
|
|
7531
|
-
{
|
|
7532
|
-
"kind": "variable",
|
|
7533
|
-
"name": "GapMatchCorrectResponse",
|
|
7534
|
-
"type": {
|
|
7535
|
-
"text": "Story"
|
|
7536
|
-
},
|
|
7537
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/gap_match.xml' }, render: args => html`<qti-item> <div> <item-container style=\"display: block; width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const canvas = within(canvasElement); const showCorrectButton = await canvas.findByShadowText(/Show correct/i); const interaction = await getAssessmentItemFromItemContainer(canvasElement); const matchItem1 = (await canvas.findByShadowText('winter')) as QtiGapMatchInteraction; const matchItem2 = (await canvas.findByShadowText('spring')) as QtiGapMatchInteraction; const dropZones = interaction.querySelectorAll(`qti-gap`); const dropZone1 = dropZones[0]; const dropZone2 = dropZones[1]; await step('Drag and drop match interaction items', async () => { await drag(matchItem1, { to: dropZone1 }); await drag(matchItem2, { to: dropZone2 }); await showCorrectButton.click(); await step('Verify correct response is shown', async () => { const correctResponses = interaction.querySelectorAll('[class=\"correct-option\"]'); expect(correctResponses.length).toBe(2); expect(correctResponses[0].textContent).toBe('winter'); expect(correctResponses[1].textContent).toBe('summer'); }); }); } }"
|
|
7538
|
-
},
|
|
7539
|
-
{
|
|
7540
|
-
"kind": "variable",
|
|
7541
|
-
"name": "GraphicAssociate",
|
|
7542
|
-
"type": {
|
|
7543
|
-
"text": "Story"
|
|
7544
|
-
},
|
|
7545
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/graphic_associate.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; border: 2px solid blue; transform: scale(0.7); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response></item-show-correct-response> <!-- <item-print-variables></item-print-variables> --> </div> </qti-item>`, play: async ({ canvasElement, step }) => { // wait for qti-simple-choices to be rendered const canvas = within(canvasElement); const item = await getAssessmentItemFromItemContainer(canvasElement); const interaction = item.querySelector('qti-graphic-associate-interaction'); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); const lines = interaction.shadowRoot.querySelector('line-container').querySelectorAll(`[part='correct-line']`).length === 2; expect(lines).toBe(true); }); } }"
|
|
7546
|
-
},
|
|
7547
|
-
{
|
|
7548
|
-
"kind": "variable",
|
|
7549
|
-
"name": "GraphicOrder",
|
|
7550
|
-
"type": {
|
|
7551
|
-
"text": "Story"
|
|
7552
|
-
},
|
|
7553
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-graphic-order.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { // wait for qti-simple-choices to be rendered const canvas = within(canvasElement); const item = await getAssessmentItemFromItemContainer(canvasElement); const interaction = item.querySelector('qti-graphic-order-interaction'); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); const hotspotChoice = interaction.querySelectorAll('qti-hotspot-choice'); // const get after content expect(window.getComputedStyle(hotspotChoice[0], ':after').content).toBe('\"C=1\"'); expect(window.getComputedStyle(hotspotChoice[1], ':after').content).toBe('\"C=4\"'); expect(window.getComputedStyle(hotspotChoice[2], ':after').content).toBe('\"C=2\"'); expect(window.getComputedStyle(hotspotChoice[3], ':after').content).toBe('\"C=3\"'); }); } }"
|
|
7554
|
-
},
|
|
7555
|
-
{
|
|
7556
|
-
"kind": "variable",
|
|
7557
|
-
"name": "InlineChoiceFullCorrectResponse",
|
|
7558
|
-
"type": {
|
|
7559
|
-
"text": "Story"
|
|
7560
|
-
},
|
|
7561
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-inline-choice.xml' // Zorg dat dit item een inline-choice bevat }, render: args => html`<qti-item> <div> <item-container style=\"display: block; width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const item = document.querySelector('qti-item'); item.configContext = { correctResponseMode: 'full' }; const canvas = within(canvasElement); const showCorrectButton = await canvas.findByShadowText(/Show correct/i); await step('Click on the Show Correct button', async () => { await fireEvent.click(showCorrectButton); await step('Verify full correct response is shown', async () => { const fullCorrectResponse = await waitFor(() => canvas.getByShadowRole('full-correct-response')); expect(fullCorrectResponse).toBeVisible(); const interaction = fullCorrectResponse.querySelector('qti-inline-choice-interaction'); expect(interaction).not.toBeNull(); const select = interaction.shadowRoot.querySelector('select'); expect(select).not.toBeNull(); const selectedOption = Array.from(select.options).find(opt => opt.selected); expect(selectedOption).not.toBeUndefined(); expect(selectedOption.textContent.trim()).toBe('York'); }); }); } }"
|
|
7562
|
-
},
|
|
7563
|
-
{
|
|
7564
|
-
"kind": "variable",
|
|
7565
|
-
"name": "InlineChoiceInternalCorrectResponse",
|
|
7566
|
-
"type": {
|
|
7567
|
-
"text": "Story"
|
|
7568
|
-
},
|
|
7569
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-inline-choice.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const item = document.querySelector('qti-item'); item.configContext = { correctResponseMode: 'internal' }; const canvas = within(canvasElement); const itemAssessment = await getAssessmentItemFromItemContainer(canvasElement); const interaction = itemAssessment.querySelector('qti-inline-choice-interaction'); const showCorrectButton = await canvas.findByShadowText(`Show correct response`); await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); const correctResponse = interaction.shadowRoot.querySelector<HTMLSpanElement>('[part=\"correct-option\"]'); //.findByShadowLabelText('correct-response'); expect(correctResponse).not.toBeNull(); expect(correctResponse.innerText).toBe('York'); }); } }"
|
|
7570
|
-
},
|
|
7571
|
-
{
|
|
7572
|
-
"kind": "variable",
|
|
7573
|
-
"name": "Match",
|
|
7574
|
-
"type": {
|
|
7575
|
-
"text": "Story"
|
|
7576
|
-
},
|
|
7577
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/match.xml' // Set the new item URL here // 'item-url': 'api/kennisnet-1/ITEM002.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const canvas = within(canvasElement); const interaction = await getAssessmentItemFromItemContainer(canvasElement); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); const correctElements = interaction.querySelectorAll(`[class=\"correct-option\"]`); expect(correctElements.length).toBe(3); const correctOptions = Array.from(correctElements).map(el => el.textContent); const allExist = correctOptions.every(element => ['Prospero', 'Demetrius', 'Capulet'].includes(element)); expect(allExist).toBe(true); }); } }"
|
|
7578
|
-
},
|
|
7579
|
-
{
|
|
7580
|
-
"kind": "variable",
|
|
7581
|
-
"name": "MatchFullCorrectResponse",
|
|
7582
|
-
"type": {
|
|
7583
|
-
"text": "Story"
|
|
7584
|
-
},
|
|
7585
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/match.xml' // Set the new item URL here // 'item-url': 'api/kennisnet-1/ITEM002.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const item = document.querySelector('qti-item'); item.configContext = { correctResponseMode: 'full' }; const canvas = within(canvasElement); const showCorrectButton = await canvas.findByShadowText(/Show correct/i); await step('Click on the Show Correct button', async () => { await fireEvent.click(showCorrectButton); await step('Verify full correct response is shown', async () => { const fullCorrectResponse = await waitFor(() => canvas.getByShadowRole('full-correct-response')); expect(fullCorrectResponse).toBeVisible(); }); }); } }"
|
|
7586
|
-
},
|
|
7587
|
-
{
|
|
7588
|
-
"kind": "variable",
|
|
7589
|
-
"name": "MatchTabular",
|
|
7590
|
-
"type": {
|
|
7591
|
-
"text": "Story"
|
|
7592
|
-
},
|
|
7593
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/match-tabular.xml' // Set the new item URL here // 'item-url': 'api/kennisnet-1/ITEM002.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const canvas = within(canvasElement); const item = await getAssessmentItemFromItemContainer(canvasElement); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; const interaction = item.querySelector('qti-match-interaction'); await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); // Find all elements with rb-correct or cb-correct parts // This uses the shadow DOM API to find elements with specific part attributes const correctRadioButtons = interaction.shadowRoot.querySelectorAll('[part~=\"rb-correct\"]'); const correctCheckboxes = interaction.shadowRoot.querySelectorAll('[part~=\"cb-correct\"]'); // Combine both types of correct elements const allCorrectElements = [...correctRadioButtons, ...correctCheckboxes] as HTMLInputElement[]; // Verify we have the expected number of correct answers expect(allCorrectElements.length).toBe(4); // Get the associated row identifiers for the correct options const correctRowIds = Array.from(allCorrectElements).map(el => el.name); // Get the values of the correct inputs (which contain the row and column IDs) const correctValues = Array.from(allCorrectElements).map(el => el.value); // Parse the values to extract row IDs const rowIds = correctValues.map(value => value.split(' ')[0]); // Verify the correct row IDs exist const expectedRowIds = ['C', 'P', 'L', 'D']; const allExist = rowIds.every(rowId => expectedRowIds.includes(rowId)); expect(allExist).toBe(true); }); } }"
|
|
7594
|
-
},
|
|
7595
|
-
{
|
|
7596
|
-
"kind": "variable",
|
|
7597
|
-
"name": "meta",
|
|
7598
|
-
"type": {
|
|
7599
|
-
"text": "Meta<typeof ItemContainer & { 'item-url': string }>"
|
|
7600
|
-
},
|
|
7601
|
-
"default": "{ component: 'item-container', args: { ...args, 'item-url': 'assets/qti-item/example-choice-item.xml' }, argTypes, parameters: { actions: { handles: events } } // tags: ['autodocs', 'new'] }"
|
|
7602
|
-
},
|
|
7603
|
-
{
|
|
7604
|
-
"kind": "variable",
|
|
7605
|
-
"name": "MultipleInteractions",
|
|
7606
|
-
"type": {
|
|
7607
|
-
"text": "Story"
|
|
7608
|
-
},
|
|
7609
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-multiple-interactions.xml' // Set the new item URL here }, render: args => html` <qti-item> <item-container style=\"width: 400px; height: 350px; display: block;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> <!-- </div> --> </qti-item>`, play: async ({ canvasElement, step }) => { // // wait for qti-simple-choice to be rendered const canvas = within(canvasElement); const interactions = await waitFor(() => { const itemContainer = canvasElement.querySelector('item-container'); if (!itemContainer) { throw new Error('Item container not found'); } if (!itemContainer.shadowRoot) { throw new Error('Shadow root not found'); } if (!itemContainer.shadowRoot.querySelector('qti-inline-choice-interaction')) { throw new Error('qti-inline-choice-interaction not found'); } return itemContainer.shadowRoot.querySelectorAll('qti-inline-choice-interaction'); }); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); }); await step('Verify correct response state is applied', async () => { for (const interaction of interactions) { const feedback = interaction.shadowRoot.querySelector('[part=\"correct-option\"]'); expect(feedback).not.toBeNull(); } }); } }"
|
|
7610
|
-
},
|
|
7611
|
-
{
|
|
7612
|
-
"kind": "variable",
|
|
7613
|
-
"name": "MultipleResponseFullCorrectResponse",
|
|
7614
|
-
"type": {
|
|
7615
|
-
"text": "Story"
|
|
7616
|
-
},
|
|
7617
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-choice-multiple-item.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const item = document.querySelector('qti-item'); item.configContext = { correctResponseMode: 'full' }; const canvas = within(canvasElement); const showCorrectButton = await canvas.findByShadowText(/Show correct/i); await step('Select the correct response mode full', async () => { await fireEvent.click(showCorrectButton); await step('Verify correct response full state is applied', async () => { const fullCorrectResponse = await canvas.findByShadowRole('full-correct-response'); expect(fullCorrectResponse).toBeVisible(); const interaction = fullCorrectResponse.querySelector('qti-choice-interaction'); const choices = Array.from(interaction.querySelectorAll('qti-simple-choice')); await interaction.updateComplete; expect(choices[0].internals.states.has('--checked')).toBe(true); expect(choices[1].internals.states.has('--checked')).toBe(true); expect(choices[2].internals.states.has('--checked')).toBe(false); }); }); } }"
|
|
7618
|
-
},
|
|
7619
|
-
{
|
|
7620
|
-
"kind": "variable",
|
|
7621
|
-
"name": "MultipleResponseInternalCorrectResponse",
|
|
7622
|
-
"type": {
|
|
7623
|
-
"text": "Story"
|
|
7624
|
-
},
|
|
7625
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-choice-multiple-item.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const item = document.querySelector('qti-item'); item.configContext = { correctResponseMode: 'internal' }; // wait for qti-simple-choice to be rendered const canvas = within(canvasElement); // const choices = await canvas.findAllByShadowRole('radio'); const choiceA: QtiSimpleChoice = await canvas.findByShadowText('This is correct.'); const choiceB: QtiSimpleChoice = await canvas.findByShadowText('This is also correct.'); const choiceC: QtiSimpleChoice = await canvas.findByShadowText('This is wrong.'); const showCorrectButton = await canvas.findByShadowText(/Show correct/i); await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); await step('Verify correct response state is applied', async () => { expect(choiceA.internals.states.has('correct-response')).toBe(true); expect(choiceB.internals.states.has('correct-response')).toBe(true); expect(choiceC.internals.states.has('correct-response')).toBe(false); expect(choiceA.internals.states.has('incorrect-response')).toBe(false); expect(choiceB.internals.states.has('incorrect-response')).toBe(false); expect(choiceC.internals.states.has('incorrect-response')).toBe(true); }); }); } }"
|
|
7626
|
-
},
|
|
7627
|
-
{
|
|
7628
|
-
"kind": "variable",
|
|
7629
|
-
"name": "NoCorrectResponse",
|
|
7630
|
-
"type": {
|
|
7631
|
-
"text": "Story"
|
|
7632
|
-
},
|
|
7633
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-choice-nocorrect-item.xml' // Set the new item URL here }, render: args => html` <qti-item> <item-container style=\"width: 400px; height: 350px; display: block;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> <!-- </div> --> </qti-item>`, play: async ({ canvasElement, step }) => { // // wait for qti-simple-choice to be rendered const canvas = within(canvasElement); await canvas.findByShadowText('You must stay with your luggage at all times.'); const _ = canvas.getAllByShadowText(/No correct response specified/i)[0]; const itemShowCorrect = canvasElement.querySelector('item-show-correct-response'); await step('Verify the Show Correct button is disabled', async () => { expect(itemShowCorrect.disabled).toBe(true); }); } }"
|
|
7634
|
-
},
|
|
7635
|
-
{
|
|
7636
|
-
"kind": "variable",
|
|
7637
|
-
"name": "SelectPoint",
|
|
7638
|
-
"type": {
|
|
7639
|
-
"text": "Story"
|
|
7640
|
-
},
|
|
7641
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/select_point.xml' // Set the new item URL here }, render: args => html`<qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { // wait for qti-simple-choice to be rendered const canvas = within(canvasElement); const item = await getAssessmentItemFromItemContainer(canvasElement); const interaction = item.querySelector('qti-select-point-interaction'); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); const correctIndication = interaction.shadowRoot.querySelector('[alt=\"correct-response-1\"]'); expect(correctIndication).not.toBeNull(); }); } }"
|
|
7642
|
-
},
|
|
7643
|
-
{
|
|
7644
|
-
"kind": "variable",
|
|
7645
|
-
"name": "SelectPointMultipleNoAreaMapping",
|
|
7646
|
-
"type": {
|
|
7647
|
-
"text": "Story"
|
|
7648
|
-
},
|
|
7649
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-select-point.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { // wait for qti-simple-choices to be rendered const canvas = within(canvasElement); const item = await getAssessmentItemFromItemContainer(canvasElement); const interaction = item.querySelector('qti-select-point-interaction'); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); const correctIndication1 = interaction.shadowRoot.querySelector('[alt=\"correct-response-1\"]'); const correctIndication2 = interaction.shadowRoot.querySelector('[alt=\"correct-response-2\"]'); const correctIndication3 = interaction.shadowRoot.querySelector('[alt=\"correct-response-3\"]'); expect(correctIndication1).not.toBeNull(); expect(correctIndication2).not.toBeNull(); expect(correctIndication3).not.toBeNull(); }); } }"
|
|
7650
|
-
},
|
|
7651
|
-
{
|
|
7652
|
-
"kind": "variable",
|
|
7653
|
-
"name": "Slider",
|
|
7654
|
-
"type": {
|
|
7655
|
-
"text": "Story"
|
|
7656
|
-
},
|
|
7657
|
-
"default": "{ args: { 'item-url': 'assets/qti-item/example-slider.xml' // Set the new item URL here }, render: args => html` <qti-item> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { // wait for qti-simple-choices to be rendered const canvas = within(canvasElement); const item = await getAssessmentItemFromItemContainer(canvasElement); const interaction = item.querySelector('qti-slider-interaction'); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); const correctIndication = interaction.shadowRoot.querySelectorAll('[id=\"knob-correct\"]'); expect(correctIndication.length).toBe(1); }); } }"
|
|
7658
|
-
},
|
|
7659
|
-
{
|
|
7660
|
-
"kind": "variable",
|
|
7661
|
-
"name": "TextEntryFullCorrectResponse",
|
|
7662
|
-
"type": {
|
|
7663
|
-
"text": "Story"
|
|
7664
|
-
},
|
|
7665
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/text_entry.xml' // Set the new item URL here }, render: args => html` <qti-item navigate=\"item\"> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const test = document.querySelector('qti-item'); test.configContext = { correctResponseMode: 'full' }; const canvas = within(canvasElement); const showCorrectButton = await canvas.findByShadowText(/Show correct/i); await step('Select the correct response mode full', async () => { await fireEvent.click(showCorrectButton); await step('Verify correct response full state is applied', async () => { const fullCorrectResponse = await canvas.findByShadowRole('full-correct-response'); expect(fullCorrectResponse).toBeVisible(); }); }); } }"
|
|
7666
|
-
},
|
|
7667
|
-
{
|
|
7668
|
-
"kind": "variable",
|
|
7669
|
-
"name": "TextEntryInternalCorrectResponse",
|
|
7670
|
-
"type": {
|
|
7671
|
-
"text": "Story"
|
|
7672
|
-
},
|
|
7673
|
-
"default": "{ args: { 'item-url': 'assets/qti-test-package/items/text_entry.xml' // Set the new item URL here }, render: args => html` <qti-item navigate=\"item\"> <div> <item-container style=\"display: block;width: 400px; height: 350px;\" item-url=${args['item-url'] as string}> <template> <style> qti-assessment-item { padding: 1rem; display: block; aspect-ratio: 4 / 3; width: 800px; border: 2px solid blue; transform: scale(0.5); transform-origin: top left; } </style> </template> </item-container> <item-show-correct-response ${spread(args)}></item-show-correct-response> </div> </qti-item>`, play: async ({ canvasElement, step }) => { const test = document.querySelector('qti-item'); test.configContext = { correctResponseMode: 'internal' }; const canvas = within(canvasElement); const item = await getAssessmentItemFromItemContainer(canvasElement); const interaction = item.querySelector('qti-text-entry-interaction'); const showCorrectButton = canvas.getAllByShadowText(/Show correct/i)[0]; await step('Click on the Show Correct button', async () => { await showCorrectButton.click(); const correctElement = interaction.shadowRoot.querySelector('[part=\"correct\"]'); expect(correctElement).toBeVisible(); }); } }"
|
|
7674
|
-
}
|
|
7675
|
-
],
|
|
7676
|
-
"exports": [
|
|
7677
|
-
{
|
|
7678
|
-
"kind": "js",
|
|
7679
|
-
"name": "ChoiceFullCorrectResponse",
|
|
7680
|
-
"declaration": {
|
|
7681
|
-
"name": "ChoiceFullCorrectResponse",
|
|
7682
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7683
|
-
}
|
|
7684
|
-
},
|
|
7685
|
-
{
|
|
7686
|
-
"kind": "js",
|
|
7687
|
-
"name": "ChoiceFullCorrectResponseOnlyWhenIncorrect",
|
|
7688
|
-
"declaration": {
|
|
7689
|
-
"name": "ChoiceFullCorrectResponseOnlyWhenIncorrect",
|
|
7690
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7691
|
-
}
|
|
7692
|
-
},
|
|
7693
|
-
{
|
|
7694
|
-
"kind": "js",
|
|
7695
|
-
"name": "ChoiceInternalCorrectResponse",
|
|
7696
|
-
"declaration": {
|
|
7697
|
-
"name": "ChoiceInternalCorrectResponse",
|
|
7698
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7699
|
-
}
|
|
7700
|
-
},
|
|
7701
|
-
{
|
|
7702
|
-
"kind": "js",
|
|
7703
|
-
"name": "default",
|
|
7704
|
-
"declaration": {
|
|
7705
|
-
"name": "meta",
|
|
7706
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7707
|
-
}
|
|
7708
|
-
},
|
|
7709
|
-
{
|
|
7710
|
-
"kind": "js",
|
|
7711
|
-
"name": "Default",
|
|
7712
|
-
"declaration": {
|
|
7713
|
-
"name": "Default",
|
|
7714
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7715
|
-
}
|
|
7716
|
-
},
|
|
7717
|
-
{
|
|
7718
|
-
"kind": "js",
|
|
7719
|
-
"name": "GapMatch",
|
|
7720
|
-
"declaration": {
|
|
7721
|
-
"name": "GapMatch",
|
|
7722
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7723
|
-
}
|
|
7724
|
-
},
|
|
7725
|
-
{
|
|
7726
|
-
"kind": "js",
|
|
7727
|
-
"name": "GapMatchCorrectResponse",
|
|
7728
|
-
"declaration": {
|
|
7729
|
-
"name": "GapMatchCorrectResponse",
|
|
7730
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7731
|
-
}
|
|
7732
|
-
},
|
|
7733
|
-
{
|
|
7734
|
-
"kind": "js",
|
|
7735
|
-
"name": "GraphicAssociate",
|
|
7736
|
-
"declaration": {
|
|
7737
|
-
"name": "GraphicAssociate",
|
|
7738
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7739
|
-
}
|
|
7740
|
-
},
|
|
7741
|
-
{
|
|
7742
|
-
"kind": "js",
|
|
7743
|
-
"name": "GraphicOrder",
|
|
7744
|
-
"declaration": {
|
|
7745
|
-
"name": "GraphicOrder",
|
|
7746
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7747
|
-
}
|
|
7748
|
-
},
|
|
7749
|
-
{
|
|
7750
|
-
"kind": "js",
|
|
7751
|
-
"name": "InlineChoiceFullCorrectResponse",
|
|
7752
|
-
"declaration": {
|
|
7753
|
-
"name": "InlineChoiceFullCorrectResponse",
|
|
7754
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7755
|
-
}
|
|
7756
|
-
},
|
|
7757
|
-
{
|
|
7758
|
-
"kind": "js",
|
|
7759
|
-
"name": "InlineChoiceInternalCorrectResponse",
|
|
7760
|
-
"declaration": {
|
|
7761
|
-
"name": "InlineChoiceInternalCorrectResponse",
|
|
7762
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7763
|
-
}
|
|
7764
|
-
},
|
|
7765
|
-
{
|
|
7766
|
-
"kind": "js",
|
|
7767
|
-
"name": "Match",
|
|
7768
|
-
"declaration": {
|
|
7769
|
-
"name": "Match",
|
|
7770
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7771
|
-
}
|
|
7772
|
-
},
|
|
7773
|
-
{
|
|
7774
|
-
"kind": "js",
|
|
7775
|
-
"name": "MatchFullCorrectResponse",
|
|
7776
|
-
"declaration": {
|
|
7777
|
-
"name": "MatchFullCorrectResponse",
|
|
7778
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7779
|
-
}
|
|
7780
|
-
},
|
|
7781
|
-
{
|
|
7782
|
-
"kind": "js",
|
|
7783
|
-
"name": "MatchTabular",
|
|
7784
|
-
"declaration": {
|
|
7785
|
-
"name": "MatchTabular",
|
|
7786
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7787
|
-
}
|
|
7788
|
-
},
|
|
7789
|
-
{
|
|
7790
|
-
"kind": "js",
|
|
7791
|
-
"name": "MultipleInteractions",
|
|
7792
|
-
"declaration": {
|
|
7793
|
-
"name": "MultipleInteractions",
|
|
7794
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7795
|
-
}
|
|
7796
|
-
},
|
|
7797
|
-
{
|
|
7798
|
-
"kind": "js",
|
|
7799
|
-
"name": "MultipleResponseFullCorrectResponse",
|
|
7800
|
-
"declaration": {
|
|
7801
|
-
"name": "MultipleResponseFullCorrectResponse",
|
|
7802
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7803
|
-
}
|
|
7804
|
-
},
|
|
7805
|
-
{
|
|
7806
|
-
"kind": "js",
|
|
7807
|
-
"name": "MultipleResponseInternalCorrectResponse",
|
|
7808
|
-
"declaration": {
|
|
7809
|
-
"name": "MultipleResponseInternalCorrectResponse",
|
|
7810
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7811
|
-
}
|
|
7812
|
-
},
|
|
7813
|
-
{
|
|
7814
|
-
"kind": "js",
|
|
7815
|
-
"name": "NoCorrectResponse",
|
|
7816
|
-
"declaration": {
|
|
7817
|
-
"name": "NoCorrectResponse",
|
|
7818
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7819
|
-
}
|
|
7820
|
-
},
|
|
7821
|
-
{
|
|
7822
|
-
"kind": "js",
|
|
7823
|
-
"name": "SelectPoint",
|
|
7824
|
-
"declaration": {
|
|
7825
|
-
"name": "SelectPoint",
|
|
7826
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7827
|
-
}
|
|
7828
|
-
},
|
|
7829
|
-
{
|
|
7830
|
-
"kind": "js",
|
|
7831
|
-
"name": "SelectPointMultipleNoAreaMapping",
|
|
7832
|
-
"declaration": {
|
|
7833
|
-
"name": "SelectPointMultipleNoAreaMapping",
|
|
7834
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7835
|
-
}
|
|
7836
|
-
},
|
|
7837
|
-
{
|
|
7838
|
-
"kind": "js",
|
|
7839
|
-
"name": "Slider",
|
|
7840
|
-
"declaration": {
|
|
7841
|
-
"name": "Slider",
|
|
7842
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7843
|
-
}
|
|
7844
|
-
},
|
|
7845
|
-
{
|
|
7846
|
-
"kind": "js",
|
|
7847
|
-
"name": "TextEntryFullCorrectResponse",
|
|
7848
|
-
"declaration": {
|
|
7849
|
-
"name": "TextEntryFullCorrectResponse",
|
|
7850
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7851
|
-
}
|
|
7852
|
-
},
|
|
7853
|
-
{
|
|
7854
|
-
"kind": "js",
|
|
7855
|
-
"name": "TextEntryInternalCorrectResponse",
|
|
7856
|
-
"declaration": {
|
|
7857
|
-
"name": "TextEntryInternalCorrectResponse",
|
|
7858
|
-
"module": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.stories.ts"
|
|
7859
|
-
}
|
|
7860
|
-
}
|
|
7861
|
-
]
|
|
7862
|
-
},
|
|
7863
7127
|
{
|
|
7864
7128
|
"kind": "javascript-module",
|
|
7865
7129
|
"path": "packages/qti-item/src/components/item-show-correct-response/item-show-correct-response.ts",
|
|
@@ -9251,12 +8515,6 @@
|
|
|
9251
8515
|
}
|
|
9252
8516
|
]
|
|
9253
8517
|
},
|
|
9254
|
-
{
|
|
9255
|
-
"kind": "javascript-module",
|
|
9256
|
-
"path": "packages/qti-processing/src/components/qti-gcd/qti.gcd.spec.ts",
|
|
9257
|
-
"declarations": [],
|
|
9258
|
-
"exports": []
|
|
9259
|
-
},
|
|
9260
8518
|
{
|
|
9261
8519
|
"kind": "javascript-module",
|
|
9262
8520
|
"path": "packages/qti-processing/src/components/qti-gcd/qti.gcd.ts",
|
|
@@ -12807,103 +12065,15 @@
|
|
|
12807
12065
|
"name": "test-check-item",
|
|
12808
12066
|
"declaration": {
|
|
12809
12067
|
"name": "TestCheckItem",
|
|
12810
|
-
"module": "packages/qti-test/src/components/test-check-item/test-check-item.ts"
|
|
12811
|
-
}
|
|
12812
|
-
},
|
|
12813
|
-
{
|
|
12814
|
-
"kind": "js",
|
|
12815
|
-
"name": "TestCheckItem",
|
|
12816
|
-
"declaration": {
|
|
12817
|
-
"name": "TestCheckItem",
|
|
12818
|
-
"module": "packages/qti-test/src/components/test-check-item/test-check-item.ts"
|
|
12819
|
-
}
|
|
12820
|
-
}
|
|
12821
|
-
]
|
|
12822
|
-
},
|
|
12823
|
-
{
|
|
12824
|
-
"kind": "javascript-module",
|
|
12825
|
-
"path": "packages/qti-test/src/components/test-container/test-container.stories.ts",
|
|
12826
|
-
"declarations": [
|
|
12827
|
-
{
|
|
12828
|
-
"kind": "variable",
|
|
12829
|
-
"name": "meta",
|
|
12830
|
-
"type": {
|
|
12831
|
-
"text": "Meta<TestContainer & { 'test-url': string }>"
|
|
12832
|
-
},
|
|
12833
|
-
"default": "{ component: 'test-container', args: { ...args, 'test-url': '/assets/qti-conformance/Basic/T4-T7/assessment.xml' }, argTypes, parameters: { actions: { handles: events } } }"
|
|
12834
|
-
},
|
|
12835
|
-
{
|
|
12836
|
-
"kind": "variable",
|
|
12837
|
-
"name": "TestDoc",
|
|
12838
|
-
"type": {
|
|
12839
|
-
"text": "Story"
|
|
12840
|
-
},
|
|
12841
|
-
"default": "{ render: (_, { loaded: { testDoc } }) => { return html` <qti-test navigate=\"item\"> <test-container .testDoc=${testDoc}></test-container> </qti-test> `; }, loaders: [ async ({ args }) => { const testDoc = qtiTransformTest() .load(args['test-url']) .then(api => api.htmlDoc()); return { testDoc }; } ], play: TestURL.play, tags: ['!autodocs'] }"
|
|
12842
|
-
},
|
|
12843
|
-
{
|
|
12844
|
-
"kind": "variable",
|
|
12845
|
-
"name": "TestURL",
|
|
12846
|
-
"type": {
|
|
12847
|
-
"text": "Story"
|
|
12848
|
-
},
|
|
12849
|
-
"default": "{ render: args => { return html`<qti-test navigate=\"item\">${template(args)}</qti-test>`; }, play: async ({ canvasElement }) => { //getAssessmentItemFromTestContainerByDataTitle const testElement = await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'T1 - Test Entry - Item 1'); expect(testElement).toBeInTheDocument(); } }"
|
|
12850
|
-
},
|
|
12851
|
-
{
|
|
12852
|
-
"kind": "variable",
|
|
12853
|
-
"name": "TestWithTemplate",
|
|
12854
|
-
"type": {
|
|
12855
|
-
"text": "Story"
|
|
12856
|
-
},
|
|
12857
|
-
"default": "{ render: args => { return html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=${args['test-url']}> <template> <style> qti-assessment-test { display: block; border: 2px solid blue; } </style> </template> </test-container> </test-navigation> </qti-test> `; }, play: TestURL.play, tags: ['!autodocs'] }"
|
|
12858
|
-
},
|
|
12859
|
-
{
|
|
12860
|
-
"kind": "variable",
|
|
12861
|
-
"name": "TestXML",
|
|
12862
|
-
"type": {
|
|
12863
|
-
"text": "Story"
|
|
12864
|
-
},
|
|
12865
|
-
"default": "{ render: (_, { loaded: { testXML } }) => { return html` <qti-test navigate=\"item\"> <test-container .testXML=${testXML}></test-container> </qti-test> `; }, loaders: [ async ({ args }) => { const testXML = await qtiTransformTest() .load(args['test-url']) .then(api => api.xml()); return { testXML }; } ], play: TestURL.play, tags: ['!autodocs'] }"
|
|
12866
|
-
}
|
|
12867
|
-
],
|
|
12868
|
-
"exports": [
|
|
12869
|
-
{
|
|
12870
|
-
"kind": "js",
|
|
12871
|
-
"name": "default",
|
|
12872
|
-
"declaration": {
|
|
12873
|
-
"name": "meta",
|
|
12874
|
-
"module": "packages/qti-test/src/components/test-container/test-container.stories.ts"
|
|
12875
|
-
}
|
|
12876
|
-
},
|
|
12877
|
-
{
|
|
12878
|
-
"kind": "js",
|
|
12879
|
-
"name": "TestDoc",
|
|
12880
|
-
"declaration": {
|
|
12881
|
-
"name": "TestDoc",
|
|
12882
|
-
"module": "packages/qti-test/src/components/test-container/test-container.stories.ts"
|
|
12883
|
-
}
|
|
12884
|
-
},
|
|
12885
|
-
{
|
|
12886
|
-
"kind": "js",
|
|
12887
|
-
"name": "TestURL",
|
|
12888
|
-
"declaration": {
|
|
12889
|
-
"name": "TestURL",
|
|
12890
|
-
"module": "packages/qti-test/src/components/test-container/test-container.stories.ts"
|
|
12891
|
-
}
|
|
12892
|
-
},
|
|
12893
|
-
{
|
|
12894
|
-
"kind": "js",
|
|
12895
|
-
"name": "TestWithTemplate",
|
|
12896
|
-
"declaration": {
|
|
12897
|
-
"name": "TestWithTemplate",
|
|
12898
|
-
"module": "packages/qti-test/src/components/test-container/test-container.stories.ts"
|
|
12068
|
+
"module": "packages/qti-test/src/components/test-check-item/test-check-item.ts"
|
|
12899
12069
|
}
|
|
12900
12070
|
},
|
|
12901
12071
|
{
|
|
12902
12072
|
"kind": "js",
|
|
12903
|
-
"name": "
|
|
12073
|
+
"name": "TestCheckItem",
|
|
12904
12074
|
"declaration": {
|
|
12905
|
-
"name": "
|
|
12906
|
-
"module": "packages/qti-test/src/components/test-
|
|
12075
|
+
"name": "TestCheckItem",
|
|
12076
|
+
"module": "packages/qti-test/src/components/test-check-item/test-check-item.ts"
|
|
12907
12077
|
}
|
|
12908
12078
|
}
|
|
12909
12079
|
]
|
|
@@ -13017,62 +12187,6 @@
|
|
|
13017
12187
|
}
|
|
13018
12188
|
]
|
|
13019
12189
|
},
|
|
13020
|
-
{
|
|
13021
|
-
"kind": "javascript-module",
|
|
13022
|
-
"path": "packages/qti-test/src/components/test-end-attempt/test-end-attempt.stories.ts",
|
|
13023
|
-
"declarations": [
|
|
13024
|
-
{
|
|
13025
|
-
"kind": "variable",
|
|
13026
|
-
"name": "Default",
|
|
13027
|
-
"type": {
|
|
13028
|
-
"text": "Story"
|
|
13029
|
-
},
|
|
13030
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <!-- <test-print-item-variables></test-print-item-variables> --> <test-container test-url=\"/assets/qti-test-package/assessment.xml\"></test-container> ${template(args, html`End Attempt`)} <test-next>Volgende</test-next> </test-navigation> </qti-test>` }"
|
|
13031
|
-
},
|
|
13032
|
-
{
|
|
13033
|
-
"kind": "variable",
|
|
13034
|
-
"name": "meta",
|
|
13035
|
-
"type": {
|
|
13036
|
-
"text": "Meta<TestEndAttempt>"
|
|
13037
|
-
},
|
|
13038
|
-
"default": "{ component: 'test-end-attempt', args, argTypes, parameters: { actions: { handles: events } } }"
|
|
13039
|
-
},
|
|
13040
|
-
{
|
|
13041
|
-
"kind": "variable",
|
|
13042
|
-
"name": "Test",
|
|
13043
|
-
"type": {
|
|
13044
|
-
"text": "Story"
|
|
13045
|
-
},
|
|
13046
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <!-- <test-print-item-variables> </test-print-item-variables> --> <test-container test-url=\"/assets/qti-test-package/assessment.xml\"> </test-container> <test-end-attempt ${spread(args)}>End Attempt</test-end-attempt> <test-next>Volgende</test-next> <test-item-link item-id=\"ITM-text_entry\">link</test-item-link> </test-navigation> </qti-test> `, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const link = await canvas.findByShadowText('link'); const info = await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'Info Start'); await fireEvent.click(link); const nextButton = await canvas.findByShadowText('Volgende'); await waitFor(() => expect(nextButton).toBeEnabled()); const firstItem = await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'Richard III (Take 3)'); expect(firstItem).toBeInTheDocument(); // click end attempt const endAttemptButton = await findByShadowText(canvasElement, 'End Attempt'); endAttemptButton.click(); await new Promise(resolve => setTimeout(resolve, 0)); /* why is this necessary */ // check if incorrect feedback block is visible const incorrect = await canvas.findByShadowText('Incorrect'); expect(incorrect.assignedSlot).toBeVisible(); // type York in the text field const textEntryInteraction = await canvas.findByShadowRole<HTMLInputElement>('textbox'); await userEvent.type(textEntryInteraction, 'York'); endAttemptButton.click(); await new Promise(resolve => setTimeout(resolve, 0)); /* why is this necessary */ // check if correct feedback block is visible const correct = await canvas.findByShadowText('Correct'); expect(correct.assignedSlot).toBeVisible(); } }"
|
|
13047
|
-
}
|
|
13048
|
-
],
|
|
13049
|
-
"exports": [
|
|
13050
|
-
{
|
|
13051
|
-
"kind": "js",
|
|
13052
|
-
"name": "default",
|
|
13053
|
-
"declaration": {
|
|
13054
|
-
"name": "meta",
|
|
13055
|
-
"module": "packages/qti-test/src/components/test-end-attempt/test-end-attempt.stories.ts"
|
|
13056
|
-
}
|
|
13057
|
-
},
|
|
13058
|
-
{
|
|
13059
|
-
"kind": "js",
|
|
13060
|
-
"name": "Default",
|
|
13061
|
-
"declaration": {
|
|
13062
|
-
"name": "Default",
|
|
13063
|
-
"module": "packages/qti-test/src/components/test-end-attempt/test-end-attempt.stories.ts"
|
|
13064
|
-
}
|
|
13065
|
-
},
|
|
13066
|
-
{
|
|
13067
|
-
"kind": "js",
|
|
13068
|
-
"name": "Test",
|
|
13069
|
-
"declaration": {
|
|
13070
|
-
"name": "Test",
|
|
13071
|
-
"module": "packages/qti-test/src/components/test-end-attempt/test-end-attempt.stories.ts"
|
|
13072
|
-
}
|
|
13073
|
-
}
|
|
13074
|
-
]
|
|
13075
|
-
},
|
|
13076
12190
|
{
|
|
13077
12191
|
"kind": "javascript-module",
|
|
13078
12192
|
"path": "packages/qti-test/src/components/test-end-attempt/test-end-attempt.ts",
|
|
@@ -13111,46 +12225,6 @@
|
|
|
13111
12225
|
}
|
|
13112
12226
|
]
|
|
13113
12227
|
},
|
|
13114
|
-
{
|
|
13115
|
-
"kind": "javascript-module",
|
|
13116
|
-
"path": "packages/qti-test/src/components/test-item-link/test-item-link.stories.ts",
|
|
13117
|
-
"declarations": [
|
|
13118
|
-
{
|
|
13119
|
-
"kind": "variable",
|
|
13120
|
-
"name": "Default",
|
|
13121
|
-
"type": {
|
|
13122
|
-
"text": "Story"
|
|
13123
|
-
},
|
|
13124
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/api/biologie/assessment.xml\"></test-container> ${template(args, html`Link to item`)} </test-navigation> </qti-test>` }"
|
|
13125
|
-
},
|
|
13126
|
-
{
|
|
13127
|
-
"kind": "variable",
|
|
13128
|
-
"name": "meta",
|
|
13129
|
-
"type": {
|
|
13130
|
-
"text": "Meta<TestItemLink>"
|
|
13131
|
-
},
|
|
13132
|
-
"default": "{ component: 'test-item-link', args: { ...args }, // itemId: 'ITM-32cjnu' - private property, set via attribute argTypes, parameters: { actions: { handles: events } } }"
|
|
13133
|
-
}
|
|
13134
|
-
],
|
|
13135
|
-
"exports": [
|
|
13136
|
-
{
|
|
13137
|
-
"kind": "js",
|
|
13138
|
-
"name": "default",
|
|
13139
|
-
"declaration": {
|
|
13140
|
-
"name": "meta",
|
|
13141
|
-
"module": "packages/qti-test/src/components/test-item-link/test-item-link.stories.ts"
|
|
13142
|
-
}
|
|
13143
|
-
},
|
|
13144
|
-
{
|
|
13145
|
-
"kind": "js",
|
|
13146
|
-
"name": "Default",
|
|
13147
|
-
"declaration": {
|
|
13148
|
-
"name": "Default",
|
|
13149
|
-
"module": "packages/qti-test/src/components/test-item-link/test-item-link.stories.ts"
|
|
13150
|
-
}
|
|
13151
|
-
}
|
|
13152
|
-
]
|
|
13153
|
-
},
|
|
13154
12228
|
{
|
|
13155
12229
|
"kind": "javascript-module",
|
|
13156
12230
|
"path": "packages/qti-test/src/components/test-item-link/test-item-link.ts",
|
|
@@ -13236,46 +12310,6 @@
|
|
|
13236
12310
|
}
|
|
13237
12311
|
]
|
|
13238
12312
|
},
|
|
13239
|
-
{
|
|
13240
|
-
"kind": "javascript-module",
|
|
13241
|
-
"path": "packages/qti-test/src/components/test-navigation/test-navigation.stories.ts",
|
|
13242
|
-
"declarations": [
|
|
13243
|
-
{
|
|
13244
|
-
"kind": "variable",
|
|
13245
|
-
"name": "Default",
|
|
13246
|
-
"type": {
|
|
13247
|
-
"text": "Story"
|
|
13248
|
-
},
|
|
13249
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> ${template(args, html` <test-container test-url=\"/assets/qti-test-package/assessment.xml\"></test-container>`)} </qti-test>` }"
|
|
13250
|
-
},
|
|
13251
|
-
{
|
|
13252
|
-
"kind": "variable",
|
|
13253
|
-
"name": "meta",
|
|
13254
|
-
"type": {
|
|
13255
|
-
"text": "Meta<TestNavigation>"
|
|
13256
|
-
},
|
|
13257
|
-
"default": "{ component: 'test-navigation', args, argTypes, parameters: { actions: { handles: events } } }"
|
|
13258
|
-
}
|
|
13259
|
-
],
|
|
13260
|
-
"exports": [
|
|
13261
|
-
{
|
|
13262
|
-
"kind": "js",
|
|
13263
|
-
"name": "default",
|
|
13264
|
-
"declaration": {
|
|
13265
|
-
"name": "meta",
|
|
13266
|
-
"module": "packages/qti-test/src/components/test-navigation/test-navigation.stories.ts"
|
|
13267
|
-
}
|
|
13268
|
-
},
|
|
13269
|
-
{
|
|
13270
|
-
"kind": "js",
|
|
13271
|
-
"name": "Default",
|
|
13272
|
-
"declaration": {
|
|
13273
|
-
"name": "Default",
|
|
13274
|
-
"module": "packages/qti-test/src/components/test-navigation/test-navigation.stories.ts"
|
|
13275
|
-
}
|
|
13276
|
-
}
|
|
13277
|
-
]
|
|
13278
|
-
},
|
|
13279
12313
|
{
|
|
13280
12314
|
"kind": "javascript-module",
|
|
13281
12315
|
"path": "packages/qti-test/src/components/test-navigation/test-navigation.ts",
|
|
@@ -13543,62 +12577,6 @@
|
|
|
13543
12577
|
}
|
|
13544
12578
|
]
|
|
13545
12579
|
},
|
|
13546
|
-
{
|
|
13547
|
-
"kind": "javascript-module",
|
|
13548
|
-
"path": "packages/qti-test/src/components/test-next/test-next.stories.ts",
|
|
13549
|
-
"declarations": [
|
|
13550
|
-
{
|
|
13551
|
-
"kind": "variable",
|
|
13552
|
-
"name": "Default",
|
|
13553
|
-
"type": {
|
|
13554
|
-
"text": "Story"
|
|
13555
|
-
},
|
|
13556
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/qti-conformance/Basic/T4-T7/assessment.xml\"> </test-container> <test-prev>vorige</test-prev> ${template(args, html`volgende`)} </test-navigation> </qti-test> ` }"
|
|
13557
|
-
},
|
|
13558
|
-
{
|
|
13559
|
-
"kind": "variable",
|
|
13560
|
-
"name": "meta",
|
|
13561
|
-
"type": {
|
|
13562
|
-
"text": "Meta<TestNext>"
|
|
13563
|
-
},
|
|
13564
|
-
"default": "{ component: 'test-next', args, argTypes, parameters: { actions: { handles: events } } }"
|
|
13565
|
-
},
|
|
13566
|
-
{
|
|
13567
|
-
"kind": "variable",
|
|
13568
|
-
"name": "Test",
|
|
13569
|
-
"type": {
|
|
13570
|
-
"text": "Story"
|
|
13571
|
-
},
|
|
13572
|
-
"default": "{ render: () => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/qti-conformance/Basic/T4-T7/assessment.xml\"> </test-container> <test-prev>vorige</test-prev> <test-next>volgende</test-next> </test-navigation> </qti-test> `, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const prevButton = canvas.getByShadowText('vorige'); const nextButton = canvas.getByShadowText('volgende'); await waitFor(() => expect(nextButton).toBeEnabled()); const firstItem = await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'T1 - Test Entry - Item 1'); expect(firstItem).toBeInTheDocument(); await new Promise(resolve => setTimeout(resolve, 500)); await fireEvent.click(nextButton); const secondItem = await getAssessmentItemFromTestContainerByDataTitle( canvasElement, 'T1 - Choice Interaction - Multiple Cardinality' ); expect(secondItem).toBeInTheDocument(); await fireEvent.click(nextButton); await new Promise(resolve => setTimeout(resolve, 1)); // minimal time to let the next button know about the update on sessionContext await fireEvent.click(nextButton); await new Promise(resolve => setTimeout(resolve, 1)); // minimal time to let the next button know about the update on sessionContext await fireEvent.click(nextButton); await new Promise(resolve => setTimeout(resolve, 1)); // minimal time to let the next button know about the update on sessionContext expect(nextButton).toBeDisabled(); await fireEvent.click(prevButton); await new Promise(resolve => setTimeout(resolve, 1)); // minimal time to let the next button know about the update on sessionContext expect(nextButton).toBeEnabled(); } }"
|
|
13573
|
-
}
|
|
13574
|
-
],
|
|
13575
|
-
"exports": [
|
|
13576
|
-
{
|
|
13577
|
-
"kind": "js",
|
|
13578
|
-
"name": "default",
|
|
13579
|
-
"declaration": {
|
|
13580
|
-
"name": "meta",
|
|
13581
|
-
"module": "packages/qti-test/src/components/test-next/test-next.stories.ts"
|
|
13582
|
-
}
|
|
13583
|
-
},
|
|
13584
|
-
{
|
|
13585
|
-
"kind": "js",
|
|
13586
|
-
"name": "Default",
|
|
13587
|
-
"declaration": {
|
|
13588
|
-
"name": "Default",
|
|
13589
|
-
"module": "packages/qti-test/src/components/test-next/test-next.stories.ts"
|
|
13590
|
-
}
|
|
13591
|
-
},
|
|
13592
|
-
{
|
|
13593
|
-
"kind": "js",
|
|
13594
|
-
"name": "Test",
|
|
13595
|
-
"declaration": {
|
|
13596
|
-
"name": "Test",
|
|
13597
|
-
"module": "packages/qti-test/src/components/test-next/test-next.stories.ts"
|
|
13598
|
-
}
|
|
13599
|
-
}
|
|
13600
|
-
]
|
|
13601
|
-
},
|
|
13602
12580
|
{
|
|
13603
12581
|
"kind": "javascript-module",
|
|
13604
12582
|
"path": "packages/qti-test/src/components/test-next/test-next.ts",
|
|
@@ -13762,62 +12740,6 @@
|
|
|
13762
12740
|
}
|
|
13763
12741
|
]
|
|
13764
12742
|
},
|
|
13765
|
-
{
|
|
13766
|
-
"kind": "javascript-module",
|
|
13767
|
-
"path": "packages/qti-test/src/components/test-paging-buttons-stamp/test-paging-buttons-stamp.stories.ts",
|
|
13768
|
-
"declarations": [
|
|
13769
|
-
{
|
|
13770
|
-
"kind": "variable",
|
|
13771
|
-
"name": "Default",
|
|
13772
|
-
"type": {
|
|
13773
|
-
"text": "Story"
|
|
13774
|
-
},
|
|
13775
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/api/biologie/assessment.xml\"></test-container> ${template( args, html`<template> <test-item-link item-id=\"{{ item.identifier }}\"> {{ item.index }} </test-item-link> </template>` )} </test-navigation> </qti-test>` }"
|
|
13776
|
-
},
|
|
13777
|
-
{
|
|
13778
|
-
"kind": "variable",
|
|
13779
|
-
"name": "meta",
|
|
13780
|
-
"type": {
|
|
13781
|
-
"text": "Meta<TestPagingButtonsStamp>"
|
|
13782
|
-
},
|
|
13783
|
-
"default": "{ component: 'test-paging-buttons-stamp', args, argTypes, parameters: { actions: { handles: events } } }"
|
|
13784
|
-
},
|
|
13785
|
-
{
|
|
13786
|
-
"kind": "variable",
|
|
13787
|
-
"name": "Title",
|
|
13788
|
-
"type": {
|
|
13789
|
-
"text": "Story"
|
|
13790
|
-
},
|
|
13791
|
-
"default": "{ render: () => html` <qti-test auto-score-items> <test-navigation .initContext=${[ { identifier: 'ITEM001', title: 'Test title', volgnummer: 2 }, { identifier: 'ITEM002', title: 'Test title 2', volgnummer: 2 } ]} .configContext=${{ infoItemCategory: 'info' }} .sessionContext=${{ navItemRefId: 'ITEM001' }} > <test-container test-url=\"/assets/api/kennisnet-1/AssessmentTest.xml\"></test-container> <test-paging-buttons-stamp data-testid=\"paging-buttons\"> <style> dl { display: grid; grid-template-columns: max-content 1fr; column-gap: 10px; } dt { font-weight: bold; } dd { margin: 0; /* Remove default margin */ } </style> <template> <test-item-link class=\"{{item.active ? 'active' : ''}}\" item-id=\"{{ item.identifier }}\" >{{ item.index }}:{{ item.title }}</test-item-link > </template> </test-paging-buttons-stamp> </test-navigation> </qti-test> `, play: async ({ canvasElement }) => { const canvas = within(canvasElement); // expect(nextButton).toBeDisabled(); const pagingButtons = await canvas.findByTestId('paging-buttons'); await waitFor( () => { const button = pagingButtons.querySelector('test-item-link'); if (!button) { throw new Error('interaction not loaded yet'); } }, { timeout: 5000 } ); // const allButtons = pagingButtons.querySelectorAll('test-item-link'); // waitFor(() => expect(allButtons[0].textContent).toBe(':')); // waitFor(() => expect(allButtons[1].textContent).toBe('1:Test title')); // await new Promise(resolve => setTimeout(resolve, 500)); // await fireEvent.click(allButtons[6]); // await new Promise(resolve => setTimeout(resolve, 500)); // waitFor(() => expect(allButtons[0].textContent).toBe(':')); // expect(allButtons[0].textContent).toBe('1:'); // const firstItem = await findByShadowTitle(canvasElement, 'T1 - Test Entry - Item 1'); // expect(firstItem).toBeInTheDocument(); // await new Promise(resolve => setTimeout(resolve, 50)); // await fireEvent.click(linkButton); // await new Promise(resolve => setTimeout(resolve, 50)); // const secondItem = await findByShadowTitle(canvasElement, 'T1 - Choice Interaction - Multiple Cardinality'); // expect(secondItem).toBeInTheDocument(); // await fireEvent.click(linkButton); // await new Promise(resolve => setTimeout(resolve, 50)); // await fireEvent.click(linkButton); // await new Promise(resolve => setTimeout(resolve, 50)); // expect(linkButton).toBeDisabled(); } }"
|
|
13792
|
-
}
|
|
13793
|
-
],
|
|
13794
|
-
"exports": [
|
|
13795
|
-
{
|
|
13796
|
-
"kind": "js",
|
|
13797
|
-
"name": "default",
|
|
13798
|
-
"declaration": {
|
|
13799
|
-
"name": "meta",
|
|
13800
|
-
"module": "packages/qti-test/src/components/test-paging-buttons-stamp/test-paging-buttons-stamp.stories.ts"
|
|
13801
|
-
}
|
|
13802
|
-
},
|
|
13803
|
-
{
|
|
13804
|
-
"kind": "js",
|
|
13805
|
-
"name": "Default",
|
|
13806
|
-
"declaration": {
|
|
13807
|
-
"name": "Default",
|
|
13808
|
-
"module": "packages/qti-test/src/components/test-paging-buttons-stamp/test-paging-buttons-stamp.stories.ts"
|
|
13809
|
-
}
|
|
13810
|
-
},
|
|
13811
|
-
{
|
|
13812
|
-
"kind": "js",
|
|
13813
|
-
"name": "Title",
|
|
13814
|
-
"declaration": {
|
|
13815
|
-
"name": "Title",
|
|
13816
|
-
"module": "packages/qti-test/src/components/test-paging-buttons-stamp/test-paging-buttons-stamp.stories.ts"
|
|
13817
|
-
}
|
|
13818
|
-
}
|
|
13819
|
-
]
|
|
13820
|
-
},
|
|
13821
12743
|
{
|
|
13822
12744
|
"kind": "javascript-module",
|
|
13823
12745
|
"path": "packages/qti-test/src/components/test-paging-buttons-stamp/test-paging-buttons-stamp.ts",
|
|
@@ -13892,62 +12814,6 @@
|
|
|
13892
12814
|
}
|
|
13893
12815
|
]
|
|
13894
12816
|
},
|
|
13895
|
-
{
|
|
13896
|
-
"kind": "javascript-module",
|
|
13897
|
-
"path": "packages/qti-test/src/components/test-prev/test-prev.stories.ts",
|
|
13898
|
-
"declarations": [
|
|
13899
|
-
{
|
|
13900
|
-
"kind": "variable",
|
|
13901
|
-
"name": "Default",
|
|
13902
|
-
"type": {
|
|
13903
|
-
"text": "Story"
|
|
13904
|
-
},
|
|
13905
|
-
"default": "{ render: () => html` <qti-test> <test-navigation> <test-container test-url=\"/assets/qti-conformance/Basic/T4-T7/assessment.xml\"> </test-container> ${template(args, html`vorige`)} <test-next>volgende</test-next> </test-navigation> </qti-test> ` }"
|
|
13906
|
-
},
|
|
13907
|
-
{
|
|
13908
|
-
"kind": "variable",
|
|
13909
|
-
"name": "meta",
|
|
13910
|
-
"type": {
|
|
13911
|
-
"text": "Meta<TestPrev>"
|
|
13912
|
-
},
|
|
13913
|
-
"default": "{ component: 'test-prev', args, argTypes, parameters: { actions: { handles: events } } }"
|
|
13914
|
-
},
|
|
13915
|
-
{
|
|
13916
|
-
"kind": "variable",
|
|
13917
|
-
"name": "Test",
|
|
13918
|
-
"type": {
|
|
13919
|
-
"text": "Story"
|
|
13920
|
-
},
|
|
13921
|
-
"default": "{ render: () => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/qti-conformance/Basic/T4-T7/assessment.xml\"> </test-container> <test-prev>vorige</test-prev> <test-next>volgende</test-next> </test-navigation> <test-item-link item-id=\"t1-test-entry-item4\">link</test-item-link> </qti-test> `, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const link = await canvas.findByShadowText('link'); await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'T1 - Test Entry - Item 1'); await fireEvent.click(link); const prevButton = canvas.getByShadowText('vorige'); const nextButton = canvas.getByShadowText('volgende'); expect(prevButton).toBeDisabled(); const firstItem = await getAssessmentItemFromTestContainerByDataTitle( canvasElement, 'T1 - Extended Text Interaction' ); expect(prevButton).not.toBeDisabled(); expect(firstItem).toBeInTheDocument(); await new Promise(resolve => setTimeout(resolve, 1)); await fireEvent.click(prevButton); await new Promise(resolve => setTimeout(resolve, 1)); await fireEvent.click(prevButton); await new Promise(resolve => setTimeout(resolve, 1)); await fireEvent.click(prevButton); const secondItem = await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'T1 - Test Entry - Item 1'); expect(secondItem).toBeInTheDocument(); expect(prevButton).toBeDisabled(); await fireEvent.click(nextButton); await new Promise(resolve => setTimeout(resolve, 1)); expect(prevButton).not.toBeDisabled(); } }"
|
|
13922
|
-
}
|
|
13923
|
-
],
|
|
13924
|
-
"exports": [
|
|
13925
|
-
{
|
|
13926
|
-
"kind": "js",
|
|
13927
|
-
"name": "default",
|
|
13928
|
-
"declaration": {
|
|
13929
|
-
"name": "meta",
|
|
13930
|
-
"module": "packages/qti-test/src/components/test-prev/test-prev.stories.ts"
|
|
13931
|
-
}
|
|
13932
|
-
},
|
|
13933
|
-
{
|
|
13934
|
-
"kind": "js",
|
|
13935
|
-
"name": "Default",
|
|
13936
|
-
"declaration": {
|
|
13937
|
-
"name": "Default",
|
|
13938
|
-
"module": "packages/qti-test/src/components/test-prev/test-prev.stories.ts"
|
|
13939
|
-
}
|
|
13940
|
-
},
|
|
13941
|
-
{
|
|
13942
|
-
"kind": "js",
|
|
13943
|
-
"name": "Test",
|
|
13944
|
-
"declaration": {
|
|
13945
|
-
"name": "Test",
|
|
13946
|
-
"module": "packages/qti-test/src/components/test-prev/test-prev.stories.ts"
|
|
13947
|
-
}
|
|
13948
|
-
}
|
|
13949
|
-
]
|
|
13950
|
-
},
|
|
13951
12817
|
{
|
|
13952
12818
|
"kind": "javascript-module",
|
|
13953
12819
|
"path": "packages/qti-test/src/components/test-prev/test-prev.ts",
|
|
@@ -14087,46 +12953,6 @@
|
|
|
14087
12953
|
}
|
|
14088
12954
|
]
|
|
14089
12955
|
},
|
|
14090
|
-
{
|
|
14091
|
-
"kind": "javascript-module",
|
|
14092
|
-
"path": "packages/qti-test/src/components/test-print-context/test-print-context.stories.ts",
|
|
14093
|
-
"declarations": [
|
|
14094
|
-
{
|
|
14095
|
-
"kind": "variable",
|
|
14096
|
-
"name": "Default",
|
|
14097
|
-
"type": {
|
|
14098
|
-
"text": "Story"
|
|
14099
|
-
},
|
|
14100
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/api/biologie/assessment.xml\"></test-container> ${template(args)} <test-next>Volgende</test-next> </test-navigation> </qti-test>` }"
|
|
14101
|
-
},
|
|
14102
|
-
{
|
|
14103
|
-
"kind": "variable",
|
|
14104
|
-
"name": "meta",
|
|
14105
|
-
"type": {
|
|
14106
|
-
"text": "Meta<TestPrintContext>"
|
|
14107
|
-
},
|
|
14108
|
-
"default": "{ component: 'test-print-context', args, argTypes, parameters: { actions: { handles: events } } }"
|
|
14109
|
-
}
|
|
14110
|
-
],
|
|
14111
|
-
"exports": [
|
|
14112
|
-
{
|
|
14113
|
-
"kind": "js",
|
|
14114
|
-
"name": "default",
|
|
14115
|
-
"declaration": {
|
|
14116
|
-
"name": "meta",
|
|
14117
|
-
"module": "packages/qti-test/src/components/test-print-context/test-print-context.stories.ts"
|
|
14118
|
-
}
|
|
14119
|
-
},
|
|
14120
|
-
{
|
|
14121
|
-
"kind": "js",
|
|
14122
|
-
"name": "Default",
|
|
14123
|
-
"declaration": {
|
|
14124
|
-
"name": "Default",
|
|
14125
|
-
"module": "packages/qti-test/src/components/test-print-context/test-print-context.stories.ts"
|
|
14126
|
-
}
|
|
14127
|
-
}
|
|
14128
|
-
]
|
|
14129
|
-
},
|
|
14130
12956
|
{
|
|
14131
12957
|
"kind": "javascript-module",
|
|
14132
12958
|
"path": "packages/qti-test/src/components/test-print-context/test-print-context.ts",
|
|
@@ -14145,74 +12971,34 @@
|
|
|
14145
12971
|
"privacy": "public",
|
|
14146
12972
|
"parsedType": {
|
|
14147
12973
|
"text": "{ view: '' | 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor', identifier: string, title: string, testParts: { active?: boolean; identifier: string; navigationMode: 'linear' | 'nonlinear'; submissionMode: 'individual' | 'simultaneous'; sections: { active?: boolean; identifier: string; title: string; completed?: boolean; items: ComputedItem[]; }[]; }[] } | undefined"
|
|
14148
|
-
}
|
|
14149
|
-
}
|
|
14150
|
-
],
|
|
14151
|
-
"superclass": {
|
|
14152
|
-
"name": "LitElement",
|
|
14153
|
-
"package": "lit"
|
|
14154
|
-
},
|
|
14155
|
-
"tagName": "test-print-context",
|
|
14156
|
-
"customElement": true,
|
|
14157
|
-
"modulePath": "packages/qti-test/src/components/test-print-context/test-print-context.ts",
|
|
14158
|
-
"definitionPath": "packages/qti-test/src/components/test-print-context/test-print-context.ts"
|
|
14159
|
-
}
|
|
14160
|
-
],
|
|
14161
|
-
"exports": [
|
|
14162
|
-
{
|
|
14163
|
-
"kind": "custom-element-definition",
|
|
14164
|
-
"name": "test-print-context",
|
|
14165
|
-
"declaration": {
|
|
14166
|
-
"name": "TestPrintContext",
|
|
14167
|
-
"module": "packages/qti-test/src/components/test-print-context/test-print-context.ts"
|
|
14168
|
-
}
|
|
14169
|
-
},
|
|
14170
|
-
{
|
|
14171
|
-
"kind": "js",
|
|
14172
|
-
"name": "TestPrintContext",
|
|
14173
|
-
"declaration": {
|
|
14174
|
-
"name": "TestPrintContext",
|
|
14175
|
-
"module": "packages/qti-test/src/components/test-print-context/test-print-context.ts"
|
|
14176
|
-
}
|
|
14177
|
-
}
|
|
14178
|
-
]
|
|
14179
|
-
},
|
|
14180
|
-
{
|
|
14181
|
-
"kind": "javascript-module",
|
|
14182
|
-
"path": "packages/qti-test/src/components/test-print-item-variables/test-print-item-variables.stories.ts",
|
|
14183
|
-
"declarations": [
|
|
14184
|
-
{
|
|
14185
|
-
"kind": "variable",
|
|
14186
|
-
"name": "Default",
|
|
14187
|
-
"type": {
|
|
14188
|
-
"text": "Story"
|
|
14189
|
-
},
|
|
14190
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/api/biologie/assessment.xml\"></test-container> ${template(args)} <test-next>Volgende</test-next> </test-navigation> </qti-test>` }"
|
|
14191
|
-
},
|
|
14192
|
-
{
|
|
14193
|
-
"kind": "variable",
|
|
14194
|
-
"name": "meta",
|
|
14195
|
-
"type": {
|
|
14196
|
-
"text": "Meta<TestPrintVariables>"
|
|
12974
|
+
}
|
|
12975
|
+
}
|
|
12976
|
+
],
|
|
12977
|
+
"superclass": {
|
|
12978
|
+
"name": "LitElement",
|
|
12979
|
+
"package": "lit"
|
|
14197
12980
|
},
|
|
14198
|
-
"
|
|
12981
|
+
"tagName": "test-print-context",
|
|
12982
|
+
"customElement": true,
|
|
12983
|
+
"modulePath": "packages/qti-test/src/components/test-print-context/test-print-context.ts",
|
|
12984
|
+
"definitionPath": "packages/qti-test/src/components/test-print-context/test-print-context.ts"
|
|
14199
12985
|
}
|
|
14200
12986
|
],
|
|
14201
12987
|
"exports": [
|
|
14202
12988
|
{
|
|
14203
|
-
"kind": "
|
|
14204
|
-
"name": "
|
|
12989
|
+
"kind": "custom-element-definition",
|
|
12990
|
+
"name": "test-print-context",
|
|
14205
12991
|
"declaration": {
|
|
14206
|
-
"name": "
|
|
14207
|
-
"module": "packages/qti-test/src/components/test-print-
|
|
12992
|
+
"name": "TestPrintContext",
|
|
12993
|
+
"module": "packages/qti-test/src/components/test-print-context/test-print-context.ts"
|
|
14208
12994
|
}
|
|
14209
12995
|
},
|
|
14210
12996
|
{
|
|
14211
12997
|
"kind": "js",
|
|
14212
|
-
"name": "
|
|
12998
|
+
"name": "TestPrintContext",
|
|
14213
12999
|
"declaration": {
|
|
14214
|
-
"name": "
|
|
14215
|
-
"module": "packages/qti-test/src/components/test-print-
|
|
13000
|
+
"name": "TestPrintContext",
|
|
13001
|
+
"module": "packages/qti-test/src/components/test-print-context/test-print-context.ts"
|
|
14216
13002
|
}
|
|
14217
13003
|
}
|
|
14218
13004
|
]
|
|
@@ -14267,62 +13053,6 @@
|
|
|
14267
13053
|
}
|
|
14268
13054
|
]
|
|
14269
13055
|
},
|
|
14270
|
-
{
|
|
14271
|
-
"kind": "javascript-module",
|
|
14272
|
-
"path": "packages/qti-test/src/components/test-scoring-buttons/test-scoring-buttons.stories.ts",
|
|
14273
|
-
"declarations": [
|
|
14274
|
-
{
|
|
14275
|
-
"kind": "variable",
|
|
14276
|
-
"name": "Default",
|
|
14277
|
-
"type": {
|
|
14278
|
-
"text": "Story"
|
|
14279
|
-
},
|
|
14280
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/test-scoring-buttons/assessment.xml\"></test-container> ${template( args, html`<template> <template type=\"repeat\" repeat=\"{{ scores }}\"> <label> <input type=\"radio\" ?checked=\"{{item == score}}\" name=\"scoring-buttons\" value=\"{{item}}\" /> <span>{{ item }}</span> </label> </template> </template>` )} <test-next>Volgende</test-next> <test-stamp> <template> {{ item.score }} </template> </test-stamp> </test-navigation> </qti-test>` }"
|
|
14281
|
-
},
|
|
14282
|
-
{
|
|
14283
|
-
"kind": "variable",
|
|
14284
|
-
"name": "meta",
|
|
14285
|
-
"type": {
|
|
14286
|
-
"text": "Meta<TestScoringButtons>"
|
|
14287
|
-
},
|
|
14288
|
-
"default": "{ component: 'test-scoring-buttons', args, argTypes, parameters: { actions: { handles: events } } }"
|
|
14289
|
-
},
|
|
14290
|
-
{
|
|
14291
|
-
"kind": "variable",
|
|
14292
|
-
"name": "Test",
|
|
14293
|
-
"type": {
|
|
14294
|
-
"text": "Story"
|
|
14295
|
-
},
|
|
14296
|
-
"default": "{ render: Default.render, play: async ({ canvasElement }) => { const assessmentTest = await getAssessmentTest(canvasElement); expect(assessmentTest).toBeInTheDocument(); // // 2 Assume the candidate rubric is not visible // const rubricElement = await canvas.findByShadowText('candidate rubric block'); // expect(rubricElement).toBeVisible(); // // 3 Select the candidate view // // 4 Wait for the candidate rubric to be visible // expect(rubricElement).toBeVisible(); // // 5 Assume correctResponse is not set // const firstChoiceElement = await canvas.findByShadowText('Correct'); // const afterStyle = getComputedStyle(firstChoiceElement, '::after'); // expect(afterStyle.content).toBe('none'); // // 6 Set the view to scorer // await userEvent.click(switchElement); // expect(afterStyle.content).not.toBe('none'); } }"
|
|
14297
|
-
}
|
|
14298
|
-
],
|
|
14299
|
-
"exports": [
|
|
14300
|
-
{
|
|
14301
|
-
"kind": "js",
|
|
14302
|
-
"name": "default",
|
|
14303
|
-
"declaration": {
|
|
14304
|
-
"name": "meta",
|
|
14305
|
-
"module": "packages/qti-test/src/components/test-scoring-buttons/test-scoring-buttons.stories.ts"
|
|
14306
|
-
}
|
|
14307
|
-
},
|
|
14308
|
-
{
|
|
14309
|
-
"kind": "js",
|
|
14310
|
-
"name": "Default",
|
|
14311
|
-
"declaration": {
|
|
14312
|
-
"name": "Default",
|
|
14313
|
-
"module": "packages/qti-test/src/components/test-scoring-buttons/test-scoring-buttons.stories.ts"
|
|
14314
|
-
}
|
|
14315
|
-
},
|
|
14316
|
-
{
|
|
14317
|
-
"kind": "js",
|
|
14318
|
-
"name": "Test",
|
|
14319
|
-
"declaration": {
|
|
14320
|
-
"name": "Test",
|
|
14321
|
-
"module": "packages/qti-test/src/components/test-scoring-buttons/test-scoring-buttons.stories.ts"
|
|
14322
|
-
}
|
|
14323
|
-
}
|
|
14324
|
-
]
|
|
14325
|
-
},
|
|
14326
13056
|
{
|
|
14327
13057
|
"kind": "javascript-module",
|
|
14328
13058
|
"path": "packages/qti-test/src/components/test-scoring-buttons/test-scoring-buttons.ts",
|
|
@@ -14514,62 +13244,6 @@
|
|
|
14514
13244
|
}
|
|
14515
13245
|
]
|
|
14516
13246
|
},
|
|
14517
|
-
{
|
|
14518
|
-
"kind": "javascript-module",
|
|
14519
|
-
"path": "packages/qti-test/src/components/test-section-buttons-stamp/test-section-buttons-stamp.stories.ts",
|
|
14520
|
-
"declarations": [
|
|
14521
|
-
{
|
|
14522
|
-
"kind": "variable",
|
|
14523
|
-
"name": "Default",
|
|
14524
|
-
"type": {
|
|
14525
|
-
"text": "Story"
|
|
14526
|
-
},
|
|
14527
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <!-- <template item-ref><div style=\"border:2px solid red\">{{ xmlDoc }}</div></template> --> <test-navigation> ${template( args, html`<template> <test-section-link section-id=\"{{ item.identifier }}\"> {{ item.identifier }} </test-section-link> </template>` )} <test-container test-url=\"/assets/qti-test-package-stimulus/assessment.xml\"></test-container> </test-navigation> </qti-test>`, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const navInfoStart = await canvas.findByShadowText('info-start'); const navBasic = await canvas.findByShadowText('basic'); const navAdvanced = await canvas.findByShadowText('advanced'); const navInfoEnd = await canvas.findByShadowText('info-end'); const firstItem = await getAssessmentItemsFromTestContainer(canvasElement); expect(firstItem[0]).toBeInTheDocument(); // Spy on event listener const eventSpy = fn(); canvasElement.addEventListener('qti-assessment-stimulus-ref-connected', eventSpy); await fireEvent.click(navInfoStart); await fireEvent.click(navBasic); // Wait until the event has been triggered four times await new Promise<void>(resolve => { const checkEventCount = () => { if (eventSpy.mock.calls.length === 4) { fireEvent.click(navAdvanced); resolve(); } else { setTimeout(checkEventCount, 10); } }; checkEventCount(); }); await fireEvent.click(navInfoEnd); const lastItem = await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'Info End'); expect(lastItem).toBeInTheDocument(); } }"
|
|
14528
|
-
},
|
|
14529
|
-
{
|
|
14530
|
-
"kind": "variable",
|
|
14531
|
-
"name": "meta",
|
|
14532
|
-
"type": {
|
|
14533
|
-
"text": "Meta<TestSectionButtonsStamp>"
|
|
14534
|
-
},
|
|
14535
|
-
"default": "{ component: 'test-section-buttons-stamp', args, argTypes, parameters: { actions: { handles: events } } }"
|
|
14536
|
-
},
|
|
14537
|
-
{
|
|
14538
|
-
"kind": "variable",
|
|
14539
|
-
"name": "StimulusDeliveryPlatform",
|
|
14540
|
-
"type": {
|
|
14541
|
-
"text": "Story"
|
|
14542
|
-
},
|
|
14543
|
-
"default": "{ render: args => { const placeholderRef = createRef<HTMLElement>(); return html` <qti-test @qti-assessment-stimulus-ref-connected=${async (e: Event) => { e.preventDefault(); // this prevents the default behaviour of the item to set the stimulus content const stimulusRef = e.composedPath()[0] as QtiAssessmentStimulusRef; stimulusRef.updateStimulusRef(placeholderRef.value); }} > <test-navigation> ${template( args, html`<template> <test-section-link section-id=\"{{ item.identifier }}\"> {{ item.identifier }} </test-section-link> </template>` )} <div class=\"flex\"> <div class=\"qti-base-stimulus\" ${ref(placeholderRef)}></div> <test-container test-url=\"/assets/qti-test-package-stimulus/assessment.xml\"></test-container> </div> </test-navigation> </qti-test>`; }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const navInfoStart = await canvas.findByShadowText('info-start'); const navBasic = await canvas.findByShadowText('basic'); const navAdvanced = await canvas.findByShadowText('advanced'); const navInfoEnd = await canvas.findByShadowText('info-end'); const testContainer = await getTestContainer(canvasElement); expect(testContainer).toBeInTheDocument(); await fireEvent.click(navInfoStart); await fireEvent.click(navBasic); await fireEvent.click(navAdvanced); await fireEvent.click(navInfoEnd); const lastItem = await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'Info End'); expect(lastItem).toBeInTheDocument(); } }"
|
|
14544
|
-
}
|
|
14545
|
-
],
|
|
14546
|
-
"exports": [
|
|
14547
|
-
{
|
|
14548
|
-
"kind": "js",
|
|
14549
|
-
"name": "default",
|
|
14550
|
-
"declaration": {
|
|
14551
|
-
"name": "meta",
|
|
14552
|
-
"module": "packages/qti-test/src/components/test-section-buttons-stamp/test-section-buttons-stamp.stories.ts"
|
|
14553
|
-
}
|
|
14554
|
-
},
|
|
14555
|
-
{
|
|
14556
|
-
"kind": "js",
|
|
14557
|
-
"name": "Default",
|
|
14558
|
-
"declaration": {
|
|
14559
|
-
"name": "Default",
|
|
14560
|
-
"module": "packages/qti-test/src/components/test-section-buttons-stamp/test-section-buttons-stamp.stories.ts"
|
|
14561
|
-
}
|
|
14562
|
-
},
|
|
14563
|
-
{
|
|
14564
|
-
"kind": "js",
|
|
14565
|
-
"name": "StimulusDeliveryPlatform",
|
|
14566
|
-
"declaration": {
|
|
14567
|
-
"name": "StimulusDeliveryPlatform",
|
|
14568
|
-
"module": "packages/qti-test/src/components/test-section-buttons-stamp/test-section-buttons-stamp.stories.ts"
|
|
14569
|
-
}
|
|
14570
|
-
}
|
|
14571
|
-
]
|
|
14572
|
-
},
|
|
14573
13247
|
{
|
|
14574
13248
|
"kind": "javascript-module",
|
|
14575
13249
|
"path": "packages/qti-test/src/components/test-section-buttons-stamp/test-section-buttons-stamp.ts",
|
|
@@ -14644,46 +13318,6 @@
|
|
|
14644
13318
|
}
|
|
14645
13319
|
]
|
|
14646
13320
|
},
|
|
14647
|
-
{
|
|
14648
|
-
"kind": "javascript-module",
|
|
14649
|
-
"path": "packages/qti-test/src/components/test-section-link/test-section-link.stories.ts",
|
|
14650
|
-
"declarations": [
|
|
14651
|
-
{
|
|
14652
|
-
"kind": "variable",
|
|
14653
|
-
"name": "Default",
|
|
14654
|
-
"type": {
|
|
14655
|
-
"text": "Story"
|
|
14656
|
-
},
|
|
14657
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/qti-test-package/assessment.xml\"></test-container> ${template(args, html`Link to section`)} </test-navigation> </qti-test>` }"
|
|
14658
|
-
},
|
|
14659
|
-
{
|
|
14660
|
-
"kind": "variable",
|
|
14661
|
-
"name": "meta",
|
|
14662
|
-
"type": {
|
|
14663
|
-
"text": "Meta<TestSectionLink & { 'section-id' }>"
|
|
14664
|
-
},
|
|
14665
|
-
"default": "{ component: 'test-section-link', args: { ...args, 'section-id': 'advanced' }, argTypes, parameters: { actions: { handles: events } } }"
|
|
14666
|
-
}
|
|
14667
|
-
],
|
|
14668
|
-
"exports": [
|
|
14669
|
-
{
|
|
14670
|
-
"kind": "js",
|
|
14671
|
-
"name": "default",
|
|
14672
|
-
"declaration": {
|
|
14673
|
-
"name": "meta",
|
|
14674
|
-
"module": "packages/qti-test/src/components/test-section-link/test-section-link.stories.ts"
|
|
14675
|
-
}
|
|
14676
|
-
},
|
|
14677
|
-
{
|
|
14678
|
-
"kind": "js",
|
|
14679
|
-
"name": "Default",
|
|
14680
|
-
"declaration": {
|
|
14681
|
-
"name": "Default",
|
|
14682
|
-
"module": "packages/qti-test/src/components/test-section-link/test-section-link.stories.ts"
|
|
14683
|
-
}
|
|
14684
|
-
}
|
|
14685
|
-
]
|
|
14686
|
-
},
|
|
14687
13321
|
{
|
|
14688
13322
|
"kind": "javascript-module",
|
|
14689
13323
|
"path": "packages/qti-test/src/components/test-section-link/test-section-link.ts",
|
|
@@ -14764,94 +13398,6 @@
|
|
|
14764
13398
|
}
|
|
14765
13399
|
]
|
|
14766
13400
|
},
|
|
14767
|
-
{
|
|
14768
|
-
"kind": "javascript-module",
|
|
14769
|
-
"path": "packages/qti-test/src/components/test-show-correct-response/test-show-correct-response.stories.ts",
|
|
14770
|
-
"declarations": [
|
|
14771
|
-
{
|
|
14772
|
-
"kind": "variable",
|
|
14773
|
-
"name": "Default",
|
|
14774
|
-
"type": {
|
|
14775
|
-
"text": "Story"
|
|
14776
|
-
},
|
|
14777
|
-
"default": "{ render: args => html` <qti-test> <test-navigation> <test-container test-url=\"/assets/qti-test-package/assessment.xml\"> </test-container> ${template(args, html`Show Correct`)} <test-next>Volgende</test-next> </test-navigation> </qti-test>` }"
|
|
14778
|
-
},
|
|
14779
|
-
{
|
|
14780
|
-
"kind": "variable",
|
|
14781
|
-
"name": "meta",
|
|
14782
|
-
"type": {
|
|
14783
|
-
"text": "Meta<TestShowCorrectResponse>"
|
|
14784
|
-
},
|
|
14785
|
-
"default": "{ component: 'test-show-correct-response', args, argTypes, parameters: { actions: { handles: events } } }"
|
|
14786
|
-
},
|
|
14787
|
-
{
|
|
14788
|
-
"kind": "variable",
|
|
14789
|
-
"name": "Test",
|
|
14790
|
-
"type": {
|
|
14791
|
-
"text": "Story"
|
|
14792
|
-
},
|
|
14793
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <!-- <test-print-item-variables></test-print-item-variables> --> <test-container test-url=\"/assets/qti-test-package/assessment.xml\"> </test-container> <test-show-correct-response ${spread(args)}>Show correct</test-show-correct-response> <test-next>Volgende</test-next> <test-item-link item-id=\"ITM-text_entry\">link</test-item-link> </test-navigation> </qti-test> `, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const link = await canvas.findByShadowText('link'); await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'Info Start'); await fireEvent.click(link); const nextButton = await canvas.findByShadowText('Volgende'); await waitFor(() => expect(nextButton).toBeEnabled()); const firstItem = await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'Richard III (Take 3)'); expect(firstItem).toBeInTheDocument(); const showCorrectButton = await findByShadowText(canvasElement, 'Show correct response'); showCorrectButton.click(); const incorrect = await canvas.findByShadowText('York'); expect(incorrect).toBeInTheDocument(); } }"
|
|
14794
|
-
},
|
|
14795
|
-
{
|
|
14796
|
-
"kind": "variable",
|
|
14797
|
-
"name": "Test2",
|
|
14798
|
-
"type": {
|
|
14799
|
-
"text": "Story"
|
|
14800
|
-
},
|
|
14801
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/qti-test-package2/AssessmentTest.xml\"> </test-container> ${template(args, html`Show Correct`)} <test-prev>Vorige</test-prev> <test-next>Volgende</test-next> </test-navigation> </qti-test>`, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const nextButton = await canvas.findByShadowText('Volgende'); await waitFor(() => expect(nextButton).toBeEnabled()); // check if show correct button is enabled const showCorrectButton = await findByShadowText(canvasElement, 'Show correct response'); await waitFor(() => expect(showCorrectButton).toBeEnabled()); // check the first alernative const firstAlternative = await findByShadowText(canvasElement, 'Richting het noorden'); await fireEvent.click(firstAlternative); // check if the item is added under the correct item-ref const itemRef = firstAlternative.closest('qti-assessment-item-ref'); expect(itemRef.getAttribute('identifier')).toBe('ODD-13122024-124755-RES1'); // navigate to the next item await fireEvent.click(nextButton); const secondAlternative = await findByShadowText(canvasElement, 'bipolaire staat'); await fireEvent.click(secondAlternative); await fireEvent.click(nextButton); // now the same item as item1 is show, check if no alternatives are selected const choiceA = await canvas.findByShadowText('Richting het noorden'); expect((choiceA.closest('qti-simple-choice') as QtiSimpleChoice).internals.states.has('--checked')).toBe(false); const choiceC = await canvas.findByShadowText('Richting het zuiden'); await fireEvent.click(choiceC); expect((choiceC.closest('qti-simple-choice') as QtiSimpleChoice).internals.states.has('--checked')).toBe(true); const prevButton = await canvas.findByShadowText('Vorige'); await fireEvent.click(prevButton); await await findByShadowText(canvasElement, 'bipolaire staat'); await fireEvent.click(prevButton); // check if A is selected again const choiceA2 = await canvas.findByShadowText('Richting het noorden'); expect((choiceA2.closest('qti-simple-choice') as QtiSimpleChoice).internals.states.has('--checked')).toBe(true); } }"
|
|
14802
|
-
},
|
|
14803
|
-
{
|
|
14804
|
-
"kind": "variable",
|
|
14805
|
-
"name": "TestFullCorrectResponse",
|
|
14806
|
-
"type": {
|
|
14807
|
-
"text": "Story"
|
|
14808
|
-
},
|
|
14809
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <!-- <test-print-item-variables></test-print-item-variables> --> <test-container test-url=\"/assets/qti-test-package/assessment.xml\"> </test-container> <test-show-correct-response ${spread(args)}>Show correct</test-show-correct-response> <test-next>Volgende</test-next> <test-item-link item-id=\"ITM-text_entry\">link</test-item-link> </test-navigation> </qti-test> `, play: async ({ canvasElement }) => { const testNavigation = document.querySelector('test-navigation') as TestNavigation; testNavigation.configContext = { correctResponseMode: 'full' }; const canvas = within(canvasElement); const link = await canvas.findByShadowText('link'); await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'Info Start'); await fireEvent.click(link); const nextButton = await canvas.findByShadowText('Volgende'); await waitFor(() => expect(nextButton).toBeEnabled()); const firstItem = await getAssessmentItemFromTestContainerByDataTitle(canvasElement, 'Richard III (Take 3)'); expect(firstItem).toBeInTheDocument(); const showCorrectButton = await findByShadowText(canvasElement, 'Show correct response'); showCorrectButton.click(); const fullCorrectResponse = await canvas.findByShadowRole('full-correct-response'); expect(fullCorrectResponse).toBeInTheDocument(); } }"
|
|
14810
|
-
}
|
|
14811
|
-
],
|
|
14812
|
-
"exports": [
|
|
14813
|
-
{
|
|
14814
|
-
"kind": "js",
|
|
14815
|
-
"name": "default",
|
|
14816
|
-
"declaration": {
|
|
14817
|
-
"name": "meta",
|
|
14818
|
-
"module": "packages/qti-test/src/components/test-show-correct-response/test-show-correct-response.stories.ts"
|
|
14819
|
-
}
|
|
14820
|
-
},
|
|
14821
|
-
{
|
|
14822
|
-
"kind": "js",
|
|
14823
|
-
"name": "Default",
|
|
14824
|
-
"declaration": {
|
|
14825
|
-
"name": "Default",
|
|
14826
|
-
"module": "packages/qti-test/src/components/test-show-correct-response/test-show-correct-response.stories.ts"
|
|
14827
|
-
}
|
|
14828
|
-
},
|
|
14829
|
-
{
|
|
14830
|
-
"kind": "js",
|
|
14831
|
-
"name": "Test",
|
|
14832
|
-
"declaration": {
|
|
14833
|
-
"name": "Test",
|
|
14834
|
-
"module": "packages/qti-test/src/components/test-show-correct-response/test-show-correct-response.stories.ts"
|
|
14835
|
-
}
|
|
14836
|
-
},
|
|
14837
|
-
{
|
|
14838
|
-
"kind": "js",
|
|
14839
|
-
"name": "Test2",
|
|
14840
|
-
"declaration": {
|
|
14841
|
-
"name": "Test2",
|
|
14842
|
-
"module": "packages/qti-test/src/components/test-show-correct-response/test-show-correct-response.stories.ts"
|
|
14843
|
-
}
|
|
14844
|
-
},
|
|
14845
|
-
{
|
|
14846
|
-
"kind": "js",
|
|
14847
|
-
"name": "TestFullCorrectResponse",
|
|
14848
|
-
"declaration": {
|
|
14849
|
-
"name": "TestFullCorrectResponse",
|
|
14850
|
-
"module": "packages/qti-test/src/components/test-show-correct-response/test-show-correct-response.stories.ts"
|
|
14851
|
-
}
|
|
14852
|
-
}
|
|
14853
|
-
]
|
|
14854
|
-
},
|
|
14855
13401
|
{
|
|
14856
13402
|
"kind": "javascript-module",
|
|
14857
13403
|
"path": "packages/qti-test/src/components/test-show-correct-response/test-show-correct-response.ts",
|
|
@@ -15023,46 +13569,6 @@
|
|
|
15023
13569
|
}
|
|
15024
13570
|
]
|
|
15025
13571
|
},
|
|
15026
|
-
{
|
|
15027
|
-
"kind": "javascript-module",
|
|
15028
|
-
"path": "packages/qti-test/src/components/test-stamp/test-stamp.stories.ts",
|
|
15029
|
-
"declarations": [
|
|
15030
|
-
{
|
|
15031
|
-
"kind": "variable",
|
|
15032
|
-
"name": "Default",
|
|
15033
|
-
"type": {
|
|
15034
|
-
"text": "Story"
|
|
15035
|
-
},
|
|
15036
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <!-- <test-print-context></test-print-context> --> ${template(args, html`<template>{{ test.title }}</template>`)} ${template( args, html` <template> <ul> <li>{{ test.identifier }}</li> <li>{{ test.title }}</li> </ul> <ul> <li>{{ testpart.items }}</li> <li>{{ testpart.active }}</li> <li>{{ testpart.identifier }}</li> <li>{{ testpart.navigationMode }}</li> <li>{{ testpart.submissionMode }}</li> </ul> <ul> <li>{{ section.title }}</li> <li>{{ section.active }}</li> <li>{{ section.identifier }}</li> <li>{{required}}</li> <li>{{fixed}}</li> <li>{{visible}}</li> <li>{{keepTogether}}</li> <li>{{ section.items }}</li> </ul> <template type=\"if\" if=\"{{ testpart.items }}\"> <template type=\"repeat\" repeat=\"{{ testpart.items }}\"> <p>{{ item.identifier }}</p> </template> </template> </template> ` )} ${template( args, html` <template> <template type=\"if\" if=\"{{ section.items }}\"> <template type=\"repeat\" repeat=\"{{ section.items }}\"> <p>{{ item.identifier }}</p> </template> </template> </template> ` )} ${template(args, html`<template>{{ item.identifier }}</template>`)} <test-container test-url=\"/assets/api/kennisnet-1/AssessmentTest.xml\"></test-container> <test-next>Volgende</test-next> </test-navigation> </qti-test>` }"
|
|
15037
|
-
},
|
|
15038
|
-
{
|
|
15039
|
-
"kind": "variable",
|
|
15040
|
-
"name": "meta",
|
|
15041
|
-
"type": {
|
|
15042
|
-
"text": "Meta<TestStamp>"
|
|
15043
|
-
},
|
|
15044
|
-
"default": "{ component: 'test-stamp', args, argTypes, parameters: { actions: { handles: events } } }"
|
|
15045
|
-
}
|
|
15046
|
-
],
|
|
15047
|
-
"exports": [
|
|
15048
|
-
{
|
|
15049
|
-
"kind": "js",
|
|
15050
|
-
"name": "default",
|
|
15051
|
-
"declaration": {
|
|
15052
|
-
"name": "meta",
|
|
15053
|
-
"module": "packages/qti-test/src/components/test-stamp/test-stamp.stories.ts"
|
|
15054
|
-
}
|
|
15055
|
-
},
|
|
15056
|
-
{
|
|
15057
|
-
"kind": "js",
|
|
15058
|
-
"name": "Default",
|
|
15059
|
-
"declaration": {
|
|
15060
|
-
"name": "Default",
|
|
15061
|
-
"module": "packages/qti-test/src/components/test-stamp/test-stamp.stories.ts"
|
|
15062
|
-
}
|
|
15063
|
-
}
|
|
15064
|
-
]
|
|
15065
|
-
},
|
|
15066
13572
|
{
|
|
15067
13573
|
"kind": "javascript-module",
|
|
15068
13574
|
"path": "packages/qti-test/src/components/test-stamp/test-stamp.ts",
|
|
@@ -15160,62 +13666,6 @@
|
|
|
15160
13666
|
}
|
|
15161
13667
|
]
|
|
15162
13668
|
},
|
|
15163
|
-
{
|
|
15164
|
-
"kind": "javascript-module",
|
|
15165
|
-
"path": "packages/qti-test/src/components/test-view-toggle/test-view-toggle.stories.ts",
|
|
15166
|
-
"declarations": [
|
|
15167
|
-
{
|
|
15168
|
-
"kind": "variable",
|
|
15169
|
-
"name": "Default",
|
|
15170
|
-
"type": {
|
|
15171
|
-
"text": "Story"
|
|
15172
|
-
},
|
|
15173
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/qti-conformance/Basic/T4-T7/assessment.xml\"></test-container> ${template(args)} </test-navigation> </qti-test>` }"
|
|
15174
|
-
},
|
|
15175
|
-
{
|
|
15176
|
-
"kind": "variable",
|
|
15177
|
-
"name": "meta",
|
|
15178
|
-
"type": {
|
|
15179
|
-
"text": "Meta<TestViewToggle>"
|
|
15180
|
-
},
|
|
15181
|
-
"default": "{ component: 'test-view-toggle', args, argTypes, parameters: { actions: { handles: events } }, tags: ['no-tests'] }"
|
|
15182
|
-
},
|
|
15183
|
-
{
|
|
15184
|
-
"kind": "variable",
|
|
15185
|
-
"name": "Test",
|
|
15186
|
-
"type": {
|
|
15187
|
-
"text": "Story"
|
|
15188
|
-
},
|
|
15189
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/qti-conformance/Basic/T4-T7/assessment.xml\"> </test-container> <test-view-toggle ${spread(args)} role=\"switch\"> <template> {{ view === 'scorer' ? 'Scorer' : 'Candidate'}} </template> </test-view-toggle> </test-navigation> </qti-test> `, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const switchElement = await canvas.findByShadowRole('switch'); // 1 Wait for the item to load const itemElement = await canvas.findByShadowTitle('T1 - Test Entry - Item 1'); expect(itemElement).toBeInTheDocument(); // 2 Assume the candidate rubric is not visible const rubricElement = await canvas.findByShadowText('candidate rubric block'); expect(rubricElement).toBeVisible(); // 3 Select the candidate view // 4 Wait for the candidate rubric to be visible expect(rubricElement).toBeVisible(); // 5 Assume correctResponse is not set const firstChoiceElement = await canvas.findByShadowText('Correct'); const afterStyle = getComputedStyle(firstChoiceElement, '::after'); expect(afterStyle.content).toBe('none'); // 6 Set the view to scorer await userEvent.click(switchElement); expect(afterStyle.content).not.toBe('none'); } }"
|
|
15190
|
-
}
|
|
15191
|
-
],
|
|
15192
|
-
"exports": [
|
|
15193
|
-
{
|
|
15194
|
-
"kind": "js",
|
|
15195
|
-
"name": "default",
|
|
15196
|
-
"declaration": {
|
|
15197
|
-
"name": "meta",
|
|
15198
|
-
"module": "packages/qti-test/src/components/test-view-toggle/test-view-toggle.stories.ts"
|
|
15199
|
-
}
|
|
15200
|
-
},
|
|
15201
|
-
{
|
|
15202
|
-
"kind": "js",
|
|
15203
|
-
"name": "Default",
|
|
15204
|
-
"declaration": {
|
|
15205
|
-
"name": "Default",
|
|
15206
|
-
"module": "packages/qti-test/src/components/test-view-toggle/test-view-toggle.stories.ts"
|
|
15207
|
-
}
|
|
15208
|
-
},
|
|
15209
|
-
{
|
|
15210
|
-
"kind": "js",
|
|
15211
|
-
"name": "Test",
|
|
15212
|
-
"declaration": {
|
|
15213
|
-
"name": "Test",
|
|
15214
|
-
"module": "packages/qti-test/src/components/test-view-toggle/test-view-toggle.stories.ts"
|
|
15215
|
-
}
|
|
15216
|
-
}
|
|
15217
|
-
]
|
|
15218
|
-
},
|
|
15219
13669
|
{
|
|
15220
13670
|
"kind": "javascript-module",
|
|
15221
13671
|
"path": "packages/qti-test/src/components/test-view-toggle/test-view-toggle.ts",
|
|
@@ -15293,62 +13743,6 @@
|
|
|
15293
13743
|
}
|
|
15294
13744
|
]
|
|
15295
13745
|
},
|
|
15296
|
-
{
|
|
15297
|
-
"kind": "javascript-module",
|
|
15298
|
-
"path": "packages/qti-test/src/components/test-view-toggle/test-view.stories.ts",
|
|
15299
|
-
"declarations": [
|
|
15300
|
-
{
|
|
15301
|
-
"kind": "variable",
|
|
15302
|
-
"name": "Default",
|
|
15303
|
-
"type": {
|
|
15304
|
-
"text": "Story"
|
|
15305
|
-
},
|
|
15306
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/qti-conformance/Basic/T4-T7/assessment.xml\"></test-container> ${template(args)} </test-navigation> </qti-test>` }"
|
|
15307
|
-
},
|
|
15308
|
-
{
|
|
15309
|
-
"kind": "variable",
|
|
15310
|
-
"name": "meta",
|
|
15311
|
-
"type": {
|
|
15312
|
-
"text": "Meta<TestViewClass>"
|
|
15313
|
-
},
|
|
15314
|
-
"default": "{ component: 'test-view', args, argTypes, parameters: { actions: { handles: events } }, tags: ['no-tests'] }"
|
|
15315
|
-
},
|
|
15316
|
-
{
|
|
15317
|
-
"kind": "variable",
|
|
15318
|
-
"name": "Test",
|
|
15319
|
-
"type": {
|
|
15320
|
-
"text": "Story"
|
|
15321
|
-
},
|
|
15322
|
-
"default": "{ render: args => html` <qti-test navigate=\"item\"> <test-navigation> <test-container test-url=\"/assets/qti-conformance/Basic/T4-T7/assessment.xml\"> </test-container> <test-view ${spread(args)}>vorige</test-view> </test-navigation> </qti-test> `, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const selectElement = await canvas.findByShadowLabelText('view'); // 1 Wait for the item to load const itemElement = await canvas.findByShadowTitle('T1 - Test Entry - Item 1'); expect(itemElement).toBeInTheDocument(); // 2 Assume the candidate rubric is not visible const rubricElement = await canvas.findByShadowText('candidate rubric block'); expect(rubricElement).toBeVisible(); // 3 Select the candidate view await userEvent.selectOptions(selectElement, 'candidate'); // 4 Wait for the candidate rubric to be visible expect(rubricElement).toBeVisible(); // 5 Assume correctResponse is not set const firstChoiceElement = await canvas.findByShadowText('Correct'); const afterStyle = getComputedStyle(firstChoiceElement, '::after'); expect(afterStyle.content).toBe('none'); // 6 Set the view to scorer await userEvent.selectOptions(selectElement, 'scorer'); // Expect the correctResponse to be visible expect(afterStyle.content).not.toBe('none'); }, args: { 'view-options': 'candidate, scorer' } }"
|
|
15323
|
-
}
|
|
15324
|
-
],
|
|
15325
|
-
"exports": [
|
|
15326
|
-
{
|
|
15327
|
-
"kind": "js",
|
|
15328
|
-
"name": "default",
|
|
15329
|
-
"declaration": {
|
|
15330
|
-
"name": "meta",
|
|
15331
|
-
"module": "packages/qti-test/src/components/test-view-toggle/test-view.stories.ts"
|
|
15332
|
-
}
|
|
15333
|
-
},
|
|
15334
|
-
{
|
|
15335
|
-
"kind": "js",
|
|
15336
|
-
"name": "Default",
|
|
15337
|
-
"declaration": {
|
|
15338
|
-
"name": "Default",
|
|
15339
|
-
"module": "packages/qti-test/src/components/test-view-toggle/test-view.stories.ts"
|
|
15340
|
-
}
|
|
15341
|
-
},
|
|
15342
|
-
{
|
|
15343
|
-
"kind": "js",
|
|
15344
|
-
"name": "Test",
|
|
15345
|
-
"declaration": {
|
|
15346
|
-
"name": "Test",
|
|
15347
|
-
"module": "packages/qti-test/src/components/test-view-toggle/test-view.stories.ts"
|
|
15348
|
-
}
|
|
15349
|
-
}
|
|
15350
|
-
]
|
|
15351
|
-
},
|
|
15352
13746
|
{
|
|
15353
13747
|
"kind": "javascript-module",
|
|
15354
13748
|
"path": "packages/qti-test/src/components/test-view-toggle/test-view.ts",
|