@qti-components/test 1.2.0
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/LICENSE.md +674 -0
- package/dist/components/index.d.ts +24 -0
- package/dist/components/index.js +26 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.d.ts +22 -0
- package/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js +78 -0
- package/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js.map +1 -0
- package/dist/components/qti-assessment-section/qti-assessment-section.d.ts +20 -0
- package/dist/components/qti-assessment-section/qti-assessment-section.js +64 -0
- package/dist/components/qti-assessment-section/qti-assessment-section.js.map +1 -0
- package/dist/components/qti-assessment-test/qti-assessment-test.d.ts +16 -0
- package/dist/components/qti-assessment-test/qti-assessment-test.js +47 -0
- package/dist/components/qti-assessment-test/qti-assessment-test.js.map +1 -0
- package/dist/components/qti-outcome-processing/qti-outcome-processing.d.ts +15 -0
- package/dist/components/qti-outcome-processing/qti-outcome-processing.js +37 -0
- package/dist/components/qti-outcome-processing/qti-outcome-processing.js.map +1 -0
- package/dist/components/qti-test/qti-test.d.ts +69 -0
- package/dist/components/qti-test/qti-test.js +80 -0
- package/dist/components/qti-test/qti-test.js.map +1 -0
- package/dist/components/qti-test-feedback/qti-test-feedback.d.ts +10 -0
- package/dist/components/qti-test-feedback/qti-test-feedback.js +24 -0
- package/dist/components/qti-test-feedback/qti-test-feedback.js.map +1 -0
- package/dist/components/qti-test-part/qti-test-part.d.ts +17 -0
- package/dist/components/qti-test-part/qti-test-part.js +58 -0
- package/dist/components/qti-test-part/qti-test-part.js.map +1 -0
- package/dist/components/qti-test-variables/qti-test-variables.d.ts +25 -0
- package/dist/components/qti-test-variables/qti-test-variables.js +79 -0
- package/dist/components/qti-test-variables/qti-test-variables.js.map +1 -0
- package/dist/components/styles.d.ts +4 -0
- package/dist/components/styles.js +23 -0
- package/dist/components/styles.js.map +1 -0
- package/dist/components/test-check-item/test-check-item.d.ts +11 -0
- package/dist/components/test-check-item/test-check-item.js +43 -0
- package/dist/components/test-check-item/test-check-item.js.map +1 -0
- package/dist/components/test-container/test-container.d.ts +33 -0
- package/dist/components/test-container/test-container.js +122 -0
- package/dist/components/test-container/test-container.js.map +1 -0
- package/dist/components/test-end-attempt/test-end-attempt.d.ts +11 -0
- package/dist/components/test-end-attempt/test-end-attempt.js +31 -0
- package/dist/components/test-end-attempt/test-end-attempt.js.map +1 -0
- package/dist/components/test-item-link/test-item-link.d.ts +13 -0
- package/dist/components/test-item-link/test-item-link.js +45 -0
- package/dist/components/test-item-link/test-item-link.js.map +1 -0
- package/dist/components/test-navigation/test-navigation.d.ts +35 -0
- package/dist/components/test-navigation/test-navigation.js +401 -0
- package/dist/components/test-navigation/test-navigation.js.map +1 -0
- package/dist/components/test-next/test-next.d.ts +33 -0
- package/dist/components/test-next/test-next.js +96 -0
- package/dist/components/test-next/test-next.js.map +1 -0
- package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.d.ts +19 -0
- package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js +44 -0
- package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js.map +1 -0
- package/dist/components/test-prev/test-prev.d.ts +31 -0
- package/dist/components/test-prev/test-prev.js +87 -0
- package/dist/components/test-prev/test-prev.js.map +1 -0
- package/dist/components/test-print-context/test-print-context.d.ts +11 -0
- package/dist/components/test-print-context/test-print-context.js +24 -0
- package/dist/components/test-print-context/test-print-context.js.map +1 -0
- package/dist/components/test-print-item-variables/test-print-item-variables.d.ts +12 -0
- package/dist/components/test-print-item-variables/test-print-item-variables.js +88 -0
- package/dist/components/test-print-item-variables/test-print-item-variables.js.map +1 -0
- package/dist/components/test-scoring-buttons/test-scoring-buttons.d.ts +19 -0
- package/dist/components/test-scoring-buttons/test-scoring-buttons.js +101 -0
- package/dist/components/test-scoring-buttons/test-scoring-buttons.js.map +1 -0
- package/dist/components/test-scoring-feedback/test-scoring-feedback.d.ts +13 -0
- package/dist/components/test-scoring-feedback/test-scoring-feedback.js +58 -0
- package/dist/components/test-scoring-feedback/test-scoring-feedback.js.map +1 -0
- package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.d.ts +19 -0
- package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js +44 -0
- package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js.map +1 -0
- package/dist/components/test-section-link/test-section-link.d.ts +13 -0
- package/dist/components/test-section-link/test-section-link.js +45 -0
- package/dist/components/test-section-link/test-section-link.js.map +1 -0
- package/dist/components/test-show-correct-response/test-show-correct-response.d.ts +22 -0
- package/dist/components/test-show-correct-response/test-show-correct-response.js +91 -0
- package/dist/components/test-show-correct-response/test-show-correct-response.js.map +1 -0
- package/dist/components/test-stamp/test-stamp.d.ts +28 -0
- package/dist/components/test-stamp/test-stamp.js +104 -0
- package/dist/components/test-stamp/test-stamp.js.map +1 -0
- package/dist/components/test-view-toggle/test-view-toggle.d.ts +16 -0
- package/dist/components/test-view-toggle/test-view-toggle.js +57 -0
- package/dist/components/test-view-toggle/test-view-toggle.js.map +1 -0
- package/dist/components/test-view-toggle/test-view.d.ts +20 -0
- package/dist/components/test-view-toggle/test-view.js +81 -0
- package/dist/components/test-view-toggle/test-view.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/mixins/index.d.ts +3 -0
- package/dist/mixins/index.js +4 -0
- package/dist/mixins/index.js.map +1 -0
- package/dist/mixins/test-base.d.ts +17 -0
- package/dist/mixins/test-base.js +153 -0
- package/dist/mixins/test-base.js.map +1 -0
- package/dist/mixins/test-navigation.mixin.d.ts +26 -0
- package/dist/mixins/test-navigation.mixin.js +502 -0
- package/dist/mixins/test-navigation.mixin.js.map +1 -0
- package/dist/mixins/test-processing.mixin.d.ts +11 -0
- package/dist/mixins/test-processing.mixin.js +55 -0
- package/dist/mixins/test-processing.mixin.js.map +1 -0
- package/dist/mixins/test-view.mixin.d.ts +6 -0
- package/dist/mixins/test-view.mixin.js +45 -0
- package/dist/mixins/test-view.mixin.js.map +1 -0
- package/dist/types/iqti-test.d.ts +28 -0
- package/dist/types/iqti-test.js +2 -0
- package/dist/types/iqti-test.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-processing.mixin.js","sourceRoot":"","sources":["../../src/mixins/test-processing.mixin.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAA2C,UAAa,EAAE,EAAE;IAC7F,MAAe,qBAAsB,SAAQ,UAAU;QACrD,YAAY,GAAG,IAAW;YACxB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YACf,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,EAAE,CAAC,CAAiC,EAAE,EAAE;gBACnF,IAAI,CAAC,WAAW,GAAG;oBACjB,GAAG,IAAI,CAAC,WAAW;oBACnB,oBAAoB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,oBAAoB,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;iBAC5F,CAAC;gBACF,CAAC,CAAC,eAAe,EAAE,CAAC;YACtB,CAAC,CAAC,CAAC;YACH,iDAAiD;YACjD,IAAI,CAAC,gBAAgB,CACnB,uBAAuB,EACvB,CAAC,CAAuE,EAAE,EAAE;gBAC1E,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;gBAC9C,IAAI,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;gBACrD,CAAC,CAAC,eAAe,EAAE,CAAC;YACtB,CAAC,CACF,CAAC;QACJ,CAAC;QAED,iBAAiB;YACf,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,wBAAwB,CAAoC,CAAC;YACzG,IAAI,CAAC,gBAAgB;gBAAE,OAAO,KAAK,CAAC;YACpC,gBAAgB,EAAE,OAAO,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,mHAAmH;QAE5G,qBAAqB,CAAC,UAAkB,EAAE,KAAoC;YACnF,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YACpD,IAAI,CAAC,eAAe,EAAE,CAAC;gBACrB,OAAO,CAAC,IAAI,CAAC,uCAAuC,UAAU,uBAAuB,CAAC,CAAC;gBACvF,OAAO;YACT,CAAC;YACD,IAAI,CAAC,WAAW,GAAG;gBACjB,GAAG,IAAI,CAAC,WAAW;gBACnB,oBAAoB,EAAE,IAAI,CAAC,WAAW,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE;oBACnE,IAAI,CAAC,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;wBAChC,OAAO,CAAC,CAAC;oBACX,CAAC;oBACD,OAAO;wBACL,GAAG,CAAC;wBACJ,KAAK,EAAE,eAAe,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAe,CAAC;qBACxF,CAAC;gBACJ,CAAC,CAAC;aACH,CAAC;QACJ,CAAC;QAEM,UAAU,CAAC,UAAkB;YAClC,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAoB,CAAC;QACzD,CAAC;QACM,WAAW,CAAC,UAAkB;YACnC,OAAO,IAAI,CAAC,WAAW,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,IAAI,IAAI,CAAC;QAC/F,CAAC;KAEF;IAED,OAAO,qBAAiE,CAAC;AAC3E,CAAC,CAAC","sourcesContent":["import type { QtiOutcomeProcessing } from '../components/qti-outcome-processing/qti-outcome-processing';\nimport type { OutcomeVariable, VariableDeclaration } from '@qti-components/base';\nimport type { TestBaseInterface } from './test-base';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestProcessingInterface {\n updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void;\n getOutcome(identifier: string): Readonly<OutcomeVariable>;\n getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;\n outcomeProcessing(): boolean;\n}\nexport const TestProcessingMixin = <T extends Constructor<TestBaseInterface>>(superClass: T) => {\n abstract class TestProcessingElement extends superClass implements TestProcessingInterface {\n constructor(...args: any[]) {\n super(...args);\n this.addEventListener('qti-register-variable', (e: CustomEvent<{ variable: any }>) => {\n this.testContext = {\n ...this.testContext,\n testOutcomeVariables: [...(this.testContext.testOutcomeVariables || []), e.detail.variable]\n };\n e.stopPropagation();\n });\n // wordt aangeroepen vanuit de processingtemplate\n this.addEventListener(\n 'qti-set-outcome-value',\n (e: CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>) => {\n const { outcomeIdentifier, value } = e.detail;\n this.updateOutcomeVariable(outcomeIdentifier, value);\n e.stopPropagation();\n }\n );\n }\n\n outcomeProcessing(): boolean {\n const outcomeProcessor = this.querySelector('qti-outcome-processing') as unknown as QtiOutcomeProcessing;\n if (!outcomeProcessor) return false;\n outcomeProcessor?.process();\n return true;\n }\n\n /* --------------------------- ENABLED WHEN UNIT TESTING OUTCOME PROCESSING ------------------------------------ */\n\n public updateOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n const outcomeVariable = this.getOutcome(identifier);\n if (!outcomeVariable) {\n console.warn(`Can not set qti-outcome-identifier: ${identifier}, it is not available`);\n return;\n }\n this.testContext = {\n ...this.testContext,\n testOutcomeVariables: this.testContext.testOutcomeVariables?.map(v => {\n if (v.identifier !== identifier) {\n return v;\n }\n return {\n ...v,\n value: outcomeVariable.cardinality === 'single' ? value : [...v.value, value as string]\n };\n })\n };\n }\n\n public getOutcome(identifier: string): Readonly<OutcomeVariable> {\n return this.getVariable(identifier) as OutcomeVariable;\n }\n public getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>> {\n return this.testContext.testOutcomeVariables?.find(v => v.identifier === identifier) || null;\n }\n /* --------------------------- ENABLED WHEN UNIT TESTING OUTCOME PROCESSING ------------------------------------ */\n }\n\n return TestProcessingElement as Constructor<TestProcessingInterface> & T;\n};\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TestBaseInterface } from './test-base';
|
|
2
|
+
type Constructor<T = {}> = abstract new (...args: any[]) => T;
|
|
3
|
+
declare class TestViewInterface {
|
|
4
|
+
}
|
|
5
|
+
export declare const TestViewMixin: <T extends Constructor<TestBaseInterface>>(superClass: T) => Constructor<TestViewInterface> & T;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const TestViewMixin = (superClass) => {
|
|
2
|
+
class TestViewClass extends superClass {
|
|
3
|
+
constructor(...args) {
|
|
4
|
+
super(...args);
|
|
5
|
+
this.sessionContext = { ...this.sessionContext, view: 'candidate' };
|
|
6
|
+
this.addEventListener('on-test-switch-view', (e) => {
|
|
7
|
+
this.sessionContext = { ...this.sessionContext, view: e.detail };
|
|
8
|
+
this._updateElementView();
|
|
9
|
+
});
|
|
10
|
+
this.addEventListener('qti-assessment-test-connected', () => {
|
|
11
|
+
this._updateElementView();
|
|
12
|
+
});
|
|
13
|
+
this.addEventListener('qti-assessment-item-connected', (e) => {
|
|
14
|
+
this._updateElementView();
|
|
15
|
+
this._setCorrectResponseVisibility(e.detail);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
willUpdate(changedProperties) {
|
|
19
|
+
super.willUpdate(changedProperties);
|
|
20
|
+
if (changedProperties.has('sessionContext')) {
|
|
21
|
+
this._updateElementView();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// Method to handle view updates for elements based on the current context view
|
|
25
|
+
_updateElementView() {
|
|
26
|
+
if (this._testElement) {
|
|
27
|
+
const viewElements = Array.from(this._testElement.querySelectorAll('[view]'));
|
|
28
|
+
viewElements.forEach((element) => {
|
|
29
|
+
element.classList.toggle('show', element.getAttribute('view') === this.sessionContext.view);
|
|
30
|
+
});
|
|
31
|
+
const assessmentItemRef = this._testElement.querySelector(`qti-assessment-item-ref[identifier="${this.sessionContext.navItemRefId}"]`);
|
|
32
|
+
const assessmentItem = assessmentItemRef?.assessmentItem;
|
|
33
|
+
if (assessmentItem) {
|
|
34
|
+
assessmentItem.showCorrectResponse(this.sessionContext.view === 'scorer');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Event handler for connected QTI assessment items
|
|
39
|
+
_setCorrectResponseVisibility(assessmentItem) {
|
|
40
|
+
assessmentItem.showCorrectResponse(this.sessionContext.view === 'scorer');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return TestViewClass;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=test-view.mixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-view.mixin.js","sourceRoot":"","sources":["../../src/mixins/test-view.mixin.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,aAAa,GAAG,CAA2C,UAAa,EAAE,EAAE;IACvF,MAAe,aAAc,SAAQ,UAAU;QAC7C,YAAY,GAAG,IAAW;YACxB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YACf,IAAI,CAAC,cAAc,GAAG,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;YAEpE,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,CAAC,CAAoB,EAAE,EAAE;gBACpE,IAAI,CAAC,cAAc,GAAG,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;gBACjE,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5B,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,gBAAgB,CAAC,+BAA+B,EAAE,GAAG,EAAE;gBAC1D,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5B,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,gBAAgB,CAAC,+BAA+B,EAAE,CAAC,CAAc,EAAE,EAAE;gBACxE,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC1B,IAAI,CAAC,6BAA6B,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;QACL,CAAC;QAED,UAAU,CAAC,iBAAyD;YAClE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;YACpC,IAAI,iBAAiB,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5B,CAAC;QACH,CAAC;QAED,+EAA+E;QACvE,kBAAkB;YACxB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAE9E,YAAY,CAAC,OAAO,CAAC,CAAC,OAAoB,EAAE,EAAE;oBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;gBAC9F,CAAC,CAAC,CAAC;gBAEH,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CACvD,uCAAuC,IAAI,CAAC,cAAc,CAAC,YAAY,IAAI,CAC5E,CAAC;gBACF,MAAM,cAAc,GAAG,iBAAiB,EAAE,cAAc,CAAC;gBAEzD,IAAI,cAAc,EAAE,CAAC;oBACnB,cAAc,CAAC,mBAAmB,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;gBAC5E,CAAC;YACH,CAAC;QACH,CAAC;QAED,mDAAmD;QAC3C,6BAA6B,CAAC,cAAiC;YACrE,cAAc,CAAC,mBAAmB,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;QAC5E,CAAC;KACF;IAED,OAAO,aAAmD,CAAC;AAC7D,CAAC,CAAC","sourcesContent":["import type { View } from '@qti-components/base';\nimport type { QtiAssessmentItemRef } from '../components/qti-assessment-item-ref/qti-assessment-item-ref';\nimport type { QtiAssessmentItem } from '@qti-components/elements';\nimport type { TestBaseInterface } from './test-base';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestViewInterface {}\n\nexport const TestViewMixin = <T extends Constructor<TestBaseInterface>>(superClass: T) => {\n abstract class TestViewClass extends superClass implements TestViewInterface {\n constructor(...args: any[]) {\n super(...args);\n this.sessionContext = { ...this.sessionContext, view: 'candidate' };\n\n this.addEventListener('on-test-switch-view', (e: CustomEvent<View>) => {\n this.sessionContext = { ...this.sessionContext, view: e.detail };\n this._updateElementView();\n });\n this.addEventListener('qti-assessment-test-connected', () => {\n this._updateElementView();\n });\n this.addEventListener('qti-assessment-item-connected', (e: CustomEvent) => {\n this._updateElementView();\n this._setCorrectResponseVisibility(e.detail);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('sessionContext')) {\n this._updateElementView();\n }\n }\n\n // Method to handle view updates for elements based on the current context view\n private _updateElementView() {\n if (this._testElement) {\n const viewElements = Array.from(this._testElement.querySelectorAll('[view]'));\n\n viewElements.forEach((element: HTMLElement) => {\n element.classList.toggle('show', element.getAttribute('view') === this.sessionContext.view);\n });\n\n const assessmentItemRef = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${this.sessionContext.navItemRefId}\"]`\n );\n const assessmentItem = assessmentItemRef?.assessmentItem;\n\n if (assessmentItem) {\n assessmentItem.showCorrectResponse(this.sessionContext.view === 'scorer');\n }\n }\n }\n\n // Event handler for connected QTI assessment items\n private _setCorrectResponseVisibility(assessmentItem: QtiAssessmentItem): void {\n assessmentItem.showCorrectResponse(this.sessionContext.view === 'scorer');\n }\n }\n\n return TestViewClass as Constructor<TestViewInterface> & T;\n};\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PostLoadTransformCallback, PostLoadTestTransformCallback } from '../mixins/test-navigation.mixin';
|
|
2
|
+
import type { LitElement } from 'lit';
|
|
3
|
+
import type { TestContext } from '@qti-components/base';
|
|
4
|
+
import type { SessionContext } from '@qti-components/base';
|
|
5
|
+
import type { OutcomeVariable, VariableDeclaration, VariableValue } from '@qti-components/base';
|
|
6
|
+
export interface IQtiTest extends LitElement, ITestNavigationMixin, ITestProcessingMixin, IMyQtiTest {
|
|
7
|
+
}
|
|
8
|
+
export interface IMyQtiTest {
|
|
9
|
+
testContext: Readonly<TestContext>;
|
|
10
|
+
sessionContext: Readonly<SessionContext>;
|
|
11
|
+
updateItemVariables(itemRefID: string, variables: VariableValue<string | string[] | null>[]): void;
|
|
12
|
+
}
|
|
13
|
+
export interface ITestNavigationMixin {
|
|
14
|
+
navigate: 'item' | 'section' | null;
|
|
15
|
+
cacheTransform: boolean;
|
|
16
|
+
requestTimeout: number;
|
|
17
|
+
showLoadingIndicators: boolean;
|
|
18
|
+
postLoadTransformCallback: PostLoadTransformCallback | null;
|
|
19
|
+
postLoadTestTransformCallback: PostLoadTestTransformCallback | null;
|
|
20
|
+
navigateTo(type: 'item' | 'section', id?: string): void;
|
|
21
|
+
retryNavigation(): void;
|
|
22
|
+
}
|
|
23
|
+
export interface ITestProcessingMixin {
|
|
24
|
+
updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void;
|
|
25
|
+
getOutcome(identifier: string): Readonly<OutcomeVariable>;
|
|
26
|
+
getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;
|
|
27
|
+
outcomeProcessing(): boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iqti-test.js","sourceRoot":"","sources":["../../src/types/iqti-test.ts"],"names":[],"mappings":"","sourcesContent":["import type { PostLoadTransformCallback, PostLoadTestTransformCallback } from '../mixins/test-navigation.mixin';\nimport type { LitElement } from 'lit';\nimport type { TestContext } from '@qti-components/base';\nimport type { SessionContext } from '@qti-components/base';\nimport type { OutcomeVariable, VariableDeclaration, VariableValue } from '@qti-components/base';\n\nexport interface IQtiTest extends LitElement, ITestNavigationMixin, ITestProcessingMixin, IMyQtiTest {}\n\nexport interface IMyQtiTest {\n // Properties from TestBase\n testContext: Readonly<TestContext>;\n sessionContext: Readonly<SessionContext>;\n\n // Methods from TestBase\n updateItemVariables(itemRefID: string, variables: VariableValue<string | string[] | null>[]): void;\n}\n\nexport interface ITestNavigationMixin {\n navigate: 'item' | 'section' | null;\n cacheTransform: boolean;\n requestTimeout: number;\n showLoadingIndicators: boolean;\n\n postLoadTransformCallback: PostLoadTransformCallback | null;\n postLoadTestTransformCallback: PostLoadTestTransformCallback | null;\n navigateTo(type: 'item' | 'section', id?: string): void;\n retryNavigation(): void;\n}\n\nexport interface ITestProcessingMixin {\n // Methods from TestProcessingMixin\n updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void;\n getOutcome(identifier: string): Readonly<OutcomeVariable>;\n getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;\n outcomeProcessing(): boolean;\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qti-components/test",
|
|
3
|
+
"description": "QTI test utilities",
|
|
4
|
+
"version": "1.2.0",
|
|
5
|
+
"author": "",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@qti-components/base": "^1.2.0",
|
|
8
|
+
"@qti-components/elements": "^1.3.0",
|
|
9
|
+
"@qti-components/interactions": "^1.8.0",
|
|
10
|
+
"@qti-components/processing": "^1.1.0",
|
|
11
|
+
"@qti-components/theme": "^1.1.0",
|
|
12
|
+
"@qti-components/transformers": "^1.4.0",
|
|
13
|
+
"@qti-components/utilities": "^1.1.0"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@heximal/templates": "^0.1.5",
|
|
17
|
+
"@lit/context": "^1.1.6",
|
|
18
|
+
"lit": "^3.3.1"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"qti",
|
|
22
|
+
"test"
|
|
23
|
+
],
|
|
24
|
+
"license": "GPL-3.0-only",
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@heximal/templates": "^0.1.5",
|
|
28
|
+
"@lit/context": "^1.1.6",
|
|
29
|
+
"lit": "^3.3.1"
|
|
30
|
+
},
|
|
31
|
+
"sideEffects": true,
|
|
32
|
+
"type": "module",
|
|
33
|
+
"types": "dist/index.d.ts",
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"provenance": true
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/Citolab/qti-components.git",
|
|
44
|
+
"directory": "packages/qti-test"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"attw": "attw --profile esm-only --pack",
|
|
48
|
+
"build": "tsc --paths null",
|
|
49
|
+
"clean": "rm -rf dist"
|
|
50
|
+
}
|
|
51
|
+
}
|