@citolab/qti-components 10.0.0-next.2 → 10.0.0-next.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +4334 -2688
- package/dist/base.d.ts +39 -13
- package/dist/base.js +14 -1
- package/dist/{chunk-RU6332MD.js → chunk-2A52V5TQ.js} +4 -4
- package/dist/{chunk-MI7774NV.js → chunk-5BP2A7BI.js} +2 -2
- package/dist/{chunk-35WWWFS6.js → chunk-DAESCCLR.js} +2 -2
- package/dist/chunk-DJ7PB252.js +7 -0
- package/dist/chunk-DJ7PB252.js.map +1 -0
- package/dist/{chunk-3ZNECUPV.js → chunk-GJWA6LLT.js} +2 -2
- package/dist/{chunk-TDWJ6WZA.js → chunk-GPC53O7P.js} +166 -10
- package/dist/chunk-GPC53O7P.js.map +1 -0
- package/dist/{chunk-6U3YPHXU.js → chunk-H6DO5UHC.js} +277 -154
- package/dist/chunk-H6DO5UHC.js.map +1 -0
- package/dist/chunk-J6VX4N7M.js +197 -0
- package/dist/chunk-J6VX4N7M.js.map +1 -0
- package/dist/{chunk-FD4AB6TM.js → chunk-KQ2LED4X.js} +2 -2
- package/dist/{chunk-6K3QWJHH.js → chunk-LPYZVKHX.js} +48 -7
- package/dist/chunk-LPYZVKHX.js.map +1 -0
- package/dist/{chunk-K3VKQ6QF.js → chunk-ORQFZNJW.js} +614 -1847
- package/dist/chunk-ORQFZNJW.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/{chunk-GBZNFSFY.js → chunk-TSJGL6FI.js} +2 -2
- package/dist/{chunk-RSMYGGQK.js → chunk-TZCOXFPB.js} +1590 -610
- package/dist/chunk-TZCOXFPB.js.map +1 -0
- package/dist/chunk-UCXLDQYA.js +56 -0
- package/dist/chunk-UCXLDQYA.js.map +1 -0
- package/dist/chunk-WWY2H2YO.js +7 -0
- package/dist/chunk-WWY2H2YO.js.map +1 -0
- package/dist/{chunk-LFVPS7KB.js → chunk-XWRZP2RM.js} +2 -2
- package/dist/{chunk-2KP5UU5A.js → chunk-Y6Q3F2S7.js} +117 -92
- package/dist/chunk-Y6Q3F2S7.js.map +1 -0
- package/dist/{chunk-TLAVOBEM.js → chunk-ZRORBAHB.js} +122 -3
- package/dist/chunk-ZRORBAHB.js.map +1 -0
- package/dist/computed.types.d-6Ht-HNRx.d.ts +80 -0
- package/dist/{config.context.d-BvU9r-Mg.d.ts → config.context.d-Dm11aAuw.d.ts} +21 -3
- package/dist/corrections.d.ts +137 -24
- package/dist/corrections.js +12 -12
- package/dist/corrections.js.map +1 -1
- package/dist/elements.d.ts +66 -73
- package/dist/elements.js +9 -6
- package/dist/index.d.ts +21 -17
- package/dist/index.js +47 -61
- package/dist/interactions.d.ts +98 -19
- package/dist/interactions.js +8 -3
- package/dist/item.css +1948 -1946
- package/dist/item.d.ts +8 -6
- package/dist/item.js +6 -5
- package/dist/item.types.d-Zc6ZQDhu.d.ts +25 -0
- package/dist/loader.d.ts +5 -3
- package/dist/loader.js +3 -2
- package/dist/processing.d.ts +19 -7
- package/dist/processing.js +4 -3
- package/dist/public-events.d-3dGip9pd.d.ts +105 -0
- package/dist/qti-components-jsx.d.ts +1780 -1727
- package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-7Kd4LBxn.d.ts} +1 -1
- package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-iH3w6mqf.d.ts} +2 -1
- package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-CT0W-8Gm.d.ts} +8 -1
- package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-CxP6KtCH.d.ts} +3 -2
- package/dist/{qti-rule-base.d-Bdzg8eGH.d.ts → qti-rule-base.d-CeKP0Ooi.d.ts} +2 -2
- package/dist/qti-test-state-CF9S8X9C.d.ts +68 -0
- package/dist/qti-test-state.d-D8Q89RzZ.d.ts +57 -0
- package/dist/{qti-test.d-DkpBNcsv.d.ts → qti-test.d-sskv-dEN.d.ts} +87 -485
- package/dist/{qti-text-entry-interaction.d-q8u5BiVK.d.ts → qti-text-entry-interaction.d-m0EFv9no.d.ts} +221 -73
- package/dist/{qti-transform-test.d-BL7GGFJj.d.ts → qti-transform-test.d-Bb9vnLzP.d.ts} +1 -0
- package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-N1Bq7e1f.d.ts} +67 -4
- package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-9gRdGK4T.d.ts} +7 -1
- package/dist/test-plugin-api.d.ts +134 -0
- package/dist/test-plugin-api.js +19 -0
- package/dist/test-plugin-api.js.map +1 -0
- package/dist/test.d.ts +26 -57
- package/dist/test.js +19 -48
- package/dist/transformers.d.ts +1 -1
- package/dist/transformers.js +2 -1
- package/dist/{item.types.d-B55QkJ92.d.ts → variables.d-DWHlTszN.d.ts} +8 -24
- package/package.json +16 -11
- package/dist/chunk-2KP5UU5A.js.map +0 -1
- package/dist/chunk-6K3QWJHH.js.map +0 -1
- package/dist/chunk-6U3YPHXU.js.map +0 -1
- package/dist/chunk-K3VKQ6QF.js.map +0 -1
- package/dist/chunk-RSMYGGQK.js.map +0 -1
- package/dist/chunk-TDWJ6WZA.js.map +0 -1
- package/dist/chunk-TLAVOBEM.js.map +0 -1
- package/dist/chunk-ZP6QQYSU.js +0 -7
- package/dist/chunk-ZP6QQYSU.js.map +0 -1
- package/dist/computed.types.d-gJrBeUMG.d.ts +0 -42
- /package/dist/{chunk-RU6332MD.js.map → chunk-2A52V5TQ.js.map} +0 -0
- /package/dist/{chunk-MI7774NV.js.map → chunk-5BP2A7BI.js.map} +0 -0
- /package/dist/{chunk-35WWWFS6.js.map → chunk-DAESCCLR.js.map} +0 -0
- /package/dist/{chunk-3ZNECUPV.js.map → chunk-GJWA6LLT.js.map} +0 -0
- /package/dist/{chunk-FD4AB6TM.js.map → chunk-KQ2LED4X.js.map} +0 -0
- /package/dist/{chunk-GBZNFSFY.js.map → chunk-TSJGL6FI.js.map} +0 -0
- /package/dist/{chunk-LFVPS7KB.js.map → chunk-XWRZP2RM.js.map} +0 -0
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
|
-
import { LitElement, PropertyValues
|
|
3
|
-
import { b as transformTestApi, t as transformItemApi } from './qti-transform-test.d-
|
|
4
|
-
import { C as ComputedContext, a as ComputedItem } from './computed.types.d-
|
|
2
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
3
|
+
import { b as transformTestApi, t as transformItemApi } from './qti-transform-test.d-Bb9vnLzP.js';
|
|
4
|
+
import { C as ComputedContext, a as ComputedItem } from './computed.types.d-6Ht-HNRx.js';
|
|
5
|
+
import './public-events.d-3dGip9pd.js';
|
|
5
6
|
import { QtiAssessmentItem, QtiModalFeedback } from './elements.js';
|
|
6
7
|
import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
|
|
7
|
-
import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-
|
|
8
|
+
import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-iH3w6mqf.js';
|
|
8
9
|
import { TemplateFunction } from '@heximal/templates';
|
|
9
|
-
import {
|
|
10
|
-
import { S as SessionContext, V as View } from './session.context.d-
|
|
11
|
-
import { C as ConfigContext } from './config.context.d-
|
|
12
|
-
import {
|
|
10
|
+
import { g as VariableValue, b as OutcomeVariable, V as VariableDeclaration } from './variables.d-DWHlTszN.js';
|
|
11
|
+
import { S as SessionContext, V as View } from './session.context.d-9gRdGK4T.js';
|
|
12
|
+
import { C as ConfigContext } from './config.context.d-Dm11aAuw.js';
|
|
13
|
+
import { I as ItemContext } from './item.types.d-Zc6ZQDhu.js';
|
|
14
|
+
import { Q as QtiTestState } from './qti-test-state.d-D8Q89RzZ.js';
|
|
15
|
+
import { b as QtiRuleBase } from './qti-rule-base.d-CeKP0Ooi.js';
|
|
13
16
|
|
|
14
17
|
declare class QtiAssessmentTest extends LitElement {
|
|
15
18
|
#private;
|
|
@@ -27,7 +30,7 @@ declare global {
|
|
|
27
30
|
}
|
|
28
31
|
declare module '../../public-events' {
|
|
29
32
|
interface PublicEventMap {
|
|
30
|
-
'
|
|
33
|
+
'qc-test-loaded': CustomEvent<QtiAssessmentTest>;
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
|
|
@@ -184,6 +187,33 @@ declare global {
|
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
189
|
|
|
190
|
+
/**
|
|
191
|
+
* @summary The qti-number-presented expression counts the selected items that have been presented to the candidate.
|
|
192
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.number-presented
|
|
193
|
+
*
|
|
194
|
+
* Outcome processing only. `section-identifier`, `include-category` and
|
|
195
|
+
* `exclude-category` narrow which item references are counted, the same way as
|
|
196
|
+
* for `qti-number-selected` and `qti-test-variables`.
|
|
197
|
+
*
|
|
198
|
+
* An item is presented once its `completionStatus` has left `not_attempted`:
|
|
199
|
+
* presenting an item starts its first attempt. An item a linear test part
|
|
200
|
+
* passed over (pre-condition, branch rule) or one the candidate has not reached
|
|
201
|
+
* keeps `not_attempted`. That makes this the count to use for a total over the
|
|
202
|
+
* candidate's own route, such as a maximum score of one point per presented item.
|
|
203
|
+
*/
|
|
204
|
+
declare class QtiNumberPresented extends QtiExpression<number> {
|
|
205
|
+
#private;
|
|
206
|
+
_testContext?: TestContext;
|
|
207
|
+
constructor();
|
|
208
|
+
getResult(): number;
|
|
209
|
+
calculate(): number;
|
|
210
|
+
}
|
|
211
|
+
declare global {
|
|
212
|
+
interface HTMLElementTagNameMap {
|
|
213
|
+
'qti-number-presented': QtiNumberPresented;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
187
217
|
/**
|
|
188
218
|
* @summary The qti-number-selected expression counts the item refs selected for the test.
|
|
189
219
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.number-selected
|
|
@@ -247,8 +277,19 @@ declare class QtiOutcomeProcessingProcessor {
|
|
|
247
277
|
process(rules: QtiRuleBase[]): void;
|
|
248
278
|
}
|
|
249
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Test-level feedback. It renders nothing where it is declared: where and when it appears is up to
|
|
282
|
+
* the host. After outcome processing, `qtiTest.getTestFeedback(access)` returns the ones that apply.
|
|
283
|
+
*/
|
|
250
284
|
declare class QtiTestFeedback extends QtiModalFeedback {
|
|
251
285
|
static styles: lit.CSSResult;
|
|
286
|
+
/** When the feedback may be shown: at the end of the test (`atEnd`), or while it runs (`during`). */
|
|
287
|
+
access: 'atEnd' | 'during';
|
|
288
|
+
/**
|
|
289
|
+
* Whether this feedback applies for a value of its `outcome-identifier`: with `show-hide="show"`
|
|
290
|
+
* when the value is (or, for a container, holds) its `identifier`; with `hide` when it is not.
|
|
291
|
+
*/
|
|
292
|
+
matches(value: string | readonly string[] | null | undefined): boolean;
|
|
252
293
|
render(): lit.TemplateResult<1>;
|
|
253
294
|
}
|
|
254
295
|
declare global {
|
|
@@ -341,56 +382,6 @@ interface ITestNavigationMixin {
|
|
|
341
382
|
};
|
|
342
383
|
}
|
|
343
384
|
|
|
344
|
-
/**
|
|
345
|
-
* Everything a host needs to persist to resume a candidate's test session, and nothing else.
|
|
346
|
-
*
|
|
347
|
-
* Read it from `qtiTest.state` or the `qti-state-changed` event, store it wherever you like —
|
|
348
|
-
* a database, `localStorage`, `sessionStorage` — and assign it back to `qtiTest.state` to resume.
|
|
349
|
-
*
|
|
350
|
-
* Deliberately not here:
|
|
351
|
-
* - declaration metadata (`baseType`, `cardinality`, `correctResponse`, `mapping`, …): it comes
|
|
352
|
-
* from the item XML on every load, and persisting the answer key with the candidate's data is
|
|
353
|
-
* both bloat and a leak;
|
|
354
|
-
* - `configContext` and `qtiContext`: inputs the host supplies on every load, not session state.
|
|
355
|
-
* The shuffle `seed` in particular must be passed in again, or the restored order changes;
|
|
356
|
-
* - `view`: a role the host decides, not something the candidate produced;
|
|
357
|
-
* - anything computed — scores per section, `done`, `active` — which is rederived from this.
|
|
358
|
-
*/
|
|
359
|
-
interface QtiTestState {
|
|
360
|
-
/** Bumped on any incompatible change to this shape. A state with another version is ignored. */
|
|
361
|
-
version: 1;
|
|
362
|
-
test: {
|
|
363
|
-
items: QtiTestStateItem[];
|
|
364
|
-
/** Test-level outcome values. Only outcomes the test declares are restored. */
|
|
365
|
-
outcomes: QtiTestStateValue[];
|
|
366
|
-
};
|
|
367
|
-
session: QtiTestStateSession;
|
|
368
|
-
}
|
|
369
|
-
interface QtiTestStateItem {
|
|
370
|
-
/** The `qti-assessment-item-ref` identifier. */
|
|
371
|
-
identifier: string;
|
|
372
|
-
variables: (QtiTestStateValue & {
|
|
373
|
-
type?: 'response' | 'outcome' | 'template' | 'context';
|
|
374
|
-
})[];
|
|
375
|
-
/** Opaque per-interaction state keyed by response identifier, e.g. a PCI's `getState()`. */
|
|
376
|
-
state?: Record<string, string | null>;
|
|
377
|
-
}
|
|
378
|
-
interface QtiTestStateValue {
|
|
379
|
-
identifier: string;
|
|
380
|
-
value: string | string[] | null;
|
|
381
|
-
}
|
|
382
|
-
/** Where the candidate is. */
|
|
383
|
-
interface QtiTestStateSession {
|
|
384
|
-
navPartId?: string | null;
|
|
385
|
-
navSectionId?: string | null;
|
|
386
|
-
navItemRefId?: string | null;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
declare global {
|
|
390
|
-
interface GlobalEventHandlersEventMap {
|
|
391
|
-
'qti-state-changed': CustomEvent<QtiTestState>;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
385
|
interface ITestStateMixin {
|
|
395
386
|
/**
|
|
396
387
|
* The candidate's persistable state: what they answered and where they are.
|
|
@@ -442,6 +433,7 @@ declare class TestNavigation extends LitElement {
|
|
|
442
433
|
protected get activeAssessmentItem(): QtiAssessmentItem | undefined;
|
|
443
434
|
render(): lit.TemplateResult<1>;
|
|
444
435
|
protected willUpdate(_changedProperties: PropertyValues): void;
|
|
436
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
445
437
|
}
|
|
446
438
|
declare global {
|
|
447
439
|
interface HTMLElementTagNameMap {
|
|
@@ -467,7 +459,7 @@ declare class TestNext extends LitElement {
|
|
|
467
459
|
sectionItems: ComputedItem[];
|
|
468
460
|
itemIndex: number;
|
|
469
461
|
_handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext): void;
|
|
470
|
-
static styles: lit.CSSResult;
|
|
462
|
+
static styles: lit.CSSResult[];
|
|
471
463
|
constructor();
|
|
472
464
|
connectedCallback(): void;
|
|
473
465
|
willUpdate(_changedProperties: Map<string | number | symbol, unknown>): void;
|
|
@@ -511,42 +503,34 @@ declare global {
|
|
|
511
503
|
}
|
|
512
504
|
}
|
|
513
505
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
static styles: lit.CSSResult;
|
|
536
|
-
private itemId;
|
|
537
|
-
constructor();
|
|
538
|
-
protected _requestItem(identifier: string): void;
|
|
539
|
-
render(): lit.TemplateResult<1>;
|
|
540
|
-
}
|
|
541
|
-
declare global {
|
|
542
|
-
interface HTMLElementTagNameMap {
|
|
543
|
-
'test-item-link': TestItemLink;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
|
|
506
|
+
/**
|
|
507
|
+
* A button that ends the attempt of an item: its response is processed, `numAttempts` goes up and
|
|
508
|
+
* feedback is shown as the item's session control allows. It dispatches `qc-test-end-attempt`,
|
|
509
|
+
* which `<test-navigation>` handles.
|
|
510
|
+
*
|
|
511
|
+
* Put it inside `<test-navigation>`, either in the toolbar, where it ends the attempt of the item on
|
|
512
|
+
* screen, or in the `<template item-ref>`, where each item gets its own and it ends the attempt of
|
|
513
|
+
* that item: with `<qti-test navigate="section">` every item of the section is on screen, each with
|
|
514
|
+
* its own button. Give it an `item` (an item-ref identifier) to end the attempt of that item instead,
|
|
515
|
+
* wherever the button sits.
|
|
516
|
+
*
|
|
517
|
+
* It is `disabled` by the state of its item: when the attempts allowed by `max-attempts` are used
|
|
518
|
+
* (non-adaptive items), when the last attempt was already optimal (non-adaptive items), when an
|
|
519
|
+
* adaptive item is completed, or, when skipping is not allowed, while the response is invalid or
|
|
520
|
+
* still the default.
|
|
521
|
+
*
|
|
522
|
+
* @slot - The label.
|
|
523
|
+
* @attr require-answer - Also disabled while the response is invalid or still the default, without `allow-skipping="false"` (which is about leaving an item, not about ending its attempt).
|
|
524
|
+
* @attr item - The item-ref identifier whose attempt this button ends; without it, the item it is stamped into, or else the one on screen.
|
|
525
|
+
* @attr disabled - Reflected: the item's attempt cannot be ended.
|
|
526
|
+
*/
|
|
547
527
|
declare class TestEndAttempt extends LitElement {
|
|
528
|
+
#private;
|
|
548
529
|
protected computedContext: ComputedContext;
|
|
549
530
|
_internalDisabled: boolean;
|
|
531
|
+
item?: string;
|
|
532
|
+
/** Ends no attempt until the response is valid and not the default, whatever the item's `allow-skipping` says. */
|
|
533
|
+
requireAnswer: boolean;
|
|
550
534
|
_handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext): void;
|
|
551
535
|
static styles: lit.CSSResult;
|
|
552
536
|
constructor();
|
|
@@ -560,24 +544,6 @@ declare global {
|
|
|
560
544
|
}
|
|
561
545
|
}
|
|
562
546
|
|
|
563
|
-
/**
|
|
564
|
-
* @deprecated test-paging-buttons-stamp is deprecated and will be removed in the future.
|
|
565
|
-
*/
|
|
566
|
-
declare class TestPagingButtonsStamp extends LitElement {
|
|
567
|
-
#private;
|
|
568
|
-
private computedContext;
|
|
569
|
-
myTemplate: TemplateFunction;
|
|
570
|
-
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
571
|
-
constructor();
|
|
572
|
-
connectedCallback(): void;
|
|
573
|
-
render(): lit.TemplateResult<1>;
|
|
574
|
-
}
|
|
575
|
-
declare global {
|
|
576
|
-
interface HTMLElementTagNameMap {
|
|
577
|
-
'test-paging-buttons-stamp': TestPagingButtonsStamp;
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
|
|
581
547
|
/**
|
|
582
548
|
* `<test-container>` is a custom element designed for hosting the qti-assessment-item.
|
|
583
549
|
* The `qti-assessment-test` will be placed inside the shadow DOM of this element.
|
|
@@ -617,385 +583,19 @@ declare global {
|
|
|
617
583
|
}
|
|
618
584
|
}
|
|
619
585
|
|
|
620
|
-
declare class TestPrintVariables extends LitElement {
|
|
621
|
-
computedContext?: ComputedContext;
|
|
622
|
-
static styles: lit.CSSResult;
|
|
623
|
-
render(): lit.TemplateResult<1>;
|
|
624
|
-
}
|
|
625
|
-
declare global {
|
|
626
|
-
interface HTMLElementTagNameMap {
|
|
627
|
-
'test-print-item-variables': TestPrintVariables;
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* @deprecated test-section-buttons-stamp is deprecated and will be removed in the future.
|
|
633
|
-
*/
|
|
634
|
-
declare class TestSectionButtonsStamp extends LitElement {
|
|
635
|
-
#private;
|
|
636
|
-
private computedContext;
|
|
637
|
-
myTemplate: TemplateFunction;
|
|
638
|
-
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
639
|
-
constructor();
|
|
640
|
-
connectedCallback(): void;
|
|
641
|
-
render(): lit.TemplateResult<1>;
|
|
642
|
-
}
|
|
643
|
-
declare global {
|
|
644
|
-
interface HTMLElementTagNameMap {
|
|
645
|
-
'test-section-buttons-stamp': TestSectionButtonsStamp;
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
declare class TestSectionLink extends LitElement {
|
|
650
|
-
#private;
|
|
651
|
-
static styles: lit.CSSResult;
|
|
652
|
-
private sectionId;
|
|
653
|
-
constructor();
|
|
654
|
-
render(): lit.TemplateResult<1>;
|
|
655
|
-
}
|
|
656
|
-
declare global {
|
|
657
|
-
interface HTMLElementTagNameMap {
|
|
658
|
-
'test-section-link': TestSectionLink;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
declare class TestPrintContext extends LitElement {
|
|
663
|
-
computedContext?: ComputedContext;
|
|
664
|
-
render(): lit.TemplateResult<1>;
|
|
665
|
-
}
|
|
666
|
-
declare global {
|
|
667
|
-
interface HTMLElementTagNameMap {
|
|
668
|
-
'test-print-context': TestPrintContext;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* A custom web component that renders a test stamp using the Lit framework.
|
|
674
|
-
* This component is deprecated and will be removed in the future.
|
|
675
|
-
* @customElement
|
|
676
|
-
* @extends {LitElement}
|
|
677
|
-
*/
|
|
678
|
-
declare class TestStamp extends LitElement {
|
|
679
|
-
/**
|
|
680
|
-
* Indicates whether the component is in debug mode.
|
|
681
|
-
* When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.
|
|
682
|
-
*/
|
|
683
|
-
debug: boolean;
|
|
684
|
-
private computedContext;
|
|
685
|
-
private stampContext;
|
|
686
|
-
myTemplate: TemplateFunction;
|
|
687
|
-
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
688
|
-
connectedCallback(): void;
|
|
689
|
-
protected willUpdate(_changedProperties: PropertyValues): void;
|
|
690
|
-
render(): lit.TemplateResult<1>;
|
|
691
|
-
}
|
|
692
|
-
declare global {
|
|
693
|
-
interface HTMLElementTagNameMap {
|
|
694
|
-
'test-stamp': TestStamp;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
declare class TestScoringButtons extends LitElement {
|
|
699
|
-
#private;
|
|
700
|
-
view: string;
|
|
701
|
-
disabled: boolean;
|
|
702
|
-
myTemplate: TemplateFunction | null;
|
|
703
|
-
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
704
|
-
connectedCallback(): void;
|
|
705
|
-
protected computedContext?: ComputedContext;
|
|
706
|
-
render(): lit.TemplateResult<1> | typeof nothing;
|
|
707
|
-
constructor();
|
|
708
|
-
}
|
|
709
|
-
declare global {
|
|
710
|
-
interface HTMLElementTagNameMap {
|
|
711
|
-
'test-scoring-buttons': TestScoringButtons;
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
declare class TestViewToggle extends LitElement {
|
|
716
|
-
myTemplate: any;
|
|
717
|
-
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
718
|
-
private sessionContext;
|
|
719
|
-
connectedCallback(): void;
|
|
720
|
-
_switchView(view: string): void;
|
|
721
|
-
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
722
|
-
render(): lit.TemplateResult<1>;
|
|
723
|
-
}
|
|
724
|
-
declare global {
|
|
725
|
-
interface HTMLElementTagNameMap {
|
|
726
|
-
'test-view-toggle': TestViewToggle;
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
declare class TestScoringFeedback extends LitElement {
|
|
731
|
-
protected computedContext?: ComputedContext;
|
|
732
|
-
view: View;
|
|
733
|
-
render(): lit.TemplateResult<1>;
|
|
734
|
-
}
|
|
735
|
-
declare global {
|
|
736
|
-
interface HTMLElementTagNameMap {
|
|
737
|
-
'test-scoring-feedback': TestScoringFeedback;
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
declare class TestCheckItem extends LitElement {
|
|
742
|
-
protected testHost?: TestHost;
|
|
743
|
-
static styles: lit.CSSResult;
|
|
744
|
-
constructor();
|
|
745
|
-
render(): lit.TemplateResult<1>;
|
|
746
|
-
}
|
|
747
|
-
declare global {
|
|
748
|
-
interface HTMLElementTagNameMap {
|
|
749
|
-
'test-check-item': TestCheckItem;
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
type SpeechState = 'idle' | 'playing' | 'paused';
|
|
754
|
-
interface TtsContext {
|
|
755
|
-
state: SpeechState;
|
|
756
|
-
/** True while every reading element is highlighted and a click on one starts reading there. */
|
|
757
|
-
picking: boolean;
|
|
758
|
-
/** Index of the currently highlighted reading element (0-based). */
|
|
759
|
-
currentElementIndex: number;
|
|
760
|
-
/** Total number of navigable reading elements in the current item. */
|
|
761
|
-
elementCount: number;
|
|
762
|
-
play(): void;
|
|
763
|
-
pause(): void;
|
|
764
|
-
resume(): void;
|
|
765
|
-
stop(): void;
|
|
766
|
-
prevElement(): void;
|
|
767
|
-
nextElement(): void;
|
|
768
|
-
/** Toggle pick mode: highlight all reading elements, then read from the one that is clicked. */
|
|
769
|
-
togglePick(): void;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
declare const ttsContext: {
|
|
773
|
-
__context__: TtsContext;
|
|
774
|
-
};
|
|
775
586
|
/**
|
|
776
|
-
*
|
|
777
|
-
*
|
|
778
|
-
*
|
|
587
|
+
* Scores the test: on click the test resets its outcomes to their declared defaults, runs its
|
|
588
|
+
* outcome processing and dispatches `qc-test-submitted`, after which the host reads the outcomes.
|
|
589
|
+
* The host decides where it sits, for example on the last item or in a review view.
|
|
779
590
|
*/
|
|
780
|
-
declare
|
|
781
|
-
#private;
|
|
591
|
+
declare class TestSubmit extends LitElement {
|
|
782
592
|
static styles: lit.CSSResult;
|
|
783
|
-
/**
|
|
784
|
-
* Accessible name of the button. Without it the default icon carries an English name, and
|
|
785
|
-
* slotted content names the button by its text; set it when you slot an icon of your own,
|
|
786
|
-
* which has no text to be named by.
|
|
787
|
-
*/
|
|
788
|
-
label?: string;
|
|
789
|
-
protected _tts?: TtsContext;
|
|
790
|
-
updated(_changed: PropertyValues): void;
|
|
791
|
-
}
|
|
792
|
-
/**
|
|
793
|
-
* `<test-item-to-speech>` is the controller and context provider. It manages
|
|
794
|
-
* speech synthesis, word highlighting, and item element lookup. Compose your
|
|
795
|
-
* own player by placing control elements as children.
|
|
796
|
-
*
|
|
797
|
-
* @example
|
|
798
|
-
* ```html
|
|
799
|
-
* <test-item-to-speech language="nl-NL">
|
|
800
|
-
* <test-tts-play></test-tts-play>
|
|
801
|
-
* <test-tts-prev></test-tts-prev>
|
|
802
|
-
* <test-tts-next></test-tts-next>
|
|
803
|
-
* <test-tts-stop></test-tts-stop>
|
|
804
|
-
* </test-item-to-speech>
|
|
805
|
-
* ```
|
|
806
|
-
*
|
|
807
|
-
* The controller lays its controls out as a wrapping row; each control draws an icon button,
|
|
808
|
-
* and slotted content replaces the icon — a slotted `<svg>` is sized like the default one. Give a
|
|
809
|
-
* control with a slotted icon a `label`, since an icon has no text to name the button by. Buttons read the qti-theme tokens (with the theme's
|
|
810
|
-
* defaults as fallbacks) and can be sized with `--test-button-size` and `--test-tts-icon-size`.
|
|
811
|
-
*
|
|
812
|
-
* ### Language resolution
|
|
813
|
-
*
|
|
814
|
-
* Each reading element is spoken in the language of the nearest `lang` attribute:
|
|
815
|
-
*
|
|
816
|
-
* 1. `lang` (or `xml:lang`) on the element itself
|
|
817
|
-
* 2. `lang` on the closest ancestor — including `<qti-assessment-item xml:lang>` and, across
|
|
818
|
-
* shadow roots, anything wrapping the test
|
|
819
|
-
* 3. `lang` on the document's `<html>` element
|
|
820
|
-
* 4. the `language` attribute on `<test-item-to-speech>`
|
|
821
|
-
*
|
|
822
|
-
* The transformer copies `xml:lang` over as a plain `lang` attribute, so QTI authored with
|
|
823
|
-
* `xml:lang="en-GB"` on a `<p>` or on the item root is honoured without further work.
|
|
824
|
-
*
|
|
825
|
-
* ### What is read
|
|
826
|
-
*
|
|
827
|
-
* Decided once per connect, by where the player is placed. The first rule that matches wins:
|
|
828
|
-
*
|
|
829
|
-
* 1. **Next to a stimulus placeholder** — the player shares its parent with a
|
|
830
|
-
* `[data-stimulus-idref]` element, e.g. in a reading-text panel beside the questions: the
|
|
831
|
-
* player reads that stimulus (its `qti-stimulus-body`), and only that. Not inside the
|
|
832
|
-
* placeholder: loading a stimulus replaces the placeholder's content. Items and navigation
|
|
833
|
-
* are ignored; when the stimulus is (re)loaded or the placeholder swapped, the player starts
|
|
834
|
-
* over on the new content.
|
|
835
|
-
* 2. **Next to `[data-tts-content]`** — the player shares its parent with an element marked
|
|
836
|
-
* `data-tts-content`: any HTML, not QTI, e.g. a start screen rendered by React. The marker goes
|
|
837
|
-
* on one container; the player reads the readable elements inside it. Navigation is ignored.
|
|
838
|
-
* The reading list is rebuilt when the player starts from the top, and when an element in it
|
|
839
|
-
* has left the page — so a re-render of the content never interrupts speech.
|
|
840
|
-
* 3. **Inside a `qti-assessment-item-ref`** — e.g. in a `<template item-ref>` on `<qti-test>`,
|
|
841
|
-
* so every item gets a player of its own: the player reads that item, and only that item.
|
|
842
|
-
* The navigation cursor is ignored; speech stops when the player leaves the page with its item.
|
|
843
|
-
* 4. **Anywhere else** — a toolbar in the page chrome: the player follows the navigation cursor
|
|
844
|
-
* and reads the item `navItemRefId` (session context) points at, found in any
|
|
845
|
-
* `test-container` reachable from the player. Navigating stops speech and starts the next
|
|
846
|
-
* item from the top.
|
|
847
|
-
*
|
|
848
|
-
* ```html
|
|
849
|
-
* <!-- 1. a player for the shared reading text -->
|
|
850
|
-
* <aside>
|
|
851
|
-
* <test-item-to-speech>…</test-item-to-speech>
|
|
852
|
-
* <div data-stimulus-idref="Stimulus1"></div>
|
|
853
|
-
* </aside>
|
|
854
|
-
*
|
|
855
|
-
* <!-- 2. a player for any other HTML -->
|
|
856
|
-
* <div>
|
|
857
|
-
* <test-item-to-speech>…</test-item-to-speech>
|
|
858
|
-
* <section data-tts-content lang="nl-NL">…</section>
|
|
859
|
-
* </div>
|
|
860
|
-
*
|
|
861
|
-
* <!-- 3. one player per item -->
|
|
862
|
-
* <qti-test>
|
|
863
|
-
* <template item-ref>
|
|
864
|
-
* <test-item-to-speech>…</test-item-to-speech>
|
|
865
|
-
* {{ xmlDoc }}
|
|
866
|
-
* </template>
|
|
867
|
-
* …
|
|
868
|
-
* </qti-test>
|
|
869
|
-
*
|
|
870
|
-
* <!-- 4. one player in the toolbar, following navigation -->
|
|
871
|
-
* <test-navigation>
|
|
872
|
-
* <header><test-item-to-speech>…</test-item-to-speech></header>
|
|
873
|
-
* <test-container test-url="…"></test-container>
|
|
874
|
-
* </test-navigation>
|
|
875
|
-
* ```
|
|
876
|
-
*
|
|
877
|
-
* In modes 3 and 4 the item re-rendering (navigating to the item already shown) restarts the
|
|
878
|
-
* player on the fresh content. An item player reads the item body as rendered: a stimulus
|
|
879
|
-
* placed inside the item is read with it, one placed outside (mode 1) is not. Only one player
|
|
880
|
-
* can speak at a time; starting one stops any other.
|
|
881
|
-
*
|
|
882
|
-
* Read are `p`, `h1`–`h6`, `li`, `dt`, `dd`, `th`, `td`, `caption`, `blockquote`, `figcaption`,
|
|
883
|
-
* `qti-prompt` and `qti-simple-choice` — the innermost match only — unless hidden (`display: none`)
|
|
884
|
-
* or inside `aria-hidden="true"`.
|
|
885
|
-
*
|
|
886
|
-
* ### Starting somewhere in the middle
|
|
887
|
-
*
|
|
888
|
-
* `<test-tts-pick>` switches the player into pick mode: every reading element gets the blue
|
|
889
|
-
* cursor highlight, and the first click on one of them leaves pick mode and starts reading
|
|
890
|
-
* from that element. Pressing the button again leaves pick mode without reading.
|
|
891
|
-
*
|
|
892
|
-
* @cssstate idle - No speech active
|
|
893
|
-
* @cssstate picking - Pick mode: all reading elements highlighted, waiting for a click
|
|
894
|
-
* @cssstate playing - Speech is playing
|
|
895
|
-
* @cssstate paused - Speech is paused
|
|
896
|
-
*/
|
|
897
|
-
declare class TestItemToSpeech extends LitElement {
|
|
898
|
-
#private;
|
|
899
|
-
static styles: lit.CSSResult;
|
|
900
|
-
/** Fallback language when neither the item content nor the document declares one. */
|
|
901
|
-
language: string;
|
|
902
|
-
protected _sessionContext?: SessionContext;
|
|
903
|
-
/** The `qti-test` this player is in, across shadow roots. */
|
|
904
|
-
protected testHost?: TestHost;
|
|
905
|
-
_ttsContext: TtsContext;
|
|
906
593
|
constructor();
|
|
907
|
-
willUpdate(changed: PropertyValues): void;
|
|
908
|
-
connectedCallback(): void;
|
|
909
|
-
disconnectedCallback(): void;
|
|
910
|
-
render(): lit.TemplateResult<1>;
|
|
911
|
-
}
|
|
912
|
-
/**
|
|
913
|
-
* Play/pause/resume toggle button — always enabled, cycles through states.
|
|
914
|
-
* Use named slots `play` and `pause` to customise the icons/labels independently; `label` and
|
|
915
|
-
* `pause-label` name the button in each state (set them when the slotted content is an icon).
|
|
916
|
-
*
|
|
917
|
-
* @example
|
|
918
|
-
* ```html
|
|
919
|
-
* <test-tts-play>
|
|
920
|
-
* <span slot="play">Voorlezen</span>
|
|
921
|
-
* <span slot="pause">Pauzeren</span>
|
|
922
|
-
* </test-tts-play>
|
|
923
|
-
* ```
|
|
924
|
-
*
|
|
925
|
-
* @cssstate idle / playing / paused
|
|
926
|
-
* @csspart button
|
|
927
|
-
*/
|
|
928
|
-
declare class TestTtsPlay extends TtsButtonBase {
|
|
929
|
-
#private;
|
|
930
|
-
/** Accessible name of the button while speech is playing; see `label`. */
|
|
931
|
-
pauseLabel?: string;
|
|
932
|
-
render(): lit.TemplateResult<1>;
|
|
933
|
-
}
|
|
934
|
-
/**
|
|
935
|
-
* Pause button — enabled only when playing.
|
|
936
|
-
* @cssstate idle / playing / paused
|
|
937
|
-
* @csspart button
|
|
938
|
-
*/
|
|
939
|
-
declare class TestTtsPause extends TtsButtonBase {
|
|
940
|
-
render(): lit.TemplateResult<1>;
|
|
941
|
-
}
|
|
942
|
-
/**
|
|
943
|
-
* Resume button — enabled only when paused.
|
|
944
|
-
* @cssstate idle / playing / paused
|
|
945
|
-
* @csspart button
|
|
946
|
-
*/
|
|
947
|
-
declare class TestTtsResume extends TtsButtonBase {
|
|
948
|
-
render(): lit.TemplateResult<1>;
|
|
949
|
-
}
|
|
950
|
-
/**
|
|
951
|
-
* Stop button — enabled when playing, paused, or in pick mode (where it leaves pick mode).
|
|
952
|
-
* @cssstate idle / playing / paused
|
|
953
|
-
* @csspart button
|
|
954
|
-
*/
|
|
955
|
-
declare class TestTtsStop extends TtsButtonBase {
|
|
956
|
-
render(): lit.TemplateResult<1>;
|
|
957
|
-
}
|
|
958
|
-
/**
|
|
959
|
-
* Prev-element button — moves cursor to the previous reading element and pauses.
|
|
960
|
-
* Disabled at the first element. Reading elements are collected lazily, so an element count
|
|
961
|
-
* of 0 means "not looked yet" rather than "nothing to read": the button stays enabled and the
|
|
962
|
-
* first click collects them.
|
|
963
|
-
* @cssstate idle / playing / paused
|
|
964
|
-
* @csspart button
|
|
965
|
-
*/
|
|
966
|
-
declare class TestTtsPrev extends TtsButtonBase {
|
|
967
|
-
render(): lit.TemplateResult<1>;
|
|
968
|
-
}
|
|
969
|
-
/**
|
|
970
|
-
* Next-element button — moves cursor to the next reading element and pauses.
|
|
971
|
-
* Disabled at the last element; enabled while the elements have not been collected yet
|
|
972
|
-
* (see `TestTtsPrev`).
|
|
973
|
-
* @cssstate idle / playing / paused
|
|
974
|
-
* @csspart button
|
|
975
|
-
*/
|
|
976
|
-
declare class TestTtsNext extends TtsButtonBase {
|
|
977
|
-
render(): lit.TemplateResult<1>;
|
|
978
|
-
}
|
|
979
|
-
/**
|
|
980
|
-
* Pick button — toggles pick mode on the controller: every reading element is highlighted and
|
|
981
|
-
* a click on one of them starts reading from there. Reflects the mode as `:state(picking)`.
|
|
982
|
-
* @cssstate idle / playing / paused
|
|
983
|
-
* @cssstate picking
|
|
984
|
-
* @csspart button
|
|
985
|
-
*/
|
|
986
|
-
declare class TestTtsPick extends TtsButtonBase {
|
|
987
594
|
render(): lit.TemplateResult<1>;
|
|
988
595
|
}
|
|
989
596
|
declare global {
|
|
990
597
|
interface HTMLElementTagNameMap {
|
|
991
|
-
'test-
|
|
992
|
-
'test-tts-play': TestTtsPlay;
|
|
993
|
-
'test-tts-pause': TestTtsPause;
|
|
994
|
-
'test-tts-resume': TestTtsResume;
|
|
995
|
-
'test-tts-stop': TestTtsStop;
|
|
996
|
-
'test-tts-prev': TestTtsPrev;
|
|
997
|
-
'test-tts-next': TestTtsNext;
|
|
998
|
-
'test-tts-pick': TestTtsPick;
|
|
598
|
+
'test-submit': TestSubmit;
|
|
999
599
|
}
|
|
1000
600
|
}
|
|
1001
601
|
|
|
@@ -1006,6 +606,8 @@ declare const QtiTest_base: (abstract new (...args: any[]) => ITestNavigationMix
|
|
|
1006
606
|
getOutcome(identifier: string): Readonly<OutcomeVariable>;
|
|
1007
607
|
getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;
|
|
1008
608
|
outcomeProcessing(): boolean;
|
|
609
|
+
submit(): boolean;
|
|
610
|
+
getTestFeedback(access?: "atEnd" | "during"): QtiTestFeedback[];
|
|
1009
611
|
}) & (abstract new (...args: any[]) => ITestStateMixin) & (abstract new (...args: any[]) => TestBaseInterface) & typeof LitElement;
|
|
1010
612
|
/**
|
|
1011
613
|
* `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
|
|
@@ -1054,8 +656,8 @@ declare const QtiTest_base: (abstract new (...args: any[]) => ITestNavigationMix
|
|
|
1054
656
|
* You can use normal class names to style the elements.
|
|
1055
657
|
* And you can use the `test-prev` and `test-next` elements to navigate through the test.
|
|
1056
658
|
*
|
|
1057
|
-
* @event
|
|
1058
|
-
* @event qti-test-context-updated - Deprecated: listen to `
|
|
659
|
+
* @event qc-test-state-changed - The candidate's persistable state changed. `detail` is a `QtiTestState`; assign it back to `state` to resume.
|
|
660
|
+
* @event qti-test-context-updated - Deprecated: listen to `qc-test-state-changed` to persist a session. `detail` is the full test context, including declaration metadata and the answer key. Removed in the next major.
|
|
1059
661
|
*/
|
|
1060
662
|
declare class QtiTest extends QtiTest_base {
|
|
1061
663
|
constructor();
|
|
@@ -1084,4 +686,4 @@ declare global {
|
|
|
1084
686
|
}
|
|
1085
687
|
}
|
|
1086
688
|
|
|
1087
|
-
export {
|
|
689
|
+
export { type ITestNavigationMixin as I, QtiAssessmentItemRef as Q, TestContainer as T, type ITestStateMixin as a, type ItemRefTemplateModel as b, QtiAssessmentSection as c, QtiAssessmentTest as d, QtiBranchRule as e, QtiItemSessionControl as f, QtiNumberPresented as g, QtiNumberSelected as h, QtiOutcomeProcessing as i, QtiOutcomeProcessingProcessor as j, QtiPreCondition as k, QtiTest as l, QtiTestFeedback as m, QtiTestPart as n, QtiTestVariables as o, QtiTestVariablesExpression as p, TestEndAttempt as q, TestNavigation as r, TestNext as s, TestPrev as t, TestSubmit as u, type ItemVariableValue as v };
|