@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.
Files changed (107) hide show
  1. package/LICENSE.md +674 -0
  2. package/dist/components/index.d.ts +24 -0
  3. package/dist/components/index.js +26 -0
  4. package/dist/components/index.js.map +1 -0
  5. package/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.d.ts +22 -0
  6. package/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js +78 -0
  7. package/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js.map +1 -0
  8. package/dist/components/qti-assessment-section/qti-assessment-section.d.ts +20 -0
  9. package/dist/components/qti-assessment-section/qti-assessment-section.js +64 -0
  10. package/dist/components/qti-assessment-section/qti-assessment-section.js.map +1 -0
  11. package/dist/components/qti-assessment-test/qti-assessment-test.d.ts +16 -0
  12. package/dist/components/qti-assessment-test/qti-assessment-test.js +47 -0
  13. package/dist/components/qti-assessment-test/qti-assessment-test.js.map +1 -0
  14. package/dist/components/qti-outcome-processing/qti-outcome-processing.d.ts +15 -0
  15. package/dist/components/qti-outcome-processing/qti-outcome-processing.js +37 -0
  16. package/dist/components/qti-outcome-processing/qti-outcome-processing.js.map +1 -0
  17. package/dist/components/qti-test/qti-test.d.ts +69 -0
  18. package/dist/components/qti-test/qti-test.js +80 -0
  19. package/dist/components/qti-test/qti-test.js.map +1 -0
  20. package/dist/components/qti-test-feedback/qti-test-feedback.d.ts +10 -0
  21. package/dist/components/qti-test-feedback/qti-test-feedback.js +24 -0
  22. package/dist/components/qti-test-feedback/qti-test-feedback.js.map +1 -0
  23. package/dist/components/qti-test-part/qti-test-part.d.ts +17 -0
  24. package/dist/components/qti-test-part/qti-test-part.js +58 -0
  25. package/dist/components/qti-test-part/qti-test-part.js.map +1 -0
  26. package/dist/components/qti-test-variables/qti-test-variables.d.ts +25 -0
  27. package/dist/components/qti-test-variables/qti-test-variables.js +79 -0
  28. package/dist/components/qti-test-variables/qti-test-variables.js.map +1 -0
  29. package/dist/components/styles.d.ts +4 -0
  30. package/dist/components/styles.js +23 -0
  31. package/dist/components/styles.js.map +1 -0
  32. package/dist/components/test-check-item/test-check-item.d.ts +11 -0
  33. package/dist/components/test-check-item/test-check-item.js +43 -0
  34. package/dist/components/test-check-item/test-check-item.js.map +1 -0
  35. package/dist/components/test-container/test-container.d.ts +33 -0
  36. package/dist/components/test-container/test-container.js +122 -0
  37. package/dist/components/test-container/test-container.js.map +1 -0
  38. package/dist/components/test-end-attempt/test-end-attempt.d.ts +11 -0
  39. package/dist/components/test-end-attempt/test-end-attempt.js +31 -0
  40. package/dist/components/test-end-attempt/test-end-attempt.js.map +1 -0
  41. package/dist/components/test-item-link/test-item-link.d.ts +13 -0
  42. package/dist/components/test-item-link/test-item-link.js +45 -0
  43. package/dist/components/test-item-link/test-item-link.js.map +1 -0
  44. package/dist/components/test-navigation/test-navigation.d.ts +35 -0
  45. package/dist/components/test-navigation/test-navigation.js +401 -0
  46. package/dist/components/test-navigation/test-navigation.js.map +1 -0
  47. package/dist/components/test-next/test-next.d.ts +33 -0
  48. package/dist/components/test-next/test-next.js +96 -0
  49. package/dist/components/test-next/test-next.js.map +1 -0
  50. package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.d.ts +19 -0
  51. package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js +44 -0
  52. package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js.map +1 -0
  53. package/dist/components/test-prev/test-prev.d.ts +31 -0
  54. package/dist/components/test-prev/test-prev.js +87 -0
  55. package/dist/components/test-prev/test-prev.js.map +1 -0
  56. package/dist/components/test-print-context/test-print-context.d.ts +11 -0
  57. package/dist/components/test-print-context/test-print-context.js +24 -0
  58. package/dist/components/test-print-context/test-print-context.js.map +1 -0
  59. package/dist/components/test-print-item-variables/test-print-item-variables.d.ts +12 -0
  60. package/dist/components/test-print-item-variables/test-print-item-variables.js +88 -0
  61. package/dist/components/test-print-item-variables/test-print-item-variables.js.map +1 -0
  62. package/dist/components/test-scoring-buttons/test-scoring-buttons.d.ts +19 -0
  63. package/dist/components/test-scoring-buttons/test-scoring-buttons.js +101 -0
  64. package/dist/components/test-scoring-buttons/test-scoring-buttons.js.map +1 -0
  65. package/dist/components/test-scoring-feedback/test-scoring-feedback.d.ts +13 -0
  66. package/dist/components/test-scoring-feedback/test-scoring-feedback.js +58 -0
  67. package/dist/components/test-scoring-feedback/test-scoring-feedback.js.map +1 -0
  68. package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.d.ts +19 -0
  69. package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js +44 -0
  70. package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js.map +1 -0
  71. package/dist/components/test-section-link/test-section-link.d.ts +13 -0
  72. package/dist/components/test-section-link/test-section-link.js +45 -0
  73. package/dist/components/test-section-link/test-section-link.js.map +1 -0
  74. package/dist/components/test-show-correct-response/test-show-correct-response.d.ts +22 -0
  75. package/dist/components/test-show-correct-response/test-show-correct-response.js +91 -0
  76. package/dist/components/test-show-correct-response/test-show-correct-response.js.map +1 -0
  77. package/dist/components/test-stamp/test-stamp.d.ts +28 -0
  78. package/dist/components/test-stamp/test-stamp.js +104 -0
  79. package/dist/components/test-stamp/test-stamp.js.map +1 -0
  80. package/dist/components/test-view-toggle/test-view-toggle.d.ts +16 -0
  81. package/dist/components/test-view-toggle/test-view-toggle.js +57 -0
  82. package/dist/components/test-view-toggle/test-view-toggle.js.map +1 -0
  83. package/dist/components/test-view-toggle/test-view.d.ts +20 -0
  84. package/dist/components/test-view-toggle/test-view.js +81 -0
  85. package/dist/components/test-view-toggle/test-view.js.map +1 -0
  86. package/dist/index.d.ts +2 -0
  87. package/dist/index.js +3 -0
  88. package/dist/index.js.map +1 -0
  89. package/dist/mixins/index.d.ts +3 -0
  90. package/dist/mixins/index.js +4 -0
  91. package/dist/mixins/index.js.map +1 -0
  92. package/dist/mixins/test-base.d.ts +17 -0
  93. package/dist/mixins/test-base.js +153 -0
  94. package/dist/mixins/test-base.js.map +1 -0
  95. package/dist/mixins/test-navigation.mixin.d.ts +26 -0
  96. package/dist/mixins/test-navigation.mixin.js +502 -0
  97. package/dist/mixins/test-navigation.mixin.js.map +1 -0
  98. package/dist/mixins/test-processing.mixin.d.ts +11 -0
  99. package/dist/mixins/test-processing.mixin.js +55 -0
  100. package/dist/mixins/test-processing.mixin.js.map +1 -0
  101. package/dist/mixins/test-view.mixin.d.ts +6 -0
  102. package/dist/mixins/test-view.mixin.js +45 -0
  103. package/dist/mixins/test-view.mixin.js.map +1 -0
  104. package/dist/types/iqti-test.d.ts +28 -0
  105. package/dist/types/iqti-test.js +2 -0
  106. package/dist/types/iqti-test.js.map +1 -0
  107. package/package.json +51 -0
