@qti-components/test 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js +0 -3
- package/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js.map +1 -1
- package/dist/components/qti-assessment-section/qti-assessment-section.js +0 -3
- package/dist/components/qti-assessment-section/qti-assessment-section.js.map +1 -1
- package/dist/components/qti-assessment-test/qti-assessment-test.js +3 -7
- package/dist/components/qti-assessment-test/qti-assessment-test.js.map +1 -1
- package/dist/components/qti-outcome-processing/qti-outcome-processing.js +2 -13
- package/dist/components/qti-outcome-processing/qti-outcome-processing.js.map +1 -1
- package/dist/components/qti-test/qti-test.d.ts +3 -1
- package/dist/components/qti-test/qti-test.js +3 -7
- package/dist/components/qti-test/qti-test.js.map +1 -1
- package/dist/components/qti-test-feedback/qti-test-feedback.d.ts +1 -1
- package/dist/components/qti-test-feedback/qti-test-feedback.js +3 -14
- package/dist/components/qti-test-feedback/qti-test-feedback.js.map +1 -1
- package/dist/components/qti-test-part/qti-test-part.js +3 -10
- package/dist/components/qti-test-part/qti-test-part.js.map +1 -1
- package/dist/components/qti-test-variables/qti-test-variables.js +0 -1
- package/dist/components/qti-test-variables/qti-test-variables.js.map +1 -1
- package/dist/components/test-check-item/test-check-item.js +2 -17
- package/dist/components/test-check-item/test-check-item.js.map +1 -1
- package/dist/components/test-container/test-container.d.ts +3 -0
- package/dist/components/test-container/test-container.js +26 -10
- package/dist/components/test-container/test-container.js.map +1 -1
- package/dist/components/test-end-attempt/test-end-attempt.js +2 -13
- package/dist/components/test-end-attempt/test-end-attempt.js.map +1 -1
- package/dist/components/test-item-link/test-item-link.js +3 -7
- package/dist/components/test-item-link/test-item-link.js.map +1 -1
- package/dist/components/test-item-to-speech/test-item-to-speech.d.ts +135 -0
- package/dist/components/test-item-to-speech/test-item-to-speech.js +513 -0
- package/dist/components/test-item-to-speech/test-item-to-speech.js.map +1 -0
- package/dist/components/test-navigation/test-navigation.d.ts +8 -3
- package/dist/components/test-navigation/test-navigation.js +9 -33
- package/dist/components/test-navigation/test-navigation.js.map +1 -1
- package/dist/components/test-next/test-next.js +3 -7
- package/dist/components/test-next/test-next.js.map +1 -1
- package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js +2 -7
- package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js.map +1 -1
- package/dist/components/test-prev/test-prev.d.ts +1 -1
- package/dist/components/test-prev/test-prev.js +3 -7
- package/dist/components/test-prev/test-prev.js.map +1 -1
- package/dist/components/test-print-context/test-print-context.js +3 -7
- package/dist/components/test-print-context/test-print-context.js.map +1 -1
- package/dist/components/test-print-item-variables/test-print-item-variables.js +2 -7
- package/dist/components/test-print-item-variables/test-print-item-variables.js.map +1 -1
- package/dist/components/test-scoring-buttons/test-scoring-buttons.js +3 -7
- package/dist/components/test-scoring-buttons/test-scoring-buttons.js.map +1 -1
- package/dist/components/test-scoring-feedback/test-scoring-feedback.js +3 -7
- package/dist/components/test-scoring-feedback/test-scoring-feedback.js.map +1 -1
- package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js +2 -7
- package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js.map +1 -1
- package/dist/components/test-section-link/test-section-link.js +3 -7
- package/dist/components/test-section-link/test-section-link.js.map +1 -1
- package/dist/components/test-stamp/test-stamp.js +3 -7
- package/dist/components/test-stamp/test-stamp.js.map +1 -1
- package/dist/components/test-view-toggle/test-view-toggle.js +2 -7
- package/dist/components/test-view-toggle/test-view-toggle.js.map +1 -1
- package/dist/components/test-view-toggle/test-view.js +7 -12
- package/dist/components/test-view-toggle/test-view.js.map +1 -1
- package/dist/elements.d.ts +124 -0
- package/dist/elements.js +62 -0
- package/dist/elements.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mixins/test-navigation.mixin.js +8 -2
- package/dist/mixins/test-navigation.mixin.js.map +1 -1
- package/dist/mixins/test-view.mixin.d.ts +3 -0
- package/dist/mixins/test-view.mixin.js +5 -4
- package/dist/mixins/test-view.mixin.js.map +1 -1
- package/dist/register.d.ts +1 -0
- package/dist/register.js +7 -0
- package/dist/register.js.map +1 -0
- package/dist/types/iqti-test.d.ts +2 -1
- package/dist/types/iqti-test.js.map +1 -1
- package/package.json +24 -7
- package/dist/components/test-show-correct-response/test-show-correct-response.d.ts +0 -22
- package/dist/components/test-show-correct-response/test-show-correct-response.js +0 -91
- package/dist/components/test-show-correct-response/test-show-correct-response.js.map +0 -1
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
1
|
import { css, html, LitElement } from 'lit';
|
|
8
|
-
import { customElement } from 'lit/decorators.js';
|
|
9
2
|
import * as styles from '../styles';
|
|
10
|
-
|
|
3
|
+
export class TestEndAttempt extends LitElement {
|
|
11
4
|
static { this.styles = css `
|
|
12
5
|
:host {
|
|
13
6
|
${styles.btn};
|
|
@@ -23,9 +16,5 @@ let TestEndAttempt = class TestEndAttempt extends LitElement {
|
|
|
23
16
|
render() {
|
|
24
17
|
return html ` <slot></slot> `;
|
|
25
18
|
}
|
|
26
|
-
}
|
|
27
|
-
TestEndAttempt = __decorate([
|
|
28
|
-
customElement('test-end-attempt')
|
|
29
|
-
], TestEndAttempt);
|
|
30
|
-
export { TestEndAttempt };
|
|
19
|
+
}
|
|
31
20
|
//# sourceMappingURL=test-end-attempt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-end-attempt.js","sourceRoot":"","sources":["../../../src/components/test-end-attempt/test-end-attempt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test-end-attempt.js","sourceRoot":"","sources":["../../../src/components/test-end-attempt/test-end-attempt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,cAAe,SAAQ,UAAU;aAC5B,WAAM,GAAG,GAAG,CAAA;;QAEtB,MAAM,CAAC,GAAG;;;QAGV,MAAM,CAAC,GAAG;;GAEf,CAAC;IAEF;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,kBAAkB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACnH,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA,iBAAiB,CAAC;IAC/B,CAAC","sourcesContent":["import { css, html, LitElement } from 'lit';\n\nimport * as styles from '../styles';\n\nexport class TestEndAttempt extends LitElement {\n static override styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this.addEventListener('click', () => this.dispatchEvent(new CustomEvent('test-end-attempt', { bubbles: true })));\n }\n\n override render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-end-attempt': TestEndAttempt;\n }\n}\n"]}
|
|
@@ -5,9 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { css, html, LitElement } from 'lit';
|
|
8
|
-
import {
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
9
|
import * as styles from '../styles';
|
|
10
|
-
|
|
10
|
+
export class TestItemLink extends LitElement {
|
|
11
11
|
static { this.styles = css `
|
|
12
12
|
:host {
|
|
13
13
|
${styles.btn};
|
|
@@ -34,12 +34,8 @@ let TestItemLink = class TestItemLink extends LitElement {
|
|
|
34
34
|
render() {
|
|
35
35
|
return html ` <slot></slot> `;
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
38
|
__decorate([
|
|
39
39
|
property({ type: String, attribute: 'item-id' })
|
|
40
40
|
], TestItemLink.prototype, "itemId", void 0);
|
|
41
|
-
TestItemLink = __decorate([
|
|
42
|
-
customElement('test-item-link')
|
|
43
|
-
], TestItemLink);
|
|
44
|
-
export { TestItemLink };
|
|
45
41
|
//# sourceMappingURL=test-item-link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-item-link.js","sourceRoot":"","sources":["../../../src/components/test-item-link/test-item-link.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"test-item-link.js","sourceRoot":"","sources":["../../../src/components/test-item-link/test-item-link.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,YAAa,SAAQ,UAAU;aAC1B,WAAM,GAAG,GAAG,CAAA;;QAEtB,MAAM,CAAC,GAAG;;;QAGV,MAAM,CAAC,GAAG;;GAEf,AAPqB,CAOpB;IAKF;QACE,KAAK,EAAE,CAAC;QAHF,WAAM,GAAW,IAAI,CAAC;QAI5B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACvE,CAAC;IAES,YAAY,CAAC,UAAkB;QACvC,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,wBAAwB,EAAE;YACxC,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;YACb,MAAM,EAAE;gBACN,IAAI,EAAE,MAAM;gBACZ,EAAE,EAAE,UAAU;aACf;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA,iBAAiB,CAAC;IAC/B,CAAC;;AAtBO;IADP,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;4CACnB","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport * as styles from '../styles';\n\nexport class TestItemLink extends LitElement {\n static override styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: String, attribute: 'item-id' })\n private itemId: string = null;\n\n constructor() {\n super();\n this.addEventListener('click', () => this._requestItem(this.itemId));\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-navigation', {\n composed: true,\n bubbles: true,\n detail: {\n type: 'item',\n id: identifier\n }\n })\n );\n }\n\n override render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-item-link': TestItemLink;\n }\n}\n"]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { PropertyValues } from 'lit';
|
|
3
|
+
import type { SessionContext } from '@qti-components/base';
|
|
4
|
+
type SpeechState = 'idle' | 'playing' | 'paused';
|
|
5
|
+
export interface TtsContext {
|
|
6
|
+
state: SpeechState;
|
|
7
|
+
/** Index of the currently highlighted reading element (0-based). */
|
|
8
|
+
currentElementIndex: number;
|
|
9
|
+
/** Total number of navigable reading elements in the current item. */
|
|
10
|
+
elementCount: number;
|
|
11
|
+
play(): void;
|
|
12
|
+
pause(): void;
|
|
13
|
+
resume(): void;
|
|
14
|
+
stop(): void;
|
|
15
|
+
prevElement(): void;
|
|
16
|
+
nextElement(): void;
|
|
17
|
+
}
|
|
18
|
+
export { SpeechState };
|
|
19
|
+
export declare const ttsContext: {
|
|
20
|
+
__context__: TtsContext;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Base class shared by all TTS control elements. Consumes `ttsContext` and
|
|
24
|
+
* mirrors the current speech state onto CSS custom states so each child can
|
|
25
|
+
* be styled with `:state(playing)`, `:state(paused)`, `:state(idle)`.
|
|
26
|
+
*/
|
|
27
|
+
declare abstract class TtsButtonBase extends LitElement {
|
|
28
|
+
#private;
|
|
29
|
+
static styles: import("lit").CSSResult;
|
|
30
|
+
protected _tts?: TtsContext;
|
|
31
|
+
updated(changed: PropertyValues): void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `<test-item-to-speech>` is the controller and context provider. It manages
|
|
35
|
+
* speech synthesis, word highlighting, and item element lookup. Compose your
|
|
36
|
+
* own player by placing control elements as children.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```html
|
|
40
|
+
* <test-item-to-speech language="nl-NL">
|
|
41
|
+
* <test-tts-play></test-tts-play>
|
|
42
|
+
* <test-tts-prev>◀◀</test-tts-prev>
|
|
43
|
+
* <test-tts-next>▶▶</test-tts-next>
|
|
44
|
+
* <test-tts-stop>■</test-tts-stop>
|
|
45
|
+
* </test-item-to-speech>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @cssstate idle - No speech active
|
|
49
|
+
* @cssstate playing - Speech is playing
|
|
50
|
+
* @cssstate paused - Speech is paused
|
|
51
|
+
*/
|
|
52
|
+
export declare class TestItemToSpeech extends LitElement {
|
|
53
|
+
#private;
|
|
54
|
+
language: string;
|
|
55
|
+
protected _sessionContext?: SessionContext;
|
|
56
|
+
_ttsContext: TtsContext;
|
|
57
|
+
constructor();
|
|
58
|
+
willUpdate(changed: PropertyValues): void;
|
|
59
|
+
updated(_changed: PropertyValues): void;
|
|
60
|
+
connectedCallback(): void;
|
|
61
|
+
disconnectedCallback(): void;
|
|
62
|
+
render(): import("lit").TemplateResult<1>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Play/pause/resume toggle button — always enabled, cycles through states.
|
|
66
|
+
* Use named slots `play` and `pause` to customise the icons/labels independently.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```html
|
|
70
|
+
* <test-tts-play>
|
|
71
|
+
* <span slot="play">▶ Play</span>
|
|
72
|
+
* <span slot="pause">⏸ Pause</span>
|
|
73
|
+
* </test-tts-play>
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @cssstate idle / playing / paused
|
|
77
|
+
* @csspart button
|
|
78
|
+
*/
|
|
79
|
+
export declare class TestTtsPlay extends TtsButtonBase {
|
|
80
|
+
#private;
|
|
81
|
+
render(): import("lit").TemplateResult<1>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Pause button — enabled only when playing.
|
|
85
|
+
* @cssstate idle / playing / paused
|
|
86
|
+
* @csspart button
|
|
87
|
+
*/
|
|
88
|
+
export declare class TestTtsPause extends TtsButtonBase {
|
|
89
|
+
render(): import("lit").TemplateResult<1>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Resume button — enabled only when paused.
|
|
93
|
+
* @cssstate idle / playing / paused
|
|
94
|
+
* @csspart button
|
|
95
|
+
*/
|
|
96
|
+
export declare class TestTtsResume extends TtsButtonBase {
|
|
97
|
+
render(): import("lit").TemplateResult<1>;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Stop button — enabled when playing or paused.
|
|
101
|
+
* @cssstate idle / playing / paused
|
|
102
|
+
* @csspart button
|
|
103
|
+
*/
|
|
104
|
+
export declare class TestTtsStop extends TtsButtonBase {
|
|
105
|
+
render(): import("lit").TemplateResult<1>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Prev-element button — moves cursor to the previous reading element and pauses.
|
|
109
|
+
* Disabled at the first element or when no elements are loaded.
|
|
110
|
+
* @cssstate idle / playing / paused
|
|
111
|
+
* @csspart button
|
|
112
|
+
*/
|
|
113
|
+
export declare class TestTtsPrev extends TtsButtonBase {
|
|
114
|
+
render(): import("lit").TemplateResult<1>;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Next-element button — moves cursor to the next reading element and pauses.
|
|
118
|
+
* Disabled at the last element or when no elements are loaded.
|
|
119
|
+
* @cssstate idle / playing / paused
|
|
120
|
+
* @csspart button
|
|
121
|
+
*/
|
|
122
|
+
export declare class TestTtsNext extends TtsButtonBase {
|
|
123
|
+
render(): import("lit").TemplateResult<1>;
|
|
124
|
+
}
|
|
125
|
+
declare global {
|
|
126
|
+
interface HTMLElementTagNameMap {
|
|
127
|
+
'test-item-to-speech': TestItemToSpeech;
|
|
128
|
+
'test-tts-play': TestTtsPlay;
|
|
129
|
+
'test-tts-pause': TestTtsPause;
|
|
130
|
+
'test-tts-resume': TestTtsResume;
|
|
131
|
+
'test-tts-stop': TestTtsStop;
|
|
132
|
+
'test-tts-prev': TestTtsPrev;
|
|
133
|
+
'test-tts-next': TestTtsNext;
|
|
134
|
+
}
|
|
135
|
+
}
|