@citolab/qti-components 7.3.23 → 7.4.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 +5485 -1
- package/custom-elements.json +29837 -0
- package/dist/chunks/chunk-4BDOB6KY.js +365 -0
- package/dist/chunks/chunk-4BDOB6KY.js.map +1 -0
- package/dist/chunks/{chunk-LF6SO3JU.js → chunk-7RW7LCEJ.js} +459 -587
- package/dist/chunks/chunk-7RW7LCEJ.js.map +1 -0
- package/dist/chunks/chunk-APBAIN6D.js +2237 -0
- package/dist/chunks/chunk-APBAIN6D.js.map +1 -0
- package/dist/chunks/{chunk-22IRJWWY.js → chunk-C5RLRG3L.js} +1 -1
- package/dist/chunks/chunk-C5RLRG3L.js.map +1 -0
- package/dist/chunks/{chunk-AZIKAG7K.js → chunk-DVQQ7I6Y.js} +1 -1
- package/dist/chunks/chunk-DVQQ7I6Y.js.map +1 -0
- package/dist/chunks/{chunk-QCB6P7DH.js → chunk-GAAFN7QF.js} +1 -1
- package/dist/chunks/{chunk-QCB6P7DH.js.map → chunk-GAAFN7QF.js.map} +1 -1
- package/dist/chunks/chunk-K47QFOQX.js +175 -0
- package/dist/chunks/chunk-K47QFOQX.js.map +1 -0
- package/dist/chunks/{chunk-FL72PF4D.js → chunk-SV4K25ZI.js} +2 -2
- package/dist/custom-elements.json +29837 -0
- package/dist/exports/computed-item.context.d.ts +1 -7
- package/dist/exports/computed.context.d.ts +2 -10
- package/dist/exports/computed.context.js +1 -1
- package/dist/exports/interaction.d.ts +45 -7
- package/dist/exports/item.context.d.ts +10 -7
- package/dist/exports/qti-assessment-item.context.d.ts +2 -7
- package/dist/exports/qti-condition-expression.d.ts +4 -5
- package/dist/exports/qti-condition-expression.js +2 -2
- package/dist/exports/qti-expression.d.ts +22 -7
- package/dist/exports/qti-expression.js +1 -1
- package/dist/exports/qti-test.d.ts +10 -38
- package/dist/exports/session.context.d.ts +2 -13
- package/dist/exports/session.context.js +1 -1
- package/dist/exports/test.context.d.ts +2 -7
- package/dist/exports/variables.d.ts +1 -7
- package/dist/index.d.ts +12 -31
- package/dist/index.js +38 -95
- package/{cdn/chunks/chunk-5TDBMEY5.js → dist/item.css} +7 -24
- package/dist/qti-assessment-item-l-mN3teH.d.ts +105 -0
- package/dist/qti-components/index.d.ts +1173 -16
- package/dist/qti-components/index.js +6 -5
- package/dist/qti-components-jsx.d.ts +4463 -0
- package/dist/qti-item/index.d.ts +114 -0
- package/dist/qti-item/index.js +19 -0
- package/dist/qti-loader/index.d.ts +2 -5
- package/dist/qti-loader/index.js +24 -4
- package/dist/qti-loader/index.js.map +1 -1
- package/dist/qti-modal-feedback-PKbhO-3w.d.ts +30 -0
- package/dist/qti-test/index.d.ts +480 -0
- package/dist/qti-test/index.js +69 -0
- package/dist/{qti-test-feedback-CZsbp6z4.d.ts → qti-test-BwvOhz_-.d.ts} +45 -18
- package/dist/variables-BCkyLoXK.d.ts +55 -0
- package/dist/vscode.css-custom-data.json +11 -0
- package/dist/vscode.html-custom-data.json +1135 -0
- package/package.json +74 -116
- package/cdn/chunks/chunk-2BSPQRNR.js +0 -6
- package/cdn/chunks/chunk-3CVBBZDT.js +0 -17
- package/cdn/chunks/chunk-3IBGLVHA.js +0 -1
- package/cdn/chunks/chunk-3YQMAZEO.js +0 -29
- package/cdn/chunks/chunk-5UQLGV7F.js +0 -5
- package/cdn/chunks/chunk-5WLHU3FH.js +0 -8
- package/cdn/chunks/chunk-6SGFGN34.js +0 -8
- package/cdn/chunks/chunk-6XVY32RS.js +0 -1
- package/cdn/chunks/chunk-7ME56ODO.js +0 -1
- package/cdn/chunks/chunk-CZDMOYYF.js +0 -1
- package/cdn/chunks/chunk-DNBBQ7LY.js +0 -1
- package/cdn/chunks/chunk-DP5FVJRS.js +0 -21
- package/cdn/chunks/chunk-E6IOJ4MV.js +0 -23
- package/cdn/chunks/chunk-G76Y52EL.js +0 -1471
- package/cdn/chunks/chunk-HCXHHI6V.js +0 -18
- package/cdn/chunks/chunk-HDMF4QZO.js +0 -48
- package/cdn/chunks/chunk-HKWYQB5Z.js +0 -37
- package/cdn/chunks/chunk-J5P2GBPV.js +0 -1
- package/cdn/chunks/chunk-KWPDTFYH.js +0 -1
- package/cdn/chunks/chunk-LIUOA3YV.js +0 -1
- package/cdn/chunks/chunk-LO2NM3CE.js +0 -1
- package/cdn/chunks/chunk-MD33BNWM.js +0 -1
- package/cdn/chunks/chunk-MRQ46JRY.js +0 -8
- package/cdn/chunks/chunk-NJP4VZB3.js +0 -8
- package/cdn/chunks/chunk-O4RAJ3LM.js +0 -25
- package/cdn/chunks/chunk-OSLUHYFD.js +0 -8
- package/cdn/chunks/chunk-P6SSTAJ2.js +0 -1
- package/cdn/chunks/chunk-PP62N3C4.js +0 -8
- package/cdn/chunks/chunk-PU7OABT3.js +0 -1
- package/cdn/chunks/chunk-PUI3LIFH.js +0 -0
- package/cdn/chunks/chunk-QBAXWCYQ.js +0 -5
- package/cdn/chunks/chunk-QEFO63QX.js +0 -8
- package/cdn/chunks/chunk-QQCGUVEV.js +0 -1
- package/cdn/chunks/chunk-QQR6POPY.js +0 -1
- package/cdn/chunks/chunk-RGNFAPWY.js +0 -2
- package/cdn/chunks/chunk-S5QDLZ6J.js +0 -1
- package/cdn/chunks/chunk-SEM2PEP6.js +0 -5
- package/cdn/chunks/chunk-SVVO2SFS.js +0 -1
- package/cdn/chunks/chunk-TCHROQU3.js +0 -1
- package/cdn/chunks/chunk-UMDZKG6K.js +0 -1
- package/cdn/chunks/chunk-VEG7LKS3.js +0 -48
- package/cdn/chunks/chunk-WCCTDLQ4.js +0 -8
- package/cdn/chunks/chunk-X4FA36TC.js +0 -1
- package/cdn/chunks/chunk-XJ2CFTZP.js +0 -1
- package/cdn/chunks/chunk-XUJ7TXHW.js +0 -1
- package/cdn/chunks/chunk-YCBNF5QU.js +0 -17
- package/cdn/chunks/chunk-YHLQ2JQ2.js +0 -1
- package/cdn/chunks/chunk-ZPCQH3EY.js +0 -10
- package/cdn/exports/computed-item.context.js +0 -1
- package/cdn/exports/computed.context.js +0 -1
- package/cdn/exports/config.context.js +0 -1
- package/cdn/exports/expression-result.js +0 -0
- package/cdn/exports/interaction.interface.js +0 -0
- package/cdn/exports/interaction.js +0 -1
- package/cdn/exports/item.context.js +0 -1
- package/cdn/exports/qti-assessment-item.context.js +0 -1
- package/cdn/exports/qti-condition-expression.js +0 -1
- package/cdn/exports/qti-expression.js +0 -1
- package/cdn/exports/qti-test.js +0 -0
- package/cdn/exports/qti.context.js +0 -1
- package/cdn/exports/session.context.js +0 -1
- package/cdn/exports/test.context.js +0 -1
- package/cdn/exports/variables.js +0 -0
- package/cdn/qti-components/index.js +0 -1
- package/cdn/qti-item/components/item-container.js +0 -1
- package/cdn/qti-item/components/item-correct-response-mode.js +0 -10
- package/cdn/qti-item/components/item-show-candidate-correction.js +0 -8
- package/cdn/qti-item/components/item-show-correct-response.js +0 -1
- package/cdn/qti-item/components/print-item-variables.js +0 -1
- package/cdn/qti-item/components/styles.js +0 -1
- package/cdn/qti-item/core/index.js +0 -1
- package/cdn/qti-loader/index.js +0 -1
- package/cdn/qti-test/components/index.js +0 -1
- package/cdn/qti-test/components/styles.js +0 -1
- package/cdn/qti-test/components/test-check-item.js +0 -1
- package/cdn/qti-test/components/test-container.js +0 -1
- package/cdn/qti-test/components/test-end-attempt.js +0 -1
- package/cdn/qti-test/components/test-item-link.js +0 -1
- package/cdn/qti-test/components/test-navigation.js +0 -1
- package/cdn/qti-test/components/test-next.js +0 -1
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +0 -1
- package/cdn/qti-test/components/test-prev.js +0 -1
- package/cdn/qti-test/components/test-print-context.js +0 -1
- package/cdn/qti-test/components/test-print-item-variables.js +0 -1
- package/cdn/qti-test/components/test-scoring-buttons.js +0 -1
- package/cdn/qti-test/components/test-scoring-feedback.js +0 -1
- package/cdn/qti-test/components/test-section-buttons-stamp.js +0 -1
- package/cdn/qti-test/components/test-section-link.js +0 -1
- package/cdn/qti-test/components/test-show-correct-response.js +0 -1
- package/cdn/qti-test/components/test-stamp.js +0 -1
- package/cdn/qti-test/components/test-view-toggle.js +0 -1
- package/cdn/qti-test/components/test-view.js +0 -1
- package/cdn/qti-test/core/index.js +0 -1
- package/cdn/qti-transformers/index.js +0 -1
- package/dist/chunks/chunk-22IRJWWY.js.map +0 -1
- package/dist/chunks/chunk-36G5MQKR.js +0 -85
- package/dist/chunks/chunk-36G5MQKR.js.map +0 -1
- package/dist/chunks/chunk-5KCXO2RP.js +0 -36
- package/dist/chunks/chunk-5KCXO2RP.js.map +0 -1
- package/dist/chunks/chunk-5ZHHNEDA.js +0 -30
- package/dist/chunks/chunk-5ZHHNEDA.js.map +0 -1
- package/dist/chunks/chunk-7K44TDQO.js +0 -91
- package/dist/chunks/chunk-7K44TDQO.js.map +0 -1
- package/dist/chunks/chunk-7OMJMXHK.js +0 -50
- package/dist/chunks/chunk-7OMJMXHK.js.map +0 -1
- package/dist/chunks/chunk-AZIKAG7K.js.map +0 -1
- package/dist/chunks/chunk-BLBSZDQ4.js +0 -52
- package/dist/chunks/chunk-BLBSZDQ4.js.map +0 -1
- package/dist/chunks/chunk-CP34TICQ.js +0 -45
- package/dist/chunks/chunk-CP34TICQ.js.map +0 -1
- package/dist/chunks/chunk-CTESMSQO.js +0 -56
- package/dist/chunks/chunk-CTESMSQO.js.map +0 -1
- package/dist/chunks/chunk-DZAMXOSC.js +0 -30
- package/dist/chunks/chunk-DZAMXOSC.js.map +0 -1
- package/dist/chunks/chunk-E6V3JHVT.js +0 -31
- package/dist/chunks/chunk-E6V3JHVT.js.map +0 -1
- package/dist/chunks/chunk-EJZQSOHU.js +0 -85
- package/dist/chunks/chunk-EJZQSOHU.js.map +0 -1
- package/dist/chunks/chunk-EMVOKXSA.js +0 -84
- package/dist/chunks/chunk-EMVOKXSA.js.map +0 -1
- package/dist/chunks/chunk-ETLOKJAG.js +0 -94
- package/dist/chunks/chunk-ETLOKJAG.js.map +0 -1
- package/dist/chunks/chunk-GAHXUFMQ.js +0 -93
- package/dist/chunks/chunk-GAHXUFMQ.js.map +0 -1
- package/dist/chunks/chunk-KG5Z2CKO.js +0 -86
- package/dist/chunks/chunk-KG5Z2CKO.js.map +0 -1
- package/dist/chunks/chunk-KSXNC564.js +0 -43
- package/dist/chunks/chunk-KSXNC564.js.map +0 -1
- package/dist/chunks/chunk-LF6SO3JU.js.map +0 -1
- package/dist/chunks/chunk-ODHS7HDB.js +0 -94
- package/dist/chunks/chunk-ODHS7HDB.js.map +0 -1
- package/dist/chunks/chunk-QU7KR7VX.js +0 -367
- package/dist/chunks/chunk-QU7KR7VX.js.map +0 -1
- package/dist/chunks/chunk-TU6COU44.js +0 -82
- package/dist/chunks/chunk-TU6COU44.js.map +0 -1
- package/dist/chunks/chunk-TUKEQ36K.js +0 -60
- package/dist/chunks/chunk-TUKEQ36K.js.map +0 -1
- package/dist/chunks/chunk-TWYN56XO.js +0 -92
- package/dist/chunks/chunk-TWYN56XO.js.map +0 -1
- package/dist/chunks/chunk-UHQVQBCL.js +0 -89
- package/dist/chunks/chunk-UHQVQBCL.js.map +0 -1
- package/dist/chunks/chunk-WFFIUFJJ.js +0 -28
- package/dist/chunks/chunk-WFFIUFJJ.js.map +0 -1
- package/dist/chunks/chunk-WN6TJQI2.js +0 -103
- package/dist/chunks/chunk-WN6TJQI2.js.map +0 -1
- package/dist/chunks/chunk-WPEFNKMC.js +0 -923
- package/dist/chunks/chunk-WPEFNKMC.js.map +0 -1
- package/dist/chunks/chunk-YPMZLHGG.js +0 -52
- package/dist/chunks/chunk-YPMZLHGG.js.map +0 -1
- package/dist/chunks/chunk-YWEWSQJR.js +0 -40
- package/dist/chunks/chunk-YWEWSQJR.js.map +0 -1
- package/dist/chunks/chunk-ZGSNDSK3.js +0 -1
- package/dist/chunks/chunk-ZGSNDSK3.js.map +0 -1
- package/dist/qti-item/components/item-container.d.ts +0 -40
- package/dist/qti-item/components/item-container.js +0 -11
- package/dist/qti-item/components/item-container.js.map +0 -1
- package/dist/qti-item/components/item-correct-response-mode.d.ts +0 -17
- package/dist/qti-item/components/item-correct-response-mode.js +0 -62
- package/dist/qti-item/components/item-correct-response-mode.js.map +0 -1
- package/dist/qti-item/components/item-show-candidate-correction.d.ts +0 -34
- package/dist/qti-item/components/item-show-candidate-correction.js +0 -88
- package/dist/qti-item/components/item-show-candidate-correction.js.map +0 -1
- package/dist/qti-item/components/item-show-correct-response.d.ts +0 -33
- package/dist/qti-item/components/item-show-correct-response.js +0 -10
- package/dist/qti-item/components/item-show-correct-response.js.map +0 -1
- package/dist/qti-item/components/print-item-variables.d.ts +0 -23
- package/dist/qti-item/components/print-item-variables.js +0 -9
- package/dist/qti-item/components/print-item-variables.js.map +0 -1
- package/dist/qti-item/components/styles.d.ts +0 -8
- package/dist/qti-item/components/styles.js +0 -14
- package/dist/qti-item/components/styles.js.map +0 -1
- package/dist/qti-item/core/index.d.ts +0 -51
- package/dist/qti-item/core/index.js +0 -26
- package/dist/qti-response-declaration-DKr08ANy.d.ts +0 -1397
- package/dist/qti-test/components/index.d.ts +0 -33
- package/dist/qti-test/components/index.js +0 -87
- package/dist/qti-test/components/styles.d.ts +0 -8
- package/dist/qti-test/components/styles.js +0 -14
- package/dist/qti-test/components/styles.js.map +0 -1
- package/dist/qti-test/components/test-check-item.d.ts +0 -16
- package/dist/qti-test/components/test-check-item.js +0 -9
- package/dist/qti-test/components/test-check-item.js.map +0 -1
- package/dist/qti-test/components/test-container.d.ts +0 -39
- package/dist/qti-test/components/test-container.js +0 -11
- package/dist/qti-test/components/test-container.js.map +0 -1
- package/dist/qti-test/components/test-end-attempt.d.ts +0 -16
- package/dist/qti-test/components/test-end-attempt.js +0 -9
- package/dist/qti-test/components/test-end-attempt.js.map +0 -1
- package/dist/qti-test/components/test-item-link.d.ts +0 -18
- package/dist/qti-test/components/test-item-link.js +0 -9
- package/dist/qti-test/components/test-item-link.js.map +0 -1
- package/dist/qti-test/components/test-navigation.d.ts +0 -73
- package/dist/qti-test/components/test-navigation.js +0 -13
- package/dist/qti-test/components/test-navigation.js.map +0 -1
- package/dist/qti-test/components/test-next.d.ts +0 -48
- package/dist/qti-test/components/test-next.js +0 -12
- package/dist/qti-test/components/test-next.js.map +0 -1
- package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +0 -23
- package/dist/qti-test/components/test-paging-buttons-stamp.js +0 -9
- package/dist/qti-test/components/test-paging-buttons-stamp.js.map +0 -1
- package/dist/qti-test/components/test-prev.d.ts +0 -46
- package/dist/qti-test/components/test-prev.js +0 -12
- package/dist/qti-test/components/test-prev.js.map +0 -1
- package/dist/qti-test/components/test-print-context.d.ts +0 -25
- package/dist/qti-test/components/test-print-context.js +0 -9
- package/dist/qti-test/components/test-print-context.js.map +0 -1
- package/dist/qti-test/components/test-print-item-variables.d.ts +0 -27
- package/dist/qti-test/components/test-print-item-variables.js +0 -9
- package/dist/qti-test/components/test-print-item-variables.js.map +0 -1
- package/dist/qti-test/components/test-scoring-buttons.d.ts +0 -32
- package/dist/qti-test/components/test-scoring-buttons.js +0 -9
- package/dist/qti-test/components/test-scoring-buttons.js.map +0 -1
- package/dist/qti-test/components/test-scoring-feedback.d.ts +0 -27
- package/dist/qti-test/components/test-scoring-feedback.js +0 -9
- package/dist/qti-test/components/test-scoring-feedback.js.map +0 -1
- package/dist/qti-test/components/test-section-buttons-stamp.d.ts +0 -23
- package/dist/qti-test/components/test-section-buttons-stamp.js +0 -9
- package/dist/qti-test/components/test-section-buttons-stamp.js.map +0 -1
- package/dist/qti-test/components/test-section-link.d.ts +0 -18
- package/dist/qti-test/components/test-section-link.js +0 -9
- package/dist/qti-test/components/test-section-link.js.map +0 -1
- package/dist/qti-test/components/test-show-correct-response.d.ts +0 -39
- package/dist/qti-test/components/test-show-correct-response.js +0 -10
- package/dist/qti-test/components/test-show-correct-response.js.map +0 -1
- package/dist/qti-test/components/test-stamp.d.ts +0 -31
- package/dist/qti-test/components/test-stamp.js +0 -9
- package/dist/qti-test/components/test-stamp.js.map +0 -1
- package/dist/qti-test/components/test-view-toggle.d.ts +0 -19
- package/dist/qti-test/components/test-view-toggle.js +0 -9
- package/dist/qti-test/components/test-view-toggle.js.map +0 -1
- package/dist/qti-test/components/test-view.d.ts +0 -24
- package/dist/qti-test/components/test-view.js +0 -10
- package/dist/qti-test/components/test-view.js.map +0 -1
- package/dist/qti-test/core/index.d.ts +0 -105
- package/dist/qti-test/core/index.js +0 -36
- package/dist/qti-test/core/index.js.map +0 -1
- /package/dist/chunks/{chunk-FL72PF4D.js.map → chunk-SV4K25ZI.js.map} +0 -0
- /package/dist/qti-item/{core/index.js.map → index.js.map} +0 -0
- /package/dist/qti-test/{components/index.js.map → index.js.map} +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
sessionContext
|
|
3
|
-
} from "./chunk-22IRJWWY.js";
|
|
4
|
-
import {
|
|
5
|
-
__decorateClass
|
|
6
|
-
} from "./chunk-H2JE6IVU.js";
|
|
7
|
-
|
|
8
|
-
// src/lib/qti-test/components/test-view-toggle.ts
|
|
9
|
-
import { consume } from "@lit/context";
|
|
10
|
-
import { html, LitElement, nothing } from "lit";
|
|
11
|
-
import { customElement } from "lit/decorators.js";
|
|
12
|
-
import { prepareTemplate } from "@heximal/templates";
|
|
13
|
-
var TestViewToggle = class extends LitElement {
|
|
14
|
-
createRenderRoot() {
|
|
15
|
-
return this;
|
|
16
|
-
}
|
|
17
|
-
connectedCallback() {
|
|
18
|
-
super.connectedCallback();
|
|
19
|
-
const templateElement = this.querySelector("template");
|
|
20
|
-
if (!templateElement) {
|
|
21
|
-
this.myTemplate = null;
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
this.myTemplate = prepareTemplate(templateElement);
|
|
25
|
-
}
|
|
26
|
-
_switchView(view) {
|
|
27
|
-
this.dispatchEvent(
|
|
28
|
-
new CustomEvent("on-test-switch-view", {
|
|
29
|
-
composed: true,
|
|
30
|
-
bubbles: true,
|
|
31
|
-
detail: view
|
|
32
|
-
})
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
firstUpdated(_changedProperties) {
|
|
36
|
-
this.addEventListener("click", () => {
|
|
37
|
-
if (this.sessionContext?.view === "scorer") {
|
|
38
|
-
this._switchView("candidate");
|
|
39
|
-
} else {
|
|
40
|
-
this._switchView("scorer");
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
render() {
|
|
45
|
-
return html`${this.myTemplate ? this.myTemplate({
|
|
46
|
-
view: this.sessionContext?.view
|
|
47
|
-
}) : nothing}`;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
__decorateClass([
|
|
51
|
-
consume({ context: sessionContext, subscribe: true })
|
|
52
|
-
], TestViewToggle.prototype, "sessionContext", 2);
|
|
53
|
-
TestViewToggle = __decorateClass([
|
|
54
|
-
customElement("test-view-toggle")
|
|
55
|
-
], TestViewToggle);
|
|
56
|
-
|
|
57
|
-
export {
|
|
58
|
-
TestViewToggle
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=chunk-TUKEQ36K.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-view-toggle.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, nothing } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { prepareTemplate } from '@heximal/templates';\n\nimport { sessionContext } from '../../exports/session.context';\n\nimport type { PropertyValues } from 'lit';\nimport type { SessionContext } from '../../exports/session.context';\n\n@customElement('test-view-toggle')\nexport class TestViewToggle extends LitElement {\n myTemplate: any;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n @consume({ context: sessionContext, subscribe: true })\n private sessionContext: SessionContext;\n\n connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n if (!templateElement) {\n this.myTemplate = null;\n return;\n }\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n _switchView(view: string) {\n this.dispatchEvent(\n new CustomEvent('on-test-switch-view', {\n composed: true,\n bubbles: true,\n detail: view\n })\n );\n }\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n this.addEventListener('click', () => {\n if (this.sessionContext?.view === 'scorer') {\n this._switchView('candidate');\n } else {\n this._switchView('scorer');\n }\n });\n }\n\n render() {\n return html`${this.myTemplate\n ? this.myTemplate({\n view: this.sessionContext?.view\n })\n : nothing}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-view-toggle': TestViewToggle;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,MAAM,YAAY,eAAe;AAC1C,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAQzB,IAAM,iBAAN,cAA6B,WAAW;AAAA,EAGnC,mBAAmD;AAC3D,WAAO;AAAA,EACT;AAAA,EAKA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,UAAM,kBAAkB,KAAK,cAAmC,UAAU;AAC1E,QAAI,CAAC,iBAAiB;AACpB,WAAK,aAAa;AAClB;AAAA,IACF;AACA,SAAK,aAAa,gBAAgB,eAAe;AAAA,EACnD;AAAA,EAEA,YAAY,MAAc;AACxB,SAAK;AAAA,MACH,IAAI,YAAY,uBAAuB;AAAA,QACrC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEU,aAAa,oBAA0C;AAC/D,SAAK,iBAAiB,SAAS,MAAM;AACnC,UAAI,KAAK,gBAAgB,SAAS,UAAU;AAC1C,aAAK,YAAY,WAAW;AAAA,MAC9B,OAAO;AACL,aAAK,YAAY,QAAQ;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,SAAS;AACP,WAAO,OAAO,KAAK,aACf,KAAK,WAAW;AAAA,MACd,MAAM,KAAK,gBAAgB;AAAA,IAC7B,CAAC,IACD,OAAO;AAAA,EACb;AACF;AAvCU;AAAA,EADP,QAAQ,EAAE,SAAS,gBAAgB,WAAW,KAAK,CAAC;AAAA,GAP1C,eAQH;AARG,iBAAN;AAAA,EADN,cAAc,kBAAkB;AAAA,GACpB;","names":[]}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
btn,
|
|
3
|
-
dis
|
|
4
|
-
} from "./chunk-5ZHHNEDA.js";
|
|
5
|
-
import {
|
|
6
|
-
computedContext
|
|
7
|
-
} from "./chunk-AZIKAG7K.js";
|
|
8
|
-
import {
|
|
9
|
-
__decorateClass
|
|
10
|
-
} from "./chunk-H2JE6IVU.js";
|
|
11
|
-
|
|
12
|
-
// src/lib/qti-test/components/test-show-correct-response.ts
|
|
13
|
-
import { css, html, LitElement } from "lit";
|
|
14
|
-
import { customElement, property } from "lit/decorators.js";
|
|
15
|
-
import { consume } from "@lit/context";
|
|
16
|
-
var TestShowCorrectResponse = class extends LitElement {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.shown = false;
|
|
20
|
-
this.disabled = false;
|
|
21
|
-
this.showCorrectText = "Show correct response";
|
|
22
|
-
this.hideCorrectText = "Hide correct response";
|
|
23
|
-
this.noCorrectResponseText = "No correct response specified";
|
|
24
|
-
}
|
|
25
|
-
// Store previous active item reference
|
|
26
|
-
willUpdate(_changedProperties) {
|
|
27
|
-
const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
|
|
28
|
-
if (this._previousActiveItem !== activeItem) {
|
|
29
|
-
this.shown = false;
|
|
30
|
-
this._previousActiveItem = activeItem;
|
|
31
|
-
}
|
|
32
|
-
if (activeItem) {
|
|
33
|
-
const containsCorrectResponse = !!activeItem?.variables?.some((v) => v["correctResponse"]);
|
|
34
|
-
const containsMapping = !!activeItem?.variables?.some((v) => {
|
|
35
|
-
return v["mapping"]?.mapEntries?.length > 0 || v["areaMapping"]?.areaMapEntries?.length > 0;
|
|
36
|
-
});
|
|
37
|
-
this.disabled = !containsCorrectResponse && !containsMapping;
|
|
38
|
-
} else {
|
|
39
|
-
this.disabled = true;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
_toggleState() {
|
|
43
|
-
if (this.disabled) return;
|
|
44
|
-
this.shown = !this.shown;
|
|
45
|
-
this.dispatchEvent(
|
|
46
|
-
new CustomEvent("test-show-correct-response", {
|
|
47
|
-
detail: this.shown,
|
|
48
|
-
bubbles: true
|
|
49
|
-
})
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
_getDisplayedText() {
|
|
53
|
-
return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
return html` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
TestShowCorrectResponse.styles = css`
|
|
60
|
-
:host {
|
|
61
|
-
${btn};
|
|
62
|
-
}
|
|
63
|
-
:host([disabled]) {
|
|
64
|
-
${dis};
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
67
|
-
__decorateClass([
|
|
68
|
-
consume({ context: computedContext, subscribe: true })
|
|
69
|
-
], TestShowCorrectResponse.prototype, "computedContext", 2);
|
|
70
|
-
__decorateClass([
|
|
71
|
-
property({ type: Boolean, reflect: true })
|
|
72
|
-
], TestShowCorrectResponse.prototype, "shown", 2);
|
|
73
|
-
__decorateClass([
|
|
74
|
-
property({ type: Boolean, reflect: true })
|
|
75
|
-
], TestShowCorrectResponse.prototype, "disabled", 2);
|
|
76
|
-
__decorateClass([
|
|
77
|
-
property({ type: String })
|
|
78
|
-
], TestShowCorrectResponse.prototype, "showCorrectText", 2);
|
|
79
|
-
__decorateClass([
|
|
80
|
-
property({ type: String })
|
|
81
|
-
], TestShowCorrectResponse.prototype, "hideCorrectText", 2);
|
|
82
|
-
__decorateClass([
|
|
83
|
-
property({ type: String })
|
|
84
|
-
], TestShowCorrectResponse.prototype, "noCorrectResponseText", 2);
|
|
85
|
-
TestShowCorrectResponse = __decorateClass([
|
|
86
|
-
customElement("test-show-correct-response")
|
|
87
|
-
], TestShowCorrectResponse);
|
|
88
|
-
|
|
89
|
-
export {
|
|
90
|
-
TestShowCorrectResponse
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=chunk-TWYN56XO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-show-correct-response.ts"],"sourcesContent":["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 { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext } from '../../exports/computed.context';\n\n/**\n * @deprecated test-show-correct-response is deprecated and will be removed in the future.\n */\n@customElement('test-show-correct-response')\nexport class TestShowCorrectResponse extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n public computedContext?: ComputedContext;\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;\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 _previousActiveItem?: unknown; // Store previous active item reference\n\n willUpdate(_changedProperties: Map<string | number | symbol, unknown>) {\n const activeItem = this.computedContext?.testParts\n .flatMap(testPart => testPart.sections.flatMap(section => section.items))\n .find(item => item.active);\n\n // If active item changed, reset shown before the update\n if (this._previousActiveItem !== activeItem) {\n this.shown = false;\n this._previousActiveItem = activeItem; // Update previous active item\n }\n\n if (activeItem) {\n const containsCorrectResponse = !!activeItem?.variables?.some(v => v['correctResponse']);\n const containsMapping = !!activeItem?.variables?.some(v => {\n return v['mapping']?.mapEntries?.length > 0 || v['areaMapping']?.areaMapEntries?.length > 0;\n });\n this.disabled = !containsCorrectResponse && !containsMapping;\n } else {\n this.disabled = true;\n }\n }\n private _toggleState() {\n if (this.disabled) return;\n this.shown = !this.shown;\n\n this.dispatchEvent(\n new CustomEvent('test-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 'test-show-correct-response': TestShowCorrectResponse;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,kBAAkB;AACtC,SAAS,eAAe,gBAAgB;AACxC,SAAS,eAAe;AAWjB,IAAM,0BAAN,cAAsC,WAAW;AAAA,EAAjD;AAAA;AAauC,iBAAQ;AACR,oBAAW;AAC3B,2BAAkB;AAClB,2BAAkB;AAClB,iCAAwB;AAAA;AAAA;AAAA,EAIpD,WAAW,oBAA4D;AACrE,UAAM,aAAa,KAAK,iBAAiB,UACtC,QAAQ,cAAY,SAAS,SAAS,QAAQ,aAAW,QAAQ,KAAK,CAAC,EACvE,KAAK,UAAQ,KAAK,MAAM;AAG3B,QAAI,KAAK,wBAAwB,YAAY;AAC3C,WAAK,QAAQ;AACb,WAAK,sBAAsB;AAAA,IAC7B;AAEA,QAAI,YAAY;AACd,YAAM,0BAA0B,CAAC,CAAC,YAAY,WAAW,KAAK,OAAK,EAAE,iBAAiB,CAAC;AACvF,YAAM,kBAAkB,CAAC,CAAC,YAAY,WAAW,KAAK,OAAK;AACzD,eAAO,EAAE,SAAS,GAAG,YAAY,SAAS,KAAK,EAAE,aAAa,GAAG,gBAAgB,SAAS;AAAA,MAC5F,CAAC;AACD,WAAK,WAAW,CAAC,2BAA2B,CAAC;AAAA,IAC/C,OAAO;AACL,WAAK,WAAW;AAAA,IAClB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__decorateClass
|
|
10
|
-
} from "./chunk-H2JE6IVU.js";
|
|
11
|
-
|
|
12
|
-
// src/lib/qti-item/components/item-show-correct-response.ts
|
|
13
|
-
import { css, html, LitElement } from "lit";
|
|
14
|
-
import { customElement, property } from "lit/decorators.js";
|
|
15
|
-
import { consume } from "@lit/context";
|
|
16
|
-
var ItemShowCorrectResponse = class extends LitElement {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.shown = false;
|
|
20
|
-
this.disabled = false;
|
|
21
|
-
this.showCorrectText = "Show correct response";
|
|
22
|
-
this.hideCorrectText = "Hide correct response";
|
|
23
|
-
this.noCorrectResponseText = "No correct response specified";
|
|
24
|
-
this._hasCorrectResponse = false;
|
|
25
|
-
// correct response is removed on certain point
|
|
26
|
-
this._previousActiveItem = "";
|
|
27
|
-
}
|
|
28
|
-
// Store previous active item reference
|
|
29
|
-
updated() {
|
|
30
|
-
if (!this._hasCorrectResponse || this._previousActiveItem !== this.computedContext?.identifier) {
|
|
31
|
-
this._previousActiveItem = this.computedContext?.identifier;
|
|
32
|
-
const containsCorrectResponse = !!this.computedContext?.variables.some((v) => v["correctResponse"]);
|
|
33
|
-
const containsMapping = !!this.computedContext?.variables.some((v) => {
|
|
34
|
-
return v["mapping"]?.mapEntries?.length > 0 || v["areaMapping"]?.areaMapEntries?.length > 0;
|
|
35
|
-
});
|
|
36
|
-
this._hasCorrectResponse = containsCorrectResponse || containsMapping;
|
|
37
|
-
}
|
|
38
|
-
this.disabled = !this._hasCorrectResponse;
|
|
39
|
-
}
|
|
40
|
-
_toggleState() {
|
|
41
|
-
if (this.disabled) return;
|
|
42
|
-
this.dispatchEvent(
|
|
43
|
-
new CustomEvent("item-show-correct-response", {
|
|
44
|
-
detail: !this.shown,
|
|
45
|
-
bubbles: true
|
|
46
|
-
})
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
_getDisplayedText() {
|
|
50
|
-
return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;
|
|
51
|
-
}
|
|
52
|
-
render() {
|
|
53
|
-
return html` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
ItemShowCorrectResponse.styles = css`
|
|
57
|
-
:host {
|
|
58
|
-
${btn};
|
|
59
|
-
}
|
|
60
|
-
:host([disabled]) {
|
|
61
|
-
${dis};
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
64
|
-
__decorateClass([
|
|
65
|
-
consume({ context: computedItemContext, subscribe: true })
|
|
66
|
-
], ItemShowCorrectResponse.prototype, "computedContext", 2);
|
|
67
|
-
__decorateClass([
|
|
68
|
-
property({ type: Boolean, reflect: true })
|
|
69
|
-
], ItemShowCorrectResponse.prototype, "shown", 2);
|
|
70
|
-
__decorateClass([
|
|
71
|
-
property({ type: Boolean, reflect: true })
|
|
72
|
-
], ItemShowCorrectResponse.prototype, "disabled", 2);
|
|
73
|
-
__decorateClass([
|
|
74
|
-
property({ type: String })
|
|
75
|
-
], ItemShowCorrectResponse.prototype, "showCorrectText", 2);
|
|
76
|
-
__decorateClass([
|
|
77
|
-
property({ type: String })
|
|
78
|
-
], ItemShowCorrectResponse.prototype, "hideCorrectText", 2);
|
|
79
|
-
__decorateClass([
|
|
80
|
-
property({ type: String })
|
|
81
|
-
], ItemShowCorrectResponse.prototype, "noCorrectResponseText", 2);
|
|
82
|
-
ItemShowCorrectResponse = __decorateClass([
|
|
83
|
-
customElement("item-show-correct-response")
|
|
84
|
-
], ItemShowCorrectResponse);
|
|
85
|
-
|
|
86
|
-
export {
|
|
87
|
-
ItemShowCorrectResponse
|
|
88
|
-
};
|
|
89
|
-
//# sourceMappingURL=chunk-UHQVQBCL.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-item/components/item-show-correct-response.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,kBAAkB;AACtC,SAAS,eAAe,gBAAgB;AACxC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,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAb/B,wBAaiC;AACA;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAd/B,wBAciC;AAChB;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAff,wBAeiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAhBf,wBAgBiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAjBf,wBAiBiB;AAjBjB,0BAAN;AAAA,EADN,cAAc,4BAA4B;AAAA,GAC9B;","names":[]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computedContext
|
|
3
|
-
} from "./chunk-AZIKAG7K.js";
|
|
4
|
-
import {
|
|
5
|
-
__decorateClass
|
|
6
|
-
} from "./chunk-H2JE6IVU.js";
|
|
7
|
-
|
|
8
|
-
// src/lib/qti-test/components/test-print-context.ts
|
|
9
|
-
import { html, LitElement } from "lit";
|
|
10
|
-
import { consume } from "@lit/context";
|
|
11
|
-
import { customElement, state } from "lit/decorators.js";
|
|
12
|
-
var TestPrintContext = class extends LitElement {
|
|
13
|
-
render() {
|
|
14
|
-
return html` <small><pre>${JSON.stringify(this.computedContext, null, 2)}</pre></small> `;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
__decorateClass([
|
|
18
|
-
state(),
|
|
19
|
-
consume({ context: computedContext, subscribe: true })
|
|
20
|
-
], TestPrintContext.prototype, "computedContext", 2);
|
|
21
|
-
TestPrintContext = __decorateClass([
|
|
22
|
-
customElement("test-print-context")
|
|
23
|
-
], TestPrintContext);
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
TestPrintContext
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=chunk-WFFIUFJJ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-print-context.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { consume } from '@lit/context';\nimport { customElement, state } from 'lit/decorators.js';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext } from '../../exports/computed.context';\n\n@customElement('test-print-context')\nexport class TestPrintContext extends LitElement {\n @state()\n @consume({ context: computedContext, subscribe: true })\n public computedContext?: ComputedContext;\n\n render() {\n return html` <small><pre>${JSON.stringify(this.computedContext, null, 2)}</pre></small> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-print-context': TestPrintContext;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,kBAAkB;AACjC,SAAS,eAAe;AACxB,SAAS,eAAe,aAAa;AAO9B,IAAM,mBAAN,cAA+B,WAAW;AAAA,EAK/C,SAAS;AACP,WAAO,oBAAoB,KAAK,UAAU,KAAK,iBAAiB,MAAM,CAAC,CAAC;AAAA,EAC1E;AACF;AALS;AAAA,EAFN,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAF3C,iBAGJ;AAHI,mBAAN;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB;","names":[]}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computedItemContext
|
|
3
|
-
} from "./chunk-4OGJBG35.js";
|
|
4
|
-
import {
|
|
5
|
-
configContext
|
|
6
|
-
} from "./chunk-ERYHQVOT.js";
|
|
7
|
-
import {
|
|
8
|
-
__decorateClass
|
|
9
|
-
} from "./chunk-H2JE6IVU.js";
|
|
10
|
-
|
|
11
|
-
// src/lib/qti-item/core/qti-item.ts
|
|
12
|
-
import { provide } from "@lit/context";
|
|
13
|
-
import { html, LitElement } from "lit";
|
|
14
|
-
import { customElement, state } from "lit/decorators.js";
|
|
15
|
-
var QtiItem = class extends LitElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
|
-
this.configContext = {};
|
|
19
|
-
// Store event handlers as instance properties
|
|
20
|
-
this._onItemContextChanged = this._handleItemContextChanged.bind(this);
|
|
21
|
-
this._onAssessmentItemConnected = this._handleAssessmentItemConnected.bind(this);
|
|
22
|
-
this._onHandleShowCorrectResponse = this._handleShowCorrectResponse.bind(this);
|
|
23
|
-
this._onHandleShowCandidateCorrection = this._handleShowCandidateCorrection.bind(this);
|
|
24
|
-
this._onHandleSwitchCorrectResponseMode = this._handleSwitchCorrectResponseMode.bind(this);
|
|
25
|
-
this.addEventListener("qti-item-context-updated", this._onItemContextChanged);
|
|
26
|
-
this.addEventListener("qti-assessment-item-connected", this._onAssessmentItemConnected);
|
|
27
|
-
this.addEventListener("item-show-correct-response", this._onHandleShowCorrectResponse);
|
|
28
|
-
this.addEventListener("item-show-candidate-correction", this._onHandleShowCandidateCorrection);
|
|
29
|
-
this.addEventListener("item-switch-correct-response-mode", this._onHandleSwitchCorrectResponseMode);
|
|
30
|
-
}
|
|
31
|
-
_handleItemContextChanged(e) {
|
|
32
|
-
this._updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail?.itemContext?.variables || []);
|
|
33
|
-
}
|
|
34
|
-
_handleAssessmentItemConnected(e) {
|
|
35
|
-
const fullVariables = e.detail._context.variables;
|
|
36
|
-
this._qtiAssessmentItem = e.detail;
|
|
37
|
-
this.computedContext = this.computedContext?.identifier === this._qtiAssessmentItem.identifier ? { ...this.computedContext, title: this._qtiAssessmentItem.title } : {
|
|
38
|
-
identifier: this._qtiAssessmentItem.identifier,
|
|
39
|
-
title: this._qtiAssessmentItem.title,
|
|
40
|
-
adaptive: this._qtiAssessmentItem.getAttribute("adaptive")?.toLowerCase() === "true" || false,
|
|
41
|
-
variables: fullVariables,
|
|
42
|
-
correctResponseMode: "internal"
|
|
43
|
-
};
|
|
44
|
-
this._updateItemVariablesInTestContext(this._qtiAssessmentItem.identifier, fullVariables || []);
|
|
45
|
-
}
|
|
46
|
-
_handleShowCorrectResponse(e) {
|
|
47
|
-
if (this._qtiAssessmentItem) {
|
|
48
|
-
this._qtiAssessmentItem.showCorrectResponse(e.detail);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
_handleShowCandidateCorrection(e) {
|
|
52
|
-
if (this._qtiAssessmentItem) {
|
|
53
|
-
this._qtiAssessmentItem.showCandidateCorrection(e.detail);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
_handleSwitchCorrectResponseMode(e) {
|
|
57
|
-
this._handleShowCorrectResponse(new CustomEvent("item-show-correct-response", { detail: false, bubbles: true }));
|
|
58
|
-
this.configContext = {
|
|
59
|
-
...this.configContext,
|
|
60
|
-
correctResponseMode: e.detail
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
_updateItemVariablesInTestContext(identifier, variables) {
|
|
64
|
-
const rawscore = variables?.find((vr) => vr.identifier == "SCORE")?.value;
|
|
65
|
-
const score = parseFloat(rawscore?.toString());
|
|
66
|
-
const completionStatus = variables?.find((v) => v.identifier === "completionStatus")?.value;
|
|
67
|
-
const correct = score !== void 0 && !isNaN(score) && score > 0;
|
|
68
|
-
const incorrect = score !== void 0 && !isNaN(score) && score <= 0;
|
|
69
|
-
const completed = completionStatus === "completed";
|
|
70
|
-
this.computedContext = {
|
|
71
|
-
...this.computedContext,
|
|
72
|
-
identifier,
|
|
73
|
-
correct,
|
|
74
|
-
incorrect,
|
|
75
|
-
completed,
|
|
76
|
-
variables
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
render() {
|
|
80
|
-
return html`<slot></slot>`;
|
|
81
|
-
}
|
|
82
|
-
disconnectedCallback() {
|
|
83
|
-
super.disconnectedCallback();
|
|
84
|
-
this.removeEventListener("qti-item-context-changed", this._onItemContextChanged);
|
|
85
|
-
this.removeEventListener("qti-assessment-item-connected", this._onAssessmentItemConnected);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
__decorateClass([
|
|
89
|
-
state(),
|
|
90
|
-
provide({ context: computedItemContext })
|
|
91
|
-
], QtiItem.prototype, "computedContext", 2);
|
|
92
|
-
__decorateClass([
|
|
93
|
-
state(),
|
|
94
|
-
provide({ context: configContext })
|
|
95
|
-
], QtiItem.prototype, "configContext", 2);
|
|
96
|
-
QtiItem = __decorateClass([
|
|
97
|
-
customElement("qti-item")
|
|
98
|
-
], QtiItem);
|
|
99
|
-
|
|
100
|
-
export {
|
|
101
|
-
QtiItem
|
|
102
|
-
};
|
|
103
|
-
//# sourceMappingURL=chunk-WN6TJQI2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-item/core/qti-item.ts"],"sourcesContent":["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 { ConfigContext, CorrectResponseMode} from '../../exports/config.context.ts';\nimport type { QtiAssessmentItem } from '../../qti-components';\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\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,eAAe;AACxB,SAAS,MAAM,kBAAkB;AACjC,SAAS,eAAe,aAAa;AAwB9B,IAAM,UAAN,cAAsB,WAAW;AAAA,EAmBtC,cAAc;AACZ,UAAM;AAXR,SAAO,gBAA+B,CAAC;AAGvC;AAAA,SAAQ,wBAAwB,KAAK,0BAA0B,KAAK,IAAI;AACxE,SAAQ,6BAA6B,KAAK,+BAA+B,KAAK,IAAI;AAElF,SAAQ,+BAA+B,KAAK,2BAA2B,KAAK,IAAI;AAChF,SAAQ,mCAAmC,KAAK,+BAA+B,KAAK,IAAI;AACxF,SAAQ,qCAAqC,KAAK,iCAAiC,KAAK,IAAI;AAI1F,SAAK,iBAAiB,4BAA4B,KAAK,qBAAqB;AAC5E,SAAK,iBAAiB,iCAAiC,KAAK,0BAA0B;AACtF,SAAK,iBAAiB,8BAA8B,KAAK,4BAA4B;AACrF,SAAK,iBAAiB,kCAAkC,KAAK,gCAAgC;AAC7F,SAAK,iBAAiB,qCAAqC,KAAK,kCAAkC;AAAA,EACpG;AAAA,EAEQ,0B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