@qti-components/base 1.3.0 → 1.4.0
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.
|
@@ -1,10 +1,38 @@
|
|
|
1
1
|
export type CorrectResponseMode = 'internal' | 'full';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration context for QTI components. Provides runtime options for assessment item and interaction behavior.
|
|
4
|
+
*/
|
|
2
5
|
export interface ConfigContext {
|
|
6
|
+
/**
|
|
7
|
+
* Optional category label for info items, used for reporting or display purposes.
|
|
8
|
+
* Example: "General Information", "Instructions".
|
|
9
|
+
*/
|
|
3
10
|
infoItemCategory?: string;
|
|
11
|
+
/**
|
|
12
|
+
* If true, calls reportValidity() on interactions after scoring to show validation feedback.
|
|
13
|
+
* Used to trigger UI validation after a scoring event.
|
|
14
|
+
*/
|
|
4
15
|
reportValidityAfterScoring?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* If true, disables further selection in choice interactions after the maximum number of choices is reached.
|
|
18
|
+
* Used in multiple-choice and similar interactions to enforce maxChoices.
|
|
19
|
+
*/
|
|
5
20
|
disableAfterIfMaxChoicesReached?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Controls the mode for showing correct responses:
|
|
23
|
+
* - 'internal': Only show correct responses for the current interaction.
|
|
24
|
+
* - 'full': Show all correct responses for the item.
|
|
25
|
+
*/
|
|
6
26
|
correctResponseMode?: CorrectResponseMode;
|
|
27
|
+
/**
|
|
28
|
+
* Optional prompt text to display in inline choice interactions when no option is selected.
|
|
29
|
+
* Example: "Select an answer..."
|
|
30
|
+
*/
|
|
7
31
|
inlineChoicePrompt?: string;
|
|
32
|
+
/**
|
|
33
|
+
* If true, only show the full correct response when the candidate's response is incorrect.
|
|
34
|
+
* Used to control feedback visibility in review/correction modes.
|
|
35
|
+
*/
|
|
8
36
|
fullCorrectResponseOnlyWhenIncorrect?: boolean;
|
|
9
37
|
}
|
|
10
38
|
export declare const configContext: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.context.js","sourceRoot":"","sources":["../../src/context/config.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"config.context.js","sourceRoot":"","sources":["../../src/context/config.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AA8C7C,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAA0B,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC","sourcesContent":["import { createContext } from '@lit/context';\n\nexport type CorrectResponseMode = 'internal' | 'full';\n\n/**\n * Configuration context for QTI components. Provides runtime options for assessment item and interaction behavior.\n */\nexport interface ConfigContext {\n /**\n * Optional category label for info items, used for reporting or display purposes.\n * Example: \"General Information\", \"Instructions\".\n */\n infoItemCategory?: string;\n\n /**\n * If true, calls reportValidity() on interactions after scoring to show validation feedback.\n * Used to trigger UI validation after a scoring event.\n */\n reportValidityAfterScoring?: boolean;\n\n /**\n * If true, disables further selection in choice interactions after the maximum number of choices is reached.\n * Used in multiple-choice and similar interactions to enforce maxChoices.\n */\n disableAfterIfMaxChoicesReached?: boolean;\n\n /**\n * Controls the mode for showing correct responses:\n * - 'internal': Only show correct responses for the current interaction.\n * - 'full': Show all correct responses for the item.\n */\n correctResponseMode?: CorrectResponseMode;\n\n /**\n * Optional prompt text to display in inline choice interactions when no option is selected.\n * Example: \"Select an answer...\"\n */\n inlineChoicePrompt?: string;\n\n /**\n * If true, only show the full correct response when the candidate's response is incorrect.\n * Used to control feedback visibility in review/correction modes.\n */\n fullCorrectResponseOnlyWhenIncorrect?: boolean;\n}\n\nexport const configContext = createContext<Readonly<ConfigContext>>(Symbol('configContext'));\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qti-components/base",
|
|
3
3
|
"description": "QTI shared utilities",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"author": "",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@qti-components/utilities": "workspace:^"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"clean": "rm -rf dist",
|
|
30
30
|
"yalc": "yalc publish",
|
|
31
31
|
"yalc:push": "yalc push",
|
|
32
|
-
"publish": "
|
|
32
|
+
"publish": "node ../../tools/publish-if-needed.mjs"
|
|
33
33
|
},
|
|
34
34
|
"type": "module",
|
|
35
35
|
"types": "dist/index.d.ts",
|