@pie-players/pie-assessment-toolkit 0.2.7 → 0.2.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/README.md +200 -67
- package/dist/attempt/TestSession.d.ts +23 -21
- package/dist/attempt/TestSession.d.ts.map +1 -1
- package/dist/attempt/TestSession.js +17 -15
- package/dist/attempt/TestSession.js.map +1 -1
- package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts +50 -0
- package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts.map +1 -0
- package/dist/attempt/adapters/activity-to-test-attempt-session.js +135 -0
- package/dist/attempt/adapters/activity-to-test-attempt-session.js.map +1 -0
- package/dist/components/ItemToolBar.custom-element.js +953 -0
- package/dist/components/PieAssessmentToolkit.custom-element.js +757 -0
- package/dist/components/SectionToolBar.custom-element.js +162 -0
- package/dist/components/item-toolbar-element.d.ts +3 -0
- package/dist/components/item-toolbar-element.d.ts.map +1 -0
- package/dist/components/item-toolbar-element.js +2 -0
- package/dist/components/item-toolbar-element.js.map +1 -0
- package/dist/components/pie-assessment-toolkit-element.d.ts +3 -0
- package/dist/components/pie-assessment-toolkit-element.d.ts.map +1 -0
- package/dist/components/pie-assessment-toolkit-element.js +2 -0
- package/dist/components/pie-assessment-toolkit-element.js.map +1 -0
- package/dist/components/section-toolbar-element.d.ts +3 -0
- package/dist/components/section-toolbar-element.d.ts.map +1 -0
- package/dist/components/section-toolbar-element.js +2 -0
- package/dist/components/section-toolbar-element.js.map +1 -0
- package/dist/context/assessment-toolkit-context.d.ts +52 -0
- package/dist/context/assessment-toolkit-context.d.ts.map +1 -0
- package/dist/context/assessment-toolkit-context.js +6 -0
- package/dist/context/assessment-toolkit-context.js.map +1 -0
- package/dist/context/runtime-context-consumer.d.ts +14 -0
- package/dist/context/runtime-context-consumer.d.ts.map +1 -0
- package/dist/context/runtime-context-consumer.js +52 -0
- package/dist/context/runtime-context-consumer.js.map +1 -0
- package/dist/index.d.ts +19 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -11
- package/dist/index.js.map +1 -1
- package/dist/runtime/RuntimeRegistry.d.ts +13 -0
- package/dist/runtime/RuntimeRegistry.d.ts.map +1 -0
- package/dist/runtime/RuntimeRegistry.js +50 -0
- package/dist/runtime/RuntimeRegistry.js.map +1 -0
- package/dist/runtime/SectionRuntimeEngine.d.ts +45 -0
- package/dist/runtime/SectionRuntimeEngine.d.ts.map +1 -0
- package/dist/runtime/SectionRuntimeEngine.js +81 -0
- package/dist/runtime/SectionRuntimeEngine.js.map +1 -0
- package/dist/runtime/registration-events.d.ts +19 -0
- package/dist/runtime/registration-events.d.ts.map +1 -0
- package/dist/runtime/registration-events.js +4 -0
- package/dist/runtime/registration-events.js.map +1 -0
- package/dist/runtime/runtime-event-guards.d.ts +3 -0
- package/dist/runtime/runtime-event-guards.d.ts.map +1 -0
- package/dist/runtime/runtime-event-guards.js +9 -0
- package/dist/runtime/runtime-event-guards.js.map +1 -0
- package/dist/runtime/tool-host-contract.d.ts +30 -0
- package/dist/runtime/tool-host-contract.d.ts.map +1 -0
- package/dist/runtime/tool-host-contract.js +48 -0
- package/dist/runtime/tool-host-contract.js.map +1 -0
- package/dist/services/HighlightCoordinator.d.ts +9 -0
- package/dist/services/HighlightCoordinator.d.ts.map +1 -1
- package/dist/services/HighlightCoordinator.js +196 -55
- package/dist/services/HighlightCoordinator.js.map +1 -1
- package/dist/services/TTSService.d.ts +21 -1
- package/dist/services/TTSService.d.ts.map +1 -1
- package/dist/services/TTSService.js +356 -117
- package/dist/services/TTSService.js.map +1 -1
- package/dist/services/ThemeProvider.d.ts +1 -0
- package/dist/services/ThemeProvider.d.ts.map +1 -1
- package/dist/services/ThemeProvider.js +82 -46
- package/dist/services/ThemeProvider.js.map +1 -1
- package/dist/services/ToolConfigResolver.d.ts +1 -1
- package/dist/services/ToolConfigResolver.js +1 -1
- package/dist/services/ToolCoordinator.d.ts +1 -1
- package/dist/services/ToolCoordinator.d.ts.map +1 -1
- package/dist/services/ToolRegistry.d.ts +76 -67
- package/dist/services/ToolRegistry.d.ts.map +1 -1
- package/dist/services/ToolRegistry.js +73 -22
- package/dist/services/ToolRegistry.js.map +1 -1
- package/dist/services/ToolkitCoordinator.d.ts +126 -8
- package/dist/services/ToolkitCoordinator.d.ts.map +1 -1
- package/dist/services/ToolkitCoordinator.js +607 -72
- package/dist/services/ToolkitCoordinator.js.map +1 -1
- package/dist/services/createDefaultToolRegistry.d.ts +11 -12
- package/dist/services/createDefaultToolRegistry.d.ts.map +1 -1
- package/dist/services/createDefaultToolRegistry.js +9 -56
- package/dist/services/createDefaultToolRegistry.js.map +1 -1
- package/dist/services/defaultPersonalNeedsProfile.d.ts +4 -0
- package/dist/services/defaultPersonalNeedsProfile.d.ts.map +1 -0
- package/dist/services/defaultPersonalNeedsProfile.js +25 -0
- package/dist/services/defaultPersonalNeedsProfile.js.map +1 -0
- package/dist/services/interfaces.d.ts +62 -2
- package/dist/services/interfaces.d.ts.map +1 -1
- package/dist/services/interfaces.js.map +1 -1
- package/dist/services/pnp-standard-features.d.ts +3 -4
- package/dist/services/pnp-standard-features.d.ts.map +1 -1
- package/dist/services/pnp-standard-features.js +0 -3
- package/dist/services/pnp-standard-features.js.map +1 -1
- package/dist/services/section-controller-types.d.ts +37 -0
- package/dist/services/section-controller-types.d.ts.map +1 -0
- package/dist/services/section-controller-types.js +2 -0
- package/dist/services/section-controller-types.js.map +1 -0
- package/dist/services/tool-config-defaults.d.ts +14 -0
- package/dist/services/tool-config-defaults.d.ts.map +1 -0
- package/dist/services/tool-config-defaults.js +23 -0
- package/dist/services/tool-config-defaults.js.map +1 -0
- package/dist/services/tool-context.d.ts +4 -4
- package/dist/services/tool-context.d.ts.map +1 -1
- package/dist/services/tool-context.js +156 -20
- package/dist/services/tool-context.js.map +1 -1
- package/dist/services/tool-instance-id.d.ts +15 -0
- package/dist/services/tool-instance-id.d.ts.map +1 -0
- package/dist/services/tool-instance-id.js +55 -0
- package/dist/services/tool-instance-id.js.map +1 -0
- package/dist/services/tool-providers/IToolProvider.d.ts +2 -3
- package/dist/services/tool-providers/IToolProvider.d.ts.map +1 -1
- package/dist/services/tool-providers/IToolProvider.js +1 -2
- package/dist/services/tool-providers/IToolProvider.js.map +1 -1
- package/dist/services/tool-providers/MathJsToolProvider.d.ts +25 -0
- package/dist/services/tool-providers/MathJsToolProvider.d.ts.map +1 -0
- package/dist/services/tool-providers/MathJsToolProvider.js +53 -0
- package/dist/services/tool-providers/MathJsToolProvider.js.map +1 -0
- package/dist/services/tool-providers/index.d.ts +2 -0
- package/dist/services/tool-providers/index.d.ts.map +1 -1
- package/dist/services/tool-providers/index.js +1 -0
- package/dist/services/tool-providers/index.js.map +1 -1
- package/dist/services/toolbar-items.d.ts +26 -0
- package/dist/services/toolbar-items.d.ts.map +1 -0
- package/dist/services/toolbar-items.js +10 -0
- package/dist/services/toolbar-items.js.map +1 -0
- package/dist/services/tools-config-normalizer.d.ts +26 -0
- package/dist/services/tools-config-normalizer.d.ts.map +1 -0
- package/dist/services/tools-config-normalizer.js +62 -0
- package/dist/services/tools-config-normalizer.js.map +1 -0
- package/dist/services/tts/browser-provider.d.ts.map +1 -1
- package/dist/services/tts/browser-provider.js +201 -34
- package/dist/services/tts/browser-provider.js.map +1 -1
- package/dist/services/tts/text-processing.d.ts +17 -0
- package/dist/services/tts/text-processing.d.ts.map +1 -0
- package/dist/services/tts/text-processing.js +144 -0
- package/dist/services/tts/text-processing.js.map +1 -0
- package/dist/tools/calculators/ti-provider.d.ts.map +1 -1
- package/dist/tools/calculators/ti-provider.js +127 -4
- package/dist/tools/calculators/ti-provider.js.map +1 -1
- package/dist/tools/client.d.ts +2 -1
- package/dist/tools/client.d.ts.map +1 -1
- package/dist/tools/client.js +2 -1
- package/dist/tools/client.js.map +1 -1
- package/dist/tools/default-tool-module-loaders.d.ts +9 -0
- package/dist/tools/default-tool-module-loaders.d.ts.map +1 -0
- package/dist/tools/default-tool-module-loaders.js +11 -0
- package/dist/tools/default-tool-module-loaders.js.map +1 -0
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/library-loader.d.ts +1 -1
- package/dist/tools/library-loader.d.ts.map +1 -1
- package/dist/tools/library-loader.js +7 -2
- package/dist/tools/library-loader.js.map +1 -1
- package/dist/tools/registrations/accessibility-tools.d.ts +8 -11
- package/dist/tools/registrations/accessibility-tools.d.ts.map +1 -1
- package/dist/tools/registrations/accessibility-tools.js +108 -120
- package/dist/tools/registrations/accessibility-tools.js.map +1 -1
- package/dist/tools/registrations/calculator.d.ts +2 -2
- package/dist/tools/registrations/calculator.d.ts.map +1 -1
- package/dist/tools/registrations/calculator.js +42 -55
- package/dist/tools/registrations/calculator.js.map +1 -1
- package/dist/tools/registrations/interaction-tools.d.ts.map +1 -1
- package/dist/tools/registrations/interaction-tools.js +77 -52
- package/dist/tools/registrations/interaction-tools.js.map +1 -1
- package/dist/tools/registrations/measurement-tools.d.ts.map +1 -1
- package/dist/tools/registrations/measurement-tools.js +63 -38
- package/dist/tools/registrations/measurement-tools.js.map +1 -1
- package/dist/tools/registrations/subject-specific-tools.d.ts.map +1 -1
- package/dist/tools/registrations/subject-specific-tools.js +63 -38
- package/dist/tools/registrations/subject-specific-tools.js.map +1 -1
- package/dist/tools/registrations/tts.d.ts +1 -1
- package/dist/tools/registrations/tts.d.ts.map +1 -1
- package/dist/tools/registrations/tts.js +171 -41
- package/dist/tools/registrations/tts.js.map +1 -1
- package/dist/tools/response-discovery.d.ts +12 -14
- package/dist/tools/response-discovery.d.ts.map +1 -1
- package/dist/tools/response-discovery.js +23 -80
- package/dist/tools/response-discovery.js.map +1 -1
- package/dist/tools/tool-tag-map.d.ts +3 -3
- package/dist/tools/tool-tag-map.d.ts.map +1 -1
- package/dist/tools/tool-tag-map.js +4 -4
- package/dist/tools/tool-tag-map.js.map +1 -1
- package/dist/tools/types.d.ts +3 -1
- package/dist/tools/types.d.ts.map +1 -1
- package/package.json +28 -27
- package/src/README.md +16 -32
- package/src/components/ItemToolBar.svelte +701 -0
- package/src/components/PieAssessmentToolkit.svelte +610 -0
- package/src/components/SectionToolBar.svelte +58 -0
- package/src/components/ToolButton.svelte +11 -11
- package/src/components/ToolButtonGroup.svelte +27 -11
- package/src/tools/README.md +6 -5
- package/src/tools/calculators/README.md +4 -4
- package/dist/player/AssessmentPlayer.d.ts +0 -397
- package/dist/player/AssessmentPlayer.d.ts.map +0 -1
- package/dist/player/AssessmentPlayer.js +0 -974
- package/dist/player/AssessmentPlayer.js.map +0 -1
- package/dist/player/index.d.ts +0 -17
- package/dist/player/index.d.ts.map +0 -1
- package/dist/player/index.js +0 -15
- package/dist/player/index.js.map +0 -1
- package/dist/player/navigation-types.d.ts +0 -63
- package/dist/player/navigation-types.d.ts.map +0 -1
- package/dist/player/navigation-types.js +0 -7
- package/dist/player/navigation-types.js.map +0 -1
- package/dist/player/qti-navigation.d.ts +0 -29
- package/dist/player/qti-navigation.d.ts.map +0 -1
- package/dist/player/qti-navigation.js +0 -160
- package/dist/player/qti-navigation.js.map +0 -1
- package/dist/reference-layout/index.d.ts +0 -19
- package/dist/reference-layout/index.d.ts.map +0 -1
- package/dist/reference-layout/index.js +0 -20
- package/dist/reference-layout/index.js.map +0 -1
- package/dist/services/AnnotationToolbarConfig.d.ts +0 -134
- package/dist/services/AnnotationToolbarConfig.d.ts.map +0 -1
- package/dist/services/AnnotationToolbarConfig.js +0 -100
- package/dist/services/AnnotationToolbarConfig.js.map +0 -1
- package/dist/services/AssessmentAuthoringService.d.ts +0 -60
- package/dist/services/AssessmentAuthoringService.d.ts.map +0 -1
- package/dist/services/AssessmentAuthoringService.js +0 -183
- package/dist/services/AssessmentAuthoringService.js.map +0 -1
- package/dist/services/PNPMapper.d.ts +0 -81
- package/dist/services/PNPMapper.d.ts.map +0 -1
- package/dist/services/PNPMapper.js +0 -108
- package/dist/services/PNPMapper.js.map +0 -1
- package/dist/services/tts/provider-interface.d.ts +0 -131
- package/dist/services/tts/provider-interface.d.ts.map +0 -1
- package/dist/services/tts/provider-interface.js +0 -10
- package/dist/services/tts/provider-interface.js.map +0 -1
- package/src/components/PNPProfileTester.example.svelte +0 -188
- package/src/components/PNPProfileTester.svelte +0 -397
- package/src/components/PNPProvenanceViewer.svelte +0 -260
- package/src/components/QuestionToolBar.svelte +0 -483
- package/src/player/AssessmentLayout.svelte +0 -68
- package/src/player/README.md +0 -154
- package/src/reference-layout/README.md +0 -135
- package/src/reference-layout/ReferenceLayout.svelte +0 -201
- package/src/reference-layout/components/AssessmentContent.svelte +0 -259
- package/src/reference-layout/components/AssessmentFooter.svelte +0 -89
- package/src/reference-layout/components/AssessmentHeader.svelte +0 -250
- package/src/reference-layout/components/AssessmentNavigation.svelte +0 -134
- package/src/reference-layout/components/AssessmentToolsBar.svelte +0 -176
- package/src/reference-layout/components/ItemPanel.svelte +0 -200
- package/src/reference-layout/components/NotesPanel.svelte +0 -179
- package/src/reference-layout/components/PassagePanel.svelte +0 -76
|
@@ -0,0 +1,757 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import 'svelte/internal/disclose-version';
|
|
3
|
+
import * as $ from 'svelte/internal/client';
|
|
4
|
+
import { ContextProvider, ContextRoot, requestContext } from "@pie-players/pie-context";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
assessmentToolkitHostRuntimeContext,
|
|
8
|
+
assessmentToolkitRuntimeContext
|
|
9
|
+
} from "../context/assessment-toolkit-context.js";
|
|
10
|
+
|
|
11
|
+
import { connectAssessmentToolkitHostRuntimeContext } from "../context/runtime-context-consumer.js";
|
|
12
|
+
import { ToolkitCoordinator } from "../services/ToolkitCoordinator.js";
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
PIE_ITEM_SESSION_CHANGED_EVENT,
|
|
16
|
+
PIE_REGISTER_EVENT,
|
|
17
|
+
PIE_UNREGISTER_EVENT
|
|
18
|
+
} from "../runtime/registration-events.js";
|
|
19
|
+
|
|
20
|
+
import { dispatchCrossBoundaryEvent } from "../runtime/tool-host-contract.js";
|
|
21
|
+
import { SectionRuntimeEngine } from "../runtime/SectionRuntimeEngine.js";
|
|
22
|
+
import { createRuntimeId, shouldHandleBySourceRuntime } from "../runtime/runtime-event-guards.js";
|
|
23
|
+
|
|
24
|
+
var root = $.from_html(`<div class="pie-assessment-toolkit-anchor svelte-vpe4u2" aria-hidden="true"></div> <!>`, 1);
|
|
25
|
+
|
|
26
|
+
const $$css = {
|
|
27
|
+
hash: 'svelte-vpe4u2',
|
|
28
|
+
code: '.pie-assessment-toolkit-anchor.svelte-vpe4u2 {display:none;}'
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default function PieAssessmentToolkit($$anchor, $$props) {
|
|
32
|
+
$.push($$props, true);
|
|
33
|
+
$.append_styles($$anchor, $$css);
|
|
34
|
+
|
|
35
|
+
const runtimeId = createRuntimeId("toolkit");
|
|
36
|
+
const sectionEngine = new SectionRuntimeEngine();
|
|
37
|
+
const DEFAULT_ENV = { mode: "gather", role: "student" };
|
|
38
|
+
|
|
39
|
+
const DEFAULT_ITEM_PLAYER_BY_TYPE = {
|
|
40
|
+
iife: "pie-item-player",
|
|
41
|
+
esm: "pie-item-player",
|
|
42
|
+
preloaded: "pie-item-player",
|
|
43
|
+
custom: ""
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
let assessmentId = $.prop($$props, 'assessmentId', 7, ""),
|
|
47
|
+
section = $.prop($$props, 'section', 7, null),
|
|
48
|
+
sectionId = $.prop($$props, 'sectionId', 7, ""),
|
|
49
|
+
attemptId = $.prop($$props, 'attemptId', 7, ""),
|
|
50
|
+
view = $.prop($$props, 'view', 7, "candidate"),
|
|
51
|
+
env = $.prop($$props, 'env', 23, () => ({})),
|
|
52
|
+
lazyInit = $.prop($$props, 'lazyInit', 7, true),
|
|
53
|
+
tools = $.prop($$props, 'tools', 23, () => ({})),
|
|
54
|
+
accessibility = $.prop($$props, 'accessibility', 23, () => ({})),
|
|
55
|
+
player = $.prop($$props, 'player', 7, null),
|
|
56
|
+
playerType = $.prop($$props, 'playerType', 7, ""),
|
|
57
|
+
coordinator = $.prop($$props, 'coordinator', 7, null),
|
|
58
|
+
createSectionController = $.prop($$props, 'createSectionController', 7, null),
|
|
59
|
+
isolation = $.prop($$props, 'isolation', 7, "inherit");
|
|
60
|
+
|
|
61
|
+
let anchor = $.state(null);
|
|
62
|
+
let ownedCoordinator = $.state(null);
|
|
63
|
+
let inheritedRuntime = $.state(null);
|
|
64
|
+
let lastOwnership = $.state(null);
|
|
65
|
+
let provider = null;
|
|
66
|
+
let contextRoot = null;
|
|
67
|
+
let hostRuntimeProvider = null;
|
|
68
|
+
let hostRuntimeRoot = null;
|
|
69
|
+
let compositionVersion = $.state(0);
|
|
70
|
+
let compositionModel = $.state(null);
|
|
71
|
+
let runtimeError = $.state(null);
|
|
72
|
+
let lastCompositionRevisionKey = $.state("");
|
|
73
|
+
let pendingCompositionModel = null;
|
|
74
|
+
let pendingCompositionEmit = false;
|
|
75
|
+
let compositionEmitRaf = null;
|
|
76
|
+
|
|
77
|
+
function getHostElement() {
|
|
78
|
+
if (!$.get(anchor)) return null;
|
|
79
|
+
|
|
80
|
+
const rootNode = $.get(anchor).getRootNode();
|
|
81
|
+
|
|
82
|
+
if (rootNode && "host" in rootNode) {
|
|
83
|
+
return rootNode.host;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return $.get(anchor).parentElement;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const host = $.derived(() => getHostElement());
|
|
90
|
+
|
|
91
|
+
function emit(name, detail) {
|
|
92
|
+
if (!$.get(host)) return;
|
|
93
|
+
|
|
94
|
+
dispatchCrossBoundaryEvent($.get(host), name, detail);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function hashString(input) {
|
|
98
|
+
let hash = 5381;
|
|
99
|
+
|
|
100
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
101
|
+
hash = (hash << 5) + hash ^ input.charCodeAt(index);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return (hash >>> 0).toString(36);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function getCompositionRevisionKey(model) {
|
|
108
|
+
const typed = model || {};
|
|
109
|
+
const sectionId = typed.section?.identifier || typed.sectionId || "";
|
|
110
|
+
const currentItemIndex = typeof typed.currentItemIndex === "number" ? typed.currentItemIndex : -1;
|
|
111
|
+
const renderables = Array.isArray(typed.renderables) ? typed.renderables : [];
|
|
112
|
+
|
|
113
|
+
const renderableSignature = renderables.map((entry, index) => {
|
|
114
|
+
const row = entry || {};
|
|
115
|
+
const entity = row.entity || {};
|
|
116
|
+
const entityId = typeof entity.id === "string" && entity.id || `renderable-${index}`;
|
|
117
|
+
const entityVersion = typeof entity.version === "string" && entity.version || (typeof entity.version === "number" ? String(entity.version) : "") || (typeof entity.config?.version === "string" ? entity.config.version : "");
|
|
118
|
+
|
|
119
|
+
return `${entityId}:${entityVersion}`;
|
|
120
|
+
}).join("|");
|
|
121
|
+
|
|
122
|
+
const sessionsByItem = typed.itemSessionsByItemId || {};
|
|
123
|
+
|
|
124
|
+
const itemSessionSignature = Object.keys(sessionsByItem).sort((left, right) => left.localeCompare(right)).map((itemId) => {
|
|
125
|
+
const session = sessionsByItem[itemId];
|
|
126
|
+
const sessionId = typeof session?.id === "string" && session.id || "";
|
|
127
|
+
const dataPayload = Array.isArray(session?.data) ? session.data : [];
|
|
128
|
+
let payloadSignature = "";
|
|
129
|
+
|
|
130
|
+
try {
|
|
131
|
+
payloadSignature = hashString(JSON.stringify(dataPayload));
|
|
132
|
+
} catch {
|
|
133
|
+
payloadSignature = String(dataPayload.length);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return `${itemId}:${sessionId}:${payloadSignature}`;
|
|
137
|
+
}).join("|");
|
|
138
|
+
|
|
139
|
+
return `${sectionId}|${currentItemIndex}|${renderableSignature}|${itemSessionSignature}`;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function isKnownPlayerType(value) {
|
|
143
|
+
return value === "iife" || value === "esm" || value === "preloaded" || value === "custom";
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function normalizeItemPlayerConfig(hostPlayer, hostPlayerType) {
|
|
147
|
+
const typeFromConfig = hostPlayer?.type;
|
|
148
|
+
|
|
149
|
+
const rawType = isKnownPlayerType(typeFromConfig)
|
|
150
|
+
? typeFromConfig
|
|
151
|
+
: isKnownPlayerType(hostPlayerType)
|
|
152
|
+
? hostPlayerType
|
|
153
|
+
: hostPlayer?.tagName ? "custom" : "iife";
|
|
154
|
+
|
|
155
|
+
const requestedTagName = hostPlayer?.tagName?.trim();
|
|
156
|
+
|
|
157
|
+
if (rawType === "custom" && !requestedTagName) {
|
|
158
|
+
return {
|
|
159
|
+
type: "iife",
|
|
160
|
+
tagName: DEFAULT_ITEM_PLAYER_BY_TYPE.iife,
|
|
161
|
+
version: undefined,
|
|
162
|
+
source: undefined,
|
|
163
|
+
isDefault: true
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
type: rawType,
|
|
169
|
+
tagName: requestedTagName || DEFAULT_ITEM_PLAYER_BY_TYPE[rawType],
|
|
170
|
+
version: hostPlayer?.version,
|
|
171
|
+
source: hostPlayer?.source,
|
|
172
|
+
isDefault: !hostPlayer && !hostPlayerType
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function normalizeEnv(input) {
|
|
177
|
+
const envValue = input || {} || {};
|
|
178
|
+
const mode = typeof envValue.mode === "string" && envValue.mode.trim() ? envValue.mode.trim() : DEFAULT_ENV.mode;
|
|
179
|
+
const role = typeof envValue.role === "string" && envValue.role.trim() ? envValue.role.trim() : DEFAULT_ENV.role;
|
|
180
|
+
|
|
181
|
+
return { mode, role };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function resolveSectionViewFromEnv(input) {
|
|
185
|
+
const resolvedEnv = normalizeEnv(input);
|
|
186
|
+
|
|
187
|
+
if (resolvedEnv.mode === "author") return "author";
|
|
188
|
+
if (resolvedEnv.role === "instructor") return "scorer";
|
|
189
|
+
|
|
190
|
+
return "candidate";
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
async function createDefaultSectionController() {
|
|
194
|
+
if (createSectionController()) {
|
|
195
|
+
return createSectionController()();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
throw new Error("pie-assessment-toolkit requires createSectionController when no coordinator hook provides one");
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function buildOwnedCoordinator() {
|
|
202
|
+
const fallbackAssessmentId = assessmentId() || section()?.identifier || `assessment-${Math.random().toString(16).slice(2)}`;
|
|
203
|
+
|
|
204
|
+
return new ToolkitCoordinator({
|
|
205
|
+
assessmentId: fallbackAssessmentId,
|
|
206
|
+
lazyInit: lazyInit(),
|
|
207
|
+
tools: tools(),
|
|
208
|
+
accessibility: accessibility()
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const effectiveCoordinator = $.derived(() => {
|
|
213
|
+
if (isolation() !== "force" && $.get(inheritedRuntime)?.coordinator) {
|
|
214
|
+
return $.get(inheritedRuntime).coordinator;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return coordinator() || $.get(ownedCoordinator);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
$.user_effect(() => {
|
|
221
|
+
if (coordinator()) {
|
|
222
|
+
if ($.get(ownedCoordinator)) {
|
|
223
|
+
$.set(ownedCoordinator, null);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (isolation() !== "force" && $.get(inheritedRuntime)?.coordinator) {
|
|
230
|
+
if ($.get(ownedCoordinator)) {
|
|
231
|
+
$.set(ownedCoordinator, null);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (!$.get(ownedCoordinator)) {
|
|
238
|
+
$.set(ownedCoordinator, buildOwnedCoordinator(), true);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
const effectiveAssessmentId = $.derived(() => assessmentId() || $.get(effectiveCoordinator)?.assessmentId || "");
|
|
243
|
+
const effectiveSectionId = $.derived(() => sectionId() || section()?.identifier || `section-${$.get(effectiveAssessmentId) || "default"}`);
|
|
244
|
+
const effectiveEnv = $.derived(() => normalizeEnv(env()));
|
|
245
|
+
const effectiveSectionView = $.derived(() => resolveSectionViewFromEnv($.get(effectiveEnv)));
|
|
246
|
+
const effectiveItemPlayer = $.derived(() => normalizeItemPlayerConfig(player(), playerType()));
|
|
247
|
+
|
|
248
|
+
const runtimeContextValue = $.derived(() => {
|
|
249
|
+
if (!$.get(effectiveCoordinator)) return null;
|
|
250
|
+
|
|
251
|
+
const services = $.get(effectiveCoordinator).getServiceBundle();
|
|
252
|
+
|
|
253
|
+
return {
|
|
254
|
+
toolkitCoordinator: $.get(effectiveCoordinator),
|
|
255
|
+
toolCoordinator: $.get(effectiveCoordinator).toolCoordinator,
|
|
256
|
+
ttsService: services.ttsService,
|
|
257
|
+
highlightCoordinator: services.highlightCoordinator,
|
|
258
|
+
catalogResolver: services.catalogResolver,
|
|
259
|
+
elementToolStateStore: services.elementToolStateStore,
|
|
260
|
+
assessmentId: $.get(effectiveAssessmentId),
|
|
261
|
+
sectionId: $.get(effectiveSectionId),
|
|
262
|
+
itemPlayer: $.get(effectiveItemPlayer),
|
|
263
|
+
reportSessionChanged: (itemId, detail) => {
|
|
264
|
+
const result = sectionEngine.handleItemSessionChanged(itemId, detail);
|
|
265
|
+
|
|
266
|
+
emitNormalizedSessionChanged({ itemId, result, fallbackSession: detail });
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
const hostRuntimeContextValue = $.derived(() => {
|
|
272
|
+
if (!$.get(effectiveCoordinator)) return null;
|
|
273
|
+
|
|
274
|
+
return { runtimeId, coordinator: $.get(effectiveCoordinator) };
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
function flushCompositionChanged(nextModel) {
|
|
278
|
+
const nextRevisionKey = getCompositionRevisionKey(nextModel);
|
|
279
|
+
|
|
280
|
+
if (nextRevisionKey === $.get(lastCompositionRevisionKey)) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
$.set(lastCompositionRevisionKey, nextRevisionKey, true);
|
|
285
|
+
$.set(compositionVersion, $.get(compositionVersion) + 1);
|
|
286
|
+
$.set(compositionModel, nextModel, true);
|
|
287
|
+
|
|
288
|
+
emit("composition-changed", {
|
|
289
|
+
composition: $.get(compositionModel),
|
|
290
|
+
version: $.get(compositionVersion)
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function emitCompositionChanged(nextModel) {
|
|
295
|
+
pendingCompositionModel = nextModel ?? sectionEngine.getCompositionModel();
|
|
296
|
+
|
|
297
|
+
if (pendingCompositionEmit) return;
|
|
298
|
+
|
|
299
|
+
pendingCompositionEmit = true;
|
|
300
|
+
|
|
301
|
+
const flush = () => {
|
|
302
|
+
pendingCompositionEmit = false;
|
|
303
|
+
compositionEmitRaf = null;
|
|
304
|
+
flushCompositionChanged(pendingCompositionModel);
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
308
|
+
compositionEmitRaf = window.requestAnimationFrame(flush);
|
|
309
|
+
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
queueMicrotask(flush);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function emitNormalizedSessionChanged(args) {
|
|
317
|
+
const normalized = args.result?.eventDetail || args.fallbackSession;
|
|
318
|
+
|
|
319
|
+
emit("session-changed", {
|
|
320
|
+
...normalized,
|
|
321
|
+
itemId: args.itemId,
|
|
322
|
+
canonicalItemId: args.canonicalItemId || args.itemId,
|
|
323
|
+
sourceRuntimeId: runtimeId
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function isLocalToCurrentRuntime(eventTarget) {
|
|
328
|
+
if (!(eventTarget instanceof HTMLElement)) return false;
|
|
329
|
+
|
|
330
|
+
const sourceRuntime = requestContext(eventTarget, assessmentToolkitHostRuntimeContext);
|
|
331
|
+
|
|
332
|
+
return sourceRuntime?.runtimeId === runtimeId;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
$.user_effect(() => {
|
|
336
|
+
if (!$.get(host)) return;
|
|
337
|
+
|
|
338
|
+
if (isolation() === "force") {
|
|
339
|
+
$.set(inheritedRuntime, null);
|
|
340
|
+
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
return connectAssessmentToolkitHostRuntimeContext($.get(host), (value) => {
|
|
345
|
+
if (value.runtimeId === runtimeId) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
$.set(inheritedRuntime, value, true);
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
$.user_effect(() => {
|
|
354
|
+
const parentRuntimeId = isolation() !== "force" && $.get(inheritedRuntime) ? $.get(inheritedRuntime).runtimeId : null;
|
|
355
|
+
const ownership = parentRuntimeId ? "inherited" : "owned";
|
|
356
|
+
|
|
357
|
+
if (ownership !== $.get(lastOwnership)) {
|
|
358
|
+
$.set(lastOwnership, ownership, true);
|
|
359
|
+
emit(ownership === "inherited" ? "runtime-inherited" : "runtime-owned", { runtimeId, parentRuntimeId });
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
$.user_effect(() => {
|
|
364
|
+
if (!$.get(host) || !$.get(hostRuntimeContextValue)) return;
|
|
365
|
+
|
|
366
|
+
hostRuntimeProvider = new ContextProvider($.get(host), {
|
|
367
|
+
context: assessmentToolkitHostRuntimeContext,
|
|
368
|
+
initialValue: $.get(hostRuntimeContextValue)
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
hostRuntimeProvider.connect();
|
|
372
|
+
hostRuntimeRoot = new ContextRoot($.get(host));
|
|
373
|
+
hostRuntimeRoot.attach();
|
|
374
|
+
|
|
375
|
+
return () => {
|
|
376
|
+
hostRuntimeRoot?.detach();
|
|
377
|
+
hostRuntimeRoot = null;
|
|
378
|
+
hostRuntimeProvider?.disconnect();
|
|
379
|
+
hostRuntimeProvider = null;
|
|
380
|
+
};
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
$.user_effect(() => {
|
|
384
|
+
if (!$.get(hostRuntimeContextValue)) return;
|
|
385
|
+
|
|
386
|
+
hostRuntimeProvider?.setValue($.get(hostRuntimeContextValue));
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
$.user_effect(() => {
|
|
390
|
+
if (!$.get(host)) return;
|
|
391
|
+
|
|
392
|
+
$.get(host).setAttribute("data-item-player-type", $.get(effectiveItemPlayer).type);
|
|
393
|
+
$.get(host).setAttribute("data-item-player-tag", $.get(effectiveItemPlayer).tagName);
|
|
394
|
+
$.get(host).setAttribute("data-env-mode", String($.get(effectiveEnv)?.mode || ""));
|
|
395
|
+
$.get(host).setAttribute("data-env-role", String($.get(effectiveEnv)?.role || ""));
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
$.user_effect(() => {
|
|
399
|
+
if (!$.get(host) || !$.get(runtimeContextValue)) return;
|
|
400
|
+
|
|
401
|
+
provider = new ContextProvider($.get(host), {
|
|
402
|
+
context: assessmentToolkitRuntimeContext,
|
|
403
|
+
initialValue: $.get(runtimeContextValue)
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
provider.connect();
|
|
407
|
+
contextRoot = new ContextRoot($.get(host));
|
|
408
|
+
contextRoot.attach();
|
|
409
|
+
|
|
410
|
+
return () => {
|
|
411
|
+
contextRoot?.detach();
|
|
412
|
+
contextRoot = null;
|
|
413
|
+
provider?.disconnect();
|
|
414
|
+
provider = null;
|
|
415
|
+
};
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
$.user_effect(() => {
|
|
419
|
+
if ($.get(runtimeContextValue)) {
|
|
420
|
+
provider?.setValue($.get(runtimeContextValue));
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
$.user_effect(() => {
|
|
425
|
+
if (!section() || !$.get(effectiveCoordinator)) return;
|
|
426
|
+
|
|
427
|
+
let cancelled = false;
|
|
428
|
+
|
|
429
|
+
void sectionEngine.initialize({
|
|
430
|
+
coordinator: $.get(effectiveCoordinator),
|
|
431
|
+
section: section(),
|
|
432
|
+
sectionId: $.get(effectiveSectionId),
|
|
433
|
+
assessmentId: $.get(effectiveAssessmentId),
|
|
434
|
+
attemptId: attemptId() || undefined,
|
|
435
|
+
view: $.get(effectiveSectionView),
|
|
436
|
+
createDefaultController: createDefaultSectionController,
|
|
437
|
+
onCompositionChanged: (nextComposition) => {
|
|
438
|
+
if (cancelled) return;
|
|
439
|
+
|
|
440
|
+
emitCompositionChanged(nextComposition);
|
|
441
|
+
}
|
|
442
|
+
}).then(() => {
|
|
443
|
+
if (cancelled) return;
|
|
444
|
+
|
|
445
|
+
emit("toolkit-ready", {
|
|
446
|
+
runtimeId,
|
|
447
|
+
assessmentId: $.get(effectiveAssessmentId),
|
|
448
|
+
sectionId: $.get(effectiveSectionId),
|
|
449
|
+
itemPlayer: $.get(effectiveItemPlayer),
|
|
450
|
+
coordinator: $.get(effectiveCoordinator)
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
emit("section-ready", { sectionId: $.get(effectiveSectionId) });
|
|
454
|
+
}).catch((error) => {
|
|
455
|
+
$.set(runtimeError, error, true);
|
|
456
|
+
emit("runtime-error", { runtimeId, error });
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
return () => {
|
|
460
|
+
cancelled = true;
|
|
461
|
+
};
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
$.user_effect(() => {
|
|
465
|
+
if (!$.get(host)) return;
|
|
466
|
+
|
|
467
|
+
const localHost = $.get(host);
|
|
468
|
+
|
|
469
|
+
const onRegister = (event) => {
|
|
470
|
+
if (!isLocalToCurrentRuntime(event.target)) return;
|
|
471
|
+
|
|
472
|
+
const detail = event.detail;
|
|
473
|
+
|
|
474
|
+
if (!detail?.element || !detail?.itemId) return;
|
|
475
|
+
|
|
476
|
+
const changed = sectionEngine.register(detail);
|
|
477
|
+
|
|
478
|
+
if (changed) emitCompositionChanged();
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
const onUnregister = (event) => {
|
|
482
|
+
if (!isLocalToCurrentRuntime(event.target)) return;
|
|
483
|
+
|
|
484
|
+
const detail = event.detail;
|
|
485
|
+
const changed = detail?.element ? sectionEngine.unregister(detail.element) : false;
|
|
486
|
+
|
|
487
|
+
if (changed) emitCompositionChanged();
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
const onItemSessionChanged = (event) => {
|
|
491
|
+
if (!isLocalToCurrentRuntime(event.target)) return;
|
|
492
|
+
|
|
493
|
+
const detail = event.detail;
|
|
494
|
+
|
|
495
|
+
if (!detail?.itemId) return;
|
|
496
|
+
if (!shouldHandleBySourceRuntime(detail.sourceRuntimeId, runtimeId)) return;
|
|
497
|
+
|
|
498
|
+
const result = sectionEngine.handleItemSessionChanged(detail.itemId, detail.session);
|
|
499
|
+
|
|
500
|
+
emitNormalizedSessionChanged({
|
|
501
|
+
itemId: detail.itemId,
|
|
502
|
+
canonicalItemId: detail.canonicalItemId,
|
|
503
|
+
result,
|
|
504
|
+
fallbackSession: detail.session
|
|
505
|
+
});
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
localHost.addEventListener(PIE_REGISTER_EVENT, onRegister);
|
|
509
|
+
localHost.addEventListener(PIE_UNREGISTER_EVENT, onUnregister);
|
|
510
|
+
localHost.addEventListener(PIE_ITEM_SESSION_CHANGED_EVENT, onItemSessionChanged);
|
|
511
|
+
|
|
512
|
+
return () => {
|
|
513
|
+
localHost.removeEventListener(PIE_REGISTER_EVENT, onRegister);
|
|
514
|
+
localHost.removeEventListener(PIE_UNREGISTER_EVENT, onUnregister);
|
|
515
|
+
localHost.removeEventListener(PIE_ITEM_SESSION_CHANGED_EVENT, onItemSessionChanged);
|
|
516
|
+
};
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
async function waitUntilReady() {
|
|
520
|
+
if (!$.get(effectiveCoordinator)) {
|
|
521
|
+
throw new Error("Coordinator not initialized");
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
await $.get(effectiveCoordinator).waitUntilReady();
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
function getServiceBundle() {
|
|
528
|
+
if (!$.get(effectiveCoordinator)) {
|
|
529
|
+
throw new Error("Coordinator not initialized");
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
return $.get(effectiveCoordinator).getServiceBundle();
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
function setHooks(hooks) {
|
|
536
|
+
if (!$.get(effectiveCoordinator)) {
|
|
537
|
+
throw new Error("Coordinator not initialized");
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
$.get(effectiveCoordinator).setHooks(hooks);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
function navigateToItem(index) {
|
|
544
|
+
return sectionEngine.navigateToItem(index);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
function getCompositionModel() {
|
|
548
|
+
return sectionEngine.getCompositionModel();
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
function getItemPlayerConfig() {
|
|
552
|
+
return $.get(effectiveItemPlayer);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
async function persist() {
|
|
556
|
+
await sectionEngine.persist();
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
async function hydrate() {
|
|
560
|
+
await sectionEngine.hydrate();
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
$.user_effect(() => {
|
|
564
|
+
return () => {
|
|
565
|
+
if (compositionEmitRaf !== null && typeof window !== "undefined") {
|
|
566
|
+
window.cancelAnimationFrame(compositionEmitRaf);
|
|
567
|
+
compositionEmitRaf = null;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
pendingCompositionEmit = false;
|
|
571
|
+
|
|
572
|
+
void sectionEngine.dispose().catch((error) => {
|
|
573
|
+
$.set(runtimeError, error, true);
|
|
574
|
+
});
|
|
575
|
+
};
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
var $$exports = {
|
|
579
|
+
waitUntilReady,
|
|
580
|
+
getServiceBundle,
|
|
581
|
+
setHooks,
|
|
582
|
+
navigateToItem,
|
|
583
|
+
getCompositionModel,
|
|
584
|
+
getItemPlayerConfig,
|
|
585
|
+
persist,
|
|
586
|
+
hydrate,
|
|
587
|
+
get assessmentId() {
|
|
588
|
+
return assessmentId();
|
|
589
|
+
},
|
|
590
|
+
|
|
591
|
+
set assessmentId($$value) {
|
|
592
|
+
assessmentId($$value);
|
|
593
|
+
$.flush();
|
|
594
|
+
},
|
|
595
|
+
|
|
596
|
+
get section() {
|
|
597
|
+
return section();
|
|
598
|
+
},
|
|
599
|
+
|
|
600
|
+
set section($$value) {
|
|
601
|
+
section($$value);
|
|
602
|
+
$.flush();
|
|
603
|
+
},
|
|
604
|
+
|
|
605
|
+
get sectionId() {
|
|
606
|
+
return sectionId();
|
|
607
|
+
},
|
|
608
|
+
|
|
609
|
+
set sectionId($$value) {
|
|
610
|
+
sectionId($$value);
|
|
611
|
+
$.flush();
|
|
612
|
+
},
|
|
613
|
+
|
|
614
|
+
get attemptId() {
|
|
615
|
+
return attemptId();
|
|
616
|
+
},
|
|
617
|
+
|
|
618
|
+
set attemptId($$value) {
|
|
619
|
+
attemptId($$value);
|
|
620
|
+
$.flush();
|
|
621
|
+
},
|
|
622
|
+
|
|
623
|
+
get view() {
|
|
624
|
+
return view();
|
|
625
|
+
},
|
|
626
|
+
|
|
627
|
+
set view($$value) {
|
|
628
|
+
view($$value);
|
|
629
|
+
$.flush();
|
|
630
|
+
},
|
|
631
|
+
|
|
632
|
+
get env() {
|
|
633
|
+
return env();
|
|
634
|
+
},
|
|
635
|
+
|
|
636
|
+
set env($$value) {
|
|
637
|
+
env($$value);
|
|
638
|
+
$.flush();
|
|
639
|
+
},
|
|
640
|
+
|
|
641
|
+
get lazyInit() {
|
|
642
|
+
return lazyInit();
|
|
643
|
+
},
|
|
644
|
+
|
|
645
|
+
set lazyInit($$value) {
|
|
646
|
+
lazyInit($$value);
|
|
647
|
+
$.flush();
|
|
648
|
+
},
|
|
649
|
+
|
|
650
|
+
get tools() {
|
|
651
|
+
return tools();
|
|
652
|
+
},
|
|
653
|
+
|
|
654
|
+
set tools($$value) {
|
|
655
|
+
tools($$value);
|
|
656
|
+
$.flush();
|
|
657
|
+
},
|
|
658
|
+
|
|
659
|
+
get accessibility() {
|
|
660
|
+
return accessibility();
|
|
661
|
+
},
|
|
662
|
+
|
|
663
|
+
set accessibility($$value) {
|
|
664
|
+
accessibility($$value);
|
|
665
|
+
$.flush();
|
|
666
|
+
},
|
|
667
|
+
|
|
668
|
+
get player() {
|
|
669
|
+
return player();
|
|
670
|
+
},
|
|
671
|
+
|
|
672
|
+
set player($$value) {
|
|
673
|
+
player($$value);
|
|
674
|
+
$.flush();
|
|
675
|
+
},
|
|
676
|
+
|
|
677
|
+
get playerType() {
|
|
678
|
+
return playerType();
|
|
679
|
+
},
|
|
680
|
+
|
|
681
|
+
set playerType($$value) {
|
|
682
|
+
playerType($$value);
|
|
683
|
+
$.flush();
|
|
684
|
+
},
|
|
685
|
+
|
|
686
|
+
get coordinator() {
|
|
687
|
+
return coordinator();
|
|
688
|
+
},
|
|
689
|
+
|
|
690
|
+
set coordinator($$value) {
|
|
691
|
+
coordinator($$value);
|
|
692
|
+
$.flush();
|
|
693
|
+
},
|
|
694
|
+
|
|
695
|
+
get createSectionController() {
|
|
696
|
+
return createSectionController();
|
|
697
|
+
},
|
|
698
|
+
|
|
699
|
+
set createSectionController($$value) {
|
|
700
|
+
createSectionController($$value);
|
|
701
|
+
$.flush();
|
|
702
|
+
},
|
|
703
|
+
|
|
704
|
+
get isolation() {
|
|
705
|
+
return isolation();
|
|
706
|
+
},
|
|
707
|
+
|
|
708
|
+
set isolation($$value) {
|
|
709
|
+
isolation($$value);
|
|
710
|
+
$.flush();
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
|
|
714
|
+
var fragment = root();
|
|
715
|
+
var div = $.first_child(fragment);
|
|
716
|
+
|
|
717
|
+
$.bind_this(div, ($$value) => $.set(anchor, $$value), () => $.get(anchor));
|
|
718
|
+
|
|
719
|
+
var node = $.sibling(div, 2);
|
|
720
|
+
|
|
721
|
+
$.slot(node, $$props, 'default', {}, null);
|
|
722
|
+
$.append($$anchor, fragment);
|
|
723
|
+
|
|
724
|
+
return $.pop($$exports);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
customElements.define('pie-assessment-toolkit', $.create_custom_element(
|
|
728
|
+
PieAssessmentToolkit,
|
|
729
|
+
{
|
|
730
|
+
assessmentId: { attribute: 'assessment-id', type: 'String' },
|
|
731
|
+
section: { attribute: 'section', type: 'Object' },
|
|
732
|
+
sectionId: { attribute: 'section-id', type: 'String' },
|
|
733
|
+
attemptId: { attribute: 'attempt-id', type: 'String' },
|
|
734
|
+
view: { attribute: 'view', type: 'String' },
|
|
735
|
+
env: { attribute: 'env', type: 'Object' },
|
|
736
|
+
lazyInit: { attribute: 'lazy-init', type: 'Boolean' },
|
|
737
|
+
tools: { attribute: 'tools', type: 'Object' },
|
|
738
|
+
accessibility: { attribute: 'accessibility', type: 'Object' },
|
|
739
|
+
player: { attribute: 'player', type: 'Object' },
|
|
740
|
+
playerType: { attribute: 'player-type', type: 'String' },
|
|
741
|
+
coordinator: { type: 'Object' },
|
|
742
|
+
createSectionController: { type: 'Object' },
|
|
743
|
+
isolation: { attribute: 'isolation', type: 'String' }
|
|
744
|
+
},
|
|
745
|
+
['default'],
|
|
746
|
+
[
|
|
747
|
+
'waitUntilReady',
|
|
748
|
+
'getServiceBundle',
|
|
749
|
+
'setHooks',
|
|
750
|
+
'navigateToItem',
|
|
751
|
+
'getCompositionModel',
|
|
752
|
+
'getItemPlayerConfig',
|
|
753
|
+
'persist',
|
|
754
|
+
'hydrate'
|
|
755
|
+
],
|
|
756
|
+
{ mode: 'open' }
|
|
757
|
+
));
|