@pie-players/pie-assessment-toolkit 0.2.7 → 0.2.9
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 +628 -0
- package/dist/components/PieAssessmentToolkit.custom-element.js +670 -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/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 +16 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -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/TTSService.d.ts +3 -1
- package/dist/services/TTSService.d.ts.map +1 -1
- package/dist/services/TTSService.js +13 -12
- 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 +64 -67
- package/dist/services/ToolRegistry.d.ts.map +1 -1
- package/dist/services/ToolRegistry.js +72 -22
- package/dist/services/ToolRegistry.js.map +1 -1
- package/dist/services/ToolkitCoordinator.d.ts +106 -8
- package/dist/services/ToolkitCoordinator.d.ts.map +1 -1
- package/dist/services/ToolkitCoordinator.js +502 -71
- package/dist/services/ToolkitCoordinator.js.map +1 -1
- package/dist/services/createDefaultToolRegistry.d.ts +12 -7
- package/dist/services/createDefaultToolRegistry.d.ts.map +1 -1
- package/dist/services/createDefaultToolRegistry.js +6 -10
- 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 +61 -1
- 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 +32 -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-context.d.ts +4 -4
- package/dist/services/tool-context.d.ts.map +1 -1
- package/dist/services/tool-context.js +106 -17
- package/dist/services/tool-context.js.map +1 -1
- package/dist/services/tool-instance-id.d.ts +17 -0
- package/dist/services/tool-instance-id.d.ts.map +1 -0
- package/dist/services/tool-instance-id.js +61 -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/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 +63 -0
- package/dist/services/tools-config-normalizer.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 +17 -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 +1 -9
- package/dist/tools/registrations/accessibility-tools.d.ts.map +1 -1
- package/dist/tools/registrations/accessibility-tools.js +95 -113
- 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 +34 -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 +27 -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 +2 -3
- 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 +25 -28
- package/src/README.md +16 -32
- package/src/components/ItemToolBar.svelte +489 -0
- package/src/components/PNPProvenanceViewer.svelte +14 -4
- package/src/components/PieAssessmentToolkit.svelte +517 -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/src/components/PNPProfileTester.example.svelte +0 -188
- package/src/components/PNPProfileTester.svelte +0 -397
- 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
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Annotation Toolbar Configuration
|
|
3
|
-
*
|
|
4
|
-
* Configures backend API endpoints for dictionary, picture dictionary, and translation features.
|
|
5
|
-
* These can be pointed to different backends in different environments:
|
|
6
|
-
* - Development: Local stub routes in section-demos
|
|
7
|
-
* - Production: pie-api-aws endpoints with authentication
|
|
8
|
-
*
|
|
9
|
-
* Part of PIE Assessment Toolkit.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Annotation Toolbar API Client
|
|
13
|
-
*
|
|
14
|
-
* Handles API calls to backend services for dictionary, picture dictionary, and translation.
|
|
15
|
-
* Automatically adds authentication and custom headers based on configuration.
|
|
16
|
-
*/
|
|
17
|
-
export class AnnotationToolbarAPIClient {
|
|
18
|
-
config;
|
|
19
|
-
constructor(config) {
|
|
20
|
-
this.config = config;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Look up a word in the dictionary
|
|
24
|
-
*/
|
|
25
|
-
async lookupDictionary(keyword, language) {
|
|
26
|
-
if (!this.config.dictionaryEndpoint) {
|
|
27
|
-
throw new Error("Dictionary endpoint not configured. Set dictionaryEndpoint in AnnotationToolbarConfig.");
|
|
28
|
-
}
|
|
29
|
-
const body = {
|
|
30
|
-
keyword,
|
|
31
|
-
language: language || this.config.defaultLanguage || "en-us",
|
|
32
|
-
};
|
|
33
|
-
const response = await this.fetch(this.config.dictionaryEndpoint, body);
|
|
34
|
-
return response.json();
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Look up images in the picture dictionary
|
|
38
|
-
*/
|
|
39
|
-
async lookupPictureDictionary(keyword, language, max) {
|
|
40
|
-
if (!this.config.pictureDictionaryEndpoint) {
|
|
41
|
-
throw new Error("Picture dictionary endpoint not configured. Set pictureDictionaryEndpoint in AnnotationToolbarConfig.");
|
|
42
|
-
}
|
|
43
|
-
const body = {
|
|
44
|
-
keyword,
|
|
45
|
-
language: language || this.config.defaultLanguage || "en-us",
|
|
46
|
-
max,
|
|
47
|
-
};
|
|
48
|
-
const response = await this.fetch(this.config.pictureDictionaryEndpoint, body);
|
|
49
|
-
return response.json();
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Translate text
|
|
53
|
-
*/
|
|
54
|
-
async translate(text, targetLanguage, sourceLanguage) {
|
|
55
|
-
if (!this.config.translationEndpoint) {
|
|
56
|
-
throw new Error("Translation endpoint not configured. Set translationEndpoint in AnnotationToolbarConfig.");
|
|
57
|
-
}
|
|
58
|
-
const body = {
|
|
59
|
-
text,
|
|
60
|
-
targetLanguage,
|
|
61
|
-
sourceLanguage: sourceLanguage || "auto",
|
|
62
|
-
};
|
|
63
|
-
const response = await this.fetch(this.config.translationEndpoint, body);
|
|
64
|
-
return response.json();
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Internal fetch helper with auth and custom headers
|
|
68
|
-
*/
|
|
69
|
-
async fetch(endpoint, body) {
|
|
70
|
-
const headers = {
|
|
71
|
-
"Content-Type": "application/json",
|
|
72
|
-
...(this.config.headers || {}),
|
|
73
|
-
};
|
|
74
|
-
// Add auth token if configured
|
|
75
|
-
if (this.config.authToken) {
|
|
76
|
-
headers["Authorization"] = `Bearer ${this.config.authToken}`;
|
|
77
|
-
}
|
|
78
|
-
// Add organization ID if configured
|
|
79
|
-
if (this.config.organizationId) {
|
|
80
|
-
headers["X-Organization-ID"] = this.config.organizationId;
|
|
81
|
-
}
|
|
82
|
-
const response = await window.fetch(endpoint, {
|
|
83
|
-
method: "POST",
|
|
84
|
-
headers,
|
|
85
|
-
body: JSON.stringify(body),
|
|
86
|
-
});
|
|
87
|
-
if (!response.ok) {
|
|
88
|
-
const errorText = await response.text();
|
|
89
|
-
throw new Error(`API request failed (${response.status}): ${errorText}`);
|
|
90
|
-
}
|
|
91
|
-
return response;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Update configuration (useful for refreshing auth tokens)
|
|
95
|
-
*/
|
|
96
|
-
updateConfig(config) {
|
|
97
|
-
this.config = { ...this.config, ...config };
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=AnnotationToolbarConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnnotationToolbarConfig.js","sourceRoot":"","sources":["../../src/services/AnnotationToolbarConfig.ts"],"names":[],"mappings":"AAA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,CAAC;QAED,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,MAAwC;QACpD,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC7C,CAAC;CACD"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { AssessmentAuthoringCallbacks, AssessmentEntity, AssessmentSection, QuestionEntity } from "@pie-players/pie-players-shared";
|
|
2
|
-
export declare class AssessmentAuthoringService {
|
|
3
|
-
private assessment;
|
|
4
|
-
private eventBus;
|
|
5
|
-
private callbacks;
|
|
6
|
-
constructor(assessment: AssessmentEntity, callbacks?: AssessmentAuthoringCallbacks);
|
|
7
|
-
/**
|
|
8
|
-
* Get the current assessment structure
|
|
9
|
-
*/
|
|
10
|
-
getAssessment(): AssessmentEntity;
|
|
11
|
-
/**
|
|
12
|
-
* Subscribe to assessment updates
|
|
13
|
-
*/
|
|
14
|
-
subscribe(listener: (assessment: AssessmentEntity) => void): () => void;
|
|
15
|
-
/**
|
|
16
|
-
* Add a question/item to the assessment
|
|
17
|
-
*/
|
|
18
|
-
addItem(item: QuestionEntity, index?: number): void;
|
|
19
|
-
/**
|
|
20
|
-
* Remove an item from the assessment
|
|
21
|
-
*/
|
|
22
|
-
removeItem(itemId: string): void;
|
|
23
|
-
/**
|
|
24
|
-
* Move an item from one position to another
|
|
25
|
-
*/
|
|
26
|
-
moveItem(fromIndex: number, toIndex: number): void;
|
|
27
|
-
/**
|
|
28
|
-
* Update an item's properties
|
|
29
|
-
*/
|
|
30
|
-
updateItem(itemId: string, updates: Partial<QuestionEntity>): void;
|
|
31
|
-
/**
|
|
32
|
-
* Reorder items to match the provided question IDs
|
|
33
|
-
*/
|
|
34
|
-
reorderItems(newOrder: string[]): void;
|
|
35
|
-
/**
|
|
36
|
-
* Add a section to the assessment
|
|
37
|
-
*/
|
|
38
|
-
addSection(section: AssessmentSection, index?: number): void;
|
|
39
|
-
/**
|
|
40
|
-
* Remove a section from the assessment
|
|
41
|
-
*/
|
|
42
|
-
removeSection(sectionId: string): void;
|
|
43
|
-
/**
|
|
44
|
-
* Update a section's properties
|
|
45
|
-
*/
|
|
46
|
-
updateSection(sectionId: string, updates: Partial<AssessmentSection>): void;
|
|
47
|
-
/**
|
|
48
|
-
* Add a question to a section
|
|
49
|
-
*/
|
|
50
|
-
addQuestionToSection(sectionId: string, questionId: string, sort?: string): void;
|
|
51
|
-
/**
|
|
52
|
-
* Remove a question from a section
|
|
53
|
-
*/
|
|
54
|
-
removeQuestionFromSection(sectionId: string, questionId: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Emit assessment update event
|
|
57
|
-
*/
|
|
58
|
-
private emitUpdate;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=AssessmentAuthoringService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssessmentAuthoringService.d.ts","sourceRoot":"","sources":["../../src/services/AssessmentAuthoringService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,4BAA4B,EAC5B,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EAEd,MAAM,iCAAiC,CAAC;AAWzC,qBAAa,0BAA0B;IACtC,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,QAAQ,CAA2C;IAC3D,OAAO,CAAC,SAAS,CAA+B;gBAG/C,UAAU,EAAE,gBAAgB,EAC5B,SAAS,GAAE,4BAAiC;IAe7C;;OAEG;IACH,aAAa,IAAI,gBAAgB;IAIjC;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,GAAG,MAAM,IAAI;IAUvE;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAWnD;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAuBhC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAoBlD;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI;IAelE;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI;IAYtC;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAW5D;;OAEG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAetC;;OAEG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAe3E;;OAEG;IACH,oBAAoB,CACnB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,MAAM,GACX,IAAI;IAcP;;OAEG;IACH,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAetE;;OAEG;IACH,OAAO,CAAC,UAAU;CAIlB"}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { TypedEventBus } from "../core/TypedEventBus.js";
|
|
2
|
-
export class AssessmentAuthoringService {
|
|
3
|
-
assessment;
|
|
4
|
-
eventBus;
|
|
5
|
-
callbacks;
|
|
6
|
-
constructor(assessment, callbacks = {}) {
|
|
7
|
-
this.assessment = { ...assessment };
|
|
8
|
-
this.callbacks = callbacks;
|
|
9
|
-
this.eventBus = new TypedEventBus();
|
|
10
|
-
// Initialize structure if missing
|
|
11
|
-
if (!this.assessment.questions) {
|
|
12
|
-
this.assessment.questions = [];
|
|
13
|
-
}
|
|
14
|
-
if (!this.assessment.sections) {
|
|
15
|
-
this.assessment.sections = [];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Get the current assessment structure
|
|
20
|
-
*/
|
|
21
|
-
getAssessment() {
|
|
22
|
-
return { ...this.assessment };
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Subscribe to assessment updates
|
|
26
|
-
*/
|
|
27
|
-
subscribe(listener) {
|
|
28
|
-
const wrappedListener = (event) => {
|
|
29
|
-
listener(event.detail);
|
|
30
|
-
};
|
|
31
|
-
this.eventBus.on("assessment-updated", wrappedListener);
|
|
32
|
-
return () => {
|
|
33
|
-
this.eventBus.off("assessment-updated", wrappedListener);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Add a question/item to the assessment
|
|
38
|
-
*/
|
|
39
|
-
addItem(item, index) {
|
|
40
|
-
const questions = this.assessment.questions || [];
|
|
41
|
-
const targetIndex = index !== undefined ? index : questions.length;
|
|
42
|
-
questions.splice(targetIndex, 0, item);
|
|
43
|
-
this.assessment.questions = questions;
|
|
44
|
-
this.callbacks.onItemAdded?.(item, targetIndex);
|
|
45
|
-
this.emitUpdate();
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Remove an item from the assessment
|
|
49
|
-
*/
|
|
50
|
-
removeItem(itemId) {
|
|
51
|
-
const questions = this.assessment.questions || [];
|
|
52
|
-
const index = questions.findIndex((q) => q.id === itemId);
|
|
53
|
-
if (index === -1) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
questions.splice(index, 1);
|
|
57
|
-
this.assessment.questions = questions;
|
|
58
|
-
// Also remove from sections
|
|
59
|
-
if (this.assessment.sections) {
|
|
60
|
-
this.assessment.sections = this.assessment.sections.map((section) => ({
|
|
61
|
-
...section,
|
|
62
|
-
questions: section.questions.filter((ref) => ref.questionId !== itemId),
|
|
63
|
-
}));
|
|
64
|
-
}
|
|
65
|
-
this.callbacks.onItemRemoved?.(itemId, index);
|
|
66
|
-
this.emitUpdate();
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Move an item from one position to another
|
|
70
|
-
*/
|
|
71
|
-
moveItem(fromIndex, toIndex) {
|
|
72
|
-
const questions = this.assessment.questions || [];
|
|
73
|
-
if (fromIndex < 0 ||
|
|
74
|
-
fromIndex >= questions.length ||
|
|
75
|
-
toIndex < 0 ||
|
|
76
|
-
toIndex >= questions.length) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const [item] = questions.splice(fromIndex, 1);
|
|
80
|
-
questions.splice(toIndex, 0, item);
|
|
81
|
-
this.assessment.questions = questions;
|
|
82
|
-
this.callbacks.onItemMoved?.(fromIndex, toIndex);
|
|
83
|
-
this.emitUpdate();
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Update an item's properties
|
|
87
|
-
*/
|
|
88
|
-
updateItem(itemId, updates) {
|
|
89
|
-
const questions = this.assessment.questions || [];
|
|
90
|
-
const index = questions.findIndex((q) => q.id === itemId);
|
|
91
|
-
if (index === -1) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
questions[index] = { ...questions[index], ...updates };
|
|
95
|
-
this.assessment.questions = questions;
|
|
96
|
-
this.callbacks.onItemUpdated?.(itemId, updates);
|
|
97
|
-
this.emitUpdate();
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Reorder items to match the provided question IDs
|
|
101
|
-
*/
|
|
102
|
-
reorderItems(newOrder) {
|
|
103
|
-
const questions = this.assessment.questions || [];
|
|
104
|
-
const questionMap = new Map(questions.map((q) => [q.id, q]));
|
|
105
|
-
const reordered = newOrder
|
|
106
|
-
.map((id) => questionMap.get(id))
|
|
107
|
-
.filter((q) => q !== undefined);
|
|
108
|
-
this.assessment.questions = reordered;
|
|
109
|
-
this.emitUpdate();
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Add a section to the assessment
|
|
113
|
-
*/
|
|
114
|
-
addSection(section, index) {
|
|
115
|
-
const sections = this.assessment.sections || [];
|
|
116
|
-
const targetIndex = index !== undefined ? index : sections.length;
|
|
117
|
-
sections.splice(targetIndex, 0, section);
|
|
118
|
-
this.assessment.sections = sections;
|
|
119
|
-
this.callbacks.onSectionAdded?.(section, targetIndex);
|
|
120
|
-
this.emitUpdate();
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Remove a section from the assessment
|
|
124
|
-
*/
|
|
125
|
-
removeSection(sectionId) {
|
|
126
|
-
const sections = this.assessment.sections || [];
|
|
127
|
-
const index = sections.findIndex((s) => s.id === sectionId);
|
|
128
|
-
if (index === -1) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
sections.splice(index, 1);
|
|
132
|
-
this.assessment.sections = sections;
|
|
133
|
-
this.callbacks.onSectionRemoved?.(sectionId, index);
|
|
134
|
-
this.emitUpdate();
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Update a section's properties
|
|
138
|
-
*/
|
|
139
|
-
updateSection(sectionId, updates) {
|
|
140
|
-
const sections = this.assessment.sections || [];
|
|
141
|
-
const index = sections.findIndex((s) => s.id === sectionId);
|
|
142
|
-
if (index === -1) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
sections[index] = { ...sections[index], ...updates };
|
|
146
|
-
this.assessment.sections = sections;
|
|
147
|
-
this.callbacks.onSectionUpdated?.(sectionId, updates);
|
|
148
|
-
this.emitUpdate();
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Add a question to a section
|
|
152
|
-
*/
|
|
153
|
-
addQuestionToSection(sectionId, questionId, sort) {
|
|
154
|
-
const sections = this.assessment.sections || [];
|
|
155
|
-
const section = sections.find((s) => s.id === sectionId);
|
|
156
|
-
if (!section) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
const ref = { questionId, sort };
|
|
160
|
-
section.questions = [...(section.questions || []), ref];
|
|
161
|
-
this.emitUpdate();
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Remove a question from a section
|
|
165
|
-
*/
|
|
166
|
-
removeQuestionFromSection(sectionId, questionId) {
|
|
167
|
-
const sections = this.assessment.sections || [];
|
|
168
|
-
const section = sections.find((s) => s.id === sectionId);
|
|
169
|
-
if (!section) {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
section.questions = section.questions.filter((ref) => ref.questionId !== questionId);
|
|
173
|
-
this.emitUpdate();
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Emit assessment update event
|
|
177
|
-
*/
|
|
178
|
-
emitUpdate() {
|
|
179
|
-
this.callbacks.onAssessmentUpdated?.(this.assessment);
|
|
180
|
-
this.eventBus.emit("assessment-updated", this.assessment);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
//# sourceMappingURL=AssessmentAuthoringService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssessmentAuthoringService.js","sourceRoot":"","sources":["../../src/services/AssessmentAuthoringService.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAUzD,MAAM,OAAO,0BAA0B;IAC9B,UAAU,CAAmB;IAC7B,QAAQ,CAA2C;IACnD,SAAS,CAA+B;IAEhD,YACC,UAA4B,EAC5B,YAA0C,EAAE;QAE5C,IAAI,CAAC,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAEpC,kCAAkC;QAClC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;YAChC,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,EAAE,CAAC;QAChC,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC/B,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,EAAE,CAAC;QAC/B,CAAC;IACF,CAAC;IAED;;OAEG;IACH,aAAa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,CAAC,SAAS,CAAC,MAAM,CAC3C,CAAC,GAAuB,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,KAAK,UAAU,CAC1D,CAAC;QAEF,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAED;;OAEG;IACK,UAAU;QACjB,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;CACD"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PNP Mapper - Maps QTI 3.0 PNP support IDs to PIE tool identifiers
|
|
3
|
-
*
|
|
4
|
-
* @deprecated This module will be removed in a future version.
|
|
5
|
-
* Use ToolRegistry instead for PNP support mapping. Tools declare their
|
|
6
|
-
* pnpSupportIds in their ToolRegistration, and PNPToolResolver uses the
|
|
7
|
-
* registry to look up tool IDs by PNP support ID.
|
|
8
|
-
*
|
|
9
|
-
* Migration path:
|
|
10
|
-
* 1. Register tools with ToolRegistry including pnpSupportIds
|
|
11
|
-
* 2. Pass ToolRegistry to PNPToolResolver constructor
|
|
12
|
-
* 3. PNPToolResolver.getToolsByPNPSupport() replaces this mapper
|
|
13
|
-
*
|
|
14
|
-
* This module is kept temporarily for backwards compatibility and will be
|
|
15
|
-
* removed in Phase 5 of the tool registry refactoring.
|
|
16
|
-
*
|
|
17
|
-
* Part of PIE Assessment Toolkit.
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Standard QTI 3.0 PNP support → PIE tool ID mapping
|
|
21
|
-
*
|
|
22
|
-
* Maps industry-standard PNP support identifiers to corresponding PIE tools.
|
|
23
|
-
* Based on IMS Global QTI 3.0 specification.
|
|
24
|
-
*/
|
|
25
|
-
export declare const PNP_TO_PIE_TOOL_MAP: Record<string, string>;
|
|
26
|
-
/**
|
|
27
|
-
* Reverse mapping for debugging/export (PIE tool ID → PNP support ID)
|
|
28
|
-
*/
|
|
29
|
-
export declare const PIE_TOOL_TO_PNP_MAP: Record<string, string>;
|
|
30
|
-
/**
|
|
31
|
-
* Map PNP support ID to PIE tool ID
|
|
32
|
-
*
|
|
33
|
-
* @param supportId QTI 3.0 PNP support identifier
|
|
34
|
-
* @returns PIE tool ID or null if no mapping exists
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* mapPNPSupportToToolId('textToSpeech') // Returns: 'pie-tool-text-to-speech'
|
|
38
|
-
* mapPNPSupportToToolId('calculator') // Returns: 'pie-tool-calculator'
|
|
39
|
-
* mapPNPSupportToToolId('unknown') // Returns: null
|
|
40
|
-
*/
|
|
41
|
-
export declare function mapPNPSupportToToolId(supportId: string): string | null;
|
|
42
|
-
/**
|
|
43
|
-
* Map PIE tool ID back to PNP support ID
|
|
44
|
-
*
|
|
45
|
-
* Useful for exporting or debugging tool configurations.
|
|
46
|
-
*
|
|
47
|
-
* @param toolId PIE tool identifier
|
|
48
|
-
* @returns QTI 3.0 PNP support ID or null if no mapping exists
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* mapToolIdToPNPSupport('pie-tool-text-to-speech') // Returns: 'textToSpeech'
|
|
52
|
-
*/
|
|
53
|
-
export declare function mapToolIdToPNPSupport(toolId: string): string | null;
|
|
54
|
-
/**
|
|
55
|
-
* Register custom PNP support mapping
|
|
56
|
-
*
|
|
57
|
-
* Allows products to extend the standard PNP vocabulary with custom tools.
|
|
58
|
-
* Custom supports should use 'x-' prefix per IMS convention.
|
|
59
|
-
*
|
|
60
|
-
* @param supportId PNP support identifier (e.g., 'x-pie-periodic-table')
|
|
61
|
-
* @param toolId PIE tool identifier (e.g., 'pie-tool-periodic-table')
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* registerCustomPNPMapping('x-pie-periodic-table', 'pie-tool-periodic-table');
|
|
65
|
-
* registerCustomPNPMapping('x-pie-graph', 'pie-tool-graphing');
|
|
66
|
-
*/
|
|
67
|
-
export declare function registerCustomPNPMapping(supportId: string, toolId: string): void;
|
|
68
|
-
/**
|
|
69
|
-
* Get all registered PNP support IDs
|
|
70
|
-
*
|
|
71
|
-
* @returns Array of all PNP support identifiers (standard + custom)
|
|
72
|
-
*/
|
|
73
|
-
export declare function getAllPNPSupports(): string[];
|
|
74
|
-
/**
|
|
75
|
-
* Check if a PNP support is registered
|
|
76
|
-
*
|
|
77
|
-
* @param supportId PNP support identifier to check
|
|
78
|
-
* @returns true if mapping exists
|
|
79
|
-
*/
|
|
80
|
-
export declare function isPNPSupportRegistered(supportId: string): boolean;
|
|
81
|
-
//# sourceMappingURL=PNPMapper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PNPMapper.d.ts","sourceRoot":"","sources":["../../src/services/PNPMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiBtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAEtD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEtE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEnE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACvC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,IAAI,CAGN;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEjE"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PNP Mapper - Maps QTI 3.0 PNP support IDs to PIE tool identifiers
|
|
3
|
-
*
|
|
4
|
-
* @deprecated This module will be removed in a future version.
|
|
5
|
-
* Use ToolRegistry instead for PNP support mapping. Tools declare their
|
|
6
|
-
* pnpSupportIds in their ToolRegistration, and PNPToolResolver uses the
|
|
7
|
-
* registry to look up tool IDs by PNP support ID.
|
|
8
|
-
*
|
|
9
|
-
* Migration path:
|
|
10
|
-
* 1. Register tools with ToolRegistry including pnpSupportIds
|
|
11
|
-
* 2. Pass ToolRegistry to PNPToolResolver constructor
|
|
12
|
-
* 3. PNPToolResolver.getToolsByPNPSupport() replaces this mapper
|
|
13
|
-
*
|
|
14
|
-
* This module is kept temporarily for backwards compatibility and will be
|
|
15
|
-
* removed in Phase 5 of the tool registry refactoring.
|
|
16
|
-
*
|
|
17
|
-
* Part of PIE Assessment Toolkit.
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Standard QTI 3.0 PNP support → PIE tool ID mapping
|
|
21
|
-
*
|
|
22
|
-
* Maps industry-standard PNP support identifiers to corresponding PIE tools.
|
|
23
|
-
* Based on IMS Global QTI 3.0 specification.
|
|
24
|
-
*/
|
|
25
|
-
export const PNP_TO_PIE_TOOL_MAP = {
|
|
26
|
-
// Standard QTI 3.0 PNP supports
|
|
27
|
-
textToSpeech: "pie-tool-text-to-speech",
|
|
28
|
-
calculator: "pie-tool-calculator",
|
|
29
|
-
ruler: "pie-tool-ruler",
|
|
30
|
-
protractor: "pie-tool-protractor",
|
|
31
|
-
highlighter: "pie-tool-annotation-toolbar",
|
|
32
|
-
lineReader: "pie-tool-line-reader",
|
|
33
|
-
magnifier: "pie-tool-magnifier",
|
|
34
|
-
colorContrast: "pie-theme-contrast",
|
|
35
|
-
answerMasking: "pie-tool-answer-eliminator",
|
|
36
|
-
dictionaryLookup: "pie-tool-dictionary",
|
|
37
|
-
// Common extensions (not in QTI standard but widely used)
|
|
38
|
-
graphingCalculator: "pie-tool-calculator",
|
|
39
|
-
scientificCalculator: "pie-tool-calculator",
|
|
40
|
-
basicCalculator: "pie-tool-calculator",
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Reverse mapping for debugging/export (PIE tool ID → PNP support ID)
|
|
44
|
-
*/
|
|
45
|
-
export const PIE_TOOL_TO_PNP_MAP = Object.fromEntries(Object.entries(PNP_TO_PIE_TOOL_MAP).map(([pnp, tool]) => [tool, pnp]));
|
|
46
|
-
/**
|
|
47
|
-
* Map PNP support ID to PIE tool ID
|
|
48
|
-
*
|
|
49
|
-
* @param supportId QTI 3.0 PNP support identifier
|
|
50
|
-
* @returns PIE tool ID or null if no mapping exists
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* mapPNPSupportToToolId('textToSpeech') // Returns: 'pie-tool-text-to-speech'
|
|
54
|
-
* mapPNPSupportToToolId('calculator') // Returns: 'pie-tool-calculator'
|
|
55
|
-
* mapPNPSupportToToolId('unknown') // Returns: null
|
|
56
|
-
*/
|
|
57
|
-
export function mapPNPSupportToToolId(supportId) {
|
|
58
|
-
return PNP_TO_PIE_TOOL_MAP[supportId] || null;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Map PIE tool ID back to PNP support ID
|
|
62
|
-
*
|
|
63
|
-
* Useful for exporting or debugging tool configurations.
|
|
64
|
-
*
|
|
65
|
-
* @param toolId PIE tool identifier
|
|
66
|
-
* @returns QTI 3.0 PNP support ID or null if no mapping exists
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* mapToolIdToPNPSupport('pie-tool-text-to-speech') // Returns: 'textToSpeech'
|
|
70
|
-
*/
|
|
71
|
-
export function mapToolIdToPNPSupport(toolId) {
|
|
72
|
-
return PIE_TOOL_TO_PNP_MAP[toolId] || null;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Register custom PNP support mapping
|
|
76
|
-
*
|
|
77
|
-
* Allows products to extend the standard PNP vocabulary with custom tools.
|
|
78
|
-
* Custom supports should use 'x-' prefix per IMS convention.
|
|
79
|
-
*
|
|
80
|
-
* @param supportId PNP support identifier (e.g., 'x-pie-periodic-table')
|
|
81
|
-
* @param toolId PIE tool identifier (e.g., 'pie-tool-periodic-table')
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* registerCustomPNPMapping('x-pie-periodic-table', 'pie-tool-periodic-table');
|
|
85
|
-
* registerCustomPNPMapping('x-pie-graph', 'pie-tool-graphing');
|
|
86
|
-
*/
|
|
87
|
-
export function registerCustomPNPMapping(supportId, toolId) {
|
|
88
|
-
PNP_TO_PIE_TOOL_MAP[supportId] = toolId;
|
|
89
|
-
PIE_TOOL_TO_PNP_MAP[toolId] = supportId;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Get all registered PNP support IDs
|
|
93
|
-
*
|
|
94
|
-
* @returns Array of all PNP support identifiers (standard + custom)
|
|
95
|
-
*/
|
|
96
|
-
export function getAllPNPSupports() {
|
|
97
|
-
return Object.keys(PNP_TO_PIE_TOOL_MAP);
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Check if a PNP support is registered
|
|
101
|
-
*
|
|
102
|
-
* @param supportId PNP support identifier to check
|
|
103
|
-
* @returns true if mapping exists
|
|
104
|
-
*/
|
|
105
|
-
export function isPNPSupportRegistered(supportId) {
|
|
106
|
-
return supportId in PNP_TO_PIE_TOOL_MAP;
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=PNPMapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PNPMapper.js","sourceRoot":"","sources":["../../src/services/PNPMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IAC1D,gCAAgC;IAChC,YAAY,EAAE,yBAAyB;IACvC,UAAU,EAAE,qBAA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