@@ -0,0 +1,44 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html, LitElement } from 'lit';
8
+ import { customElement } from 'lit/decorators.js';
9
+ import { prepareTemplate } from '@heximal/templates';
10
+ import { consume } from '@lit/context';
11
+ import { computedContext } from '@qti-components/base';
12
+ /**
13
+ * @deprecated test-paging-buttons-stamp is deprecated and will be removed in the future.
14
+ */
15
+ let TestPagingButtonsStamp = class TestPagingButtonsStamp extends LitElement {
16
+ #internals;
17
+ createRenderRoot() {
18
+ return this;
19
+ }
20
+ constructor() {
21
+ super();
22
+ this.#internals = this.attachInternals();
23
+ this.#internals.ariaLabel = 'pagination';
24
+ }
25
+ connectedCallback() {
26
+ super.connectedCallback();
27
+ const templateElement = this.querySelector('template');
28
+ this.myTemplate = prepareTemplate(templateElement);
29
+ }
30
+ render() {
31
+ if (!this.computedContext)
32
+ return html ``;
33
+ const items = this.computedContext.testParts.flatMap(testPart => testPart.sections.flatMap(section => section.items));
34
+ return html ` ${items.map(item => this.myTemplate({ item, view: this.computedContext.view }))} `;
35
+ }
36
+ };
37
+ __decorate([
38
+ consume({ context: computedContext, subscribe: true })
39
+ ], TestPagingButtonsStamp.prototype, "computedContext", void 0);
40
+ TestPagingButtonsStamp = __decorate([
41
+ customElement('test-paging-buttons-stamp')
42
+ ], TestPagingButtonsStamp);
43
+ export { TestPagingButtonsStamp };
44
+ //# sourceMappingURL=test-paging-buttons-stamp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-paging-buttons-stamp.js","sourceRoot":"","sources":["../../../src/components/test-paging-buttons-stamp/test-paging-buttons-stamp.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAKvD;;GAEG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,UAAU;IAKpD,UAAU,CAAmB;IAEV,gBAAgB;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACzC,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,YAAY,CAAC;IAC3C,CAAC;IAEQ,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAsB,UAAU,CAAC,CAAC;QAC5E,IAAI,CAAC,UAAU,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC;IACrD,CAAC;IAEQ,MAAM;QACb,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE,OAAO,IAAI,CAAA,EAAE,CAAC;QACzC,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAC9D,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CACpD,CAAC;QAEF,OAAO,IAAI,CAAA,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC;IAClG,CAAC;CACF,CAAA;AA7BS;IADP,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;+DACd;AAF9B,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CA+BlC","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { prepareTemplate } from '@heximal/templates';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '@qti-components/base';\n\nimport type { ComputedContext } from '@qti-components/base';\nimport type { TemplateFunction } from '@heximal/templates';\n\n/**\n * @deprecated test-paging-buttons-stamp is deprecated and will be removed in the future.\n */\n@customElement('test-paging-buttons-stamp')\nexport class TestPagingButtonsStamp extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n myTemplate: TemplateFunction;\n #internals: ElementInternals;\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n constructor() {\n super();\n this.#internals = this.attachInternals();\n this.#internals.ariaLabel = 'pagination';\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n override render() {\n if (!this.computedContext) return html``;\n const items = this.computedContext.testParts.flatMap(testPart =>\n testPart.sections.flatMap(section => section.items)\n );\n\n return html` ${items.map(item => this.myTemplate({ item, view: this.computedContext.view }))} `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-paging-buttons-stamp': TestPagingButtonsStamp;\n }\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import { LitElement } from 'lit';
2
+ import type { ComputedContext, ComputedItem } from '@qti-components/base';
3
+ /**
4
+ * Represents a custom element for navigating to the previous test item.
5
+ *
6
+ * @remarks
7
+ * This element provides functionality for navigating to the previous test item.
8
+ *
9
+ * @example
10
+ * ```html
11
+ * <test-prev></test-prev>
12
+ * ```
13
+ */
14
+ export declare class TestPrev extends LitElement {
15
+ _internalDisabled: boolean;
16
+ private computedContext;
17
+ sectionItems: ComputedItem[];
18
+ itemIndex: number;
19
+ _handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext): void;
20
+ static styles: import("lit").CSSResult;
21
+ constructor();
22
+ willUpdate(_changedProperties: Map<string | number | symbol, unknown>): void;
23
+ checkDisabled(): void;
24
+ protected _requestItem(identifier: string): void;
25
+ render(): import("lit").TemplateResult<1>;
26
+ }
27
+ declare global {
28
+ interface HTMLElementTagNameMap {
29
+ 'test-previous': TestPrev;
30
+ }
31
+ }
@@ -0,0 +1,87 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { css, html, LitElement } from 'lit';
8
+ import { customElement, property } from 'lit/decorators.js';
9
+ import { consume } from '@lit/context';
10
+ import { watch } from '@qti-components/utilities';
11
+ import { computedContext } from '@qti-components/base';
12
+ import * as styles from '../styles';
13
+ /**
14
+ * Represents a custom element for navigating to the previous test item.
15
+ *
16
+ * @remarks
17
+ * This element provides functionality for navigating to the previous test item.
18
+ *
19
+ * @example
20
+ * ```html
21
+ * <test-prev></test-prev>
22
+ * ```
23
+ */
24
+ let TestPrev = class TestPrev extends LitElement {
25
+ _handleTestElementChange(_oldValue, newValue) {
26
+ if (newValue) {
27
+ this._internalDisabled = false;
28
+ }
29
+ }
30
+ static { this.styles = css `
31
+ :host {
32
+ ${styles.btn};
33
+ }
34
+ :host([disabled]) {
35
+ ${styles.dis};
36
+ }
37
+ `; }
38
+ constructor() {
39
+ super();
40
+ this._internalDisabled = true;
41
+ this.addEventListener('click', e => {
42
+ e.preventDefault();
43
+ if (!this._internalDisabled)
44
+ this._requestItem(this.sectionItems[this.itemIndex - 1].identifier);
45
+ });
46
+ }
47
+ willUpdate(_changedProperties) {
48
+ if (!this.computedContext)
49
+ return;
50
+ const testPart = this.computedContext?.testParts.find(testPart => testPart.active);
51
+ if (!testPart)
52
+ return;
53
+ this.sectionItems = testPart.sections.flatMap(section => section.items);
54
+ this.itemIndex = this.sectionItems.findIndex(item => item.active);
55
+ this.checkDisabled();
56
+ }
57
+ checkDisabled() {
58
+ this._internalDisabled = !this.computedContext || this.itemIndex === 0 || this.itemIndex === -1;
59
+ }
60
+ _requestItem(identifier) {
61
+ this.dispatchEvent(new CustomEvent('qti-request-navigation', {
62
+ composed: true,
63
+ bubbles: true,
64
+ detail: {
65
+ type: 'item',
66
+ id: identifier
67
+ }
68
+ }));
69
+ }
70
+ render() {
71
+ return html `<slot></slot>`;
72
+ }
73
+ };
74
+ __decorate([
75
+ property({ type: Boolean, reflect: true, attribute: 'disabled' })
76
+ ], TestPrev.prototype, "_internalDisabled", void 0);
77
+ __decorate([
78
+ consume({ context: computedContext, subscribe: true })
79
+ ], TestPrev.prototype, "computedContext", void 0);
80
+ __decorate([
81
+ watch('computedContext')
82
+ ], TestPrev.prototype, "_handleTestElementChange", null);
83
+ TestPrev = __decorate([
84
+ customElement('test-prev')
85
+ ], TestPrev);
86
+ export { TestPrev };
87
+ //# sourceMappingURL=test-prev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-prev.js","sourceRoot":"","sources":["../../../src/components/test-prev/test-prev.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AAIpC;;;;;;;;;;GAUG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAWtC,wBAAwB,CAAC,SAA0B,EAAE,QAAyB;QAC5E,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QACjC,CAAC;IACH,CAAC;aAEe,WAAM,GAAG,GAAG,CAAA;;QAEtB,MAAM,CAAC,GAAG;;;QAGV,MAAM,CAAC,GAAG;;GAEf,AAPqB,CAOpB;IAEF;QACE,KAAK,EAAE,CAAC;QAzBH,sBAAiB,GAAG,IAAI,CAAC;QA2B9B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;YACjC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,IAAI,CAAC,iBAAiB;gBAAE,IAAI,CAAC,Y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,CAAC;mDAClC;AAGxB;IADP,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;iDACd;AAMzC;IADC,KAAK,CAAC,iBAAiB,CAAC;wDAKxB;AAfU,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAgEpB","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { watch } from '@qti-components/utilities';\nimport { computedContext } from '@qti-components/base';\n\nimport * as styles from '../styles';\n\nimport type { ComputedContext, ComputedItem } from '@qti-components/base';\n\n/**\n * Represents a custom element for navigating to the previous test item.\n *\n * @remarks\n * This element provides functionality for navigating to the previous test item.\n *\n * @example\n * ```html\n * <test-prev></test-prev>\n * ```\n */\n@customElement('test-prev')\nexport class TestPrev extends LitElement {\n @property({ type: Boolean, reflect: true, attribute: 'disabled' })\n public _internalDisabled = true;\n\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n sectionItems: ComputedItem[];\n itemIndex: number;\n\n @watch('computedContext')\n _handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext) {\n if (newValue) {\n this._internalDisabled = false;\n }\n }\n\n static override styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this._internalDisabled) this._requestItem(this.sectionItems[this.itemIndex - 1].identifier);\n });\n }\n\n override willUpdate(_changedProperties: Map<string | number | symbol, unknown>) {\n if (!this.computedContext) return;\n const testPart = this.computedContext?.testParts.find(testPart => testPart.active);\n if (!testPart) return;\n this.sectionItems = testPart.sections.flatMap(section => section.items);\n this.itemIndex = this.sectionItems.findIndex(item => item.active);\n this.checkDisabled();\n }\n\n checkDisabled() {\n this._internalDisabled = !this.computedContext || this.itemIndex === 0 || this.itemIndex === -1;\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-navigation', {\n composed: true,\n bubbles: true,\n detail: {\n type: 'item',\n id: identifier\n }\n })\n );\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-previous': TestPrev;\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { LitElement } from 'lit';
2
+ import type { ComputedContext } from '@qti-components/base';
3
+ export declare class TestPrintContext extends LitElement {
4
+ computedContext?: ComputedContext;
5
+ render(): import("lit").TemplateResult<1>;
6
+ }
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ 'test-print-context': TestPrintContext;
10
+ }
11
+ }
@@ -0,0 +1,24 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html, LitElement } from 'lit';
8
+ import { consume } from '@lit/context';
9
+ import { customElement, state } from 'lit/decorators.js';
10
+ import { computedContext } from '@qti-components/base';
11
+ let TestPrintContext = class TestPrintContext extends LitElement {
12
+ render() {
13
+ return html ` <small><pre>${JSON.stringify(this.computedContext, null, 2)}</pre></small> `;
14
+ }
15
+ };
16
+ __decorate([
17
+ state(),
18
+ consume({ context: computedContext, subscribe: true })
19
+ ], TestPrintContext.prototype, "computedContext", void 0);
20
+ TestPrintContext = __decorate([
21
+ customElement('test-print-context')
22
+ ], TestPrintContext);
23
+ export { TestPrintContext };
24
+ //# sourceMappingURL=test-print-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-print-context.js","sourceRoot":"","sources":["../../../src/components/test-print-context/test-print-context.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAKhD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAKrC,MAAM;QACb,OAAO,IAAI,CAAA,gBAAgB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,iBAAiB,CAAC;IAC5F,CAAC;CACF,CAAA;AALQ;IAFN,KAAK,EAAE;IACP,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;yDACd;AAH9B,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAQ5B","sourcesContent":["import { html, LitElement } from 'lit';\nimport { consume } from '@lit/context';\nimport { customElement, state } from 'lit/decorators.js';\n\nimport { computedContext } from '@qti-components/base';\n\nimport type { ComputedContext } from '@qti-components/base';\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 override 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"]}
@@ -0,0 +1,12 @@
1
+ import { LitElement } from 'lit';
2
+ import type { ComputedContext } from '@qti-components/base';
3
+ export declare class TestPrintVariables extends LitElement {
4
+ computedContext?: ComputedContext;
5
+ static styles: import("lit").CSSResult;
6
+ render(): import("lit").TemplateResult<1>;
7
+ }
8
+ declare global {
9
+ interface HTMLElementTagNameMap {
10
+ 'test-print-item-variables': TestPrintVariables;
11
+ }
12
+ }
@@ -0,0 +1,88 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html, css, LitElement } from 'lit';
8
+ import { consume } from '@lit/context';
9
+ import { customElement } from 'lit/decorators.js';
10
+ import { computedContext } from '@qti-components/base';
11
+ let TestPrintVariables = class TestPrintVariables extends LitElement {
12
+ static { this.styles = css `
13
+ table {
14
+ width: 100%;
15
+ border-collapse: collapse;
16
+ margin: 20px 0;
17
+ font-size: 14px;
18
+ text-align: left;
19
+ }
20
+ th,
21
+ td {
22
+ border: 1px solid #ddd;
23
+ padding: 8px;
24
+ }
25
+ th {
26
+ background-color: #f4f4f4;
27
+ font-weight: bold;
28
+ }
29
+ h3 {
30
+ margin-top: 20px;
31
+ font-size: 16px;
32
+ }
33
+ `; }
34
+ render() {
35
+ const activeItem = this.computedContext?.testParts
36
+ .flatMap(testPart => testPart.sections.flatMap(section => section.items))
37
+ .find(item => item.active);
38
+ if (!activeItem || !activeItem.variables)
39
+ return html ``;
40
+ const responseVariables = activeItem.variables.filter(v => v.type === 'response');
41
+ const outcomeVariables = activeItem.variables.filter(v => v.type === 'outcome');
42
+ const renderTable = (variables, title) => html `
43
+ <h3>${title}</h3>
44
+ <table>
45
+ <thead>
46
+ <tr>
47
+ <th>Identifier</th>
48
+ <th>Value</th>
49
+ <th>Cardinality</th>
50
+ <th>Base Type</th>
51
+ <th>Correct Response / Mappings</th>
52
+ </tr>
53
+ </thead>
54
+ <tbody>
55
+ ${variables.map(v => {
56
+ const correctResponse = v.correctResponse
57
+ ? Array.isArray(v.correctResponse)
58
+ ? v.correctResponse.join(', ')
59
+ : v.correctResponse
60
+ : '';
61
+ const mapEntries = v.mapping?.mapEntries?.map(m => `${m.mapKey}=${m.mappedValue}pt`).join(', ') || '';
62
+ const areaMapEntries = v.areaMapping?.areaMapEntries?.map(m => `${m.shape}(${m.coords})=${m.mappedValue}pt`).join(', ') || '';
63
+ return html `
64
+ <tr>
65
+ <td>${v.identifier}</td>
66
+ <td>${Array.isArray(v.value) ? v.value.join(', ') : v.value}</td>
67
+ <td>${v.cardinality}</td>
68
+ <td>${v.baseType}</td>
69
+ <td>${correctResponse || mapEntries || areaMapEntries}</td>
70
+ </tr>
71
+ `;
72
+ })}
73
+ </tbody>
74
+ </table>
75
+ `;
76
+ return html `
77
+ ${renderTable(responseVariables, 'Response Variables')} ${renderTable(outcomeVariables, 'Outcome Variables')}
78
+ `;
79
+ }
80
+ };
81
+ __decorate([
82
+ consume({ context: computedContext, subscribe: true })
83
+ ], TestPrintVariables.prototype, "computedContext", void 0);
84
+ TestPrintVariables = __decorate([
85
+ customElement('test-print-item-variables')
86
+ ], TestPrintVariables);
87
+ export { TestPrintVariables };
88
+ //# sourceMappingURL=test-print-item-variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-print-item-variables.js","sourceRoot":"","sources":["../../../src/components/test-print-item-variables/test-print-item-variables.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAMhD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;aAIhC,WAAM,GAAG,GAAG,CAAA;;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C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAEtG,MAAM,cAAc,GAClB,CAAC,CAAC,WAAW,EAAE,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAEzG,OAAO,IAAI,CAAA;;sBAED,CAAC,CAAC,UAAU;sBACZ,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;sBACrD,CAAC,CAAC,WAAW;sBACb,CAAC,CAAC,QAAQ;sBACV,eAAe,IAAI,UAAU,IAAI,cAAc;;aAExD,CAAC;QACJ,CAAC,CAAC;;;KAGP,CAAC;QAEF,OAAO,IAAI,CAAA;QACP,WAAW,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,IAAI,WAAW,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;KAC7G,CAAC;IACJ,CAAC;;AA7EM;IADN,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;2DACd;AAF9B,kBAAkB;IAD9B,aAAa,CAAC,2BAA2B,CAAC;GAC9B,kBAAkB,CAgF9B","sourcesContent":["import { html, css, LitElement } from 'lit';\nimport { consume } from '@lit/context';\nimport { customElement } from 'lit/decorators.js';\n\nimport { computedContext } from '@qti-components/base';\n\nimport type { ResponseVariable } from '@qti-components/base';\nimport type { ComputedContext } from '@qti-components/base';\n\n@customElement('test-print-item-variables')\nexport class TestPrintVariables extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n public computedContext?: ComputedContext;\n\n static override 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 override render() {\n const activeItem = this.computedContext?.testParts\n .flatMap(testPart => testPart.sections.flatMap(section => section.items))\n .find(item => item.active);\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 'test-print-item-variables': TestPrintVariables;\n }\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { LitElement, nothing } from 'lit';
2
+ import type { TemplateFunction } from '@heximal/templates';
3
+ import type { ComputedContext } from '@qti-components/base';
4
+ export declare class TestScoringButtons extends LitElement {
5
+ #private;
6
+ view: string;
7
+ disabled: boolean;
8
+ myTemplate: TemplateFunction | null;
9
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
10
+ connectedCallback(): void;
11
+ protected computedContext?: ComputedContext;
12
+ render(): import("lit").TemplateResult<1> | typeof nothing;
13
+ constructor();
14
+ }
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'test-scoring-buttons': TestScoringButtons;
18
+ }
19
+ }
@@ -0,0 +1,101 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html, LitElement, nothing } from 'lit';
8
+ import { consume } from '@lit/context';
9
+ import { customElement, property } from 'lit/decorators.js';
10
+ import { prepareTemplate } from '@heximal/templates';
11
+ import { computedContext } from '@qti-components/base';
12
+ let TestScoringButtons = class TestScoringButtons extends LitElement {
13
+ createRenderRoot() {
14
+ return this;
15
+ }
16
+ connectedCallback() {
17
+ super.connectedCallback();
18
+ const templateElement = this.querySelector('template');
19
+ if (!templateElement) {
20
+ this.myTemplate = null;
21
+ return;
22
+ }
23
+ this.myTemplate = prepareTemplate(templateElement);
24
+ }
25
+ #changeOutcomeScore(value) {
26
+ const testPart = this.computedContext?.testParts.find(testPart => testPart.active);
27
+ const sectionItems = testPart.sections.flatMap(section => section.items);
28
+ const currentItemIdentifier = sectionItems.find(item => item.active)?.identifier;
29
+ this.dispatchEvent(new CustomEvent('test-update-outcome-variable', {
30
+ detail: {
31
+ assessmentItemRefId: currentItemIdentifier,
32
+ outcomeVariableId: 'SCORE',
33
+ value
34
+ },
35
+ bubbles: true
36
+ }));
37
+ }
38
+ render() {
39
+ const activeItem = this.computedContext?.testParts
40
+ .flatMap(testPart => testPart.sections.flatMap(section => section.items))
41
+ .find(item => item.active);
42
+ if (!activeItem || !activeItem.variables)
43
+ return html ``;
44
+ const maxScore = activeItem.variables.find(vr => vr.identifier == 'MAXSCORE')?.value;
45
+ const scoreOutcome = activeItem.variables.find(vr => vr.identifier == 'SCORE');
46
+ const score = scoreOutcome?.value;
47
+ const disabled = !(scoreOutcome?.externalScored === 'human');
48
+ if (!maxScore || !scoreOutcome)
49
+ return nothing;
50
+ const scores = [...Array(Number(maxScore) + 1).keys()];
51
+ return html `${this.myTemplate ? this.myTemplate({ scores, score, disabled }) : nothing}`;
52
+ }
53
+ constructor() {
54
+ super();
55
+ this.view = ''; // is only an attribute, but this is here because.. react
56
+ this.disabled = false;
57
+ this.myTemplate = null;
58
+ this.addEventListener('click', e => {
59
+ const target = e.target;
60
+ const value = parseFloat(target.value);
61
+ if (target.tagName === 'INPUT') {
62
+ this.#changeOutcomeScore(value);
63
+ }
64
+ });
65
+ // return maxScore
66
+ // ? html`
67
+ // <form part="form">
68
+ // ${[...Array(Number(maxScore) + 1).keys()].map(itemIndex => {
69
+ // const identifier = `scoring-buttons${itemIndex}${activeItem.identifier}`;
70
+ // return html` <input
71
+ // part="input"
72
+ // type="radio"
73
+ // ?disabled=${this.disabled}
74
+ // .checked=${itemIndex === Number(score)}
75
+ // @change=${() => this._changeOutcomeScore(itemIndex)}
76
+ // id=${identifier}
77
+ // name=${`scoring-buttons-${activeItem.identifier}`}
78
+ // value=${itemIndex}
79
+ // />
80
+ // <label part="label" for=${identifier}>${itemIndex}</label>`;
81
+ // })}
82
+ // </form>
83
+ // <slot></slot>
84
+ // `
85
+ // : nothing;
86
+ }
87
+ };
88
+ __decorate([
89
+ property({ type: String, attribute: 'view' })
90
+ ], TestScoringButtons.prototype, "view", void 0);
91
+ __decorate([
92
+ property({ type: Boolean })
93
+ ], TestScoringButtons.prototype, "disabled", void 0);
94
+ __decorate([
95
+ consume({ context: computedContext, subscribe: true })
96
+ ], TestScoringButtons.prototype, "computedContext", void 0);
97
+ TestScoringButtons = __decorate([
98
+ customElement('test-scoring-buttons')
99
+ ], TestScoringButtons);
100
+ export { TestScoringButtons };
101
+ //# sourceMappingURL=test-scoring-buttons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-scoring-buttons.js","sourceRoot":"","sources":["../../../src/components/test-scoring-buttons/test-scoring-buttons.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAOhD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAK7B,gBAAgB;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAEQ,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAsB,UAAU,CAAC,CAAC;QAC5E,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC;IACrD,CAAC;IAKD,mBAAmB,CAAC,KAAa;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACnF,MAAM,YAAY,GAAG,QAAQ,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AAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAA2B;AAkB7C;IADT,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;2DACX;AApBjC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA4F9B","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { consume } from '@lit/context';\nimport { customElement, property } from 'lit/decorators.js';\nimport { prepareTemplate } from '@heximal/templates';\n\nimport { computedContext } from '@qti-components/base';\n\nimport type { TemplateFunction } from '@heximal/templates';\nimport type { OutcomeVariable } from '@qti-components/base';\nimport type { ComputedContext } from '@qti-components/base';\n\n@customElement('test-scoring-buttons')\nexport class TestScoringButtons extends LitElement {\n @property({ type: String, attribute: 'view' }) view = ''; // is only an attribute, but this is here because.. react\n @property({ type: Boolean }) disabled: boolean = false;\n myTemplate: TemplateFunction | null = null;\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n override 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 @consume({ context: computedContext, subscribe: true })\n protected computedContext?: ComputedContext;\n\n #changeOutcomeScore(value: number) {\n const testPart = this.computedContext?.testParts.find(testPart => testPart.active);\n const sectionItems = testPart.sections.flatMap(section => section.items);\n const currentItemIdentifier = sectionItems.find(item => item.active)?.identifier;\n\n this.dispatchEvent(\n new CustomEvent('test-update-outcome-variable', {\n detail: {\n assessmentItemRefId: currentItemIdentifier,\n outcomeVariableId: 'SCORE',\n value\n },\n bubbles: true\n })\n );\n }\n\n override render() {\n const activeItem = this.computedContext?.testParts\n .flatMap(testPart => testPart.sections.flatMap(section => section.items))\n .find(item => item.active);\n\n if (!activeItem || !activeItem.variables) return html``;\n\n const maxScore = activeItem.variables.find(vr => vr.identifier == 'MAXSCORE')?.value;\n const scoreOutcome = activeItem.variables.find(vr => vr.identifier == 'SCORE') as OutcomeVariable;\n\n const score = scoreOutcome?.value;\n\n const disabled = !(scoreOutcome?.externalScored === 'human');\n\n if (!maxScore || !scoreOutcome) return nothing;\n const scores = [...Array(Number(maxScore) + 1).keys()];\n\n return html`${this.myTemplate ? this.myTemplate({ scores, score, disabled }) : nothing}`;\n }\n\n constructor() {\n super();\n this.addEventListener('click', e => {\n const target = e.target as HTMLInputElement;\n const value = parseFloat(target.value);\n if (target.tagName === 'INPUT') {\n this.#changeOutcomeScore(value);\n }\n });\n\n // return maxScore\n // ? html`\n // <form part=\"form\">\n // ${[...Array(Number(maxScore) + 1).keys()].map(itemIndex => {\n // const identifier = `scoring-buttons${itemIndex}${activeItem.identifier}`;\n // return html` <input\n // part=\"input\"\n // type=\"radio\"\n // ?disabled=${this.disabled}\n // .checked=${itemIndex === Number(score)}\n // @change=${() => this._changeOutcomeScore(itemIndex)}\n // id=${identifier}\n // name=${`scoring-buttons-${activeItem.identifier}`}\n // value=${itemIndex}\n // />\n\n // <label part=\"label\" for=${identifier}>${itemIndex}</label>`;\n // })}\n // </form>\n // <slot></slot>\n // `\n // : nothing;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-scoring-buttons': TestScoringButtons;\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { LitElement } from 'lit';
2
+ import type { View } from '@qti-components/base';
3
+ import type { ComputedContext } from '@qti-components/base';
4
+ export declare class TestScoringFeedback extends LitElement {
5
+ protected computedContext?: ComputedContext;
6
+ view: View;
7
+ render(): import("lit").TemplateResult<1>;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ 'test-scoring-feedback': TestScoringFeedback;
12
+ }
13
+ }
@@ -0,0 +1,58 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { consume } from '@lit/context';
8
+ import { html, LitElement } from 'lit';
9
+ import { customElement, property } from 'lit/decorators.js';
10
+ import { computedContext } from '@qti-components/base';
11
+ let TestScoringFeedback = class TestScoringFeedback extends LitElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.view = null;
15
+ }
16
+ render() {
17
+ const activeItem = this.computedContext?.testParts
18
+ .flatMap(testPart => testPart.sections.flatMap(section => section.items))
19
+ .find(item => item.active);
20
+ if (!activeItem || !activeItem.variables)
21
+ return html ``;
22
+ if (activeItem['category'] === 'dep-informational')
23
+ return html `<div>${this.dataset.informational}</div>`;
24
+ const completionStatus = activeItem?.variables.find(v => v.identifier === 'completionStatus')?.value;
25
+ const scoreOutcome = activeItem?.variables.find(vr => vr.identifier == 'SCORE');
26
+ const score = parseFloat(scoreOutcome?.value);
27
+ const externalScored = activeItem['externalScored'];
28
+ const feedbackText = () => {
29
+ if (completionStatus !== 'completed') {
30
+ return this.dataset.textNoResponse;
31
+ }
32
+ if (!externalScored && score !== undefined && !Number.isNaN(score)) {
33
+ return score > 0 ? this.dataset.textCorrect : this.dataset.textIncorrect;
34
+ }
35
+ if (externalScored === 'externalMachine') {
36
+ return Number.isNaN(score) || score === undefined
37
+ ? this.dataset.scoreUnknown
38
+ : `We hebben je antwoord ${score === 0 ? 'geen punten' : score == 1 ? 'één punt' : `${score} punten`} gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt.`;
39
+ }
40
+ if (externalScored === 'human') {
41
+ return Number.isNaN(score) ? '' : 'Deze score heb je zelf toegekend.';
42
+ }
43
+ return this.dataset.inProgress;
44
+ };
45
+ return html `<div>${feedbackText()}</div>`;
46
+ }
47
+ };
48
+ __decorate([
49
+ consume({ context: computedContext, subscribe: true })
50
+ ], TestScoringFeedback.prototype, "computedContext", void 0);
51
+ __decorate([
52
+ property({ type: String, attribute: 'view' })
53
+ ], TestScoringFeedback.prototype, "view", void 0);
54
+ TestScoringFeedback = __decorate([
55
+ customElement('test-scoring-feedback')
56
+ ], TestScoringFeedback);
57
+ export { TestScoringFeedback };
58
+ //# sourceMappingURL=test-scoring-feedback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-scoring-feedback.js","sourceRoot":"","sources":["../../../src/components/test-scoring-feedback/test-scoring-feedback.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAOhD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IAA5C;;QAKE,SAAI,GAAS,IAAI,CAAC;IAyC3B,CAAC;IAvCU,MAAM;QACb,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS;aAC/C,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aACxE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE7B,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,SAAS;YAAE,OAAO,IAAI,CAAA,EAAE,CAAC;QAExD,IAAK,UAAkB,CAAC,UAAU,CAAC,KAAK,mBAAmB;YAAE,OAAO,IAAI,CAAA,QAAQ,IAAI,CAAC,OAAO,CAAC,aAAa,QAAQ,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K,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mCAAmC,CAAC;YACxE,CAAC;YAED,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;QACjC,CAAC,CAAC;QAEF,OAAO,IAAI,CAAA,QAAQ,YAAY,EAAE,QAAQ,CAAC;IAC5C,CAAC;CACF,CAAA;AA5CW;IADT,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;4DACX;AAGrC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;iDACrB;AALd,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CA8C/B","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { computedContext } from '@qti-components/base';\n\nimport type { View } from '@qti-components/base';\nimport type { OutcomeVariable } from '@qti-components/base';\nimport type { ComputedContext } from '@qti-components/base';\n\n@customElement('test-scoring-feedback')\nexport class TestScoringFeedback extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n protected computedContext?: ComputedContext;\n\n @property({ type: String, attribute: 'view' })\n public view: View = null;\n\n override render() {\n const activeItem = this.computedContext?.testParts\n .flatMap(testPart => testPart.sections.flatMap(section => section.items))\n .find(item => item.active);\n\n if (!activeItem || !activeItem.variables) return html``;\n\n if ((activeItem as any)['category'] === 'dep-informational') return html`<div>${this.dataset.informational}</div>`;\n\n const completionStatus = activeItem?.variables.find(v => v.identifier === 'completionStatus')?.value;\n const scoreOutcome = activeItem?.variables.find(vr => vr.identifier == 'SCORE') as OutcomeVariable;\n\n const score = parseFloat(scoreOutcome?.value as string);\n const externalScored = (activeItem as any)['externalScored'];\n\n const feedbackText = () => {\n if (completionStatus !== 'completed') {\n return this.dataset.textNoResponse;\n }\n\n if (!externalScored && score !== undefined && !Number.isNaN(score)) {\n return score > 0 ? this.dataset.textCorrect : this.dataset.textIncorrect;\n }\n\n if (externalScored === 'externalMachine') {\n return Number.isNaN(score) || score === undefined\n ? this.dataset.scoreUnknown\n : `We hebben je antwoord ${score === 0 ? 'geen punten' : score == 1 ? 'één punt' : `${score} punten`} gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt.`;\n }\n\n if (externalScored === 'human') {\n return Number.isNaN(score) ? '' : 'Deze score heb je zelf toegekend.';\n }\n\n return this.dataset.inProgress;\n };\n\n return html`<div>${feedbackText()}</div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-scoring-feedback': TestScoringFeedback;\n }\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { LitElement } from 'lit';
2
+ import type { TemplateFunction } from '@heximal/templates';
3
+ /**
4
+ * @deprecated test-section-buttons-stamp is deprecated and will be removed in the future.
5
+ */
6
+ export declare class TestSectionButtonsStamp extends LitElement {
7
+ #private;
8
+ private computedContext;
9
+ myTemplate: TemplateFunction;
10
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
11
+ constructor();
12
+ connectedCallback(): void;
13
+ render(): import("lit").TemplateResult<1>;
14
+ }
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'test-section-buttons-stamp': TestSectionButtonsStamp;
18
+ }
19
+ }
@@ -0,0 +1,44 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html, LitElement } from 'lit';
8
+ import { customElement } from 'lit/decorators.js';
9
+ import { prepareTemplate } from '@heximal/templates';
10
+ import { consume } from '@lit/context';
11
+ import { computedContext } from '@qti-components/base';
12
+ /**
13
+ * @deprecated test-section-buttons-stamp is deprecated and will be removed in the future.
14
+ */
15
+ let TestSectionButtonsStamp = class TestSectionButtonsStamp extends LitElement {
16
+ #internals;
17
+ createRenderRoot() {
18
+ return this;
19
+ }
20
+ constructor() {
21
+ super();
22
+ this.#internals = this.attachInternals();
23
+ this.#internals.ariaLabel = 'pagination';
24
+ }
25
+ connectedCallback() {
26
+ super.connectedCallback();
27
+ const templateElement = this.querySelector('template');
28
+ this.myTemplate = prepareTemplate(templateElement);
29
+ }
30
+ render() {
31
+ if (!this.computedContext)
32
+ return html ``;
33
+ const sections = this.computedContext.testParts.flatMap(testPart => testPart.sections);
34
+ return html ` ${sections.map(item => this.myTemplate({ item }))} `;
35
+ }
36
+ };
37
+ __decorate([
38
+ consume({ context: computedContext, subscribe: true })
39
+ ], TestSectionButtonsStamp.prototype, "computedContext", void 0);
40
+ TestSectionButtonsStamp = __decorate([
41
+ customElement('test-section-buttons-stamp')
42
+ ], TestSectionButtonsStamp);
43
+ export { TestSectionButtonsStamp };
44
+ //# sourceMappingURL=test-section-buttons-stamp.js.map