qti3-item-player-vue3 0.2.0 → 0.2.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/README.md +51 -23
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Amp-up.io QTI 3 Player Component for Vue 3
|
1
|
+
# Amp-up.io QTI 3 Item Player Component for Vue 3
|
2
2
|
|
3
3
|
<div id="top"></div>
|
4
4
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
This is the **Vue 3 version** of the original Amp-up.io QTI 3 Player Component ("QTI 3 Player") which was originally built with Vue 2.6.
|
13
|
+
This is the **Vue 3 version** of the original Amp-up.io QTI 3 Item Player Component ("QTI 3 Player") which was originally built with Vue 2.6.
|
14
14
|
|
15
15
|
The QTI 3 Player is a 100% JavaScript component that aims to encapsulate the best practices and behaviors of the 1EdTech QTI 3 Assessment **Item** specification.
|
16
16
|
|
@@ -76,17 +76,34 @@ npm run build
|
|
76
76
|
|
77
77
|
## Usage
|
78
78
|
|
79
|
-
### 1.
|
79
|
+
### 1. Install QTI 3 Player
|
80
|
+
|
81
|
+
```sh
|
82
|
+
cd <Project folder where your package.json is located>
|
83
|
+
npm install qti3-item-player-vue3
|
84
|
+
```
|
85
|
+
|
86
|
+
### 2. Import and Use QTI 3 Player
|
80
87
|
|
81
88
|
```js
|
82
|
-
|
89
|
+
import { createApp } from 'vue'
|
90
|
+
import App from './App.vue'
|
91
|
+
// The Qti3Player component
|
83
92
|
import Qti3Player from 'qti3-item-player-vue3'
|
84
|
-
|
93
|
+
|
94
|
+
const app = createApp(App)
|
95
|
+
|
96
|
+
// "use" triggers the component installer, and makes Qti3Player
|
97
|
+
// available globally to all app components.
|
98
|
+
app
|
99
|
+
.use(Qti3Player)
|
100
|
+
.mount('#app')
|
85
101
|
```
|
102
|
+
|
86
103
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
87
104
|
|
88
105
|
|
89
|
-
###
|
106
|
+
### 3. Load the QTI 3 Player component and import the Player CSS into your Page or Template
|
90
107
|
|
91
108
|
```html
|
92
109
|
<Qti3Player
|
@@ -105,10 +122,16 @@ import 'qti3-item-player-vue3/dist/qti3Player.css'
|
|
105
122
|
@notifyQti3ItemCatalogEvent="handleItemCatalogEvent"
|
106
123
|
/>
|
107
124
|
```
|
125
|
+
|
126
|
+
```js
|
127
|
+
// The Qti3Player built-in CSS
|
128
|
+
import 'qti3-item-player-vue3/dist/qti3Player.css'
|
129
|
+
```
|
130
|
+
|
108
131
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
109
132
|
|
110
133
|
|
111
|
-
###
|
134
|
+
### 4. Listen for the QTI 3 Player 'notifyQti3PlayerReady' event
|
112
135
|
|
113
136
|
This event signifies that the QTI 3 Player component is loaded and ready for action. The following snippet is a sample handler for the `notifyQti3PlayerReady` event. QTI 3 Player hands itself as an argument to the `notifyQti3PlayerReady` event, thus simplifying further QTI 3 Player API calls.
|
114
137
|
|
@@ -124,12 +147,13 @@ handlePlayerReady (qti3Player) {
|
|
124
147
|
this.qti3Player = qti3Player
|
125
148
|
}
|
126
149
|
```
|
150
|
+
|
127
151
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
128
152
|
|
129
153
|
|
130
|
-
###
|
154
|
+
### 5. Load a QTI 3 Item into QTI 3 Player
|
131
155
|
|
132
|
-
Once QTI 3 Player is loaded and ready (see #
|
156
|
+
Once QTI 3 Player is loaded and ready (see #4 above), QTI 3 Item XML can be loaded directly into QTI 3 Player via the Player's `loadItemFromXML` method which takes two arguments `xml {String}` and `configuration {Object}`.
|
133
157
|
|
134
158
|
```js
|
135
159
|
// Load item XML with a configuration. Use the 'this.qti3Player' reference
|
@@ -137,7 +161,7 @@ Once QTI 3 Player is loaded and ready (see #3 above), QTI 3 Item XML can be load
|
|
137
161
|
this.qti3Player.loadItemFromXml(xml, configuration)
|
138
162
|
```
|
139
163
|
|
140
|
-
####
|
164
|
+
#### 5a) About a Configuration
|
141
165
|
|
142
166
|
The `configuration` object is used to specify runtime context to QTI 3 Player during the item session loaded in `loadItemFromXml`. A configuration object has the following structure:
|
143
167
|
|
@@ -151,7 +175,7 @@ configuration: {
|
|
151
175
|
}
|
152
176
|
```
|
153
177
|
|
154
|
-
####
|
178
|
+
#### 5b) Constructing a Configuration
|
155
179
|
|
156
180
|
The following snippet is an example of how an application can construct a `configuration`.
|
157
181
|
|
@@ -216,7 +240,7 @@ In the absence of a `pnp` property, QTI 3 Player will use defaults, or previous
|
|
216
240
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
217
241
|
|
218
242
|
|
219
|
-
###
|
243
|
+
### 6. Listen for the QTI 3 Player 'notifyQti3ItemReady' Event
|
220
244
|
|
221
245
|
QTI 3 Player triggers a `notifyQti3ItemReady` event upon completion of the Player's `loadItemFromXML` method. The following snippet is a sample handler for the `notifyQti3ItemReady` event.
|
222
246
|
|
@@ -235,10 +259,11 @@ handleItemReady (item) {
|
|
235
259
|
this.item = item
|
236
260
|
}
|
237
261
|
```
|
262
|
+
|
238
263
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
239
264
|
|
240
265
|
|
241
|
-
###
|
266
|
+
### 7. Retrieving Item State
|
242
267
|
|
243
268
|
After item XML is loaded and an attempt has begun, a test controller may retrieve the item's current state via two methods:
|
244
269
|
|
@@ -254,7 +279,7 @@ After item XML is loaded and an attempt has begun, a test controller may retriev
|
|
254
279
|
|
255
280
|
The `endAttempt` and `suspendAttempt` methods may take a considerable amount of time to complete. QTI 3 Player triggers the `notifyQti3EndAttemptCompleted` and `notifyQti3SuspendAttemptCompleted` events, respectively, upon completion of an `endAttempt` or a `suspendAttempt` method call.
|
256
281
|
|
257
|
-
####
|
282
|
+
#### 7a) Calling endAttempt and handling the notifyQti3EndAttemptCompleted event
|
258
283
|
|
259
284
|
```js
|
260
285
|
// Call the endAttempt method, passing a string/target action that will be
|
@@ -276,7 +301,7 @@ handleEndAttemptCompleted (data) {
|
|
276
301
|
}
|
277
302
|
```
|
278
303
|
|
279
|
-
####
|
304
|
+
#### 7b) Calling suspendAttempt and handling the notifyQti3SuspendAttemptCompleted event
|
280
305
|
|
281
306
|
```js
|
282
307
|
// Call the suspendAttempt method, passing a string/target action that will be
|
@@ -297,10 +322,11 @@ handleSuspendAttemptCompleted (data) {
|
|
297
322
|
// ... do something ...
|
298
323
|
}
|
299
324
|
```
|
325
|
+
|
300
326
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
301
327
|
|
302
328
|
|
303
|
-
###
|
329
|
+
### 8. About Item State
|
304
330
|
|
305
331
|
#### Item State Object Structure
|
306
332
|
|
@@ -393,10 +419,11 @@ In this item, there are two qti-choice-interaction's, each with single cardinali
|
|
393
419
|
"target": "navigateNextItem"
|
394
420
|
}
|
395
421
|
```
|
422
|
+
|
396
423
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
397
424
|
|
398
425
|
|
399
|
-
###
|
426
|
+
### 9. Scoring API
|
400
427
|
|
401
428
|
There are scenarios where an encapsulating application may load item XML - along with a provided Item State - into QTI 3 Player and then score the Item State by executing response processing. Such a scenario exists when a Test Part's `submission-mode` is set to `simultaneous`. Another use-case is when a scoring system is batch-scoring a collection of items and a candidate's Item States from a submitted Test. For these scenarios, use the `scoreAttempt` method:
|
402
429
|
|
@@ -415,7 +442,7 @@ The `scoreAttempt` method may take a considerable amount of time to complete. Q
|
|
415
442
|
/>
|
416
443
|
```
|
417
444
|
|
418
|
-
####
|
445
|
+
#### 9a) Calling scoreAttempt and handling the notifyQti3ScoreAttemptCompleted event
|
419
446
|
|
420
447
|
```js
|
421
448
|
// Call the scoreAttempt method, passing a string/target action that will be
|
@@ -448,7 +475,7 @@ handleScoreAttemptCompleted (data) {
|
|
448
475
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
449
476
|
|
450
477
|
|
451
|
-
###
|
478
|
+
### 10. Item Session 'Alert' Messages and the notifyQti3ItemAlertEvent
|
452
479
|
|
453
480
|
An item session 'alert' message is triggered by QTI 3 Player when a person exceeds an interaction's max-choices or max-associations threshold. QTI 3 Player uses a built-in messaging/toast component to display such alerts to the candidate.
|
454
481
|
|
@@ -483,10 +510,11 @@ displayItemAlertEvent (event) {
|
|
483
510
|
})
|
484
511
|
}
|
485
512
|
```
|
513
|
+
|
486
514
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
487
515
|
|
488
516
|
|
489
|
-
###
|
517
|
+
### 11. Item Session 'Invalid Response' Messages
|
490
518
|
|
491
519
|
An item session 'invalid response' message is triggered by QTI 3 Player when,
|
492
520
|
|
@@ -528,7 +556,7 @@ This permits an encapsulating application to handle and display validation messa
|
|
528
556
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
529
557
|
|
530
558
|
|
531
|
-
###
|
559
|
+
### 12. Item 'Catalog' Events
|
532
560
|
|
533
561
|
An item 'catalog' event is triggered by QTI 3 Player when a user selects a control (such as a highlighted term) within the item's presentation that is bound to an item's catalog. As of QTI 3 Player version 0.3.1, the only supported catalog event () is a 'glossary' event. QTI 3 Player will display its own Catalog Glossary Dialog component when a user selects a control within the item's presentation that is bound to a 'glossary' event.
|
534
562
|
|
@@ -594,7 +622,7 @@ As of the 0.3.4 release, QTI 3 Player supports the following IS0 639 language co
|
|
594
622
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
595
623
|
|
596
624
|
|
597
|
-
###
|
625
|
+
### 13. About Dynamic Catalog Rebinding
|
598
626
|
|
599
627
|
Under most use-cases, a PNP is passed into QTI 3 Player as part of the configuration (see 4b Constructing a Configuration) as an item's XML is loaded. However, _after an item is loaded_, an encapsulating application may update PNP settings and then force a catalog rebinding with the updated PNP settings. QTI 3 Player implements a `bindCatalog` API method for this use-case.
|
600
628
|
|
@@ -707,7 +735,7 @@ The QTI3 Item Player 2022-2024 development roadmap includes all features and cap
|
|
707
735
|
- [x] Support for Interaction "Review" Status
|
708
736
|
- [x] Improved Audio Player
|
709
737
|
- [x] Improved Video Player
|
710
|
-
- [
|
738
|
+
- [x] Update Quill.js to version 2.x
|
711
739
|
|
712
740
|
<p align="right">(<a href="#top">back to top</a>)</p>
|
713
741
|
|