@pie-players/pie-assessment-toolkit 0.2.4 → 0.2.5

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.
@@ -164,7 +164,7 @@ export declare class AssessmentPlayer {
164
164
  * Get player environment
165
165
  */
166
166
  getEnv(): {
167
- mode: "view" | "gather" | "evaluate" | "author";
167
+ mode: "gather" | "view" | "evaluate" | "author";
168
168
  };
169
169
  /**
170
170
  * Get ToolCoordinator for tool management
@@ -0,0 +1,81 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,108 @@
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
@@ -0,0 +1 @@
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,qBAAqB;IACjC,KAAK,EAAE,gBAAgB;IACvB,UAAU,EAAE,qBAAqB;IACjC,WAAW,EAAE,6BAA6B;IAC1C,UAAU,EAAE,sBAAsB;IAClC,SAAS,EAAE,oBAAoB;IAC/B,aAAa,EAAE,oBAAoB;IACnC,aAAa,EAAE,4BAA4B;IAC3C,gBAAgB,EAAE,qBAAqB;IAEvC,0DAA0D;IAC1D,kBAAkB,EAAE,qBAAqB;IACzC,oBAAoB,EAAE,qBAAqB;IAC3C,eAAe,EAAE,qBAAqB;CACtC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA2B,MAAM,CAAC,WAAW,CAC5E,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CACrE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAiB;IACtD,OAAO,mBAAmB,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAc;IACnD,OAAO,mBAAmB,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,wBAAwB,CACvC,SAAiB,EACjB,MAAc;IAEd,mBAAmB,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;IACxC,mBAAmB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAChC,OAAO,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAiB;IACvD,OAAO,SAAS,IAAI,mBAAmB,CAAC;AACzC,CAAC"}
@@ -168,7 +168,7 @@ export declare const QTI_STANDARD_ACCESS_FEATURES: {
168
168
  /**
169
169
  * Flat list of all standard access features for validation
170
170
  */
171
- export declare const ALL_STANDARD_ACCESS_FEATURES: ("braille" | "calculator" | "textToSpeech" | "ruler" | "protractor" | "answerEliminator" | "graph" | "periodicTable" | "graphingCalculator" | "readAloud" | "strikethrough" | "answerMasking" | "magnification" | "screenMagnifier" | "zoomable" | "readingMask" | "readingGuide" | "readingRuler" | "highContrastDisplay" | "colorContrast" | "invertColors" | "highlighting" | "annotations" | "highContrastAudio" | "displayTransformability" | "largePrint" | "fontEnlargement" | "resizeText" | "alternativeText" | "longDescription" | "describedMath" | "tactileGraphic" | "tactileObject" | "audioDescription" | "humanVoice" | "syntheticVoice" | "speechRate" | "speechVolume" | "voicePitch" | "captions" | "closedCaptions" | "openCaptions" | "transcript" | "signLanguage" | "subtitles" | "audioControl" | "noBackgroundAudio" | "keyboardControl" | "mouseControl" | "touchControl" | "voiceControl" | "switchControl" | "eyeGazeControl" | "singleSwitchAccess" | "stickyKeys" | "keyboardShortcuts" | "timingControl" | "unlimitedTime" | "extendedTime" | "pauseControl" | "simplifiedLanguage" | "reducedComplexity" | "structuralNavigation" | "tableOfContents" | "reducedDistraction" | "noFlashing" | "pauseAnimation" | "bookmarking" | "guidedNavigation" | "dictionary" | "thesaurus" | "spellingAssistance" | "grammarAssistance" | "lineSpacing" | "wordSpacing" | "letterSpacing" | "fontFamily" | "wordHighlighting" | "lineHighlighting" | "focusIndicator" | "printableResource" | "nemeth" | "refreshableBraille" | "index" | "pageNavigation" | "skipContent" | "breadcrumbs" | "searchable" | "fullTextSearch" | "multilingualText" | "translatedText" | "glossary" | "signLanguageInterpretation" | "visualLanguage" | "formulaSheet" | "itemGlossary" | "tutorialAvailable")[];
171
+ export declare const ALL_STANDARD_ACCESS_FEATURES: ("index" | "textToSpeech" | "calculator" | "braille" | "answerEliminator" | "graph" | "periodicTable" | "ruler" | "protractor" | "magnification" | "screenMagnifier" | "zoomable" | "highContrastDisplay" | "highContrastAudio" | "colorContrast" | "invertColors" | "displayTransformability" | "largePrint" | "fontEnlargement" | "resizeText" | "alternativeText" | "longDescription" | "describedMath" | "tactileGraphic" | "tactileObject" | "audioDescription" | "readAloud" | "humanVoice" | "syntheticVoice" | "speechRate" | "speechVolume" | "voicePitch" | "captions" | "closedCaptions" | "openCaptions" | "transcript" | "signLanguage" | "subtitles" | "audioControl" | "noBackgroundAudio" | "keyboardControl" | "mouseControl" | "touchControl" | "voiceControl" | "switchControl" | "eyeGazeControl" | "singleSwitchAccess" | "stickyKeys" | "keyboardShortcuts" | "timingControl" | "unlimitedTime" | "extendedTime" | "pauseControl" | "simplifiedLanguage" | "reducedComplexity" | "structuralNavigation" | "tableOfContents" | "reducedDistraction" | "noFlashing" | "pauseAnimation" | "annotations" | "bookmarking" | "highlighting" | "guidedNavigation" | "dictionary" | "thesaurus" | "spellingAssistance" | "grammarAssistance" | "lineSpacing" | "wordSpacing" | "letterSpacing" | "fontFamily" | "readingMask" | "readingGuide" | "readingRuler" | "wordHighlighting" | "lineHighlighting" | "focusIndicator" | "printableResource" | "nemeth" | "refreshableBraille" | "pageNavigation" | "skipContent" | "breadcrumbs" | "searchable" | "fullTextSearch" | "multilingualText" | "translatedText" | "glossary" | "signLanguageInterpretation" | "visualLanguage" | "graphingCalculator" | "formulaSheet" | "answerMasking" | "strikethrough" | "itemGlossary" | "tutorialAvailable")[];
172
172
  /**
173
173
  * Example PNP configurations for common accessibility needs
174
174
  * These are NOT official profiles but illustrative examples showing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-players/pie-assessment-toolkit",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "description": "PIE assessment toolkit: composable services + reference implementation for assessment players and tool coordination",
6
6
  "license": "MIT",
@@ -44,6 +44,14 @@
44
44
  "svelte": "./src/components/PNPProfileTester.svelte",
45
45
  "import": "./src/components/PNPProfileTester.svelte"
46
46
  },
47
+ "./services/pnp-standard-features": {
48
+ "types": "./dist/services/pnp-standard-features.d.ts",
49
+ "import": "./dist/services/pnp-standard-features.js"
50
+ },
51
+ "./services/pnp-provenance": {
52
+ "types": "./dist/services/pnp-provenance.d.ts",
53
+ "import": "./dist/services/pnp-provenance.js"
54
+ },
47
55
  "./services/I18nService": {
48
56
  "types": "./dist/services/I18nService.d.ts",
49
57
  "import": "./dist/services/I18nService.js"
@@ -67,10 +75,12 @@
67
75
  "@pie-players/pie-calculator-desmos": "0.1.2",
68
76
  "@pie-players/pie-players-shared": "0.2.2",
69
77
  "@pie-players/pie-tts": "0.1.1",
70
- "@pie-players/tts-client-server": "0.2.1"
78
+ "@pie-players/tts-client-server": "0.2.1",
79
+ "@sveltejs/kit": "^2.52.0",
80
+ "daisyui": "^5.5.18"
71
81
  },
72
82
  "peerDependencies": {
73
- "svelte": "^5.51.0"
83
+ "svelte": "^5.51.3"
74
84
  },
75
85
  "devDependencies": {
76
86
  "@biomejs/biome": "^2.3.10",
@@ -7,7 +7,7 @@
7
7
  EXAMPLE_PNP_CONFIGURATIONS,
8
8
  QTI_STANDARD_ACCESS_FEATURES,
9
9
  getFeatureCategory,
10
- } from '../services/pnp-standard-features';
10
+ } from '@pie-players/pie-assessment-toolkit/services/pnp-standard-features';
11
11
 
12
12
  interface Props {
13
13
  /** Callback when profile changes */
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import type { PNPResolutionProvenance } from '../services/pnp-provenance';
2
+ import type { PNPResolutionProvenance } from '@pie-players/pie-assessment-toolkit/services/pnp-provenance';
3
3
 
4
4
  // PNP Provenance Viewer Component
5
5
  // Visualizes how PNP resolution decisions were made.