@citolab/qti-components 7.13.0 → 7.14.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 +103 -103
- package/custom-elements.json +1128 -315
- package/dist/chunks/{chunk-IHE5M7QU.js → chunk-7567ZPN6.js} +4 -4
- package/dist/chunks/chunk-7567ZPN6.js.map +1 -0
- package/dist/chunks/{chunk-TFNRSY74.js → chunk-TISKSGJE.js} +24 -19
- package/dist/chunks/chunk-TISKSGJE.js.map +1 -0
- package/dist/chunks/{chunk-WFUXZ4UT.js → chunk-XBPO6E25.js} +27 -37
- package/dist/chunks/chunk-XBPO6E25.js.map +1 -0
- package/dist/chunks/{chunk-XI7S3HP2.js → chunk-XEKFVRIO.js} +363 -337
- package/dist/chunks/chunk-XEKFVRIO.js.map +1 -0
- package/dist/exports/qti-test.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +47 -36
- package/dist/index.js.map +1 -1
- package/dist/qti-components/index.d.ts +10 -9
- package/dist/qti-components/index.js +4 -2
- package/dist/qti-components-jsx.d.ts +15 -15
- package/dist/qti-item/index.js +2 -2
- package/dist/qti-loader/index.js +2 -2
- package/dist/qti-loader/index.js.map +1 -1
- package/dist/qti-test/index.d.ts +3 -3
- package/dist/qti-test/index.js +3 -3
- package/dist/{qti-test-DEJqAn7G.d.ts → qti-test-Db7oNIWY.d.ts} +1 -1
- package/dist/{qti-transform-test-DkSRdVBF.d.ts → qti-transform-test-Bz9A3hmD.d.ts} +2 -5
- package/dist/qti-transformers/index.d.ts +3 -3
- package/dist/qti-transformers/index.js +1 -1
- package/dist/vscode.html-custom-data.json +4 -21
- package/package.json +10 -1
- package/dist/chunks/chunk-IHE5M7QU.js.map +0 -1
- package/dist/chunks/chunk-TFNRSY74.js.map +0 -1
- package/dist/chunks/chunk-WFUXZ4UT.js.map +0 -1
- package/dist/chunks/chunk-XI7S3HP2.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { Q as QtiAssessmentItem } from '../qti-assessment-item-l-mN3teH.js';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement, CSSResultGroup, PropertyValues, PropertyValueMap, nothing } from 'lit';
|
|
4
4
|
import * as lit_html from 'lit-html';
|
|
@@ -17,21 +17,22 @@ import { R as ResponseVariable, V as VariableDeclaration } from '../variables-BC
|
|
|
17
17
|
export { c as QtiAreaMapEntry, b as QtiAreaMapping, a as QtiMapEntry, Q as QtiMapping, d as areaShape } from '../variables-BCkyLoXK.js';
|
|
18
18
|
import '../exports/qti.context.js';
|
|
19
19
|
|
|
20
|
+
declare class QtiAssessmentStimulusRefConnectedEvent extends Event {
|
|
21
|
+
element: QtiAssessmentStimulusRef;
|
|
22
|
+
item: QtiAssessmentItem;
|
|
23
|
+
static eventName: string;
|
|
24
|
+
constructor(element: QtiAssessmentStimulusRef, item: QtiAssessmentItem);
|
|
25
|
+
}
|
|
20
26
|
/**
|
|
21
27
|
* Represents a custom element for referencing an assessment stimulus.
|
|
22
28
|
*/
|
|
23
29
|
declare class QtiAssessmentStimulusRef extends LitElement {
|
|
24
|
-
/**
|
|
25
|
-
* The identifier of the stimulus.
|
|
26
|
-
*/
|
|
27
30
|
identifier: string;
|
|
28
|
-
/**
|
|
29
|
-
* The href of the stimulus.
|
|
30
|
-
*/
|
|
31
31
|
href: string;
|
|
32
32
|
/**
|
|
33
33
|
* Lifecycle method called when the element is connected to the DOM.
|
|
34
|
-
*
|
|
34
|
+
* First checks if there's a data-stimulus-idref element. If found, loads the stimulus directly.
|
|
35
|
+
* If not found, delegates to the delivery platform via an event.
|
|
35
36
|
*/
|
|
36
37
|
connectedCallback(): Promise<void>;
|
|
37
38
|
/**
|
|
@@ -1518,4 +1519,4 @@ declare global {
|
|
|
1518
1519
|
}
|
|
1519
1520
|
}
|
|
1520
1521
|
|
|
1521
|
-
export { type Orientation, QtiAnd, QtiAssessmentStimulusRef, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoiceInteraction, QtiCompanionMaterialsInfo, QtiContainerSize, QtiContains, QtiContentBody, QtiCorrect, QtiCustomInteraction, QtiCustomOperator, QtiDefault, QtiDelete, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExtendedTextInteraction, QtiFeedbackBlock, QtiFeedbackInline, QtiFieldValue, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGcd, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiIndex, QtiInlineChoice, QtiInlineChoiceInteraction, QtiIsNull, QtiItemBody, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMatchInteraction, QtiMathOperator, QtiMediaInteraction, QtiMember, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiOutcomeProcessing, QtiOutcomeProcessingProcessor, QtiPortableCustomInteraction, QtiPositionObjectInteraction, QtiPositionObjectStage, QtiPower, QtiPrintedVariable, QtiProduct, QtiPrompt, QtiRandom, QtiRandomInteger, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessing, QtiRound, QtiRoundTo, QtiRubricBlock, QtiRule, type QtiRuleBase, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiStringMatch, QtiStylesheet, QtiSubtract, QtiSum, QtiSumExpression, QtiTextEntryInteraction, QtiUploadInteraction, QtiVariable, qtiAndMixin, qtiSubtractMixin };
|
|
1522
|
+
export { type Orientation, QtiAnd, QtiAssessmentItem, QtiAssessmentStimulusRef, QtiAssessmentStimulusRefConnectedEvent, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoiceInteraction, QtiCompanionMaterialsInfo, QtiContainerSize, QtiContains, QtiContentBody, QtiCorrect, QtiCustomInteraction, QtiCustomOperator, QtiDefault, QtiDelete, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExtendedTextInteraction, QtiFeedbackBlock, QtiFeedbackInline, QtiFieldValue, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGcd, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiIndex, QtiInlineChoice, QtiInlineChoiceInteraction, QtiIsNull, QtiItemBody, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMatchInteraction, QtiMathOperator, QtiMediaInteraction, QtiMember, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiOutcomeProcessing, QtiOutcomeProcessingProcessor, QtiPortableCustomInteraction, QtiPositionObjectInteraction, QtiPositionObjectStage, QtiPower, QtiPrintedVariable, QtiProduct, QtiPrompt, QtiRandom, QtiRandomInteger, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessing, QtiRound, QtiRoundTo, QtiRubricBlock, QtiRule, type QtiRuleBase, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiStringMatch, QtiStylesheet, QtiSubtract, QtiSum, QtiSumExpression, QtiTextEntryInteraction, QtiUploadInteraction, QtiVariable, qtiAndMixin, qtiSubtractMixin };
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
QtiAnd,
|
|
3
3
|
QtiAssessmentItem,
|
|
4
4
|
QtiAssessmentStimulusRef,
|
|
5
|
+
QtiAssessmentStimulusRefConnectedEvent,
|
|
5
6
|
QtiAssociableHotspot,
|
|
6
7
|
QtiAssociateInteraction,
|
|
7
8
|
QtiBaseValue,
|
|
@@ -95,12 +96,12 @@ import {
|
|
|
95
96
|
QtiVariable,
|
|
96
97
|
qtiAndMixin,
|
|
97
98
|
qtiSubtractMixin
|
|
98
|
-
} from "../chunks/chunk-
|
|
99
|
+
} from "../chunks/chunk-TISKSGJE.js";
|
|
99
100
|
import {
|
|
100
101
|
QtiModalFeedback
|
|
101
102
|
} from "../chunks/chunk-YD7FVKDP.js";
|
|
102
103
|
import "../chunks/chunk-ELDMXTUQ.js";
|
|
103
|
-
import "../chunks/chunk-
|
|
104
|
+
import "../chunks/chunk-XBPO6E25.js";
|
|
104
105
|
import "../chunks/chunk-SV4K25ZI.js";
|
|
105
106
|
import "../chunks/chunk-GAAFN7QF.js";
|
|
106
107
|
import "../chunks/chunk-H6KHXSIO.js";
|
|
@@ -114,6 +115,7 @@ export {
|
|
|
114
115
|
QtiAnd,
|
|
115
116
|
QtiAssessmentItem,
|
|
116
117
|
QtiAssessmentStimulusRef,
|
|
118
|
+
QtiAssessmentStimulusRefConnectedEvent,
|
|
117
119
|
QtiAssociableHotspot,
|
|
118
120
|
QtiAssociateInteraction,
|
|
119
121
|
QtiBaseValue,
|
|
@@ -51,7 +51,7 @@ import type { QtiTemplateProcessing } from "src/lib/qti-components/qti-template-
|
|
|
51
51
|
import type { QtiFeedback } from "src/lib/qti-components/qti-feedback/qti-feedback.ts";
|
|
52
52
|
import type { ItemShowCorrectResponse } from "src/lib/qti-item/components/item-show-correct-response.ts";
|
|
53
53
|
import type { QtiAssessmentItem } from "src/lib/qti-components/qti-assessment-item/qti-assessment-item.ts";
|
|
54
|
-
import type { QtiAssessmentStimulusRef } from "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts";
|
|
54
|
+
import type { QtiAssessmentStimulusRefConnectedEvent, QtiAssessmentStimulusRef } from "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts";
|
|
55
55
|
import type { QtiCompanionMaterialsInfo } from "src/lib/qti-components/qti-companion-materials-info/qti-companion-materials-info.ts";
|
|
56
56
|
import type { QtiCustomOperator } from "src/lib/qti-components/qti-custom-operator/qti-custom-operator.ts";
|
|
57
57
|
import type { QtiFeedbackBlock } from "src/lib/qti-components/qti-feedback/qti-feedback-block/qti-feedback-block.ts";
|
|
@@ -610,9 +610,9 @@ export type QtiAssessmentItemProps = {
|
|
|
610
610
|
|
|
611
611
|
|
|
612
612
|
export type QtiAssessmentStimulusRefProps = {
|
|
613
|
-
/**
|
|
613
|
+
/** */
|
|
614
614
|
"identifier"?: QtiAssessmentStimulusRef['identifier'];
|
|
615
|
-
/**
|
|
615
|
+
/** */
|
|
616
616
|
"href"?: QtiAssessmentStimulusRef['href'];
|
|
617
617
|
|
|
618
618
|
|
|
@@ -1622,8 +1622,6 @@ export type QtiTestProps = {
|
|
|
1622
1622
|
/** */
|
|
1623
1623
|
"requestTimeout"?: QtiTest['requestTimeout'];
|
|
1624
1624
|
/** */
|
|
1625
|
-
"showLoadingIndicators"?: QtiTest['showLoadingIndicators'];
|
|
1626
|
-
/** */
|
|
1627
1625
|
"postLoadTransformCallback"?: QtiTest['postLoadTransformCallback'];
|
|
1628
1626
|
/** */
|
|
1629
1627
|
"postLoadTestTransformCallback"?: QtiTest['postLoadTestTransformCallback'];
|
|
@@ -1637,9 +1635,11 @@ export type QtiTestProps = {
|
|
|
1637
1635
|
/** */
|
|
1638
1636
|
"onqti-request-navigation"?: (e: CustomEvent<CustomEvent>) => void;
|
|
1639
1637
|
/** */
|
|
1640
|
-
"onqti-navigation-
|
|
1638
|
+
"onqti-navigation-loading-started"?: (e: CustomEvent<CustomEvent>) => void;
|
|
1641
1639
|
/** */
|
|
1642
|
-
"onqti-navigation-
|
|
1640
|
+
"onqti-navigation-loading-ended"?: (e: CustomEvent<CustomEvent>) => void;
|
|
1641
|
+
/** */
|
|
1642
|
+
"onqti-navigation-error"?: (e: CustomEvent<CustomEvent>) => void;
|
|
1643
1643
|
/** */
|
|
1644
1644
|
"onqti-test-loaded"?: (e: CustomEvent<CustomEvent>) => void;
|
|
1645
1645
|
/** */
|
|
@@ -2660,8 +2660,8 @@ export type QtiTestVariablesProps = {
|
|
|
2660
2660
|
*
|
|
2661
2661
|
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2662
2662
|
*
|
|
2663
|
-
* - `identifier`:
|
|
2664
|
-
* - `href`:
|
|
2663
|
+
* - `identifier`: undefined
|
|
2664
|
+
* - `href`: undefined
|
|
2665
2665
|
*
|
|
2666
2666
|
* ## Methods
|
|
2667
2667
|
*
|
|
@@ -4054,9 +4054,8 @@ export type QtiTestVariablesProps = {
|
|
|
4054
4054
|
* - `navigate`: undefined
|
|
4055
4055
|
* - `cache-transform`/`cacheTransform`: undefined
|
|
4056
4056
|
* - `requestTimeout`: undefined
|
|
4057
|
-
* - `
|
|
4058
|
-
* - `
|
|
4059
|
-
* - `postLoadTestTransformCallback`: undefined
|
|
4057
|
+
* - `postLoadTransformCallback`: undefined (property only)
|
|
4058
|
+
* - `postLoadTestTransformCallback`: undefined (property only)
|
|
4060
4059
|
* - `sessionContext`: undefined (property only)
|
|
4061
4060
|
* - `testContext`: undefined (property only)
|
|
4062
4061
|
*
|
|
@@ -4066,8 +4065,9 @@ export type QtiTestVariablesProps = {
|
|
|
4066
4065
|
*
|
|
4067
4066
|
* - `qti-test-connected`: undefined
|
|
4068
4067
|
* - `qti-request-navigation`: undefined
|
|
4068
|
+
* - `qti-navigation-loading-started`: undefined
|
|
4069
|
+
* - `qti-navigation-loading-ended`: undefined
|
|
4069
4070
|
* - `qti-navigation-error`: undefined
|
|
4070
|
-
* - `qti-navigation-status`: undefined
|
|
4071
4071
|
* - `qti-test-loaded`: undefined
|
|
4072
4072
|
* - `qti-test-context-updated`: undefined
|
|
4073
4073
|
*
|
|
@@ -4075,8 +4075,8 @@ export type QtiTestVariablesProps = {
|
|
|
4075
4075
|
*
|
|
4076
4076
|
* Methods that can be called to access component functionality.
|
|
4077
4077
|
*
|
|
4078
|
-
* - `navigateTo(type: 'item' | 'section', id?: string) => void`:
|
|
4079
|
-
* - `
|
|
4078
|
+
* - `navigateTo(type: 'item' | 'section', id?: string) => void`: Navigate to a specific item or section
|
|
4079
|
+
* - `getLoadingProgress() => void`: Get current loading progress for external consumption
|
|
4080
4080
|
* - `outcomeProcessing() => boolean`: undefined
|
|
4081
4081
|
* - `updateOutcomeVariable(identifier: string, value: string | string[] | undefined) => void`: undefined
|
|
4082
4082
|
* - `getOutcome(identifier: string) => Readonly<OutcomeVariable>`: undefined
|
package/dist/qti-item/index.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
ItemShowCorrectResponse,
|
|
4
4
|
PrintItemVariables,
|
|
5
5
|
QtiItem
|
|
6
|
-
} from "../chunks/chunk-
|
|
6
|
+
} from "../chunks/chunk-7567ZPN6.js";
|
|
7
7
|
import "../chunks/chunk-PT5ASWGQ.js";
|
|
8
8
|
import "../chunks/chunk-ELDMXTUQ.js";
|
|
9
|
-
import "../chunks/chunk-
|
|
9
|
+
import "../chunks/chunk-XBPO6E25.js";
|
|
10
10
|
import "../chunks/chunk-4OGJBG35.js";
|
|
11
11
|
import "../chunks/chunk-BHJSX3Q6.js";
|
|
12
12
|
import "../chunks/chunk-H2JE6IVU.js";
|
package/dist/qti-loader/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
qtiTransformItem,
|
|
3
3
|
qtiTransformManifest,
|
|
4
4
|
qtiTransformTest
|
|
5
|
-
} from "../chunks/chunk-
|
|
5
|
+
} from "../chunks/chunk-XBPO6E25.js";
|
|
6
6
|
import "../chunks/chunk-H2JE6IVU.js";
|
|
7
7
|
|
|
8
8
|
// src/lib/qti-loader/qti-loader.ts
|
|
@@ -22,7 +22,7 @@ var getManifestInfo = async (manifestURL) => {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
var getItemByUri = async (itemUri) => {
|
|
25
|
-
return qtiTransformItem().load(itemUri).
|
|
25
|
+
return qtiTransformItem().load(itemUri).then((api) => api.htmlDoc().firstElementChild);
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
28
|
getItemByUri,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-loader/qti-loader.ts"],"sourcesContent":["import { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\n\nimport type { QtiAssessmentItem } from '../qti-components/qti-assessment-item/qti-assessment-item';\n\nexport type ManifestInfo = {\n testIdentifier: string;\n testHTMLDoc: DocumentFragment;\n testURI: string;\n testURL: string;\n items: {\n identifier: string;\n href: string;\n category: string;\n }[];\n};\n\n// Utility function to ensure package URIs end with a '/'\n// const normalizeUri = (uri: string) => (uri.endsWith('/') ? uri : `${uri}/`);\n\n// Fetches assessment data from the manifest\nexport const getManifestInfo = async (manifestURL: string): Promise<ManifestInfo> => {\n const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf('/'));\n\n const test = await qtiTransformManifest()\n .load(`${manifestURL}`)\n .then(api => api.assessmentTest());\n\n const testHTMLDoc = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.htmlDoc());\n\n const items = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.items());\n\n const testURL = `${baseURI}/${test.href}`;\n const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf('/'))}`;\n\n return {\n testHTMLDoc,\n testURI,\n testURL,\n items,\n testIdentifier: test.identifier\n };\n};\n\n// Fetches a single item by URI\nexport const getItemByUri = async (itemUri: string): Promise<QtiAssessmentItem> => {\n return qtiTransformItem()\n .load(itemUri)\n .
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-loader/qti-loader.ts"],"sourcesContent":["import { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\n\nimport type { QtiAssessmentItem } from '../qti-components/qti-assessment-item/qti-assessment-item';\n\nexport type ManifestInfo = {\n testIdentifier: string;\n testHTMLDoc: DocumentFragment;\n testURI: string;\n testURL: string;\n items: {\n identifier: string;\n href: string;\n category: string;\n }[];\n};\n\n// Utility function to ensure package URIs end with a '/'\n// const normalizeUri = (uri: string) => (uri.endsWith('/') ? uri : `${uri}/`);\n\n// Fetches assessment data from the manifest\nexport const getManifestInfo = async (manifestURL: string): Promise<ManifestInfo> => {\n const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf('/'));\n\n const test = await qtiTransformManifest()\n .load(`${manifestURL}`)\n .then(api => api.assessmentTest());\n\n const testHTMLDoc = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.htmlDoc());\n\n const items = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.items());\n\n const testURL = `${baseURI}/${test.href}`;\n const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf('/'))}`;\n\n return {\n testHTMLDoc,\n testURI,\n testURL,\n items,\n testIdentifier: test.identifier\n };\n};\n\n// Fetches a single item by URI\nexport const getItemByUri = async (itemUri: string): Promise<QtiAssessmentItem> => {\n return qtiTransformItem()\n .load(itemUri)\n .then(api => api.htmlDoc().firstElementChild as QtiAssessmentItem);\n};\n"],"mappings":";;;;;;;;AAqBO,IAAM,kBAAkB,OAAO,gBAA+C;AACnF,QAAM,UAAU,YAAY,UAAU,GAAG,YAAY,YAAY,GAAG,CAAC;AAErE,QAAM,OAAO,MAAM,qBAAqB,EACrC,KAAK,GAAG,WAAW,EAAE,EACrB,KAAK,SAAO,IAAI,eAAe,CAAC;AAEnC,QAAM,cAAc,MAAM,iBAAiB,EACxC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,QAAQ,CAAC;AAE5B,QAAM,QAAQ,MAAM,iBAAiB,EAClC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,MAAM,CAAC;AAE1B,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,IAAI;AACvC,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,KAAK,UAAU,GAAG,KAAK,KAAK,YAAY,GAAG,CAAC,CAAC;AAEhF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,KAAK;AAAA,EACvB;AACF;AAGO,IAAM,eAAe,OAAO,YAAgD;AACjF,SAAO,iBAAiB,EACrB,KAAK,OAAO,EACZ,KAAK,SAAO,IAAI,QAAQ,EAAE,iBAAsC;AACrE;","names":[]}
|
package/dist/qti-test/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { e as VariableValue, O as OutcomeVariable, V as VariableDeclaration } fr
|
|
|
3
3
|
import * as lit from 'lit';
|
|
4
4
|
import { LitElement, PropertyValues, nothing } from 'lit';
|
|
5
5
|
import { SessionContext } from '../exports/session.context.js';
|
|
6
|
-
import { b as QtiAssessmentTest, I as IQtiTest } from '../qti-test-
|
|
7
|
-
export { Q as QtiAssessmentItemRef, a as QtiAssessmentSection, d as QtiTestFeedback, c as QtiTestPart } from '../qti-test-
|
|
6
|
+
import { b as QtiAssessmentTest, I as IQtiTest } from '../qti-test-Db7oNIWY.js';
|
|
7
|
+
export { Q as QtiAssessmentItemRef, a as QtiAssessmentSection, d as QtiTestFeedback, c as QtiTestPart } from '../qti-test-Db7oNIWY.js';
|
|
8
8
|
import { TestContext } from '../exports/test.context.js';
|
|
9
9
|
export { INITIAL_TEST_CONTEXT, testContext } from '../exports/test.context.js';
|
|
10
10
|
import { QtiContext } from '../exports/qti.context.js';
|
|
@@ -13,7 +13,7 @@ import { ConfigContext } from '../exports/config.context.js';
|
|
|
13
13
|
import { TemplateFunction } from '@heximal/templates';
|
|
14
14
|
import { ViewMode } from 'storybook/internal/types';
|
|
15
15
|
import '../exports/expression-result.js';
|
|
16
|
-
import '../qti-transform-test-
|
|
16
|
+
import '../qti-transform-test-Bz9A3hmD.js';
|
|
17
17
|
import '../qti-assessment-item-l-mN3teH.js';
|
|
18
18
|
import '../qti-modal-feedback-PKbhO-3w.js';
|
|
19
19
|
import '../exports/item.context.js';
|
package/dist/qti-test/index.js
CHANGED
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
TestStamp,
|
|
24
24
|
TestView,
|
|
25
25
|
TestViewToggle
|
|
26
|
-
} from "../chunks/chunk-
|
|
27
|
-
import "../chunks/chunk-PT5ASWGQ.js";
|
|
26
|
+
} from "../chunks/chunk-XEKFVRIO.js";
|
|
28
27
|
import "../chunks/chunk-YD7FVKDP.js";
|
|
28
|
+
import "../chunks/chunk-PT5ASWGQ.js";
|
|
29
29
|
import "../chunks/chunk-ELDMXTUQ.js";
|
|
30
|
-
import "../chunks/chunk-
|
|
30
|
+
import "../chunks/chunk-XBPO6E25.js";
|
|
31
31
|
import "../chunks/chunk-H6KHXSIO.js";
|
|
32
32
|
import "../chunks/chunk-C5RLRG3L.js";
|
|
33
33
|
import {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as transformItemApi, a as transformTestApi } from './qti-transform-test-
|
|
1
|
+
import { t as transformItemApi, a as transformTestApi } from './qti-transform-test-Bz9A3hmD.js';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
4
|
import { Q as QtiAssessmentItem } from './qti-assessment-item-l-mN3teH.js';
|
|
@@ -14,10 +14,7 @@ interface ModuleResolutionConfig {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
type transformItemApi = {
|
|
17
|
-
load: (uri: string) =>
|
|
18
|
-
promise: Promise<transformItemApi>;
|
|
19
|
-
request: XMLHttpRequest | null;
|
|
20
|
-
};
|
|
17
|
+
load: (uri: string, signal?: AbortSignal) => Promise<transformItemApi>;
|
|
21
18
|
parse: (xmlString: string) => transformItemApi;
|
|
22
19
|
path: (location: string) => transformItemApi;
|
|
23
20
|
fn: (fn: (xmlFragment: XMLDocument) => void) => transformItemApi;
|
|
@@ -47,7 +44,7 @@ declare const qtiTransformItem: (cache?: boolean) => transformItemApi;
|
|
|
47
44
|
* const xml = qtiTransformer.xml();
|
|
48
45
|
*/
|
|
49
46
|
type transformTestApi = {
|
|
50
|
-
load: (uri: string) => Promise<transformTestApi>;
|
|
47
|
+
load: (uri: string, signal?: AbortSignal) => Promise<transformTestApi>;
|
|
51
48
|
parse: (xmlString: string) => transformTestApi;
|
|
52
49
|
path: (location: string) => transformTestApi;
|
|
53
50
|
fn: (fn: (xmlFragment: XMLDocument) => void) => transformTestApi;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { M as ModuleResolutionConfig, q as qtiTransformItem, b as qtiTransformTest, t as transformItemApi, a as transformTestApi } from '../qti-transform-test-
|
|
1
|
+
export { M as ModuleResolutionConfig, q as qtiTransformItem, b as qtiTransformTest, t as transformItemApi, a as transformTestApi } from '../qti-transform-test-Bz9A3hmD.js';
|
|
2
2
|
|
|
3
3
|
declare const qtiTransformManifest: () => {
|
|
4
|
-
load: (uri: string) => Promise<{
|
|
5
|
-
load(uri: any): Promise</*elided*/ any>;
|
|
4
|
+
load: (uri: string, signal?: AbortSignal) => Promise<{
|
|
5
|
+
load(uri: any, signal: any): Promise</*elided*/ any>;
|
|
6
6
|
parse(xmlString: string): void;
|
|
7
7
|
assessmentTest(): {
|
|
8
8
|
href: string;
|
|
@@ -369,16 +369,8 @@
|
|
|
369
369
|
"name": "qti-assessment-stimulus-ref",
|
|
370
370
|
"description": "Represents a custom element for referencing an assessment stimulus.\n---\n\n\n### **Methods:**\n - **updateStimulusRef(stimulusRef: _Element_)** - Loads and appends the stimulus to the specified element.",
|
|
371
371
|
"attributes": [
|
|
372
|
-
{
|
|
373
|
-
|
|
374
|
-
"description": "The identifier of the stimulus.",
|
|
375
|
-
"values": []
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
"name": "href",
|
|
379
|
-
"description": "The href of the stimulus.",
|
|
380
|
-
"values": []
|
|
381
|
-
}
|
|
372
|
+
{ "name": "identifier", "values": [] },
|
|
373
|
+
{ "name": "href", "values": [] }
|
|
382
374
|
],
|
|
383
375
|
"references": []
|
|
384
376
|
},
|
|
@@ -966,23 +958,14 @@
|
|
|
966
958
|
},
|
|
967
959
|
{
|
|
968
960
|
"name": "qti-test",
|
|
969
|
-
"description": "`<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n\nThis component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n\n### Example Usage\n\nMinimal example including navigation:\n\n```html\n<qti-test>\n <test-navigation>\n <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n <nav class=\"flex\">\n <test-prev></test-prev>\n <test-next></test-next>\n </nav>\n </test-navigation>\n</qti-test>\n```\n\nUse the following file structure\nA qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n\n```plaintext\nRoot/\n├── index.html\n└── /assets/api/examples/\n ├── assessmenttest.xml\n └── imsmanifest.xml\n\n```\n\n### Test components\n\nUse test components inside the qti-test component for added functionality.\n### Test next\n`<test-next> | TestNext`\n\n### Test prev\n\n`<test-prev> | TestPrev`\n### Test components\n\nYou can use normal class names to style the elements.\nAnd you can use the `test-prev` and `test-next` elements to navigate through the test.\n---\n\n\n### **Events:**\n - **qti-test-connected**\n- **qti-request-navigation**\n- **qti-navigation-
|
|
961
|
+
"description": "`<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n\nThis component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n\n### Example Usage\n\nMinimal example including navigation:\n\n```html\n<qti-test>\n <test-navigation>\n <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n <nav class=\"flex\">\n <test-prev></test-prev>\n <test-next></test-next>\n </nav>\n </test-navigation>\n</qti-test>\n```\n\nUse the following file structure\nA qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n\n```plaintext\nRoot/\n├── index.html\n└── /assets/api/examples/\n ├── assessmenttest.xml\n └── imsmanifest.xml\n\n```\n\n### Test components\n\nUse test components inside the qti-test component for added functionality.\n### Test next\n`<test-next> | TestNext`\n\n### Test prev\n\n`<test-prev> | TestPrev`\n### Test components\n\nYou can use normal class names to style the elements.\nAnd you can use the `test-prev` and `test-next` elements to navigate through the test.\n---\n\n\n### **Events:**\n - **qti-test-connected**\n- **qti-request-navigation**\n- **qti-navigation-loading-started**\n- **qti-navigation-loading-ended**\n- **qti-navigation-error**\n- **qti-test-loaded**\n- **qti-test-context-updated**\n\n### **Methods:**\n - **navigateTo(type: _'item' | 'section'_, id: _string_): _void_** - Navigate to a specific item or section\n- **getLoadingProgress()** - Get current loading progress for external consumption",
|
|
970
962
|
"attributes": [
|
|
971
963
|
{
|
|
972
964
|
"name": "navigate",
|
|
973
965
|
"values": [{ "name": "item" }, { "name": "section" }]
|
|
974
966
|
},
|
|
975
967
|
{ "name": "cache-transform", "values": [] },
|
|
976
|
-
{ "name": "requestTimeout", "values": [] }
|
|
977
|
-
{ "name": "showLoadingIndicators", "values": [] },
|
|
978
|
-
{
|
|
979
|
-
"name": "postLoadTransformCallback",
|
|
980
|
-
"values": [{ "name": "PostLoadTransformCallback" }]
|
|
981
|
-
},
|
|
982
|
-
{
|
|
983
|
-
"name": "postLoadTestTransformCallback",
|
|
984
|
-
"values": [{ "name": "PostLoadTestTransformCallback" }]
|
|
985
|
-
}
|
|
968
|
+
{ "name": "requestTimeout", "values": [] }
|
|
986
969
|
],
|
|
987
970
|
"references": []
|
|
988
971
|
},
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=22.0.0"
|
|
23
23
|
},
|
|
24
|
-
"version": "7.
|
|
24
|
+
"version": "7.14.1",
|
|
25
25
|
"type": "module",
|
|
26
26
|
"main": "./dist/index.js",
|
|
27
27
|
"types": "./dist/index.d.ts",
|
|
@@ -147,6 +147,10 @@
|
|
|
147
147
|
"husky": "^9.1.7",
|
|
148
148
|
"lit": "^3.3.0",
|
|
149
149
|
"madge": "^8.0.0",
|
|
150
|
+
"mdx-mermaid": "^2.0.3",
|
|
151
|
+
"mermaid": "^11.12.0",
|
|
152
|
+
"msw": "^2.11.5",
|
|
153
|
+
"msw-storybook-addon": "^2.0.5",
|
|
150
154
|
"nodemon": "^3.1.10",
|
|
151
155
|
"npm-run-all": "^4.1.5",
|
|
152
156
|
"path-browserify": "^1.0.1",
|
|
@@ -185,5 +189,10 @@
|
|
|
185
189
|
"homepage": "https://github.com/Citolab/qti-components#readme",
|
|
186
190
|
"overrides": {
|
|
187
191
|
"storybook": "$storybook"
|
|
192
|
+
},
|
|
193
|
+
"msw": {
|
|
194
|
+
"workerDirectory": [
|
|
195
|
+
"public"
|
|
196
|
+
]
|
|
188
197
|
}
|
|
189
198
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-item/components/item-container.ts","../../src/lib/qti-item/components/print-item-variables.ts","../../src/lib/qti-item/components/item-show-correct-response.ts","../../src/lib/qti-item/components/styles.ts","../../src/lib/qti-item/core/qti-item.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\n\nimport { watch } from '../../decorators/watch';\nimport itemCss from '../../../item.css?inline';\nimport { qtiTransformItem } from '../../qti-transformers';\n\n/**\n * `<item-container>` is a custom element designed for hosting the qti-assessment-item.\n * The `qti-assessment-item` will be placed inside the shadow DOM of this element.\n * The element loads the item from the provided URL and renders it inside the shadow DOM.\n *\n * ### Styling\n * Add a class to the element for styling.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n@customElement('item-container')\nexport class ItemContainer extends LitElement {\n /** URL of the item to load */\n @property({ type: String, attribute: 'item-url' })\n itemURL: string = null;\n\n /** A parsed HTML document */\n @state()\n itemDoc: DocumentFragment = null;\n\n /** The raw XML string */\n @state()\n itemXML: string = null;\n\n /** Template content if provided */\n private templateContent = null;\n\n @watch('itemURL', { waitUntilFirstUpdate: true })\n protected async handleItemURLChange() {\n if (!this.itemURL) return;\n try {\n const { promise: api } = await qtiTransformItem().load(this.itemURL);\n this.itemDoc = (await api).htmlDoc();\n } catch (error) {\n console.error('Error loading or parsing XML:', error);\n }\n }\n\n @watch('itemXML', { waitUntilFirstUpdate: true })\n protected handleItemXMLChange() {\n if (!this.itemXML) return;\n try {\n this.itemDoc = qtiTransformItem().parse(this.itemXML).htmlDoc();\n } catch (error) {\n console.error('Error parsing XML:', error);\n }\n }\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.initializeTemplateContent();\n this.applyStyles();\n if (this.itemURL) {\n this.handleItemURLChange();\n }\n if (this.itemXML) {\n this.handleItemXMLChange();\n }\n }\n\n private initializeTemplateContent() {\n const template = this.querySelector('template') as HTMLTemplateElement;\n this.templateContent = template ? template.content : html``;\n }\n\n private applyStyles() {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n render() {\n return html`\n ${this.templateContent}\n <slot></slot>\n ${until(this.itemDoc, html`<span>Loading...</span>`)}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-container': ItemContainer;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { computedItemContext } from '../../exports/computed-item.context';\n\nimport type { ResponseVariable } from '../../exports/variables';\nimport type { ComputedItemContext } from '../../exports/computed-item.context';\n\n@customElement('print-item-variables')\nexport class PrintItemVariables extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n protected computedContext?: ComputedItemContext;\n\n static styles = css`\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n `;\n\n render() {\n const activeItem = this.computedContext;\n\n if (!activeItem || !activeItem.variables) return html``;\n\n const responseVariables: ResponseVariable[] = activeItem.variables.filter(v => v.type === 'response');\n const outcomeVariables = activeItem.variables.filter(v => v.type === 'outcome');\n\n const renderTable = (variables: ResponseVariable[], title: string) => html`\n <h3>${title}</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ${variables.map(v => {\n const correctResponse = v.correctResponse\n ? Array.isArray(v.correctResponse)\n ? v.correctResponse.join(', ')\n : v.correctResponse\n : '';\n\n const mapEntries = v.mapping?.mapEntries?.map(m => `${m.mapKey}=${m.mappedValue}pt`).join(', ') || '';\n\n const areaMapEntries =\n v.areaMapping?.areaMapEntries?.map(m => `${m.shape}(${m.coords})=${m.mappedValue}pt`).join(', ') || '';\n\n return html`\n <tr>\n <td>${v.identifier}</td>\n <td>${Array.isArray(v.value) ? v.value.join(', ') : v.value}</td>\n <td>${v.cardinality}</td>\n <td>${v.baseType}</td>\n <td>${correctResponse || mapEntries || areaMapEntries}</td>\n </tr>\n `;\n })}\n </tbody>\n </table>\n `;\n\n return html`\n ${renderTable(responseVariables, 'Response Variables')} ${renderTable(outcomeVariables, 'Outcome Variables')}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'print-item-variables': PrintItemVariables;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport * as styles from './styles';\nimport { computedItemContext } from '../../exports/computed-item.context';\n\nimport type { ComputedItemContext } from '../../exports/computed-item.context';\n\n@customElement('item-show-correct-response')\nexport class ItemShowCorrectResponse extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n public computedContext?: ComputedItemContext;\n\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false; // Reflects to `disabled` attribute\n @property({ type: String }) showCorrectText = 'Show correct response';\n @property({ type: String }) hideCorrectText = 'Hide correct response';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n private _hasCorrectResponse = false; // correct response is removed on certain point\n private _previousActiveItem = ''; // Store previous active item reference\n\n updated() {\n if (!this._hasCorrectResponse || this._previousActiveItem !== this.computedContext?.identifier) {\n this._previousActiveItem = this.computedContext?.identifier;\n const containsCorrectResponse = !!this.computedContext?.variables.some(v => v['correctResponse']);\n const containsMapping = !!this.computedContext?.variables.some(v => {\n return v['mapping']?.mapEntries?.length > 0 || v['areaMapping']?.areaMapEntries?.length > 0;\n });\n this._hasCorrectResponse = containsCorrectResponse || containsMapping;\n }\n this.disabled = !this._hasCorrectResponse;\n }\n\n private _toggleState() {\n if (this.disabled) return; // Prevent toggle if disabled\n\n this.dispatchEvent(\n new CustomEvent('item-show-correct-response', {\n detail: !this.shown,\n bubbles: true\n })\n );\n }\n\n private _getDisplayedText(): string {\n return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;\n }\n\n render() {\n return html` <div @click=\"${this._toggleState}\">${this._getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-show-correct-response': ItemShowCorrectResponse;\n }\n}\n","// /* eslint-disable lit-plugin(no-invalid-css) */\nimport { css } from 'lit';\n\nexport const form = css`\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n`;\n\nexport const btn = css`\n background-color: lightgray;\n ${form};\n`;\n\nexport const dis = css`\n cursor: not-allowed;\n opacity: 0.8;\n`;\n\nexport const ind = css`\n ${form};\n border: 1px solid gray;\n`;\n","import { provide } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\n\nimport { computedItemContext } from '../../exports/computed-item.context';\nimport { configContext } from '../../exports/config.context.ts';\n\nimport type { QtiAssessmentItem } from '../../qti-components/qti-assessment-item/qti-assessment-item.ts';\nimport type { ConfigContext, CorrectResponseMode } from '../../exports/config.context.ts';\nimport type { ItemContext } from '../../exports/item.context';\nimport type { VariableDeclaration } from '../../exports/variables';\nimport type { ComputedItemContext } from '../../exports/computed-item.context';\n\n/**\n * `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.\n * It can also host some functionalities to interact with the item like scoring, showing feedback, etc.\n * Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.\n * See `<item-container>` for more details.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n@customElement('qti-item')\nexport class QtiItem extends LitElement {\n @state()\n @provide({ context: computedItemContext })\n public computedContext: ComputedItemContext;\n private _qtiAssessmentItem?: QtiAssessmentItem;\n\n @state()\n @provide({ context: configContext })\n public configContext: ConfigContext = {};\n\n // Store event handlers as instance properties\n private _onItemContextChanged = this._handleItemContextChanged.bind(this);\n private _onAssessmentItemConnected = this._handleAssessmentItemConnected.bind(this);\n\n private _onHandleShowCorrectResponse = this._handleShowCorrectResponse.bind(this);\n private _onHandleShowCandidateCorrection = this._handleShowCandidateCorrection.bind(this);\n private _onHandleSwitchCorrectResponseMode = this._handleSwitchCorrectResponseMode.bind(this);\n\n constructor() {\n super();\n this.addEventListener('qti-item-context-updated', this._onItemContextChanged);\n this.addEventListener('qti-assessment-item-connected', this._onAssessmentItemConnected);\n this.addEventListener('item-show-correct-response', this._onHandleShowCorrectResponse);\n this.addEventListener('item-show-candidate-correction', this._onHandleShowCandidateCorrection);\n this.addEventListener('item-switch-correct-response-mode', this._onHandleSwitchCorrectResponseMode);\n }\n\n private _handleItemContextChanged(e: CustomEvent<{ itemContext: ItemContext }>) {\n this._updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail?.itemContext?.variables || []);\n }\n\n private _handleAssessmentItemConnected(e: CustomEvent<QtiAssessmentItem>) {\n const fullVariables = (e.detail as any)._context.variables;\n this._qtiAssessmentItem = e.detail;\n this.computedContext =\n this.computedContext?.identifier === this._qtiAssessmentItem.identifier\n ? { ...this.computedContext, title: this._qtiAssessmentItem.title }\n : ({\n identifier: this._qtiAssessmentItem.identifier,\n title: this._qtiAssessmentItem.title,\n adaptive: this._qtiAssessmentItem.getAttribute('adaptive')?.toLowerCase() === 'true' || false,\n variables: fullVariables,\n correctResponseMode: 'internal'\n } as ComputedItemContext);\n this._updateItemVariablesInTestContext(this._qtiAssessmentItem.identifier, fullVariables || []);\n }\n\n private _handleShowCorrectResponse(e: CustomEvent<boolean>) {\n if (this._qtiAssessmentItem) {\n this._qtiAssessmentItem.showCorrectResponse(e.detail);\n }\n }\n\n private _handleShowCandidateCorrection(e: CustomEvent<boolean>) {\n if (this._qtiAssessmentItem) {\n this._qtiAssessmentItem.showCandidateCorrection(e.detail);\n }\n }\n\n private _handleSwitchCorrectResponseMode(e: CustomEvent<CorrectResponseMode>) {\n // Switch off the correct response first\n this._handleShowCorrectResponse(new CustomEvent('item-show-correct-response', { detail: false, bubbles: true }));\n\n this.configContext = {\n ...this.configContext,\n correctResponseMode: e.detail\n };\n }\n\n private _updateItemVariablesInTestContext(\n identifier: string,\n variables: readonly VariableDeclaration<string | string[] | null>[]\n ): void {\n const rawscore = variables?.find(vr => vr.identifier == 'SCORE')?.value;\n const score = parseFloat(rawscore?.toString());\n const completionStatus = variables?.find(v => v.identifier === 'completionStatus')?.value;\n\n const correct = score !== undefined && !isNaN(score) && score > 0;\n const incorrect = score !== undefined && !isNaN(score) && score <= 0;\n const completed = completionStatus === 'completed';\n this.computedContext = {\n ...this.computedContext,\n identifier,\n correct,\n incorrect,\n completed,\n variables\n };\n }\n\n render() {\n return html`<slot></slot>`;\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('qti-item-context-changed', this._onItemContextChanged);\n this.removeEventListener('qti-assessment-item-connected', this._onAssessmentItemConnected);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item': QtiItem;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,YAAY;AACjC,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,aAAa;AAqBf,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC;AAAA;AAGL,mBAAkB;AAIlB,mBAA4B;AAI5B,mBAAkB;AAGlB;AAAA,SAAQ,kBAAkB;AAAA;AAAA,EAG1B,MAAgB,sBAAsB;AACpC,QAAI,CAAC,KAAK,QAAS;AACnB,QAAI;AACF,YAAM,EAAE,SAAS,IAAI,IAAI,MAAM,iBAAiB,EAAE,KAAK,KAAK,OAAO;AACnE,WAAK,WAAW,MAAM,KAAK,QAAQ;AAAA,IACrC,SAAS,OAAO;AACd,cAAQ,MAAM,iCAAiC,KAAK;AAAA,IACtD;AAAA,EACF;AAAA,EAGU,sBAAsB;AAC9B,QAAI,CAAC,KAAK,QAAS;AACnB,QAAI;AACF,WAAK,UAAU,iBAAiB,EAAE,MAAM,KAAK,OAAO,EAAE,QAAQ;AAAA,IAChE,SAAS,OAAO;AACd,cAAQ,MAAM,sBAAsB,KAAK;AAAA,IAC3C;AAAA,EACF;AAAA,EAEA,MAAM,oBAAmC;AACvC,UAAM,kBAAkB;AACxB,SAAK,0BAA0B;AAC/B,SAAK,YAAY;AACjB,QAAI,KAAK,SAAS;AAChB,WAAK,oBAAoB;AAAA,IAC3B;AACA,QAAI,KAAK,SAAS;AAChB,WAAK,oBAAoB;AAAA,IAC3B;AAAA,EACF;AAAA,EAEQ,4BAA4B;AAClC,UAA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U,UAAa,CAAC,MAAM,KAAK,KAAK,QAAQ;AAChE,UAAM,YAAY,UAAU,UAAa,CAAC,MAAM,KAAK,KAAK,SAAS;AACnE,UAAM,YAAY,qBAAqB;AACvC,SAAK,kBAAkB;AAAA,MACrB,GAAG,KAAK;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAOC;AAAA,EACT;AAAA,EAES,uBAAuB;AAC9B,UAAM,qBAAqB;AAC3B,SAAK,oBAAoB,4BAA4B,KAAK,qBAAqB;AAC/E,SAAK,oBAAoB,iCAAiC,KAAK,0BAA0B;AAAA,EAC3F;AACF;AAhGS;AAAA,EAFNC,OAAM;AAAA,EACN,QAAQ,EAAE,SAAS,oBAAoB,CAAC;AAAA,GAF9B,QAGJ;AAKA;AAAA,EAFNA,OAAM;AAAA,EACN,QAAQ,EAAE,SAAS,cAAc,CAAC;AAAA,GAPxB,QAQJ;AARI,UAAN;AAAA,EADNC,eAAc,UAAU;AAAA,GACZ;","names":["html","LitElement","customElement","LitElement","html","customElement","css","html","LitElement","customElement","property","consume","css","LitElement","html","css","consume","property","customElement","html","LitElement","customElement","state","LitElement","html","state","customElement"]}
|