@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,24 @@
1
+ export * from '../components/qti-test/qti-test';
2
+ export * from '../components/qti-assessment-item-ref/qti-assessment-item-ref';
3
+ export * from '../components/qti-assessment-section/qti-assessment-section';
4
+ export * from '../components/qti-assessment-test/qti-assessment-test';
5
+ export * from '../components/qti-test-part/qti-test-part';
6
+ export * from '../components/qti-test-feedback/qti-test-feedback';
7
+ export * from './test-navigation/test-navigation';
8
+ export * from './test-next/test-next';
9
+ export * from './test-prev/test-prev';
10
+ export * from './test-view-toggle/test-view';
11
+ export * from './test-item-link/test-item-link';
12
+ export * from './test-end-attempt/test-end-attempt';
13
+ export * from './test-show-correct-response/test-show-correct-response';
14
+ export * from './test-paging-buttons-stamp/test-paging-buttons-stamp';
15
+ export * from './test-container/test-container';
16
+ export * from './test-print-item-variables/test-print-item-variables';
17
+ export * from './test-section-buttons-stamp/test-section-buttons-stamp';
18
+ export * from './test-section-link/test-section-link';
19
+ export * from './test-print-context/test-print-context';
20
+ export * from './test-stamp/test-stamp';
21
+ export * from './test-scoring-buttons/test-scoring-buttons';
22
+ export * from './test-view-toggle/test-view-toggle';
23
+ export * from './test-scoring-feedback/test-scoring-feedback';
24
+ export * from './test-check-item/test-check-item';
@@ -0,0 +1,26 @@
1
+ /* test functionality webcomponents which are tested and can be used in your project */
2
+ export * from '../components/qti-test/qti-test';
3
+ export * from '../components/qti-assessment-item-ref/qti-assessment-item-ref';
4
+ export * from '../components/qti-assessment-section/qti-assessment-section';
5
+ export * from '../components/qti-assessment-test/qti-assessment-test';
6
+ export * from '../components/qti-test-part/qti-test-part';
7
+ export * from '../components/qti-test-feedback/qti-test-feedback';
8
+ export * from './test-navigation/test-navigation';
9
+ export * from './test-next/test-next';
10
+ export * from './test-prev/test-prev';
11
+ export * from './test-view-toggle/test-view';
12
+ export * from './test-item-link/test-item-link';
13
+ export * from './test-end-attempt/test-end-attempt';
14
+ export * from './test-show-correct-response/test-show-correct-response';
15
+ export * from './test-paging-buttons-stamp/test-paging-buttons-stamp';
16
+ export * from './test-container/test-container';
17
+ export * from './test-print-item-variables/test-print-item-variables';
18
+ export * from './test-section-buttons-stamp/test-section-buttons-stamp';
19
+ export * from './test-section-link/test-section-link';
20
+ export * from './test-print-context/test-print-context';
21
+ export * from './test-stamp/test-stamp';
22
+ export * from './test-scoring-buttons/test-scoring-buttons';
23
+ export * from './test-view-toggle/test-view-toggle';
24
+ export * from './test-scoring-feedback/test-scoring-feedback';
25
+ export * from './test-check-item/test-check-item';
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,cAAc,iCAAiC,CAAC;AAChD,cAAc,+DAA+D,CAAC;AAC9E,cAAc,6DAA6D,CAAC;AAC5E,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mDAAmD,CAAC;AAElE,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yDAAyD,CAAC;AACxE,cAAc,uDAAuD,CAAC;AACtE,cAAc,iCAAiC,CAAC;AAChD,cAAc,uDAAuD,CAAC;AACtE,cAAc,yDAAyD,CAAC;AACxE,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yBAAyB,CAAC;AACxC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC","sourcesContent":["/* test functionality webcomponents which are tested and can be used in your project */\nexport * from '../components/qti-test/qti-test';\nexport * from '../components/qti-assessment-item-ref/qti-assessment-item-ref';\nexport * from '../components/qti-assessment-section/qti-assessment-section';\nexport * from '../components/qti-assessment-test/qti-assessment-test';\nexport * from '../components/qti-test-part/qti-test-part';\nexport * from '../components/qti-test-feedback/qti-test-feedback';\n\nexport * from './test-navigation/test-navigation';\nexport * from './test-next/test-next';\nexport * from './test-prev/test-prev';\nexport * from './test-view-toggle/test-view';\nexport * from './test-item-link/test-item-link';\nexport * from './test-end-attempt/test-end-attempt';\nexport * from './test-show-correct-response/test-show-correct-response';\nexport * from './test-paging-buttons-stamp/test-paging-buttons-stamp';\nexport * from './test-container/test-container';\nexport * from './test-print-item-variables/test-print-item-variables';\nexport * from './test-section-buttons-stamp/test-section-buttons-stamp';\nexport * from './test-section-link/test-section-link';\nexport * from './test-print-context/test-print-context';\nexport * from './test-stamp/test-stamp';\nexport * from './test-scoring-buttons/test-scoring-buttons';\nexport * from './test-view-toggle/test-view-toggle';\nexport * from './test-scoring-feedback/test-scoring-feedback';\nexport * from './test-check-item/test-check-item';\n"]}
@@ -0,0 +1,22 @@
1
+ import { LitElement } from 'lit';
2
+ import type { QtiAssessmentItem } from '@qti-components/elements';
3
+ import type { TemplateFunction } from '@heximal/templates';
4
+ export declare class QtiAssessmentItemRef extends LitElement {
5
+ category?: string;
6
+ identifier?: string;
7
+ required?: boolean;
8
+ fixed?: boolean;
9
+ href?: string;
10
+ weigths: Map<string, number>;
11
+ xmlDoc: DocumentFragment;
12
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
13
+ get assessmentItem(): QtiAssessmentItem | null;
14
+ myTemplate: TemplateFunction;
15
+ connectedCallback(): Promise<void>;
16
+ render(): unknown;
17
+ }
18
+ declare global {
19
+ interface HTMLElementTagNameMap {
20
+ 'qti-assessment-item-ref': QtiAssessmentItemRef;
21
+ }
22
+ }
@@ -0,0 +1,78 @@
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 { LitElement } from 'lit';
8
+ import { property } from 'lit/decorators.js';
9
+ // Converter function to interpret "true" and "false" as booleans
10
+ const stringToBooleanConverter = {
11
+ fromAttribute(value) {
12
+ return value === 'true';
13
+ },
14
+ toAttribute(value) {
15
+ return value ? 'true' : 'false';
16
+ }
17
+ };
18
+ // @customElement('qti-assessment-item-ref')
19
+ export class QtiAssessmentItemRef extends LitElement {
20
+ constructor() {
21
+ super(...arguments);
22
+ // @consume({ context: computedContext, subscribe: true })
23
+ // private computedContext: ComputedContext;
24
+ this.weigths = new Map();
25
+ }
26
+ createRenderRoot() {
27
+ return this;
28
+ }
29
+ get assessmentItem() {
30
+ return this.renderRoot?.querySelector('qti-assessment-item');
31
+ }
32
+ async connectedCallback() {
33
+ super.connectedCallback();
34
+ /*
35
+ searches for the template element to use in the qti-test component
36
+ can be used to render extra things for an item, like a bookmark, index nummer
37
+ put this in your test-container component
38
+ <template item-ref>
39
+ <div>Extra content</div>
40
+ </template>
41
+ */
42
+ // const templateElement = ((this.getRootNode() as any).host as HTMLElement)
43
+ // .closest('qti-test')
44
+ // .querySelector<HTMLTemplateElement>('template[item-ref]');
45
+ // if (templateElement) this.myTemplate = prepareTemplate(templateElement);
46
+ await this.updateComplete;
47
+ this.dispatchEvent(new CustomEvent('qti-assessment-item-ref-connected', {
48
+ bubbles: true,
49
+ composed: true,
50
+ detail: { identifier: this.identifier, href: this.href, category: this.category }
51
+ }));
52
+ }
53
+ render() {
54
+ return this.myTemplate ? this.myTemplate({ xmlDoc: this.xmlDoc }) : this.xmlDoc;
55
+ }
56
+ }
57
+ __decorate([
58
+ property({ type: String })
59
+ ], QtiAssessmentItemRef.prototype, "category", void 0);
60
+ __decorate([
61
+ property({ type: String })
62
+ ], QtiAssessmentItemRef.prototype, "identifier", void 0);
63
+ __decorate([
64
+ property({ type: Boolean, converter: stringToBooleanConverter })
65
+ ], QtiAssessmentItemRef.prototype, "required", void 0);
66
+ __decorate([
67
+ property({ type: Boolean, converter: stringToBooleanConverter })
68
+ ], QtiAssessmentItemRef.prototype, "fixed", void 0);
69
+ __decorate([
70
+ property({ type: String })
71
+ ], QtiAssessmentItemRef.prototype, "href", void 0);
72
+ __decorate([
73
+ property({ type: Object, attribute: false })
74
+ ], QtiAssessmentItemRef.prototype, "xmlDoc", void 0);
75
+ if (!customElements.get('qti-assessment-item-ref')) {
76
+ customElements.define('qti-assessment-item-ref', QtiAssessmentItemRef);
77
+ }
78
+ //# sourceMappingURL=qti-assessment-item-ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qti-assessment-item-ref.js","sourceRoot":"","sources":["../../../src/components/qti-assessment-item-ref/qti-assessment-item-ref.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAK7C,iEAAiE;AACjE,MAAM,wBAAwB,GAAG;IAC/B,aAAa,CAAC,KAAa;QACzB,OAAO,KAAK,KAAK,MAAM,CAAC;IAC1B,CAAC;IACD,WAAW,CAAC,KAAc;QACxB,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAClC,CAAC;CACF,CAAC;AAEF,4CAA4C;AAC5C,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IAApD;;QAOE,0DAA0D;QAC1D,4CAA4C;QAE5C,YAAO,GAAwB,IAAI,GAAG,EAAE,CAAC;IA8C3C,CAAC;IAzCoB,gBAAgB;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC/D,CAAC;IAIQ,KAAK,CAAC,iBAAiB;QAC9B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B;;;;;;;UAOE;QACF,4EAA4E;QAC5E,yBAAyB;QACzB,+DAA+D;QAE/D,2EAA2E;QAE3E,MAAM,IAAI,CAAC,cAAc,CAAC;QAE1B,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,mCAAmC,EAAE;YACnD,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;SAClF,CAAC,CACH,CAAC;IACJ,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAClF,CAAC;CACF;AAvD6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAqB;AACkB;IAAjE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC;sDAAoB;AACnB;IAAjE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC;mDAAiB;AACtD;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAe;AAQ1C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;oDACnB;AA6C5B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,yBAAyB,CAAC,EAAE,CAAC;IACnD,cAAc,CAAC,MAAM,CAAC,yBAAyB,EAAE,oBAAoB,CAAC,CAAC;AACzE,CAAC","sourcesContent":["import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport type { QtiAssessmentItem } from '@qti-components/elements';\nimport type { TemplateFunction } from '@heximal/templates';\n\n// Converter function to interpret \"true\" and \"false\" as booleans\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\n// @customElement('qti-assessment-item-ref')\nexport class QtiAssessmentItemRef extends LitElement {\n @property({ type: String }) category?: string;\n @property({ type: String }) identifier?: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) required?: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed?: boolean;\n @property({ type: String }) href?: string;\n\n // @consume({ context: computedContext, subscribe: true })\n // private computedContext: ComputedContext;\n\n weigths: Map<string, number> = new Map();\n\n @property({ type: Object, attribute: false })\n xmlDoc!: DocumentFragment; // the XMLDocument\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n get assessmentItem(): QtiAssessmentItem | null {\n return this.renderRoot?.querySelector('qti-assessment-item');\n }\n\n myTemplate: TemplateFunction;\n\n override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n\n /*\n searches for the template element to use in the qti-test component\n can be used to render extra things for an item, like a bookmark, index nummer\n put this in your test-container component\n <template item-ref>\n <div>Extra content</div>\n </template>\n */\n // const templateElement = ((this.getRootNode() as any).host as HTMLElement)\n // .closest('qti-test')\n // .querySelector<HTMLTemplateElement>('template[item-ref]');\n\n // if (templateElement) this.myTemplate = prepareTemplate(templateElement);\n\n await this.updateComplete;\n\n this.dispatchEvent(\n new CustomEvent('qti-assessment-item-ref-connected', {\n bubbles: true,\n composed: true,\n detail: { identifier: this.identifier, href: this.href, category: this.category }\n })\n );\n }\n\n override render() {\n return this.myTemplate ? this.myTemplate({ xmlDoc: this.xmlDoc }) : this.xmlDoc;\n }\n}\n\nif (!customElements.get('qti-assessment-item-ref')) {\n customElements.define('qti-assessment-item-ref', QtiAssessmentItemRef);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-item-ref': QtiAssessmentItemRef;\n }\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import { LitElement } from 'lit';
2
+ import type { TestContext } from '@qti-components/base';
3
+ export declare class QtiAssessmentSection extends LitElement {
4
+ #private;
5
+ identifier: string;
6
+ required: string;
7
+ fixed: boolean;
8
+ get title(): string;
9
+ set title(value: string);
10
+ visible: boolean;
11
+ keepTogether: boolean;
12
+ _testContext?: TestContext;
13
+ connectedCallback(): Promise<void>;
14
+ render(): import("lit").TemplateResult<1>;
15
+ }
16
+ declare global {
17
+ interface HTMLElementTagNameMap {
18
+ 'qti-assessment-section': QtiAssessmentSection;
19
+ }
20
+ }
@@ -0,0 +1,64 @@
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 { property } from 'lit/decorators.js';
10
+ import { testContext } from '@qti-components/base';
11
+ // https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/index.html#Root_AssessmentSection
12
+ const stringToBooleanConverter = {
13
+ fromAttribute(value) {
14
+ return value === 'true';
15
+ },
16
+ toAttribute(value) {
17
+ return value ? 'true' : 'false';
18
+ }
19
+ };
20
+ export class QtiAssessmentSection extends LitElement {
21
+ get title() {
22
+ return this.#title;
23
+ }
24
+ set title(value) {
25
+ this.#title = value;
26
+ this.removeAttribute('title');
27
+ this.setAttribute('data-title', value);
28
+ }
29
+ #title = '';
30
+ async connectedCallback() {
31
+ this.#title = this.getAttribute('title') || '';
32
+ super.connectedCallback();
33
+ await this.updateComplete;
34
+ this.dispatchEvent(new Event('qti-assessment-section-connected', {
35
+ bubbles: true,
36
+ composed: true
37
+ }));
38
+ }
39
+ render() {
40
+ return html `<slot name="qti-rubric-block"></slot><slot></slot>`;
41
+ }
42
+ }
43
+ __decorate([
44
+ property({ type: String })
45
+ ], QtiAssessmentSection.prototype, "identifier", void 0);
46
+ __decorate([
47
+ property({ type: String })
48
+ ], QtiAssessmentSection.prototype, "required", void 0);
49
+ __decorate([
50
+ property({ type: Boolean, converter: stringToBooleanConverter })
51
+ ], QtiAssessmentSection.prototype, "fixed", void 0);
52
+ __decorate([
53
+ property({ type: Boolean, converter: stringToBooleanConverter })
54
+ ], QtiAssessmentSection.prototype, "visible", void 0);
55
+ __decorate([
56
+ property({ type: Boolean, converter: stringToBooleanConverter, attribute: 'keep-together' })
57
+ ], QtiAssessmentSection.prototype, "keepTogether", void 0);
58
+ __decorate([
59
+ consume({ context: testContext, subscribe: true })
60
+ ], QtiAssessmentSection.prototype, "_testContext", void 0);
61
+ if (!customElements.get('qti-assessment-section')) {
62
+ customElements.define('qti-assessment-section', QtiAssessmentSection);
63
+ }
64
+ //# sourceMappingURL=qti-assessment-section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qti-assessment-section.js","sourceRoot":"","sources":["../../../src/components/qti-assessment-section/qti-assessment-section.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAInD,mGAAmG;AAEnG,MAAM,wBAAwB,GAAG;IAC/B,aAAa,CAAC,KAAa;QACzB,OAAO,KAAK,KAAK,MAAM,CAAC;IAC1B,CAAC;IACD,WAAW,CAAC,KAAc;QACxB,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAClC,CAAC;CACF,CAAC;AAEF,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IAKlD,IAAa,KAAK;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,IAAa,KAAK,CAAC,KAAa;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAOD,MAAM,GAAG,EAAE,CAAC;IAEH,KAAK,CAAC,iBAAiB;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAC/C,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,MAAM,IAAI,CAAC,cAAc,CAAC;QAC1B,IAAI,CAAC,aAAa,CAChB,IAAI,KAAK,CAAC,kCAAkC,EAAE;YAC5C,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAC;IACJ,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA,oDAAoD,CAAC;IAClE,CAAC;CACF;AAnC6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAoB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAkB;AACqB;IAAjE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC;mDAAgB;AAUf;IAAjE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC;qDAAkB;AACW;IAA7F,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;0DAAuB;AAG7G;IADN,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;0DACjB;AAqBpC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,wBAAwB,CAAC,EAAE,CAAC;IAClD,cAAc,CAAC,MAAM,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { testContext } from '@qti-components/base';\n\nimport type { TestContext } from '@qti-components/base';\n\n// https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/index.html#Root_AssessmentSection\n\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\nexport class QtiAssessmentSection extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String }) required: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed: boolean;\n\n override get title(): string {\n return this.#title;\n }\n override set title(value: string) {\n this.#title = value;\n this.removeAttribute('title');\n this.setAttribute('data-title', value);\n }\n @property({ type: Boolean, converter: stringToBooleanConverter }) visible: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter, attribute: 'keep-together' }) keepTogether: boolean;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n #title = '';\n\n override async connectedCallback(): Promise<void> {\n this.#title = this.getAttribute('title') || '';\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-assessment-section-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n override render() {\n return html`<slot name=\"qti-rubric-block\"></slot><slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-assessment-section')) {\n customElements.define('qti-assessment-section', QtiAssessmentSection);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-section': QtiAssessmentSection;\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { LitElement } from 'lit';
2
+ import type { TestContext } from '@qti-components/base';
3
+ export declare class QtiAssessmentTest extends LitElement {
4
+ #private;
5
+ identifier: string;
6
+ get title(): string;
7
+ set title(value: string);
8
+ _testContext?: TestContext;
9
+ connectedCallback(): Promise<void>;
10
+ render(): import("lit").TemplateResult<1>;
11
+ }
12
+ declare global {
13
+ interface HTMLElementTagNameMap {
14
+ 'qti-assessment-test': QtiAssessmentTest;
15
+ }
16
+ }
@@ -0,0 +1,47 @@
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 { testContext } from '@qti-components/base';
11
+ let QtiAssessmentTest = class QtiAssessmentTest extends LitElement {
12
+ get title() {
13
+ return this.#title;
14
+ }
15
+ set title(value) {
16
+ this.#title = value;
17
+ this.removeAttribute('title');
18
+ this.setAttribute('data-title', value);
19
+ }
20
+ #title = '';
21
+ async connectedCallback() {
22
+ super.connectedCallback();
23
+ await this.updateComplete;
24
+ this.dispatchEvent(new CustomEvent('qti-assessment-test-connected', {
25
+ detail: this,
26
+ bubbles: true,
27
+ composed: true
28
+ }));
29
+ }
30
+ render() {
31
+ return html ` <slot></slot>`;
32
+ }
33
+ };
34
+ __decorate([
35
+ property({ type: String })
36
+ ], QtiAssessmentTest.prototype, "identifier", void 0);
37
+ __decorate([
38
+ property({ type: String })
39
+ ], QtiAssessmentTest.prototype, "title", null);
40
+ __decorate([
41
+ consume({ context: testContext, subscribe: true })
42
+ ], QtiAssessmentTest.prototype, "_testContext", void 0);
43
+ QtiAssessmentTest = __decorate([
44
+ customElement('qti-assessment-test')
45
+ ], QtiAssessmentTest);
46
+ export { QtiAssessmentTest };
47
+ //# sourceMappingURL=qti-assessment-test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qti-assessment-test.js","sourceRoot":"","sources":["../../../src/components/qti-assessment-test/qti-assessment-test.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,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAK5C,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAG/C,IAAa,KAAK;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,IAAa,KAAK,CAAC,KAAa;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAID,MAAM,GAAG,EAAE,CAAC;IAEH,KAAK,CAAC,iBAAiB;QAC9B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,MAAM,IAAI,CAAC,cAAc,CAAC;QAC1B,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,+BAA+B,EAAE;YAC/C,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAC;IACJ,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA,gBAAgB,CAAC;IAC9B,CAAC;CACF,CAAA;AA9B6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAoB;AAE/C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAG1B;AAQM;IADN,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;uDACjB;AAbvB,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA+B7B","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { testContext } from '@qti-components/base';\n\nimport type { TestContext } from '@qti-components/base';\n\n@customElement('qti-assessment-test')\nexport class QtiAssessmentTest extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String })\n override get title(): string {\n return this.#title;\n }\n override set title(value: string) {\n this.#title = value;\n this.removeAttribute('title');\n this.setAttribute('data-title', value);\n }\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n #title = '';\n\n override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new CustomEvent('qti-assessment-test-connected', {\n detail: this,\n bubbles: true,\n composed: true\n })\n );\n }\n\n override render() {\n return html` <slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-test': QtiAssessmentTest;\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import { LitElement } from 'lit';
2
+ import type { QtiRuleBase } from '@qti-components/base';
3
+ export declare class QtiOutcomeProcessing extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ render(): import("lit").TemplateResult<1>;
6
+ process(): void;
7
+ }
8
+ declare global {
9
+ interface HTMLElementTagNameMap {
10
+ 'qti-outcome-processing': QtiOutcomeProcessing;
11
+ }
12
+ }
13
+ export declare class QtiOutcomeProcessingProcessor {
14
+ process(rules: QtiRuleBase[]): void;
15
+ }
@@ -0,0 +1,37 @@
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 } from 'lit/decorators.js';
9
+ let QtiOutcomeProcessing = class QtiOutcomeProcessing extends LitElement {
10
+ static { this.styles = [
11
+ css `
12
+ :host {
13
+ display: none;
14
+ }
15
+ `
16
+ ]; }
17
+ render() {
18
+ return html `<slot></slot>`;
19
+ }
20
+ process() {
21
+ const logic = new QtiOutcomeProcessingProcessor();
22
+ const rules = [...this.children];
23
+ logic.process(rules);
24
+ }
25
+ };
26
+ QtiOutcomeProcessing = __decorate([
27
+ customElement('qti-outcome-processing')
28
+ ], QtiOutcomeProcessing);
29
+ export { QtiOutcomeProcessing };
30
+ export class QtiOutcomeProcessingProcessor {
31
+ process(rules) {
32
+ for (const rule of rules) {
33
+ rule.process();
34
+ }
35
+ }
36
+ }
37
+ //# sourceMappingURL=qti-outcome-processing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qti-outcome-processing.js","sourceRoot":"","sources":["../../../src/components/qti-outcome-processing/qti-outcome-processing.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAK3C,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU;aAClC,WAAM,GAAG;QACvB,GAAG,CAAA;;;;KAIF;KACF,AANqB,CAMpB;IAEO,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;IAEM,OAAO;QACZ,MAAM,KAAK,GAAG,IAAI,6BAA6B,EAAE,CAAC;QAClD,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAA6B,CAAC;QAC7D,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;;AAjBU,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CAkBhC;;AAQD,MAAM,OAAO,6BAA6B;IACjC,OAAO,CAAC,KAAoB;QACjC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;CACF","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport type { QtiRuleBase } from '@qti-components/base';\n\n@customElement('qti-outcome-processing')\nexport class QtiOutcomeProcessing extends LitElement {\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n\n public process() {\n const logic = new QtiOutcomeProcessingProcessor();\n const rules = [...this.children] as unknown as QtiRuleBase[];\n logic.process(rules);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-outcome-processing': QtiOutcomeProcessing;\n }\n}\n\nexport class QtiOutcomeProcessingProcessor {\n public process(rules: QtiRuleBase[]) {\n for (const rule of rules) {\n rule.process();\n }\n }\n}\n"]}
@@ -0,0 +1,69 @@
1
+ import { LitElement } from 'lit';
2
+ declare const QtiTest_base: (abstract new (...args: any[]) => {}) & (abstract new (...args: any[]) => {}) & (abstract new (...args: any[]) => {
3
+ updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void;
4
+ getOutcome(identifier: string): Readonly<import("packages/qti-base/dist").OutcomeVariable>;
5
+ getVariable(identifier: string): Readonly<import("packages/qti-base/dist").VariableDeclaration<string | string[] | null>>;
6
+ outcomeProcessing(): boolean;
7
+ }) & (abstract new (...args: any[]) => import("../../mixins").TestBaseInterface) & typeof LitElement;
8
+ /**
9
+ * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
10
+ *
11
+ * This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.
12
+ *
13
+ * ### Example Usage
14
+ *
15
+ * Minimal example including navigation:
16
+ *
17
+ * ```html
18
+ * <qti-test>
19
+ * <test-navigation>
20
+ * <test-container test-url="./path/to/assessment.xml"></test-container>
21
+ * <nav class="flex">
22
+ * <test-prev></test-prev>
23
+ * <test-next></test-next>
24
+ * </nav>
25
+ * </test-navigation>
26
+ * </qti-test>
27
+ * ```
28
+ *
29
+ * Use the following file structure
30
+ * A qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.
31
+ *
32
+ * ```plaintext
33
+ * Root/
34
+ * ├── index.html
35
+ * └── /assets/api/examples/
36
+ * ├── assessmenttest.xml
37
+ * └── imsmanifest.xml
38
+ *
39
+ * ```
40
+ *
41
+ * ### Test components
42
+ *
43
+ * Use test components inside the qti-test component for added functionality.
44
+ * ### Test next
45
+ * `<test-next> | TestNext`
46
+ *
47
+ * ### Test prev
48
+ *
49
+ * `<test-prev> | TestPrev`
50
+ * ### Test components
51
+ *
52
+ * You can use normal class names to style the elements.
53
+ * And you can use the `test-prev` and `test-next` elements to navigate through the test.
54
+ *
55
+ */
56
+ export declare class QtiTest extends QtiTest_base {
57
+ /**
58
+ * Renders the component's template.
59
+ * Provides a default `<slot>` for content projection.
60
+ */
61
+ connectedCallback(): Promise<void>;
62
+ render(): import("lit").TemplateResult<1>;
63
+ }
64
+ declare global {
65
+ interface HTMLElementTagNameMap {
66
+ 'qti-test': QtiTest;
67
+ }
68
+ }
69
+ export {};
@@ -0,0 +1,80 @@
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 { TestNavigationMixin, TestViewMixin } from '../../mixins';
10
+ import { TestBaseMixin } from '../../mixins/test-base';
11
+ import { TestProcessingMixin } from '../../mixins/test-processing.mixin';
12
+ /**
13
+ * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
14
+ *
15
+ * This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.
16
+ *
17
+ * ### Example Usage
18
+ *
19
+ * Minimal example including navigation:
20
+ *
21
+ * ```html
22
+ * <qti-test>
23
+ * <test-navigation>
24
+ * <test-container test-url="./path/to/assessment.xml"></test-container>
25
+ * <nav class="flex">
26
+ * <test-prev></test-prev>
27
+ * <test-next></test-next>
28
+ * </nav>
29
+ * </test-navigation>
30
+ * </qti-test>
31
+ * ```
32
+ *
33
+ * Use the following file structure
34
+ * A qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.
35
+ *
36
+ * ```plaintext
37
+ * Root/
38
+ * ├── index.html
39
+ * └── /assets/api/examples/
40
+ * ├── assessmenttest.xml
41
+ * └── imsmanifest.xml
42
+ *
43
+ * ```
44
+ *
45
+ * ### Test components
46
+ *
47
+ * Use test components inside the qti-test component for added functionality.
48
+ * ### Test next
49
+ * `<test-next> | TestNext`
50
+ *
51
+ * ### Test prev
52
+ *
53
+ * `<test-prev> | TestPrev`
54
+ * ### Test components
55
+ *
56
+ * You can use normal class names to style the elements.
57
+ * And you can use the `test-prev` and `test-next` elements to navigate through the test.
58
+ *
59
+ */
60
+ let QtiTest = class QtiTest extends TestNavigationMixin(TestViewMixin(TestProcessingMixin(TestBaseMixin(LitElement)))) {
61
+ // TODO: Properly implement IQtiTest interface
62
+ // export class QtiTest extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {
63
+ /**
64
+ * Renders the component's template.
65
+ * Provides a default `<slot>` for content projection.
66
+ */
67
+ async connectedCallback() {
68
+ super.connectedCallback();
69
+ await this.updateComplete;
70
+ this.dispatchEvent(new CustomEvent('qti-test-connected', { detail: this }));
71
+ }
72
+ render() {
73
+ return html `<slot></slot>`;
74
+ }
75
+ };
76
+ QtiTest = __decorate([
77
+ customElement('qti-test')
78
+ ], QtiTest);
79
+ export { QtiTest };
80
+ //# sourceMappingURL=qti-test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qti-test.js","sourceRoot":"","sources":["../../../src/components/qti-test/qti-test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAIzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,mBAAmB,CAAC,aAAa,CAAC,mBAAmB,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7G,8CAA8C;IAC9C,+FAA+F;IAE/F;;;OAGG;IACM,KAAK,CAAC,iBAAiB;QAC9B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,MAAM,IAAI,CAAC,cAAc,CAAC;QAC1B,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,oBAAoB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;CACF,CAAA;AAjBY,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAiBnB","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { TestNavigationMixin, TestViewMixin } from '../../mixins';\nimport { TestBaseMixin } from '../../mixins/test-base';\nimport { TestProcessingMixin } from '../../mixins/test-processing.mixin';\n\nimport type { IQtiTest } from '../../types/iqti-test';\n\n/**\n * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n *\n * This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n *\n * ### Example Usage\n *\n * Minimal example including navigation:\n *\n * ```html\n * <qti-test>\n * <test-navigation>\n * <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n * <nav class=\"flex\">\n * <test-prev></test-prev>\n * <test-next></test-next>\n * </nav>\n * </test-navigation>\n * </qti-test>\n * ```\n *\n * Use the following file structure\n * A qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n *\n * ```plaintext\n * Root/\n * ├── index.html\n * └── /assets/api/examples/\n * ├── assessmenttest.xml\n * └── imsmanifest.xml\n *\n * ```\n *\n * ### Test components\n *\n * Use test components inside the qti-test component for added functionality.\n * ### Test next\n * `<test-next> | TestNext`\n *\n * ### Test prev\n *\n * `<test-prev> | TestPrev`\n * ### Test components\n *\n * You can use normal class names to style the elements.\n * And you can use the `test-prev` and `test-next` elements to navigate through the test.\n *\n */\n@customElement('qti-test')\nexport class QtiTest extends TestNavigationMixin(TestViewMixin(TestProcessingMixin(TestBaseMixin(LitElement)))) {\n // TODO: Properly implement IQtiTest interface\n // export class QtiTest extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {\n\n /**\n * Renders the component's template.\n * Provides a default `<slot>` for content projection.\n */\n override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(new CustomEvent('qti-test-connected', { detail: this }));\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test': QtiTest;\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { QtiModalFeedback } from '@qti-components/elements';
2
+ export declare class QtiTestFeedback extends QtiModalFeedback {
3
+ static styles: import("lit").CSSResult;
4
+ render(): import("lit").TemplateResult<1>;
5
+ }
6
+ declare global {
7
+ interface HTMLElementTagNameMap {
8
+ 'qti-test-feedback': QtiTestFeedback;
9
+ }
10
+ }
@@ -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 { customElement } from 'lit/decorators.js';
8
+ import { css, html } from 'lit';
9
+ import { QtiModalFeedback } from '@qti-components/elements';
10
+ let QtiTestFeedback = class QtiTestFeedback extends QtiModalFeedback {
11
+ static { this.styles = css `
12
+ :host {
13
+ color: gray;
14
+ }
15
+ `; }
16
+ render() {
17
+ return html ``;
18
+ }
19
+ };
20
+ QtiTestFeedback = __decorate([
21
+ customElement('qti-test-feedback')
22
+ ], QtiTestFeedback);
23
+ export { QtiTestFeedback };
24
+ //# sourceMappingURL=qti-test-feedback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qti-test-feedback.js","sourceRoot":"","sources":["../../../src/components/qti-test-feedback/qti-test-feedback.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGrD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,gBAAgB;aACnC,WAAM,GAAG,GAAG,CAAA;;;;GAI3B,AAJqB,CAIpB;IACO,MAAM;QACb,OAAO,IAAI,CAAA,EAAE,CAAC;IAChB,CAAC;;AARU,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAS3B","sourcesContent":["import { customElement } from 'lit/decorators.js';\nimport { css, html } from 'lit';\n\nimport { QtiModalFeedback } from '@qti-components/elements';\n\n@customElement('qti-test-feedback')\nexport class QtiTestFeedback extends QtiModalFeedback {\n static override styles = css`\n :host {\n color: gray;\n }\n `;\n override render() {\n return html``;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test-feedback': QtiTestFeedback;\n }\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class QtiTestPart extends LitElement {
3
+ #private;
4
+ identifier: string;
5
+ get title(): string;
6
+ set title(value: string);
7
+ class: string;
8
+ navigationMode: 'linear' | 'nonlinear';
9
+ submissionMode: 'individual' | 'simultaneous';
10
+ connectedCallback(): Promise<void>;
11
+ render(): import("lit").TemplateResult<1>;
12
+ }
13
+ declare global {
14
+ interface HTMLElementTagNameMap {
15
+ 'qti-test-part': QtiTestPart;
16
+ }
17
+ }