@citolab/qti-components 7.0.1 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/{index.min.js → index.js} +378 -186
- package/dist/custom-elements.json +27088 -0
- package/dist/{qti-test/index.d.ts → index.d.ts} +163 -2
- package/dist/index.js +13601 -0
- package/dist/index.js.map +1 -0
- package/dist/item.css +223 -32
- package/dist/{qti-loader → loader}/index.d.ts +1 -1
- package/dist/qti-components-jsx.d.ts +29 -25
- package/dist/{qti-simple-choice-CynLWb8d.d.cts → qti-simple-choice-DG8ImdPz.d.ts} +2 -2
- package/dist/vscode.html-custom-data.json +12 -9
- package/package.json +40 -59
- package/cdn/index.min.cjs +0 -4489
- package/dist/qti-components/index.cjs +0 -6704
- package/dist/qti-components/index.cjs.map +0 -1
- package/dist/qti-components/index.d.cts +0 -150
- package/dist/qti-components/index.d.ts +0 -150
- package/dist/qti-components/index.js +0 -6593
- package/dist/qti-components/index.js.map +0 -1
- package/dist/qti-item/index.cjs +0 -89
- package/dist/qti-item/index.cjs.map +0 -1
- package/dist/qti-item/index.d.cts +0 -24
- package/dist/qti-item/index.d.ts +0 -24
- package/dist/qti-item/index.js +0 -65
- package/dist/qti-item/index.js.map +0 -1
- package/dist/qti-loader/index.cjs +0 -332
- package/dist/qti-loader/index.cjs.map +0 -1
- package/dist/qti-loader/index.d.cts +0 -20
- package/dist/qti-simple-choice-CynLWb8d.d.ts +0 -1185
- package/dist/qti-test/index.cjs +0 -4632
- package/dist/qti-test/index.cjs.map +0 -1
- package/dist/qti-test/index.d.cts +0 -304
- package/dist/qti-test/index.js +0 -4599
- package/dist/qti-test/index.js.map +0 -1
- package/dist/qti-transformers/index.cjs +0 -316
- package/dist/qti-transformers/index.cjs.map +0 -1
- package/dist/qti-transformers/index.d.cts +0 -75
- /package/dist/{qti-loader → loader}/index.js +0 -0
- /package/dist/{qti-loader → loader}/index.js.map +0 -0
- /package/dist/{qti-transformers → transformers}/index.d.ts +0 -0
- /package/dist/{qti-transformers → transformers}/index.js +0 -0
- /package/dist/{qti-transformers → transformers}/index.js.map +0 -0
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
import * as lit_html from 'lit-html';
|
|
2
|
-
import { I as ItemContext, V as VariableDeclaration, p as QtiAssessmentItem } from '../qti-simple-choice-CynLWb8d.cjs';
|
|
3
|
-
import * as lit from 'lit';
|
|
4
|
-
import { LitElement } from 'lit';
|
|
5
|
-
import 'lit-html/directives/ref.js';
|
|
6
|
-
|
|
7
|
-
interface TestContext {
|
|
8
|
-
items: (ItemContext & {
|
|
9
|
-
category?: string;
|
|
10
|
-
})[];
|
|
11
|
-
testOutcomeVariables: VariableDeclaration<string | string[]>[];
|
|
12
|
-
}
|
|
13
|
-
type TestElement = {
|
|
14
|
-
el: QtiAssessmentTest;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
declare class QtiAssessmentItemRef extends LitElement {
|
|
18
|
-
category?: string;
|
|
19
|
-
identifier?: string;
|
|
20
|
-
required?: boolean;
|
|
21
|
-
fixed?: boolean;
|
|
22
|
-
href?: string;
|
|
23
|
-
_testContext?: TestContext;
|
|
24
|
-
weigths: Map<string, number>;
|
|
25
|
-
xmlDoc: DocumentFragment;
|
|
26
|
-
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
27
|
-
get assessmentItem(): QtiAssessmentItem | null;
|
|
28
|
-
connectedCallback(): Promise<void>;
|
|
29
|
-
render(): lit_html.TemplateResult<1>;
|
|
30
|
-
}
|
|
31
|
-
declare global {
|
|
32
|
-
interface HTMLElementTagNameMap {
|
|
33
|
-
'qti-assessment-item-ref': QtiAssessmentItemRef;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
declare class QtiAssessmentSection extends LitElement {
|
|
38
|
-
identifier: string;
|
|
39
|
-
required: string;
|
|
40
|
-
fixed: boolean;
|
|
41
|
-
title: string;
|
|
42
|
-
visible: boolean;
|
|
43
|
-
keepTogether: boolean;
|
|
44
|
-
_testContext?: TestContext;
|
|
45
|
-
connectedCallback(): Promise<void>;
|
|
46
|
-
render(): lit_html.TemplateResult<1>;
|
|
47
|
-
}
|
|
48
|
-
declare global {
|
|
49
|
-
interface HTMLElementTagNameMap {
|
|
50
|
-
'qti-assessment-section': QtiAssessmentSection;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
declare class QtiAssessmentTest extends LitElement {
|
|
55
|
-
identifier: string;
|
|
56
|
-
title: string;
|
|
57
|
-
_testContext?: TestContext;
|
|
58
|
-
connectedCallback(): Promise<void>;
|
|
59
|
-
render(): lit_html.TemplateResult<1>;
|
|
60
|
-
}
|
|
61
|
-
declare global {
|
|
62
|
-
interface HTMLElementTagNameMap {
|
|
63
|
-
'qti-assessment-test': QtiAssessmentTest;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
declare class QtiTestPart extends LitElement {
|
|
68
|
-
identifier: string;
|
|
69
|
-
title: string;
|
|
70
|
-
class: string;
|
|
71
|
-
NavigationMode: 'linear' | 'nonlinear';
|
|
72
|
-
submissionMode: 'individual' | 'simultaneous';
|
|
73
|
-
connectedCallback(): Promise<void>;
|
|
74
|
-
render(): lit_html.TemplateResult<1>;
|
|
75
|
-
}
|
|
76
|
-
declare global {
|
|
77
|
-
interface HTMLElementTagNameMap {
|
|
78
|
-
'qti-test-part': QtiTestPart;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare abstract class TestBase extends LitElement {
|
|
83
|
-
protected _testContext: Readonly<TestContext>;
|
|
84
|
-
protected testElement: TestElement;
|
|
85
|
-
constructor();
|
|
86
|
-
get context(): TestContext;
|
|
87
|
-
set context(testContext: TestContext);
|
|
88
|
-
private _updateItemVariablesInTestContext;
|
|
89
|
-
/**
|
|
90
|
-
* Updates the variables of an assessment item in the test context.
|
|
91
|
-
* - Matches the assessment item with the corresponding test context item.
|
|
92
|
-
* - If the item is not found, logs a warning.
|
|
93
|
-
* - Updates variables in the test context if exactly one variable exists.
|
|
94
|
-
* - Otherwise, syncs the assessment item's variables with the test context.
|
|
95
|
-
*
|
|
96
|
-
* @param assessmentItem - The assessment item to update.
|
|
97
|
-
*/
|
|
98
|
-
private _updateItemInTestContext;
|
|
99
|
-
connectedCallback(): void;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
declare const QtiTest_base: (abstract new (...args: any[]) => {}) & (abstract new (...args: any[]) => {}) & (abstract new (...args: any[]) => {}) & typeof TestBase;
|
|
103
|
-
/**
|
|
104
|
-
* `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
|
|
105
|
-
*
|
|
106
|
-
* This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.
|
|
107
|
-
*
|
|
108
|
-
* ### Example Usage
|
|
109
|
-
*
|
|
110
|
-
* Minimal markup:
|
|
111
|
-
* ```html
|
|
112
|
-
* <qti-test test="./path/to/assessment.xml">
|
|
113
|
-
* <test-container></test-container>
|
|
114
|
-
* </qti-test>
|
|
115
|
-
* ```
|
|
116
|
-
*
|
|
117
|
-
* With navigation buttons:
|
|
118
|
-
* ```html
|
|
119
|
-
* <qti-test >
|
|
120
|
-
* <test-container test-url="./path/to/assessment.xml"></test-container>
|
|
121
|
-
* <div class="flex">
|
|
122
|
-
* <test-prev></test-prev>
|
|
123
|
-
* <test-next></test-next>
|
|
124
|
-
* </div>
|
|
125
|
-
* </qti-test>
|
|
126
|
-
* ```
|
|
127
|
-
*
|
|
128
|
-
* You can use normal class names to style the elements.
|
|
129
|
-
* And you can use the `test-prev` and `test-next` elements to navigate through the test.
|
|
130
|
-
*
|
|
131
|
-
* @attr {string} testURL - the relative location to the QTI assessment.xml file
|
|
132
|
-
*
|
|
133
|
-
* @tag qti-player
|
|
134
|
-
*
|
|
135
|
-
* ### Features
|
|
136
|
-
*
|
|
137
|
-
* - **Dynamic Template Loading**:
|
|
138
|
-
* If a `<template>` element is included as a child of `<qti-test>`, its content is dynamically appended to the shadow DOM.
|
|
139
|
-
*/
|
|
140
|
-
declare class QtiTest extends QtiTest_base {
|
|
141
|
-
/**
|
|
142
|
-
* Lifecycle callback invoked when the element is added to the DOM.
|
|
143
|
-
* Automatically appends the content of a `<template>` element (if present)
|
|
144
|
-
* to the shadow DOM.
|
|
145
|
-
*/
|
|
146
|
-
connectedCallback(): void;
|
|
147
|
-
/**
|
|
148
|
-
* Renders the component's template.
|
|
149
|
-
* Provides a default `<slot>` for content projection.
|
|
150
|
-
*/
|
|
151
|
-
render(): lit_html.TemplateResult<1>;
|
|
152
|
-
}
|
|
153
|
-
declare global {
|
|
154
|
-
interface HTMLElementTagNameMap {
|
|
155
|
-
'qti-test': QtiTest;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
declare abstract class TestComponent extends LitElement {
|
|
160
|
-
disabled: boolean;
|
|
161
|
-
_testContext?: TestContext;
|
|
162
|
-
_testElement?: TestElement;
|
|
163
|
-
_handleTestElementChange(_oldValue: TestElement, newValue: TestElement): void;
|
|
164
|
-
protected _internals: ElementInternals;
|
|
165
|
-
protected items: any;
|
|
166
|
-
protected itemIndex: any;
|
|
167
|
-
protected view: any;
|
|
168
|
-
constructor();
|
|
169
|
-
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
170
|
-
protected _switchView(view: string): void;
|
|
171
|
-
protected _requestItem(identifier: string): void;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Represents a custom element for navigating to the next test item.
|
|
176
|
-
*
|
|
177
|
-
* @remarks
|
|
178
|
-
* This element provides functionality for navigating to the next test item.
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* ```html
|
|
182
|
-
* <test-next></test-next>
|
|
183
|
-
* ```
|
|
184
|
-
*/
|
|
185
|
-
declare class TestNext extends TestComponent {
|
|
186
|
-
static styles: lit.CSSResult;
|
|
187
|
-
constructor();
|
|
188
|
-
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
189
|
-
render(): lit_html.TemplateResult<1>;
|
|
190
|
-
}
|
|
191
|
-
declare global {
|
|
192
|
-
interface HTMLElementTagNameMap {
|
|
193
|
-
'test-next': TestNext;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Represents a custom element for navigating to the previous test item.
|
|
199
|
-
*
|
|
200
|
-
* @remarks
|
|
201
|
-
* This element provides functionality for navigating to the previous test item.
|
|
202
|
-
*
|
|
203
|
-
* @example
|
|
204
|
-
* ```html
|
|
205
|
-
* <test-prev></test-prev>
|
|
206
|
-
* ```
|
|
207
|
-
*/
|
|
208
|
-
declare class TestPrev extends TestComponent {
|
|
209
|
-
static styles: lit.CSSResult;
|
|
210
|
-
constructor();
|
|
211
|
-
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
212
|
-
render(): lit_html.TemplateResult<1>;
|
|
213
|
-
}
|
|
214
|
-
declare global {
|
|
215
|
-
interface HTMLElementTagNameMap {
|
|
216
|
-
'test-previous': TestPrev;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
declare class TestView extends TestComponent {
|
|
221
|
-
static DEFAULT_VIEW_OPTIONS: string[];
|
|
222
|
-
label: string;
|
|
223
|
-
viewOptions: string;
|
|
224
|
-
_handleViewOptionsChange: (_: string, viewOptions: string) => void;
|
|
225
|
-
private _viewOptions;
|
|
226
|
-
render(): lit_html.TemplateResult<1>;
|
|
227
|
-
}
|
|
228
|
-
declare global {
|
|
229
|
-
interface HTMLElementTagNameMap {
|
|
230
|
-
'test-view': TestView;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
declare class TestItemLink extends TestComponent {
|
|
235
|
-
private itemId;
|
|
236
|
-
constructor();
|
|
237
|
-
render(): lit_html.TemplateResult<1>;
|
|
238
|
-
}
|
|
239
|
-
declare global {
|
|
240
|
-
interface HTMLElementTagNameMap {
|
|
241
|
-
'test-item-link': TestItemLink;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* `<test-container>` is a custom element designed for hosting the qti-assessment-test.
|
|
247
|
-
* The `qti-assessment-test` will be placed inside the shadow DOM of this element.
|
|
248
|
-
*
|
|
249
|
-
* ### Example Usage
|
|
250
|
-
* The `test-container` element to hosts the visual representation of the items.
|
|
251
|
-
* You can style the container by adding a class to the element.
|
|
252
|
-
*
|
|
253
|
-
* ```html
|
|
254
|
-
* <qti-test testurl="./path/to/assessment.xml">
|
|
255
|
-
* <test-container class="container bg-white m-2"></test-container>
|
|
256
|
-
* </qti-test>
|
|
257
|
-
* ```
|
|
258
|
-
*
|
|
259
|
-
* @tag test-container
|
|
260
|
-
*/
|
|
261
|
-
declare class TestContainer extends LitElement {
|
|
262
|
-
/**
|
|
263
|
-
* Internal state for the dynamically loaded content.
|
|
264
|
-
* This is a Promise resolving to the content that will be rendered.
|
|
265
|
-
*/
|
|
266
|
-
private content;
|
|
267
|
-
testURL: string;
|
|
268
|
-
/**
|
|
269
|
-
* Preloaded content from a `<template>` child, if present.
|
|
270
|
-
*/
|
|
271
|
-
private preContent;
|
|
272
|
-
/**
|
|
273
|
-
* Lifecycle callback invoked when the element is added to the DOM.
|
|
274
|
-
* Handles template preloading and dispatches a `qti-load-test-request` event
|
|
275
|
-
* if no template is found.
|
|
276
|
-
*/
|
|
277
|
-
connectedCallback(): Promise<void>;
|
|
278
|
-
/**
|
|
279
|
-
* Renders the component content.
|
|
280
|
-
* Preloaded template content is rendered first, followed by the default slot
|
|
281
|
-
* and dynamically loaded content.
|
|
282
|
-
*/
|
|
283
|
-
render(): lit_html.TemplateResult<1>;
|
|
284
|
-
}
|
|
285
|
-
declare global {
|
|
286
|
-
interface HTMLElementTagNameMap {
|
|
287
|
-
'test-container': TestContainer;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
declare class TestPagingButtonsStamp extends TestComponent {
|
|
292
|
-
private maxDisplayedItems;
|
|
293
|
-
private skipOnCategory;
|
|
294
|
-
protected createRenderRoot(): this;
|
|
295
|
-
constructor();
|
|
296
|
-
render(): lit_html.TemplateResult<1>;
|
|
297
|
-
}
|
|
298
|
-
declare global {
|
|
299
|
-
interface HTMLElementTagNameMap {
|
|
300
|
-
'test-paging-buttons-stamp': TestPagingButtonsStamp;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export { QtiAssessmentItemRef, QtiAssessmentSection, QtiAssessmentTest, QtiTest, QtiTestPart, TestContainer, TestItemLink, TestNext, TestPagingButtonsStamp, TestPrev, TestView };
|