@citolab/qti-components 10.0.0-next.1 → 10.0.0-next.10
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 +1970 -364
- package/dist/base.d.ts +10 -10
- package/dist/base.js +7 -1
- package/dist/{chunk-RU6332MD.js → chunk-3TUGZHKB.js} +3 -3
- package/dist/{chunk-RSMYGGQK.js → chunk-AHULN3UB.js} +390 -243
- package/dist/chunk-AHULN3UB.js.map +1 -0
- package/dist/{chunk-35WWWFS6.js → chunk-CQ3WU35R.js} +2 -2
- package/dist/{chunk-6K3QWJHH.js → chunk-LCGPLQLE.js} +40 -4
- package/dist/chunk-LCGPLQLE.js.map +1 -0
- package/dist/{chunk-MI7774NV.js → chunk-M7X6TWSX.js} +2 -2
- package/dist/{chunk-FD4AB6TM.js → chunk-Q3C7XFVS.js} +2 -2
- package/dist/chunk-QVZLJY75.js +7 -0
- package/dist/chunk-QVZLJY75.js.map +1 -0
- package/dist/{chunk-CKJ7M7JQ.js → chunk-RRMCWCSA.js} +2287 -2061
- package/dist/chunk-RRMCWCSA.js.map +1 -0
- package/dist/{chunk-GBZNFSFY.js → chunk-RWMY7KRT.js} +2 -2
- package/dist/{chunk-TDWJ6WZA.js → chunk-T7YSBBAA.js} +37 -1
- package/dist/chunk-T7YSBBAA.js.map +1 -0
- package/dist/{chunk-YYIS6FDP.js → chunk-WPILS3CW.js} +2 -2
- package/dist/{chunk-6U3YPHXU.js → chunk-YOCOLMGB.js} +40 -5
- package/dist/{chunk-6U3YPHXU.js.map → chunk-YOCOLMGB.js.map} +1 -1
- package/dist/{chunk-FWR6HZQS.js → chunk-YYZCTIZY.js} +6 -6
- package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-IXACuBr7.d.ts} +10 -1
- package/dist/corrections.d.ts +9 -9
- package/dist/corrections.js +8 -8
- package/dist/elements.d.ts +2 -2
- package/dist/elements.js +3 -3
- package/dist/index.d.ts +11 -11
- package/dist/index.js +37 -19
- package/dist/interactions.d.ts +4 -4
- package/dist/interactions.js +7 -3
- package/dist/item.css +2 -1
- package/dist/item.d.ts +4 -4
- package/dist/item.js +4 -4
- package/dist/{item.types.d-B55QkJ92.d.ts → item.types.d-DuVR0ZVK.d.ts} +7 -1
- package/dist/loader.d.ts +2 -2
- package/dist/processing.d.ts +10 -3
- package/dist/processing.js +3 -3
- package/dist/qti-components-jsx.d.ts +928 -757
- package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
- package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +1 -1
- package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-DbzPSJuK.d.ts} +1 -1
- package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-B1gffYCL.d.ts} +1 -1
- package/dist/{qti-test.d-DkpBNcsv.d.ts → qti-test.d-D-RYWphm.d.ts} +182 -99
- package/dist/{qti-text-entry-interaction.d-q8u5BiVK.d.ts → qti-text-entry-interaction.d-utFyp1DH.d.ts} +28 -18
- package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
- package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-DW09Lrie.d.ts} +7 -1
- package/dist/test.d.ts +117 -9
- package/dist/test.js +19 -11
- package/package.json +9 -9
- package/dist/chunk-6K3QWJHH.js.map +0 -1
- package/dist/chunk-CKJ7M7JQ.js.map +0 -1
- package/dist/chunk-RSMYGGQK.js.map +0 -1
- package/dist/chunk-TDWJ6WZA.js.map +0 -1
- package/dist/chunk-ZP6QQYSU.js +0 -7
- package/dist/chunk-ZP6QQYSU.js.map +0 -1
- /package/dist/{chunk-RU6332MD.js.map → chunk-3TUGZHKB.js.map} +0 -0
- /package/dist/{chunk-35WWWFS6.js.map → chunk-CQ3WU35R.js.map} +0 -0
- /package/dist/{chunk-MI7774NV.js.map → chunk-M7X6TWSX.js.map} +0 -0
- /package/dist/{chunk-FD4AB6TM.js.map → chunk-Q3C7XFVS.js.map} +0 -0
- /package/dist/{chunk-GBZNFSFY.js.map → chunk-RWMY7KRT.js.map} +0 -0
- /package/dist/{chunk-YYIS6FDP.js.map → chunk-WPILS3CW.js.map} +0 -0
- /package/dist/{chunk-FWR6HZQS.js.map → chunk-YYZCTIZY.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
import { b as ItemContext, V as VariableDeclaration, g as ResponseVariable, B as BaseType } from './item.types.d-
|
|
3
|
+
import { b as ItemContext, V as VariableDeclaration, g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js';
|
|
4
4
|
import { a as QtiContextType, Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
|
|
5
5
|
|
|
6
6
|
interface TestContext {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
import { a as Cardinality } from './item.types.d-
|
|
3
|
+
import { a as Cardinality } from './item.types.d-DuVR0ZVK.js';
|
|
4
4
|
|
|
5
5
|
declare abstract class QtiVariableDeclaration extends LitElement {
|
|
6
6
|
render(): lit.TemplateResult<1>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
3
|
import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
|
|
4
|
-
import { C as ComputedItemContext, V as View } from './session.context.d-
|
|
4
|
+
import { C as ComputedItemContext, V as View } from './session.context.d-DW09Lrie.js';
|
|
5
5
|
import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
|
|
6
6
|
import { QtiAssessmentItem } from './elements.js';
|
|
7
7
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement, PropertyValues, nothing } from 'lit';
|
|
3
3
|
import { b as transformTestApi, t as transformItemApi } from './qti-transform-test.d-BL7GGFJj.js';
|
|
4
|
-
import { C as ComputedContext, a as ComputedItem } from './computed.types.d-
|
|
4
|
+
import { C as ComputedContext, a as ComputedItem } from './computed.types.d-IXACuBr7.js';
|
|
5
5
|
import { QtiAssessmentItem, QtiModalFeedback } from './elements.js';
|
|
6
6
|
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-
|
|
7
|
+
import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-B-Cfbqlb.js';
|
|
8
8
|
import { TemplateFunction } from '@heximal/templates';
|
|
9
|
-
import { h as VariableValue, b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-
|
|
10
|
-
import { S as SessionContext, V as View } from './session.context.d-
|
|
9
|
+
import { h as VariableValue, b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
|
|
10
|
+
import { S as SessionContext, V as View } from './session.context.d-DW09Lrie.js';
|
|
11
11
|
import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
|
|
12
12
|
import { b as QtiRuleBase } from './qti-rule-base.d-Bdzg8eGH.js';
|
|
13
13
|
|
|
@@ -184,6 +184,33 @@ declare global {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
/**
|
|
188
|
+
* @summary The qti-number-presented expression counts the selected items that have been presented to the candidate.
|
|
189
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.number-presented
|
|
190
|
+
*
|
|
191
|
+
* Outcome processing only. `section-identifier`, `include-category` and
|
|
192
|
+
* `exclude-category` narrow which item references are counted, the same way as
|
|
193
|
+
* for `qti-number-selected` and `qti-test-variables`.
|
|
194
|
+
*
|
|
195
|
+
* An item is presented once its `completionStatus` has left `not_attempted`:
|
|
196
|
+
* presenting an item starts its first attempt. An item a linear test part
|
|
197
|
+
* passed over (pre-condition, branch rule) or one the candidate has not reached
|
|
198
|
+
* keeps `not_attempted`. That makes this the count to use for a total over the
|
|
199
|
+
* candidate's own route, such as a maximum score of one point per presented item.
|
|
200
|
+
*/
|
|
201
|
+
declare class QtiNumberPresented extends QtiExpression<number> {
|
|
202
|
+
#private;
|
|
203
|
+
_testContext?: TestContext;
|
|
204
|
+
constructor();
|
|
205
|
+
getResult(): number;
|
|
206
|
+
calculate(): number;
|
|
207
|
+
}
|
|
208
|
+
declare global {
|
|
209
|
+
interface HTMLElementTagNameMap {
|
|
210
|
+
'qti-number-presented': QtiNumberPresented;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
187
214
|
/**
|
|
188
215
|
* @summary The qti-number-selected expression counts the item refs selected for the test.
|
|
189
216
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.number-selected
|
|
@@ -247,8 +274,19 @@ declare class QtiOutcomeProcessingProcessor {
|
|
|
247
274
|
process(rules: QtiRuleBase[]): void;
|
|
248
275
|
}
|
|
249
276
|
|
|
277
|
+
/**
|
|
278
|
+
* Test-level feedback. It renders nothing where it is declared: where and when it appears is up to
|
|
279
|
+
* the host. After outcome processing, `qtiTest.getTestFeedback(access)` returns the ones that apply.
|
|
280
|
+
*/
|
|
250
281
|
declare class QtiTestFeedback extends QtiModalFeedback {
|
|
251
282
|
static styles: lit.CSSResult;
|
|
283
|
+
/** When the feedback may be shown: at the end of the test (`atEnd`), or while it runs (`during`). */
|
|
284
|
+
access: 'atEnd' | 'during';
|
|
285
|
+
/**
|
|
286
|
+
* Whether this feedback applies for a value of its `outcome-identifier`: with `show-hide="show"`
|
|
287
|
+
* when the value is (or, for a container, holds) its `identifier`; with `hide` when it is not.
|
|
288
|
+
*/
|
|
289
|
+
matches(value: string | readonly string[] | null | undefined): boolean;
|
|
252
290
|
render(): lit.TemplateResult<1>;
|
|
253
291
|
}
|
|
254
292
|
declare global {
|
|
@@ -379,8 +417,19 @@ interface QtiTestStateValue {
|
|
|
379
417
|
identifier: string;
|
|
380
418
|
value: string | string[] | null;
|
|
381
419
|
}
|
|
382
|
-
/**
|
|
420
|
+
/**
|
|
421
|
+
* What each plugin keeps in the state, by plugin name. Empty here: a plugin adds its own entry by
|
|
422
|
+
* augmenting this interface (`declare module` on the module that declares it, with
|
|
423
|
+
* `interface QtiTestPluginState { bookmarks: string[] }`), and reads it with
|
|
424
|
+
* `pluginState(computedContext, 'bookmarks')`. The test never reads an entry; it
|
|
425
|
+
* stores and restores it, so a value must survive `JSON.stringify`.
|
|
426
|
+
*/
|
|
427
|
+
interface QtiTestPluginState {
|
|
428
|
+
}
|
|
429
|
+
/** Where the candidate is, and what plugins keep. */
|
|
383
430
|
interface QtiTestStateSession {
|
|
431
|
+
/** Plugin entries by plugin name. Entries of plugins that are not loaded are kept as they are. */
|
|
432
|
+
plugins?: Partial<QtiTestPluginState> & Record<string, unknown>;
|
|
384
433
|
navPartId?: string | null;
|
|
385
434
|
navSectionId?: string | null;
|
|
386
435
|
navItemRefId?: string | null;
|
|
@@ -511,26 +560,6 @@ declare global {
|
|
|
511
560
|
}
|
|
512
561
|
}
|
|
513
562
|
|
|
514
|
-
declare class TestView extends LitElement {
|
|
515
|
-
#private;
|
|
516
|
-
static DEFAULT_VIEW_OPTIONS: string[];
|
|
517
|
-
private sessionContext;
|
|
518
|
-
/** label accompanying the select view dropdown */
|
|
519
|
-
label: string;
|
|
520
|
-
/** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */
|
|
521
|
-
viewOptions: string;
|
|
522
|
-
protected _handleViewOptionsChange: () => void;
|
|
523
|
-
connectedCallback(): void;
|
|
524
|
-
private _viewOptions;
|
|
525
|
-
protected _switchView(view: string): void;
|
|
526
|
-
render(): lit.TemplateResult<1>;
|
|
527
|
-
}
|
|
528
|
-
declare global {
|
|
529
|
-
interface HTMLElementTagNameMap {
|
|
530
|
-
'test-view': TestView;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
|
|
534
563
|
declare class TestItemLink extends LitElement {
|
|
535
564
|
static styles: lit.CSSResult;
|
|
536
565
|
private itemId;
|
|
@@ -560,24 +589,6 @@ declare global {
|
|
|
560
589
|
}
|
|
561
590
|
}
|
|
562
591
|
|
|
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
592
|
/**
|
|
582
593
|
* `<test-container>` is a custom element designed for hosting the qti-assessment-item.
|
|
583
594
|
* The `qti-assessment-test` will be placed inside the shadow DOM of this element.
|
|
@@ -617,45 +628,82 @@ declare global {
|
|
|
617
628
|
}
|
|
618
629
|
}
|
|
619
630
|
|
|
620
|
-
declare class
|
|
621
|
-
|
|
631
|
+
declare class TestSectionLink extends LitElement {
|
|
632
|
+
#private;
|
|
622
633
|
static styles: lit.CSSResult;
|
|
634
|
+
private sectionId;
|
|
635
|
+
constructor();
|
|
623
636
|
render(): lit.TemplateResult<1>;
|
|
624
637
|
}
|
|
625
638
|
declare global {
|
|
626
639
|
interface HTMLElementTagNameMap {
|
|
627
|
-
'test-
|
|
640
|
+
'test-section-link': TestSectionLink;
|
|
628
641
|
}
|
|
629
642
|
}
|
|
630
643
|
|
|
644
|
+
declare module '../../types/qti-test-state' {
|
|
645
|
+
interface QtiTestPluginState {
|
|
646
|
+
/** Item-ref identifiers the candidate marked to come back to, in the order they were marked. */
|
|
647
|
+
bookmarks: string[];
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
/** The item-ref identifiers bookmarked so far. For a host's own navigation: mark these. */
|
|
651
|
+
declare const bookmarkedItems: (context: Pick<ComputedContext, "plugins"> | undefined) => string[];
|
|
631
652
|
/**
|
|
632
|
-
*
|
|
653
|
+
* A toggle that marks the item on screen to come back to. The marks live in the test's state under
|
|
654
|
+
* `bookmarks` (`session.plugins.bookmarks`), so a host that stores `state` stores them, and a
|
|
655
|
+
* reloaded test shows them again.
|
|
656
|
+
*
|
|
657
|
+
* Put it inside `<test-navigation>`, either in the toolbar, where it marks the item on screen, or in
|
|
658
|
+
* the `<template item-ref>`, where each item gets its own and it marks that item. It is a button
|
|
659
|
+
* (`role="button"`, `aria-pressed`) and reflects `bookmarked` on the host for styling; its content is
|
|
660
|
+
* the label. In the toolbar it is `disabled` while no item is on screen. A host's own navigation reads
|
|
661
|
+
* the marks with `bookmarkedItems(computedContext)`.
|
|
662
|
+
*
|
|
663
|
+
* Give it an `item` (an item-ref identifier) to mark that item instead, wherever the button sits: in a
|
|
664
|
+
* stamp template that lists the items of a section, `<test-bookmark item="{{ item.identifier }}">`
|
|
665
|
+
* puts a button next to each one.
|
|
666
|
+
*
|
|
667
|
+
* @slot - The label.
|
|
668
|
+
* @attr item - The item-ref identifier this button marks; without it, the item it is stamped into, or else the one on screen.
|
|
669
|
+
* @attr bookmarked - Reflected: the item on screen is bookmarked.
|
|
670
|
+
* @attr disabled - Reflected: there is no item on screen.
|
|
633
671
|
*/
|
|
634
|
-
declare class
|
|
672
|
+
declare class TestBookmark extends LitElement {
|
|
635
673
|
#private;
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
674
|
+
protected computedContext?: ComputedContext;
|
|
675
|
+
item?: string;
|
|
676
|
+
bookmarked: boolean;
|
|
677
|
+
disabled: boolean;
|
|
678
|
+
static styles: lit.CSSResult;
|
|
639
679
|
constructor();
|
|
640
680
|
connectedCallback(): void;
|
|
681
|
+
protected willUpdate(): void;
|
|
682
|
+
protected updated(): void;
|
|
641
683
|
render(): lit.TemplateResult<1>;
|
|
642
684
|
}
|
|
643
685
|
declare global {
|
|
644
686
|
interface HTMLElementTagNameMap {
|
|
645
|
-
'test-
|
|
687
|
+
'test-bookmark': TestBookmark;
|
|
646
688
|
}
|
|
647
689
|
}
|
|
648
690
|
|
|
649
|
-
|
|
650
|
-
|
|
691
|
+
/**
|
|
692
|
+
* Ends the attempt on the current item and switches the test to `view` (default `scorer`), which
|
|
693
|
+
* reveals the `[view]` content for that view, such as a scorer's rubric. The view stays until
|
|
694
|
+
* something switches it back (`test-view-toggle`).
|
|
695
|
+
*
|
|
696
|
+
* @attr view - The view to switch to after the attempt ended.
|
|
697
|
+
*/
|
|
698
|
+
declare class TestCheckItem extends LitElement {
|
|
699
|
+
view: View;
|
|
651
700
|
static styles: lit.CSSResult;
|
|
652
|
-
private sectionId;
|
|
653
701
|
constructor();
|
|
654
702
|
render(): lit.TemplateResult<1>;
|
|
655
703
|
}
|
|
656
704
|
declare global {
|
|
657
705
|
interface HTMLElementTagNameMap {
|
|
658
|
-
'test-
|
|
706
|
+
'test-check-item': TestCheckItem;
|
|
659
707
|
}
|
|
660
708
|
}
|
|
661
709
|
|
|
@@ -669,6 +717,45 @@ declare global {
|
|
|
669
717
|
}
|
|
670
718
|
}
|
|
671
719
|
|
|
720
|
+
declare class TestPrintVariables extends LitElement {
|
|
721
|
+
computedContext?: ComputedContext;
|
|
722
|
+
static styles: lit.CSSResult;
|
|
723
|
+
render(): lit.TemplateResult<1>;
|
|
724
|
+
}
|
|
725
|
+
declare global {
|
|
726
|
+
interface HTMLElementTagNameMap {
|
|
727
|
+
'test-print-item-variables': TestPrintVariables;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
declare class TestScoringButtons extends LitElement {
|
|
732
|
+
#private;
|
|
733
|
+
view: string;
|
|
734
|
+
disabled: boolean;
|
|
735
|
+
myTemplate: TemplateFunction | null;
|
|
736
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
737
|
+
connectedCallback(): void;
|
|
738
|
+
protected computedContext?: ComputedContext;
|
|
739
|
+
render(): lit.TemplateResult<1> | typeof nothing;
|
|
740
|
+
constructor();
|
|
741
|
+
}
|
|
742
|
+
declare global {
|
|
743
|
+
interface HTMLElementTagNameMap {
|
|
744
|
+
'test-scoring-buttons': TestScoringButtons;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
declare class TestScoringFeedback extends LitElement {
|
|
749
|
+
protected computedContext?: ComputedContext;
|
|
750
|
+
view: View;
|
|
751
|
+
render(): lit.TemplateResult<1>;
|
|
752
|
+
}
|
|
753
|
+
declare global {
|
|
754
|
+
interface HTMLElementTagNameMap {
|
|
755
|
+
'test-scoring-feedback': TestScoringFeedback;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
672
759
|
/**
|
|
673
760
|
* A custom web component that renders a test stamp using the Lit framework.
|
|
674
761
|
* This component is deprecated and will be removed in the future.
|
|
@@ -695,58 +782,54 @@ declare global {
|
|
|
695
782
|
}
|
|
696
783
|
}
|
|
697
784
|
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
protected computedContext?: ComputedContext;
|
|
706
|
-
render(): lit.TemplateResult<1> | typeof nothing;
|
|
785
|
+
/**
|
|
786
|
+
* Scores the test: on click the test resets its outcomes to their declared defaults, runs its
|
|
787
|
+
* outcome processing and dispatches `cito-test-submitted`, after which the host reads the outcomes.
|
|
788
|
+
* The host decides where it sits, for example on the last item or in a review view.
|
|
789
|
+
*/
|
|
790
|
+
declare class TestSubmit extends LitElement {
|
|
791
|
+
static styles: lit.CSSResult;
|
|
707
792
|
constructor();
|
|
793
|
+
render(): lit.TemplateResult<1>;
|
|
708
794
|
}
|
|
709
795
|
declare global {
|
|
710
796
|
interface HTMLElementTagNameMap {
|
|
711
|
-
'test-
|
|
797
|
+
'test-submit': TestSubmit;
|
|
712
798
|
}
|
|
713
799
|
}
|
|
714
800
|
|
|
715
|
-
declare class
|
|
716
|
-
|
|
717
|
-
|
|
801
|
+
declare class TestView extends LitElement {
|
|
802
|
+
#private;
|
|
803
|
+
static DEFAULT_VIEW_OPTIONS: string[];
|
|
718
804
|
private sessionContext;
|
|
805
|
+
/** label accompanying the select view dropdown */
|
|
806
|
+
label: string;
|
|
807
|
+
/** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */
|
|
808
|
+
viewOptions: string;
|
|
809
|
+
protected _handleViewOptionsChange: () => void;
|
|
719
810
|
connectedCallback(): void;
|
|
720
|
-
|
|
721
|
-
protected
|
|
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;
|
|
811
|
+
private _viewOptions;
|
|
812
|
+
protected _switchView(view: string): void;
|
|
733
813
|
render(): lit.TemplateResult<1>;
|
|
734
814
|
}
|
|
735
815
|
declare global {
|
|
736
816
|
interface HTMLElementTagNameMap {
|
|
737
|
-
'test-
|
|
817
|
+
'test-view': TestView;
|
|
738
818
|
}
|
|
739
819
|
}
|
|
740
820
|
|
|
741
|
-
declare class
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
821
|
+
declare class TestViewToggle extends LitElement {
|
|
822
|
+
myTemplate: any;
|
|
823
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
824
|
+
private sessionContext;
|
|
825
|
+
connectedCallback(): void;
|
|
826
|
+
_switchView(view: string): void;
|
|
827
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
745
828
|
render(): lit.TemplateResult<1>;
|
|
746
829
|
}
|
|
747
830
|
declare global {
|
|
748
831
|
interface HTMLElementTagNameMap {
|
|
749
|
-
'test-
|
|
832
|
+
'test-view-toggle': TestViewToggle;
|
|
750
833
|
}
|
|
751
834
|
}
|
|
752
835
|
|
|
@@ -769,9 +852,6 @@ interface TtsContext {
|
|
|
769
852
|
togglePick(): void;
|
|
770
853
|
}
|
|
771
854
|
|
|
772
|
-
declare const ttsContext: {
|
|
773
|
-
__context__: TtsContext;
|
|
774
|
-
};
|
|
775
855
|
/**
|
|
776
856
|
* Base class shared by all TTS control elements. Consumes `ttsContext` and
|
|
777
857
|
* mirrors the current speech state onto CSS custom states so each child can
|
|
@@ -840,10 +920,9 @@ declare abstract class TtsButtonBase extends LitElement {
|
|
|
840
920
|
* 3. **Inside a `qti-assessment-item-ref`** — e.g. in a `<template item-ref>` on `<qti-test>`,
|
|
841
921
|
* so every item gets a player of its own: the player reads that item, and only that item.
|
|
842
922
|
* The navigation cursor is ignored; speech stops when the player leaves the page with its item.
|
|
843
|
-
* 4. **Anywhere else
|
|
844
|
-
* and reads the item
|
|
845
|
-
*
|
|
846
|
-
* item from the top.
|
|
923
|
+
* 4. **Anywhere else inside `<test-navigation>`** — e.g. a toolbar: the player follows the
|
|
924
|
+
* navigation cursor and reads the active item of the computed context. Navigating stops
|
|
925
|
+
* speech and starts the next item from the top.
|
|
847
926
|
*
|
|
848
927
|
* ```html
|
|
849
928
|
* <!-- 1. a player for the shared reading text -->
|
|
@@ -899,9 +978,11 @@ declare class TestItemToSpeech extends LitElement {
|
|
|
899
978
|
static styles: lit.CSSResult;
|
|
900
979
|
/** Fallback language when neither the item content nor the document declares one. */
|
|
901
980
|
language: string;
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
981
|
+
/**
|
|
982
|
+
* The test as `test-navigation` computes it: which item is active, and where it is rendered
|
|
983
|
+
* (`itemElement`). Updated on navigation and whenever an item is rendered.
|
|
984
|
+
*/
|
|
985
|
+
protected _computedContext?: ComputedContext;
|
|
905
986
|
_ttsContext: TtsContext;
|
|
906
987
|
constructor();
|
|
907
988
|
willUpdate(changed: PropertyValues): void;
|
|
@@ -1006,6 +1087,8 @@ declare const QtiTest_base: (abstract new (...args: any[]) => ITestNavigationMix
|
|
|
1006
1087
|
getOutcome(identifier: string): Readonly<OutcomeVariable>;
|
|
1007
1088
|
getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;
|
|
1008
1089
|
outcomeProcessing(): boolean;
|
|
1090
|
+
submit(): boolean;
|
|
1091
|
+
getTestFeedback(access?: "atEnd" | "during"): QtiTestFeedback[];
|
|
1009
1092
|
}) & (abstract new (...args: any[]) => ITestStateMixin) & (abstract new (...args: any[]) => TestBaseInterface) & typeof LitElement;
|
|
1010
1093
|
/**
|
|
1011
1094
|
* `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
|
|
@@ -1084,4 +1167,4 @@ declare global {
|
|
|
1084
1167
|
}
|
|
1085
1168
|
}
|
|
1086
1169
|
|
|
1087
|
-
export {
|
|
1170
|
+
export { TestScoringButtons as A, TestScoringFeedback as B, TestSectionLink as C, TestStamp as D, TestSubmit as E, TestTtsNext as F, TestTtsPause as G, TestTtsPick as H, type ITestNavigationMixin as I, TestTtsPlay as J, TestTtsPrev as K, TestTtsResume as L, TestTtsStop as M, TestView as N, TestViewToggle as O, bookmarkedItems as P, QtiAssessmentItemRef as Q, type QtiTestPluginState as R, type ItemVariableValue as S, TestBookmark 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, TestCheckItem as q, TestContainer as r, TestEndAttempt as s, TestItemLink as t, TestItemToSpeech as u, TestNavigation as v, TestNext as w, TestPrev as x, TestPrintContext as y, TestPrintVariables as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
|
|
3
|
-
import { I as Interaction } from './
|
|
3
|
+
import { I as Interaction, b as RecordValue } from './record.d-wB9uYs-j.js';
|
|
4
4
|
import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
|
|
5
5
|
import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
|
|
6
|
-
import { B as BaseType, a as Cardinality, b as ItemContext, Q as QtiAreaMapEntry } from './item.types.d-
|
|
6
|
+
import { B as BaseType, a as Cardinality, b as ItemContext, Q as QtiAreaMapEntry } from './item.types.d-DuVR0ZVK.js';
|
|
7
7
|
import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
|
|
8
8
|
import * as lit_directives_ref_js from 'lit/directives/ref.js';
|
|
9
9
|
|
|
@@ -754,6 +754,20 @@ declare const QtiGraphicGapMatchInteraction_base: (abstract new (...args: any[])
|
|
|
754
754
|
declare class QtiGraphicGapMatchInteraction extends QtiGraphicGapMatchInteraction_base {
|
|
755
755
|
#private;
|
|
756
756
|
static styles: CSSResultGroup;
|
|
757
|
+
/**
|
|
758
|
+
* A hotspot's box is its authored `coords`, always (CONFIGURABILITY.md §4). The measured
|
|
759
|
+
* `--qti-dropzone-min-*` reservation is a floor on the hotspot's `min-width`/`min-height`, and it
|
|
760
|
+
* beat the percentage box from `positionShapes` as soon as the graphic rendered narrower than its
|
|
761
|
+
* declared width: a 275px chip kept a 17% hotspot at 275px over a 482px map. Chips are sized to
|
|
762
|
+
* their hotspots through `--qti-graphic-scale` instead.
|
|
763
|
+
*/
|
|
764
|
+
autoSizeDropzones: boolean;
|
|
765
|
+
/**
|
|
766
|
+
* Rendered width of the graphic over its declared width: the factor the drop areas are scaled by.
|
|
767
|
+
* Published as `--qti-graphic-scale` on both slots, so it reaches a chip in the bank and one placed
|
|
768
|
+
* in a hotspot (qti-gap-img.styles.ts), without writing to the light-DOM host.
|
|
769
|
+
*/
|
|
770
|
+
private _graphicScale;
|
|
757
771
|
render(): lit.TemplateResult<1>;
|
|
758
772
|
shouldReturnToInventoryOnInventoryDrop(): boolean;
|
|
759
773
|
connectedCallback(): void;
|
|
@@ -1111,10 +1125,11 @@ type PciInteractionStatus = 'interacting' | 'suspended' | 'closed' | 'solution'
|
|
|
1111
1125
|
* Correct response of a response declaration, mirroring `qti-correct-response`.
|
|
1112
1126
|
*
|
|
1113
1127
|
* `value` holds the authored `qti-value` content: a single value for `single`
|
|
1114
|
-
* cardinality,
|
|
1128
|
+
* cardinality, a field map (`{ time: '4.0', point: '460 245' }`) for `record`
|
|
1129
|
+
* cardinality, and an array of values for every other cardinality.
|
|
1115
1130
|
*/
|
|
1116
1131
|
interface PciCorrectResponse {
|
|
1117
|
-
value: string | string[]
|
|
1132
|
+
value: string | string[] | Record<string, string | string[] | null>;
|
|
1118
1133
|
}
|
|
1119
1134
|
/**
|
|
1120
1135
|
* Response declaration passed into the `getInstance` configuration so a PCI can
|
|
@@ -1207,6 +1222,12 @@ declare type QtiVariableJSON = {
|
|
|
1207
1222
|
record?: QtiRecordItem[] | null;
|
|
1208
1223
|
};
|
|
1209
1224
|
|
|
1225
|
+
/** Text for an inline `<script>`: a `</script` inside it would end the element early. */
|
|
1226
|
+
declare const inlineScriptText: (text: string) => string;
|
|
1227
|
+
/** Text for an inline `<style>`: a `</style` inside it would end the element early. */
|
|
1228
|
+
declare const inlineStyleText: (text: string) => string;
|
|
1229
|
+
/** A response value as this interaction holds it: a record response is its field map. */
|
|
1230
|
+
type PciResponseValue = string | string[] | RecordValue;
|
|
1210
1231
|
declare class QtiPortableCustomInteraction extends Interaction {
|
|
1211
1232
|
#private;
|
|
1212
1233
|
protected _iframeLoaded: boolean;
|
|
@@ -1222,6 +1243,7 @@ declare class QtiPortableCustomInteraction extends Interaction {
|
|
|
1222
1243
|
customInteractionTypeIdentifier: string;
|
|
1223
1244
|
requirePathsJson: string;
|
|
1224
1245
|
requireShimJson: string;
|
|
1246
|
+
/** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
|
|
1225
1247
|
requireJsUrl: string;
|
|
1226
1248
|
baseUrl: string;
|
|
1227
1249
|
useDefaultPaths: boolean;
|
|
@@ -1249,10 +1271,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
|
|
|
1249
1271
|
* Get direct child elements by tag name
|
|
1250
1272
|
*/
|
|
1251
1273
|
private getDirectChildrenByTag;
|
|
1252
|
-
/**
|
|
1253
|
-
* Coerce a scalar value to the expected base-type when possible
|
|
1254
|
-
*/
|
|
1255
|
-
private coerceBaseValue;
|
|
1256
1274
|
/**
|
|
1257
1275
|
* Normalize an input into a list form
|
|
1258
1276
|
*/
|
|
@@ -1261,14 +1279,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
|
|
|
1261
1279
|
* Convert a variable value to QtiVariableJSON
|
|
1262
1280
|
*/
|
|
1263
1281
|
private variableToQtiVariableJSON;
|
|
1264
|
-
/**
|
|
1265
|
-
* Convert a record object into QtiVariableJSON
|
|
1266
|
-
*/
|
|
1267
|
-
private recordToQtiVariableJSON;
|
|
1268
|
-
/**
|
|
1269
|
-
* Build a record entry from an arbitrary value
|
|
1270
|
-
*/
|
|
1271
|
-
private recordEntryFromValue;
|
|
1272
1282
|
/**
|
|
1273
1283
|
* Extract default QTI_CONTEXT values from qti-context-declaration elements
|
|
1274
1284
|
*/
|
|
@@ -1288,7 +1298,7 @@ declare class QtiPortableCustomInteraction extends Interaction {
|
|
|
1288
1298
|
/**
|
|
1289
1299
|
* Converts response variables to QtiVariableJSON
|
|
1290
1300
|
*/
|
|
1291
|
-
protected responseVariablesToQtiVariableJSON(input:
|
|
1301
|
+
protected responseVariablesToQtiVariableJSON(input: PciResponseValue, cardinality: Cardinality, baseType: BaseType, fieldBaseTypes?: Record<string, BaseType>): QtiVariableJSON;
|
|
1292
1302
|
validate(): boolean;
|
|
1293
1303
|
set value(v: string | null);
|
|
1294
1304
|
get value(): string | null;
|
|
@@ -1574,4 +1584,4 @@ declare global {
|
|
|
1574
1584
|
}
|
|
1575
1585
|
}
|
|
1576
1586
|
|
|
1577
|
-
export { type Choice as C, type Orientation as O, QtiAssociableHotspot as Q, QtiAssociateInteraction as a, QtiChoiceInteraction as b, QtiExtendedTextInteraction as c, QtiGap as d, QtiGapImg as e, QtiGapMatchInteraction as f, QtiGapText as g, QtiGraphicAssociateInteraction as h, QtiGraphicGapMatchInteraction as i, QtiGraphicOrderInteraction as j, QtiHotspotChoice as k, QtiHotspotInteraction as l, QtiHottext as m, QtiHottextInteraction as n, QtiInlineChoice as o, QtiInlineChoiceInteraction as p, QtiMatchInteraction as q, QtiOrderInteraction as r, QtiPortableCustomInteraction as s, QtiPrompt as t, QtiSelectPointInteraction as u, QtiSimpleAssociableChoice as v, QtiSimpleChoice as w, QtiSliderInteraction as x, QtiTextEntryInteraction as y,
|
|
1587
|
+
export { inlineStyleText as A, QtiPortableCustomInteractionTest as B, type Choice as C, type Orientation as O, QtiAssociableHotspot as Q, QtiAssociateInteraction as a, QtiChoiceInteraction as b, QtiExtendedTextInteraction as c, QtiGap as d, QtiGapImg as e, QtiGapMatchInteraction as f, QtiGapText as g, QtiGraphicAssociateInteraction as h, QtiGraphicGapMatchInteraction as i, QtiGraphicOrderInteraction as j, QtiHotspotChoice as k, QtiHotspotInteraction as l, QtiHottext as m, QtiHottextInteraction as n, QtiInlineChoice as o, QtiInlineChoiceInteraction as p, QtiMatchInteraction as q, QtiOrderInteraction as r, QtiPortableCustomInteraction as s, QtiPrompt as t, QtiSelectPointInteraction as u, QtiSimpleAssociableChoice as v, QtiSimpleChoice as w, QtiSliderInteraction as x, QtiTextEntryInteraction as y, inlineScriptText as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import { C as ConfigContext, V as ValidationDisplayMode } from './config.context.d-BvU9r-Mg.js';
|
|
3
3
|
import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
|
|
4
|
-
import { g as ResponseVariable } from './item.types.d-
|
|
4
|
+
import { g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* What a choice element should render and behave as. The same element — `qti-simple-choice`,
|
|
@@ -123,4 +123,36 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
|
|
|
123
123
|
protected firstUpdated(_changedProperties?: PropertyValues): void;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
/**
|
|
127
|
+
* The value of a variable with `record` cardinality: its fields by field identifier.
|
|
128
|
+
*
|
|
129
|
+
* Field values are kept the way every other response value is kept, as QTI string literals — a
|
|
130
|
+
* float is `"4.12"`, a point is `"455 250"` — with a list-valued field as an array of them.
|
|
131
|
+
*/
|
|
132
|
+
type RecordValue = Record<string, string | string[] | null>;
|
|
133
|
+
/** A record's field values with the base type each `qti-value` declared for its field. */
|
|
134
|
+
interface RecordFieldValues {
|
|
135
|
+
value: RecordValue;
|
|
136
|
+
baseTypes: Record<string, BaseType>;
|
|
137
|
+
}
|
|
138
|
+
/** Whether a variable value is a record: a plain object, not a list and not NULL. */
|
|
139
|
+
declare const isRecordValue: (value: unknown) => value is RecordValue;
|
|
140
|
+
/**
|
|
141
|
+
* Reads the field values of a record out of `qti-value field-identifier="…" base-type="…"`
|
|
142
|
+
* elements, as found in a `qti-correct-response` or `qti-default-value` of a record declaration.
|
|
143
|
+
*
|
|
144
|
+
* A value without a `field-identifier` is not a record field and is skipped. A field without a
|
|
145
|
+
* `base-type` gets no entry in `baseTypes`, so a reader can tell "declared string" from "unknown".
|
|
146
|
+
*/
|
|
147
|
+
declare const readRecordFieldValues: (valueElements: Iterable<Element>) => RecordFieldValues;
|
|
148
|
+
/**
|
|
149
|
+
* A best guess at a record field's base type, for when the declaration does not say.
|
|
150
|
+
*
|
|
151
|
+
* A record field value carries no type of its own once it is stored, and a record response
|
|
152
|
+
* declaration has no `base-type`, so this is the fallback. A number is a float (or an integer
|
|
153
|
+
* when given as a whole JS number), two numbers separated by whitespace are a point, and
|
|
154
|
+
* anything else is a string.
|
|
155
|
+
*/
|
|
156
|
+
declare const inferRecordFieldBaseType: (value: unknown) => BaseType;
|
|
157
|
+
|
|
158
|
+
export { type ChoiceRole as C, Interaction as I, type RecordFieldValues as R, type InteractionContext as a, type RecordValue as b, interactionContext as c, isRecordValue as d, inferRecordFieldBaseType as i, readRecordFieldValues as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VariableDeclaration } from './item.types.d-
|
|
1
|
+
import { V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
|
|
2
2
|
|
|
3
3
|
type ComputedItemContext = {
|
|
4
4
|
identifier: string;
|
|
@@ -26,6 +26,12 @@ interface SessionContext {
|
|
|
26
26
|
/** @deprecated Never set by the library. Removed in the next major. */
|
|
27
27
|
navTestLoading?: boolean;
|
|
28
28
|
view?: View;
|
|
29
|
+
/**
|
|
30
|
+
* What test plugins keep, by plugin name: JSON the test stores and restores without reading it.
|
|
31
|
+
* Part of the persisted state (`QtiTestState.session.plugins`); written through the
|
|
32
|
+
* `cito-test-update-plugin-state` request.
|
|
33
|
+
*/
|
|
34
|
+
plugins?: Readonly<Record<string, unknown>>;
|
|
29
35
|
}
|
|
30
36
|
declare const INITIAL_SESSION_CONTEXT: Readonly<SessionContext>;
|
|
31
37
|
declare const sessionContext: {
|