@pie-players/pie-assessment-player 0.3.73 → 0.3.74
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
CHANGED
|
@@ -8,6 +8,9 @@ Primary entrypoint:
|
|
|
8
8
|
|
|
9
9
|
- `@pie-players/pie-assessment-player`
|
|
10
10
|
|
|
11
|
+
The entry is bundler-only: it imports the toolkit, players-shared and the
|
|
12
|
+
section player by bare specifier.
|
|
13
|
+
|
|
11
14
|
## AssessmentController
|
|
12
15
|
|
|
13
16
|
`AssessmentController` is the domain authority for an assessment attempt. It
|
|
@@ -100,7 +103,8 @@ change only — section-level events flow through the embedded
|
|
|
100
103
|
`previousSectionId`, `canNext` / `canPrevious`).
|
|
101
104
|
- `assessment-session-applied` — `hydrate()` loaded a persisted session.
|
|
102
105
|
- `assessment-session-changed` — assessment session mutated (navigation,
|
|
103
|
-
per-section snapshot upsert).
|
|
106
|
+
per-section snapshot upsert). The active section's snapshot is upserted once
|
|
107
|
+
for each `session-changed` it emits.
|
|
104
108
|
- `assessment-progress-changed` — visited-section count flipped.
|
|
105
109
|
- `assessment-submission-state-changed` — `submit()` recorded the final
|
|
106
110
|
state.
|
|
@@ -189,16 +193,68 @@ Toolkit tool/backend operational stream (when toolkit is mounted):
|
|
|
189
193
|
- `pie-tool-backend-call-start|success|error`
|
|
190
194
|
- `pie-tool-library-load-start|success|error`
|
|
191
195
|
|
|
196
|
+
## Preloaded elements
|
|
197
|
+
|
|
198
|
+
With `player-type="preloaded"` (or `playerType = "preloaded"`) the section
|
|
199
|
+
players load no element code, and their pre-warm asserts that every tag the
|
|
200
|
+
content names is registered. The host registers the elements with
|
|
201
|
+
`registerPreloadedElements` from `@pie-players/pie-item-player/preloaded`
|
|
202
|
+
before the assessment player mounts:
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
import { registerPreloadedElements } from "@pie-players/pie-item-player/preloaded";
|
|
206
|
+
import * as delivery from "@pie-element/multiple-choice/browser/delivery";
|
|
207
|
+
import * as controller from "@pie-element/multiple-choice/browser/controller";
|
|
208
|
+
import manifest from "../package.json"; // pins "@pie-element/multiple-choice" exactly
|
|
209
|
+
|
|
210
|
+
registerPreloadedElements([
|
|
211
|
+
{
|
|
212
|
+
tag: "pie-element-multiple-choice",
|
|
213
|
+
package: "@pie-element/multiple-choice",
|
|
214
|
+
version: manifest.dependencies["@pie-element/multiple-choice"],
|
|
215
|
+
element: delivery,
|
|
216
|
+
controller,
|
|
217
|
+
},
|
|
218
|
+
]);
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
- A tag missing at pre-warm leaves the section's items unmounted and raises a
|
|
222
|
+
non-recoverable `element-preload` framework error.
|
|
223
|
+
- Install element packages with `npm install --save-exact`. npm otherwise saves
|
|
224
|
+
a caret range, which registration rejects as a `version`, and which a fresh
|
|
225
|
+
install can resolve to another release line: `^13.4.0-next.15` resolves to
|
|
226
|
+
the legacy `13.4.4`, which has no `./browser/*` modules.
|
|
227
|
+
- Install every pie-elements-ng package from one release, in one install from
|
|
228
|
+
the same dist-tag, and upgrade them together. Elements whose `./browser/*`
|
|
229
|
+
builds typeset on `window.MathJax` share the MathJax the first of them loads,
|
|
230
|
+
in the build and configuration of that element's release, so in a mixed set
|
|
231
|
+
an element can typeset with a MathJax it was not built for. Elements that
|
|
232
|
+
bundle their own MathJax share none
|
|
233
|
+
([One MathJax version per page](../../docs/item-player/loading-strategies.md#one-mathjax-version-per-page)).
|
|
234
|
+
- Register one version per package; registering a second version throws.
|
|
235
|
+
- Register each package's `controller` unless the item players are hosted
|
|
236
|
+
(`sectionPlayerRuntime.player.hosted`, or an enabled
|
|
237
|
+
`sectionPlayerRuntime.player.backend.delivery`). A player that is not hosted
|
|
238
|
+
runs `model()` in the browser and warns for each tag registered without one.
|
|
239
|
+
- Only `@pie-element/*` builds from pie-elements-ng publish
|
|
240
|
+
`./browser/delivery` and `./browser/controller`.
|
|
241
|
+
- Under TypeScript, the `package.json` import needs `resolveJsonModule`, and a
|
|
242
|
+
package version that ships no declarations for `./browser/*` needs a
|
|
243
|
+
`declare module` shim for those subpaths.
|
|
244
|
+
|
|
245
|
+
See [`strategy="preloaded"`](../../docs/item-player/loading-strategies.md#strategypreloaded)
|
|
246
|
+
for the registration contract.
|
|
247
|
+
|
|
192
248
|
## Content trust boundary
|
|
193
249
|
|
|
194
250
|
Assessment markup reaches the DOM via the underlying
|
|
195
251
|
`<pie-item-player>` element, which now sanitizes item / passage markup by
|
|
196
|
-
default through DOMPurify. See
|
|
197
|
-
[pie-item-player README](
|
|
252
|
+
default through DOMPurify. See the
|
|
253
|
+
[pie-item-player README](../item-player/README.md#content-trust-boundary)
|
|
198
254
|
for the allow-list, opt-out mechanics (`trust-markup`), and the
|
|
199
255
|
`sanitizeMarkup` property override. Assessment-player hosts forward these
|
|
200
|
-
settings by setting `
|
|
201
|
-
`
|
|
202
|
-
|
|
256
|
+
settings by setting `sectionPlayerRuntime.player.trustMarkup` /
|
|
257
|
+
`sectionPlayerRuntime.player.sanitizeMarkup` on the assessment player; it passes
|
|
258
|
+
that runtime to each section player, whose runtime flattens `runtime.player.*`
|
|
203
259
|
fields onto the embedded `<pie-item-player>` (see the section-player README
|
|
204
260
|
for the exact forwarding shape).
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const ASSESSMENT_PLAYER_PUBLIC_EVENTS: {
|
|
2
2
|
readonly controllerReady: "assessment-controller-ready";
|
|
3
3
|
readonly navigationRequested: "assessment-navigation-requested";
|
|
4
|
-
readonly submitRequested: "assessment-submit-requested";
|
|
5
4
|
readonly routeChanged: "assessment-route-changed";
|
|
6
5
|
readonly sessionApplied: "assessment-session-applied";
|
|
7
6
|
readonly sessionChanged: "assessment-session-changed";
|
|
@@ -43,6 +43,7 @@ var e = {
|
|
|
43
43
|
items: "Vragen",
|
|
44
44
|
section: "Onderdeel",
|
|
45
45
|
loadingSection: "Onderdeel wordt geladen…",
|
|
46
|
+
sectionLoadError: "Het onderdeel kon niet worden geladen.",
|
|
46
47
|
loadingPassage: "Tekst wordt geladen…",
|
|
47
48
|
configurationError: "Configuratiefout",
|
|
48
49
|
playerError: "Fout in de speler",
|
|
@@ -108,6 +109,11 @@ var e = {
|
|
|
108
109
|
centerA11y: "Venster centreren",
|
|
109
110
|
closeA11y: "Hulpmiddel sluiten"
|
|
110
111
|
},
|
|
112
|
+
placement: {
|
|
113
|
+
controlsA11y: "Verplaatsen en draaien",
|
|
114
|
+
rotateClockwiseA11y: "{degrees}° rechtsom draaien",
|
|
115
|
+
rotateCounterclockwiseA11y: "{degrees}° linksom draaien"
|
|
116
|
+
},
|
|
111
117
|
announce: {
|
|
112
118
|
movedUp: "Omhoog verplaatst naar {position}",
|
|
113
119
|
movedDown: "Omlaag verplaatst naar {position}",
|
|
@@ -135,8 +141,8 @@ var e = {
|
|
|
135
141
|
},
|
|
136
142
|
graph: {
|
|
137
143
|
name: "Grafiek",
|
|
138
|
-
description: "
|
|
139
|
-
buttonA11y: "Grafiek,
|
|
144
|
+
description: "Assenstelsel",
|
|
145
|
+
buttonA11y: "Grafiek, assenstelsel",
|
|
140
146
|
tooltip: "Grafiek",
|
|
141
147
|
toolA11y: "Grafiekhulpmiddel — punten en lijnen tekenen in een assenstelsel",
|
|
142
148
|
canvasA11y: "Tekenvlak — gebruik de hulpmiddelen om punten toe te voegen en lijnen te tekenen",
|