@citolab/qti-components 6.0.34 → 6.3.1
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/dist/chunk-43RGQFGW.cjs +1 -0
- package/dist/chunk-AWSFYZS5.js +17 -0
- package/dist/chunk-BKBZWUX6.cjs +1 -0
- package/dist/chunk-CCQXZDO6.cjs +17 -0
- package/dist/chunk-DPSTDDQZ.js +1 -0
- package/dist/chunk-KESARAC5.js +1 -0
- package/dist/{chunk-X6JTBTZK.js → chunk-LNHTXQXY.js} +2 -6
- package/dist/{chunk-UGSY24LD.cjs → chunk-LWL4UHCJ.cjs} +2 -6
- package/dist/chunk-MTPOYN4D.js +0 -0
- package/dist/chunk-TEMU6PXC.cjs +1 -0
- package/dist/context/index.cjs +1 -1
- package/dist/context/index.d.cts +3 -3
- package/dist/context/index.d.ts +3 -3
- package/dist/context/index.js +1 -1
- package/dist/custom-elements.json +1978 -900
- package/dist/index.cjs +257 -132
- package/dist/index.d.cts +195 -64
- package/dist/index.d.ts +195 -64
- package/dist/index.js +257 -132
- package/dist/qti-assessment-test-15ffab61.d.ts +34 -0
- package/dist/qti-assessment-test-a1f2cb91.d.ts +34 -0
- package/dist/qti-components/index.cjs +51 -51
- package/dist/qti-components/index.d.cts +33 -12
- package/dist/qti-components/index.d.ts +33 -12
- package/dist/qti-components/index.js +77 -77
- package/dist/qti-item/index.cjs +1 -1
- package/dist/qti-item/index.d.cts +10 -8
- package/dist/qti-item/index.d.ts +10 -8
- package/dist/qti-item/index.js +1 -1
- package/dist/qti-item-react/index.cjs +1 -1
- package/dist/qti-item-react/index.d.cts +5 -4
- package/dist/qti-item-react/index.d.ts +5 -4
- package/dist/qti-item-react/index.js +1 -1
- package/dist/{qti-simple-choice-e2bc67b1.d.ts → qti-simple-choice-5902cb37.d.ts} +45 -48
- package/dist/qti-test/index.cjs +79 -0
- package/dist/qti-test/index.d.cts +94 -0
- package/dist/qti-test/index.d.ts +94 -0
- package/dist/qti-test/index.js +79 -0
- package/dist/qti-test-react/index.cjs +1 -0
- package/dist/qti-test-react/index.d.cts +29 -0
- package/dist/qti-test-react/index.d.ts +29 -0
- package/dist/qti-test-react/index.js +1 -0
- package/dist/qti-transform/index.cjs +1 -1
- package/dist/qti-transform/index.d.cts +1 -0
- package/dist/qti-transform/index.d.ts +1 -0
- package/dist/qti-transform/index.js +1 -1
- package/package.json +44 -33
- package/readme.md +3 -3
- package/dist/chunk-5GG2XAUT.js +0 -1
- package/dist/chunk-G7BJTOY4.cjs +0 -17
- package/dist/chunk-GGEPFBR7.cjs +0 -1
- package/dist/chunk-UE4QJK43.js +0 -17
package/dist/qti-item/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-TEMU6PXC.cjs');var _chunkLWL4UHCJcjs = require('../chunk-LWL4UHCJ.cjs');require('../chunk-BKBZWUX6.cjs');require('../chunk-CCQXZDO6.cjs');require('../chunk-6G76D2MI.cjs');exports.QtiItem = _chunkLWL4UHCJcjs.a;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
|
-
import * as lit from 'lit';
|
|
3
2
|
import { LitElement } from 'lit';
|
|
3
|
+
import { AudienceContext } from '../context/index.cjs';
|
|
4
|
+
import { Q as QtiAssessmentItem } from '../qti-simple-choice-5902cb37.js';
|
|
5
|
+
import 'lit-html/directives/ref';
|
|
4
6
|
|
|
5
7
|
declare class QtiItem extends LitElement {
|
|
6
8
|
itemLocation: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
private provider;
|
|
11
|
-
private _xml;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
update(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
11
|
+
protected _xml: string;
|
|
12
12
|
set xml(val: string);
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
set css(val: string);
|
|
14
|
+
get assessmentItem(): QtiAssessmentItem | null;
|
|
15
|
+
audienceContext: AudienceContext;
|
|
16
|
+
constructor();
|
|
15
17
|
connectedCallback(): void;
|
|
16
18
|
render: () => lit_html.TemplateResult<1>;
|
|
17
19
|
}
|
package/dist/qti-item/index.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
|
-
import * as lit from 'lit';
|
|
3
2
|
import { LitElement } from 'lit';
|
|
3
|
+
import { AudienceContext } from '../context/index.js';
|
|
4
|
+
import { Q as QtiAssessmentItem } from '../qti-simple-choice-5902cb37.js';
|
|
5
|
+
import 'lit-html/directives/ref';
|
|
4
6
|
|
|
5
7
|
declare class QtiItem extends LitElement {
|
|
6
8
|
itemLocation: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
private provider;
|
|
11
|
-
private _xml;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
update(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
11
|
+
protected _xml: string;
|
|
12
12
|
set xml(val: string);
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
set css(val: string);
|
|
14
|
+
get assessmentItem(): QtiAssessmentItem | null;
|
|
15
|
+
audienceContext: AudienceContext;
|
|
16
|
+
constructor();
|
|
15
17
|
connectedCallback(): void;
|
|
16
18
|
render: () => lit_html.TemplateResult<1>;
|
|
17
19
|
}
|
package/dist/qti-item/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import"../chunk-MTPOYN4D.js";import{a}from"../chunk-LNHTXQXY.js";import"../chunk-DPSTDDQZ.js";import"../chunk-AWSFYZS5.js";import"../chunk-343LZK3D.js";export{a as QtiItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkLWL4UHCJcjs = require('../chunk-LWL4UHCJ.cjs');require('../chunk-BKBZWUX6.cjs');require('../chunk-CCQXZDO6.cjs');require('../chunk-6G76D2MI.cjs');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _react3 = require('@lit/react');var s=_react3.createComponent.call(void 0, {tagName:"qti-item",react:_react2.default,elementClass:_chunkLWL4UHCJcjs.a,events:{onOutcomeChanged:"qti-outcome-changed",onInteractionChanged:"qti-interaction-changed",onItemConnected:"qti-item-connected"}});exports.QtiItem = s;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { Ref } from 'react';
|
|
2
2
|
import { QtiItem as QtiItem$1 } from '../qti-item/index.cjs';
|
|
3
|
-
import { O as OutcomeChangedDetails, I as InteractionChangedDetails, Q as QtiAssessmentItem } from '../qti-simple-choice-
|
|
3
|
+
import { O as OutcomeChangedDetails, I as InteractionChangedDetails, Q as QtiAssessmentItem } from '../qti-simple-choice-5902cb37.js';
|
|
4
4
|
import 'lit-html';
|
|
5
5
|
import 'lit';
|
|
6
|
+
import '../context/index.cjs';
|
|
6
7
|
import 'lit-html/directives/ref';
|
|
7
8
|
|
|
8
9
|
interface QtiItemProps {
|
|
@@ -13,9 +14,9 @@ interface QtiItemProps {
|
|
|
13
14
|
view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
|
|
14
15
|
};
|
|
15
16
|
'item-location'?: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
onOutcomeChanged?: (e: CustomEvent<OutcomeChangedDetails>) => void;
|
|
18
|
+
onInteractionChanged?: (e: CustomEvent<InteractionChangedDetails>) => void;
|
|
19
|
+
onItemConnected?: (e: CustomEvent<QtiAssessmentItem>) => void;
|
|
19
20
|
}
|
|
20
21
|
declare const QtiItem: React.ForwardRefExoticComponent<QtiItemProps>;
|
|
21
22
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { Ref } from 'react';
|
|
2
2
|
import { QtiItem as QtiItem$1 } from '../qti-item/index.js';
|
|
3
|
-
import { O as OutcomeChangedDetails, I as InteractionChangedDetails, Q as QtiAssessmentItem } from '../qti-simple-choice-
|
|
3
|
+
import { O as OutcomeChangedDetails, I as InteractionChangedDetails, Q as QtiAssessmentItem } from '../qti-simple-choice-5902cb37.js';
|
|
4
4
|
import 'lit-html';
|
|
5
5
|
import 'lit';
|
|
6
|
+
import '../context/index.js';
|
|
6
7
|
import 'lit-html/directives/ref';
|
|
7
8
|
|
|
8
9
|
interface QtiItemProps {
|
|
@@ -13,9 +14,9 @@ interface QtiItemProps {
|
|
|
13
14
|
view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
|
|
14
15
|
};
|
|
15
16
|
'item-location'?: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
onOutcomeChanged?: (e: CustomEvent<OutcomeChangedDetails>) => void;
|
|
18
|
+
onInteractionChanged?: (e: CustomEvent<InteractionChangedDetails>) => void;
|
|
19
|
+
onItemConnected?: (e: CustomEvent<QtiAssessmentItem>) => void;
|
|
19
20
|
}
|
|
20
21
|
declare const QtiItem: React.ForwardRefExoticComponent<QtiItemProps>;
|
|
21
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"../chunk-
|
|
1
|
+
import{a as t}from"../chunk-LNHTXQXY.js";import"../chunk-DPSTDDQZ.js";import"../chunk-AWSFYZS5.js";import"../chunk-343LZK3D.js";import e from"react";import{createComponent as o}from"@lit/react";var s=o({tagName:"qti-item",react:e,elementClass:t,events:{onOutcomeChanged:"qti-outcome-changed",onInteractionChanged:"qti-interaction-changed",onItemConnected:"qti-item-connected"}});export{s as QtiItem};
|
|
@@ -24,7 +24,7 @@ type Cardinality = 'multiple' | 'ordered' | 'single';
|
|
|
24
24
|
interface OutcomeChangedDetails {
|
|
25
25
|
item: string;
|
|
26
26
|
outcomeIdentifier: string;
|
|
27
|
-
value: string | string[]
|
|
27
|
+
value: Readonly<string | string[]>;
|
|
28
28
|
}
|
|
29
29
|
type InteractionChangedDetails = ResponseInteraction & {
|
|
30
30
|
item: string;
|
|
@@ -74,27 +74,15 @@ interface VariableDeclaration<T> {
|
|
|
74
74
|
identifier: string;
|
|
75
75
|
cardinality: Cardinality;
|
|
76
76
|
baseType: BaseType;
|
|
77
|
-
value: T
|
|
77
|
+
value: Readonly<T>;
|
|
78
|
+
type: 'outcome' | 'response';
|
|
78
79
|
}
|
|
79
|
-
interface
|
|
80
|
-
cardinality: Cardinality;
|
|
81
|
-
baseType: BaseType;
|
|
82
|
-
result: number | boolean | string | (number | boolean | string)[];
|
|
80
|
+
interface OutcomeVariable extends VariableDeclaration<string | string[] | null> {
|
|
83
81
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
value: string | string[] | null;
|
|
89
|
-
}
|
|
90
|
-
declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
|
|
91
|
-
identifier: string;
|
|
92
|
-
cardinality: Cardinality;
|
|
93
|
-
baseType: BaseType;
|
|
94
|
-
value: string | string[] | null;
|
|
95
|
-
candidateResponse: string | string[] | null;
|
|
96
|
-
mapping: QtiMapping;
|
|
97
|
-
correctResponse: string | string[] | null;
|
|
82
|
+
interface ResponseVariable extends VariableDeclaration<string | string[] | null> {
|
|
83
|
+
candidateResponse?: string | string[] | null;
|
|
84
|
+
mapping?: QtiMapping;
|
|
85
|
+
correctResponse?: string | string[] | null;
|
|
98
86
|
}
|
|
99
87
|
|
|
100
88
|
type QtiRegisterVariable = CustomEvent<{
|
|
@@ -193,6 +181,15 @@ declare namespace qtiChoiceElementSelected {
|
|
|
193
181
|
};
|
|
194
182
|
}
|
|
195
183
|
|
|
184
|
+
interface ItemContext {
|
|
185
|
+
href?: string;
|
|
186
|
+
identifier: string;
|
|
187
|
+
variables: ReadonlyArray<VariableDeclaration<string | string[]>>;
|
|
188
|
+
}
|
|
189
|
+
declare const itemContext: {
|
|
190
|
+
__context__: ItemContext;
|
|
191
|
+
};
|
|
192
|
+
|
|
196
193
|
/**
|
|
197
194
|
* @summary The qti-assessment-item element contains all the other QTI 3 item structures.
|
|
198
195
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
|
|
@@ -210,35 +207,37 @@ declare namespace qtiChoiceElementSelected {
|
|
|
210
207
|
*
|
|
211
208
|
*/
|
|
212
209
|
declare class QtiAssessmentItem extends LitElement {
|
|
213
|
-
variables: VariableDeclaration<string | string[]>[];
|
|
214
|
-
private feedbackElements;
|
|
215
|
-
private interactionElements;
|
|
216
|
-
disabled: boolean;
|
|
217
|
-
readonly: boolean;
|
|
218
210
|
title: string;
|
|
219
|
-
identifier: string;
|
|
220
|
-
|
|
221
|
-
|
|
211
|
+
identifier: string | undefined;
|
|
212
|
+
adaptive: 'true' | 'false';
|
|
213
|
+
timeDependent: 'true' | 'false';
|
|
214
|
+
disabled: boolean;
|
|
222
215
|
_handleDisabledChange: (_: boolean, disabled: boolean) => void;
|
|
216
|
+
readonly: boolean;
|
|
223
217
|
_handleReadonlyChange: (_: boolean, readonly: boolean) => void;
|
|
224
|
-
|
|
218
|
+
private _context;
|
|
219
|
+
get context(): ItemContext;
|
|
220
|
+
set variables(value: VariableDeclaration<string | string[] | null>[]);
|
|
221
|
+
private _initialContext;
|
|
222
|
+
private _feedbackElements;
|
|
223
|
+
private _interactionElements;
|
|
225
224
|
firstUpdated(val: any): void;
|
|
226
225
|
disconnectedCallback(): void;
|
|
227
|
-
|
|
228
|
-
showCorrectResponse(): void;
|
|
229
|
-
processResponse(): boolean;
|
|
226
|
+
/** @deprecated use context property instead */
|
|
230
227
|
set responses(myResponses: ResponseInteraction[]);
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
private
|
|
240
|
-
|
|
241
|
-
|
|
228
|
+
render(): lit_html.TemplateResult<1>;
|
|
229
|
+
constructor();
|
|
230
|
+
showCorrectResponse(): void;
|
|
231
|
+
processResponse(countNumAttempts?: boolean): boolean;
|
|
232
|
+
resetResponses(): void;
|
|
233
|
+
getResponse(identifier: string): Readonly<ResponseVariable>;
|
|
234
|
+
getOutcome(identifier: string): Readonly<OutcomeVariable>;
|
|
235
|
+
getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;
|
|
236
|
+
private handleUpdateResponseVariable;
|
|
237
|
+
updateResponseVariable(identifier: string, value: string | string[] | undefined): void;
|
|
238
|
+
updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void;
|
|
239
|
+
private _getCompletionStatus;
|
|
240
|
+
private _emit;
|
|
242
241
|
}
|
|
243
242
|
declare global {
|
|
244
243
|
interface HTMLElementTagNameMap {
|
|
@@ -306,9 +305,8 @@ declare abstract class Interaction extends LitElement {
|
|
|
306
305
|
disabled: boolean;
|
|
307
306
|
/** readonly should be exposed to the attributes and accessible as property */
|
|
308
307
|
readonly: boolean;
|
|
309
|
-
abstract reset(): void;
|
|
310
308
|
abstract validate(): boolean;
|
|
311
|
-
abstract set response(val: string | string[]);
|
|
309
|
+
abstract set response(val: Readonly<string | string[]>);
|
|
312
310
|
connectedCallback(): void;
|
|
313
311
|
saveResponse(value: string | string[]): void;
|
|
314
312
|
}
|
|
@@ -370,9 +368,8 @@ declare abstract class Choices extends Interaction {
|
|
|
370
368
|
_handleReadonlyChange: (_: boolean, readonly: boolean) => void;
|
|
371
369
|
_handleMaxChoicesChange: () => void;
|
|
372
370
|
constructor();
|
|
373
|
-
reset(): void;
|
|
374
371
|
validate(): boolean;
|
|
375
|
-
set response(
|
|
372
|
+
set response(responseValue: string | string[]);
|
|
376
373
|
connectedCallback(): void;
|
|
377
374
|
disconnectedCallback(): void;
|
|
378
375
|
private _registerChoiceElement;
|
|
@@ -463,4 +460,4 @@ declare global {
|
|
|
463
460
|
}
|
|
464
461
|
}
|
|
465
462
|
|
|
466
|
-
export { QtiHottext as A, BaseType as B, Cardinality as C, QtiSimpleChoice as D, InteractionChangedDetails as I, Multiple as M, OutcomeChangedDetails as O, QtiAssessmentItem as Q, ResponseVariable as R, VariableDeclaration as V,
|
|
463
|
+
export { QtiHottext as A, BaseType as B, Cardinality as C, QtiSimpleChoice as D, itemContext as E, InteractionChangedDetails as I, Multiple as M, OutcomeChangedDetails as O, QtiAssessmentItem as Q, ResponseVariable as R, VariableDeclaration as V, ItemContext as a, Choices as b, Interaction as c, QtiRule as d, QtiChoice as e, Calculate as f, directedPair as g, ResponseInteraction as h, float as i, integer as j, Ordered as k, qtiInteractionChanged as l, qtiRegisterVariable as m, qtiRegisterInteraction as n, qtiRegisterChoice as o, qtiRegisterHotspot as p, qtiOutcomeChanged as q, qtiLooseChoice as r, qtiInteractionResponse as s, qtiChoiceElementSelected as t, OutcomeVariable as u, QtiTextEntryInteraction as v, QtiExtendedTextInteraction as w, QtiChoiceInteraction as x, QtiResponseProcessing as y, QtiMapping as z };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-TEMU6PXC.cjs');var _chunkLWL4UHCJcjs = require('../chunk-LWL4UHCJ.cjs');require('../chunk-BKBZWUX6.cjs');require('../chunk-CCQXZDO6.cjs');var _chunk43RGQFGWcjs = require('../chunk-43RGQFGW.cjs');var _chunk6G76D2MIcjs = require('../chunk-6G76D2MI.cjs');var _decoratorsjs = require('lit/decorators.js');var a=class extends _chunkLWL4UHCJcjs.a{connectedCallback(){super.connectedCallback();let t=new CustomEvent("register-item-ref",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href}});this.dispatchEvent(t)}};_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],a.prototype,"identifier",2),_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],a.prototype,"href",2),a= exports.QtiAssessmentItemRef =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-assessment-item-ref")],a);var _lit = require('lit');var d=class extends _lit.LitElement{constructor(){super(...arguments);this._navigationMode="linear"}render(){return _lit.html`
|
|
2
|
+
<slot name="qti-item"></slot>
|
|
3
|
+
<slot> </slot>
|
|
4
|
+
`}};_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"navigation-mode"})],d.prototype,"_navigationMode",2),d= exports.QtiTestPart =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-test-part")],d);var _haunted = require('haunted');var u=class extends _lit.LitElement{constructor(){super(...arguments);this._navigationMode="linear";this.loadedItems=[];this.itemRefEls=_haunted.useRef.call(void 0, new Map);this.controller=new AbortController}requestItem(t){let r=async()=>{for(let m of this.itemRefEls.current.values())m.xml="";let s=this.itemRefEls.current.get(t),i=new AbortController().signal;try{let l=await(await fetch(`${this.assessmentTestURI}/items/${s.href}`,{signal:i})).text();s.xml=l}catch(m){m.name==="AbortError"?console.log("Fetch aborted"):console.error(m)}};this.controller&&this.controller.abort(),r()}render(){return _lit.html`
|
|
5
|
+
<qti-assessment-test
|
|
6
|
+
@register-item-ref=${t=>{this.itemRefEls.current.set(t.target.identifier,t.target),t.target.itemLocation=`${this.assessmentTestURI}/items/${t.target.href}`}}
|
|
7
|
+
@on-test-set-item=${({detail:t})=>this.requestItem(t)}
|
|
8
|
+
>
|
|
9
|
+
<test-show-index></test-show-index>
|
|
10
|
+
<qti-test-part identifier="part1" navigation-mode="nonlinear" submission-mode="individual">
|
|
11
|
+
<qti-assessment-section identifier="section-1" title="Section 1" visible="true" required="true">
|
|
12
|
+
${this.loadedItems.map(t=>_lit.html`<qti-assessment-item-ref identifier="${t.identifier}" href="${t.href}">
|
|
13
|
+
</qti-assessment-item-ref>`)}
|
|
14
|
+
</qti-assessment-section>
|
|
15
|
+
</qti-test-part>
|
|
16
|
+
<test-next>NEXT</test-next>
|
|
17
|
+
|
|
18
|
+
<test-prev>PREV</test-prev>
|
|
19
|
+
<test-progress></test-progress>
|
|
20
|
+
<test-paging-buttons></test-paging-buttons>
|
|
21
|
+
<test-paging-radio></test-paging-radio>
|
|
22
|
+
<test-slider></test-slider>
|
|
23
|
+
<test-show-correct>correct</test-show-correct>
|
|
24
|
+
<test-print-variables></test-print-variables>
|
|
25
|
+
</qti-assessment-test>
|
|
26
|
+
`}};_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"navigation-mode"})],u.prototype,"_navigationMode",2),_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String,attribute:"assessment-test-uri"})],u.prototype,"assessmentTestURI",2),u= exports.QtiTest =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-test")],u);var _context2 = require('@lit/context');var f=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:r}=this._testContext,s=Math.min(r+1,t.length-1);return _lit.html`
|
|
27
|
+
<button part="button" @click=${n=>this._requestItem(s)} id="${t[s].identifier}">
|
|
28
|
+
<slot></slot>
|
|
29
|
+
</button>
|
|
30
|
+
`}};_chunk6G76D2MIcjs.c.call(void 0, [_context2.consume.call(void 0, {context:_chunk43RGQFGWcjs.a,subscribe:!0}),_decoratorsjs.state.call(void 0, )],f.prototype,"_testContext",2),f= exports.TestNext =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-next")],f);var x=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:r}=this._testContext,s=Math.max(r-1,0);return _lit.html`
|
|
31
|
+
<button part="button" @click=${n=>this._requestItem(s)} id="${t[s].identifier}">
|
|
32
|
+
<slot></slot>
|
|
33
|
+
</button>
|
|
34
|
+
`}};_chunk6G76D2MIcjs.c.call(void 0, [_context2.consume.call(void 0, {context:_chunk43RGQFGWcjs.a,subscribe:!0}),_decoratorsjs.state.call(void 0, )],x.prototype,"_testContext",2),x= exports.TestPrev =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-prev")],x);var h=class extends _lit.LitElement{render(){let{items:t,itemIndex:r}=this._testProvider;return _lit.html`
|
|
35
|
+
<progress part="progress" id="file" max=${t.length-1} value=${r}>
|
|
36
|
+
${r/(t.length-1)}%
|
|
37
|
+
</progress>
|
|
38
|
+
`}};_chunk6G76D2MIcjs.c.call(void 0, [_context2.consume.call(void 0, {context:_chunk43RGQFGWcjs.a,subscribe:!0}),_decoratorsjs.state.call(void 0, )],h.prototype,"_testProvider",2),h= exports.QtiTestProgress =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-progress")],h);var b=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:r}=this._testProvider;return _lit.html`
|
|
39
|
+
<input
|
|
40
|
+
part="input"
|
|
41
|
+
type="range"
|
|
42
|
+
value=${r}
|
|
43
|
+
class="absolute w-full appearance-none bg-transparent"
|
|
44
|
+
max=${t.length-1}
|
|
45
|
+
@input=${s=>this._requestItem(+s.target.value)}
|
|
46
|
+
/>
|
|
47
|
+
`}};_chunk6G76D2MIcjs.c.call(void 0, [_context2.consume.call(void 0, {context:_chunk43RGQFGWcjs.a,subscribe:!0}),_decoratorsjs.state.call(void 0, )],b.prototype,"_testProvider",2),b= exports.QtiTestSlider =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-slider")],b);var v=class extends _lit.LitElement{createRenderRoot(){return this}_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:r}=this._testProvider;return _lit.html`
|
|
48
|
+
${t.map((s,n)=>{var i;return _lit.html` <label>
|
|
49
|
+
<input
|
|
50
|
+
type="radio"
|
|
51
|
+
part="input"
|
|
52
|
+
name="item"
|
|
53
|
+
value="${n}"
|
|
54
|
+
?checked=${n===r}
|
|
55
|
+
@change=${m=>this._requestItem(n)}
|
|
56
|
+
data-completion-status=${(i=s.variables.find(m=>m.identifier==="completionStatus"))==null?void 0:i.value}
|
|
57
|
+
id="${s.identifier}"
|
|
58
|
+
/>
|
|
59
|
+
${n+1}
|
|
60
|
+
</label>`})}
|
|
61
|
+
`}};_chunk6G76D2MIcjs.c.call(void 0, [_context2.consume.call(void 0, {context:_chunk43RGQFGWcjs.a,subscribe:!0}),_decoratorsjs.state.call(void 0, )],v.prototype,"_testProvider",2),v= exports.QtiTestPagingRadio =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-paging-radio")],v);var E=class extends _lit.LitElement{createRenderRoot(){return this}_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:r}=this._testProvider;return _lit.html`
|
|
62
|
+
${t.map((s,n)=>{var i;return _lit.html` <button
|
|
63
|
+
part="button"
|
|
64
|
+
data-completion-status=${(i=s.variables.find(m=>m.identifier==="completionStatus"))==null?void 0:i.value}
|
|
65
|
+
data-active-item=${n===r}
|
|
66
|
+
@click=${m=>this._requestItem(n)}
|
|
67
|
+
id="${s.identifier}"
|
|
68
|
+
>
|
|
69
|
+
${n+1}
|
|
70
|
+
</button>`})}
|
|
71
|
+
`}};_chunk6G76D2MIcjs.c.call(void 0, [_context2.consume.call(void 0, {context:_chunk43RGQFGWcjs.a,subscribe:!0}),_decoratorsjs.state.call(void 0, )],E.prototype,"_testProvider",2),E= exports.QtiTestPagingButtons =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-paging-buttons")],E);var C=class extends _lit.LitElement{render(){var n,i,m;let{items:t,itemIndex:r}=this._testProvider;if(r==null)return _lit.html``;let s=(m=(i=this.closest("qti-assessment-test"))==null?void 0:i.itemRefEls.get((n=t[r])==null?void 0:n.identifier))==null?void 0:m.assessmentItem;return _lit.html`
|
|
72
|
+
<button part="button" @click=${l=>s.showCorrectResponse()}>
|
|
73
|
+
<slot></slot>
|
|
74
|
+
</button>
|
|
75
|
+
`}};_chunk6G76D2MIcjs.c.call(void 0, [_context2.consume.call(void 0, {context:_chunk43RGQFGWcjs.a,subscribe:!0}),_decoratorsjs.state.call(void 0, )],C.prototype,"_testProvider",2),C= exports.QtiTestShowCorrect =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-show-correct")],C);var _=class extends _lit.LitElement{constructor(){super(...arguments);this._printed=""}render(){return _lit.html`${this._printed}<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(t){var s,n;let r=Array.from((s=this.childNodes)!=null?s:[]).find(i=>i.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","item",(n=r.textContent)!=null?n:"")}catch(i){console.error("custom-operator contains invalid javascript code",i)}this._context=new (0, _context2.ContextConsumer)(this,_chunk43RGQFGWcjs.a,i=>{this._printed=this.operatorFunction(i,this.closest("qti-assessment-item"))},!0)}};_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.state.call(void 0, )],_.prototype,"_printed",2),_= exports.TestScript =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-script")],_);var $=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t,itemIndex:r}=this._testContext,s=t[r-1];return _lit.html` ${r+1}/${t.length} `}};_chunk6G76D2MIcjs.c.call(void 0, [_context2.consume.call(void 0, {context:_chunk43RGQFGWcjs.a,subscribe:!0}),_decoratorsjs.state.call(void 0, )],$.prototype,"_testContext",2),$= exports.TestShowIndex =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-show-index")],$);var q=class extends _lit.LitElement{render(){return _lit.html`
|
|
76
|
+
<pre>
|
|
77
|
+
${JSON.stringify(_chunk6G76D2MIcjs.b.call(void 0, _chunk6G76D2MIcjs.a.call(void 0, {},this._testProvider),{items:this._testProvider.items.map(t=>_chunk6G76D2MIcjs.b.call(void 0, _chunk6G76D2MIcjs.a.call(void 0, {},t),{itemEl:null}))}),null,2)}</pre
|
|
78
|
+
>
|
|
79
|
+
`}};_chunk6G76D2MIcjs.c.call(void 0, [_context2.consume.call(void 0, {context:_chunk43RGQFGWcjs.a,subscribe:!0}),_decoratorsjs.state.call(void 0, )],q.prototype,"_testProvider",2),q= exports.QtiPrintVariables =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-print-variables")],q);var g=class extends _lit.LitElement{_requestItem(t){this.dispatchEvent(new CustomEvent("on-test-request-item",{composed:!0,bubbles:!0,detail:t}))}render(){let{items:t}=this._testContext,r=t.reduce((n,i)=>{let m=i.variables.find(l=>l.identifier==="SCORE");return n+(m?+m.value:0)},0),s=t.reduce((n,i)=>{let m=i.variables.find(l=>l.identifier==="MAXSCORE");return n+(m?+m.value:0)},0);return _lit.html` ${r}/${s}`}};_chunk6G76D2MIcjs.c.call(void 0, [_context2.consume.call(void 0, {context:_chunk43RGQFGWcjs.a,subscribe:!0}),_decoratorsjs.state.call(void 0, )],g.prototype,"_testContext",2),g= exports.QtiTestPrintScore =_chunk6G76D2MIcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "test-print-score")],g);exports.QtiAssessmentItemRef = a; exports.QtiAssessmentTest = _chunk43RGQFGWcjs.b; exports.QtiPrintVariables = q; exports.QtiTest = u; exports.QtiTestPagingButtons = E; exports.QtiTestPagingRadio = v; exports.QtiTestPart = d; exports.QtiTestPrintScore = g; exports.QtiTestProgress = h; exports.QtiTestShowCorrect = C; exports.QtiTestSlider = b; exports.TestNext = f; exports.TestPrev = x; exports.TestScript = _; exports.TestShowIndex = $;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { a as QtiAssessmentItemRef, T as TestContext } from '../qti-assessment-test-15ffab61.js';
|
|
2
|
+
export { Q as QtiAssessmentTest } from '../qti-assessment-test-15ffab61.js';
|
|
3
|
+
import * as lit_html from 'lit-html';
|
|
4
|
+
import { LitElement } from 'lit';
|
|
5
|
+
import '../qti-simple-choice-5902cb37.js';
|
|
6
|
+
import 'lit-html/directives/ref';
|
|
7
|
+
import '../qti-item/index.cjs';
|
|
8
|
+
import '../context/index.cjs';
|
|
9
|
+
|
|
10
|
+
declare class QtiTestPart extends LitElement {
|
|
11
|
+
private _navigationMode;
|
|
12
|
+
render(): lit_html.TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare class QtiTest extends LitElement {
|
|
16
|
+
private _navigationMode;
|
|
17
|
+
private assessmentTestURI;
|
|
18
|
+
loadedItems: any[];
|
|
19
|
+
itemRefEls: {
|
|
20
|
+
current: Map<string, QtiAssessmentItemRef>;
|
|
21
|
+
};
|
|
22
|
+
controller: AbortController;
|
|
23
|
+
requestItem(identifier: string): void;
|
|
24
|
+
render(): lit_html.TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare class TestNext extends LitElement {
|
|
28
|
+
_testContext?: TestContext;
|
|
29
|
+
_requestItem(index: any): void;
|
|
30
|
+
render(): lit_html.TemplateResult<1>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class TestPrev extends LitElement {
|
|
34
|
+
_testContext?: TestContext;
|
|
35
|
+
_requestItem(index: any): void;
|
|
36
|
+
render(): lit_html.TemplateResult<1>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class QtiTestProgress extends LitElement {
|
|
40
|
+
_testProvider?: TestContext;
|
|
41
|
+
render(): lit_html.TemplateResult<1>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare class QtiTestSlider extends LitElement {
|
|
45
|
+
_testProvider?: TestContext;
|
|
46
|
+
_requestItem(index: any): void;
|
|
47
|
+
render(): lit_html.TemplateResult<1>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare class QtiTestPagingRadio extends LitElement {
|
|
51
|
+
_testProvider?: TestContext;
|
|
52
|
+
protected createRenderRoot(): this;
|
|
53
|
+
_requestItem(index: any): void;
|
|
54
|
+
render(): lit_html.TemplateResult<1>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare class QtiTestPagingButtons extends LitElement {
|
|
58
|
+
_testProvider?: TestContext;
|
|
59
|
+
protected createRenderRoot(): this;
|
|
60
|
+
_requestItem(index: any): void;
|
|
61
|
+
render(): lit_html.TemplateResult<1>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare class QtiTestShowCorrect extends LitElement {
|
|
65
|
+
_testProvider?: TestContext;
|
|
66
|
+
render(): lit_html.TemplateResult<1>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare class TestScript extends LitElement {
|
|
70
|
+
private operatorFunction;
|
|
71
|
+
private _context;
|
|
72
|
+
private _printed;
|
|
73
|
+
render(): lit_html.TemplateResult<1>;
|
|
74
|
+
handleSlotChange(event: Event): void;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare class TestShowIndex extends LitElement {
|
|
78
|
+
_testContext?: TestContext;
|
|
79
|
+
_requestItem(index: any): void;
|
|
80
|
+
render(): lit_html.TemplateResult<1>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare class QtiPrintVariables extends LitElement {
|
|
84
|
+
_testProvider?: TestContext;
|
|
85
|
+
render(): lit_html.TemplateResult<1>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare class QtiTestPrintScore extends LitElement {
|
|
89
|
+
_testContext?: TestContext;
|
|
90
|
+
_requestItem(index: any): void;
|
|
91
|
+
render(): lit_html.TemplateResult<1>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { QtiAssessmentItemRef, QtiPrintVariables, QtiTest, QtiTestPagingButtons, QtiTestPagingRadio, QtiTestPart, QtiTestPrintScore, QtiTestProgress, QtiTestShowCorrect, QtiTestSlider, TestNext, TestPrev, TestScript, TestShowIndex };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { a as QtiAssessmentItemRef, T as TestContext } from '../qti-assessment-test-a1f2cb91.js';
|
|
2
|
+
export { Q as QtiAssessmentTest } from '../qti-assessment-test-a1f2cb91.js';
|
|
3
|
+
import * as lit_html from 'lit-html';
|
|
4
|
+
import { LitElement } from 'lit';
|
|
5
|
+
import '../qti-simple-choice-5902cb37.js';
|
|
6
|
+
import 'lit-html/directives/ref';
|
|
7
|
+
import '../qti-item/index.js';
|
|
8
|
+
import '../context/index.js';
|
|
9
|
+
|
|
10
|
+
declare class QtiTestPart extends LitElement {
|
|
11
|
+
private _navigationMode;
|
|
12
|
+
render(): lit_html.TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare class QtiTest extends LitElement {
|
|
16
|
+
private _navigationMode;
|
|
17
|
+
private assessmentTestURI;
|
|
18
|
+
loadedItems: any[];
|
|
19
|
+
itemRefEls: {
|
|
20
|
+
current: Map<string, QtiAssessmentItemRef>;
|
|
21
|
+
};
|
|
22
|
+
controller: AbortController;
|
|
23
|
+
requestItem(identifier: string): void;
|
|
24
|
+
render(): lit_html.TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare class TestNext extends LitElement {
|
|
28
|
+
_testContext?: TestContext;
|
|
29
|
+
_requestItem(index: any): void;
|
|
30
|
+
render(): lit_html.TemplateResult<1>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class TestPrev extends LitElement {
|
|
34
|
+
_testContext?: TestContext;
|
|
35
|
+
_requestItem(index: any): void;
|
|
36
|
+
render(): lit_html.TemplateResult<1>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class QtiTestProgress extends LitElement {
|
|
40
|
+
_testProvider?: TestContext;
|
|
41
|
+
render(): lit_html.TemplateResult<1>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare class QtiTestSlider extends LitElement {
|
|
45
|
+
_testProvider?: TestContext;
|
|
46
|
+
_requestItem(index: any): void;
|
|
47
|
+
render(): lit_html.TemplateResult<1>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare class QtiTestPagingRadio extends LitElement {
|
|
51
|
+
_testProvider?: TestContext;
|
|
52
|
+
protected createRenderRoot(): this;
|
|
53
|
+
_requestItem(index: any): void;
|
|
54
|
+
render(): lit_html.TemplateResult<1>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare class QtiTestPagingButtons extends LitElement {
|
|
58
|
+
_testProvider?: TestContext;
|
|
59
|
+
protected createRenderRoot(): this;
|
|
60
|
+
_requestItem(index: any): void;
|
|
61
|
+
render(): lit_html.TemplateResult<1>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare class QtiTestShowCorrect extends LitElement {
|
|
65
|
+
_testProvider?: TestContext;
|
|
66
|
+
render(): lit_html.TemplateResult<1>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare class TestScript extends LitElement {
|
|
70
|
+
private operatorFunction;
|
|
71
|
+
private _context;
|
|
72
|
+
private _printed;
|
|
73
|
+
render(): lit_html.TemplateResult<1>;
|
|
74
|
+
handleSlotChange(event: Event): void;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare class TestShowIndex extends LitElement {
|
|
78
|
+
_testContext?: TestContext;
|
|
79
|
+
_requestItem(index: any): void;
|
|
80
|
+
render(): lit_html.TemplateResult<1>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare class QtiPrintVariables extends LitElement {
|
|
84
|
+
_testProvider?: TestContext;
|
|
85
|
+
render(): lit_html.TemplateResult<1>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare class QtiTestPrintScore extends LitElement {
|
|
89
|
+
_testContext?: TestContext;
|
|
90
|
+
_requestItem(index: any): void;
|
|
91
|
+
render(): lit_html.TemplateResult<1>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { QtiAssessmentItemRef, QtiPrintVariables, QtiTest, QtiTestPagingButtons, QtiTestPagingRadio, QtiTestPart, QtiTestPrintScore, QtiTestProgress, QtiTestShowCorrect, QtiTestSlider, TestNext, TestPrev, TestScript, TestShowIndex };
|