@pie-element/fraction-model 7.0.4-next.20261011174919 → 7.0.4
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/dist/author/defaults.d.ts +37 -32
- package/dist/author/index.d.ts +19 -21
- package/dist/author/index.js +13 -6
- package/dist/author/main.d.ts +34 -12
- package/dist/author/main.js +30 -38
- package/dist/browser/author/index.js +13 -13
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +13 -13
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +1 -1
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +5 -4
- package/dist/controller/index.d.ts +47 -8
- package/dist/controller/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +389 -0
- package/dist/schemas/model.schema.json +372 -0
- package/dist/schemas/session.schema.json +79 -0
- package/dist/types.d.ts +169 -0
- package/package.json +17 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/controller/defaults.ts","../../../../src/controller/index.ts"],"sourcesContent":["// @ts-nocheck\n\n// Should be exactly the same as configure/defaults.js\nexport default {\n model: {\n correctResponse: [],\n title: '',\n prompt: '',\n modelTypeSelected: 'bar',\n maxModelSelected: 1,\n partsPerModel: 5,\n allowedStudentConfig: false,\n showGraphLabels: false,\n },\n};\n","// @ts-nocheck\n\nimport { isEmpty } from '@pie-element/shared-lodash';\nimport defaults from './defaults.js';\n\n/*\n * Function to check the correctness of the response\n * @param {model} model contains the model object\n * @param {answers} answers contains the answers object\n * @param {env} env contains the environment object\n * @returns {string} returns the correctness of the response\n * */\nexport const getResponseCorrectness = (model, answers, env = {}) => {\n let correct;\n if (model.allowedStudentConfig) {\n correct = !!(\n answers.partsPerModel === model.partsPerModel &&\n partialFillCheck(answers.response, model.partsPerModel) &&\n numeratorCheck(model.correctResponse, answers.response)\n );\n } else {\n correct = !!(\n partialFillCheck(answers.response, model.partsPerModel) && numeratorCheck(model.correctResponse, answers.response)\n );\n }\n return correct ? 'correct' : 'incorrect';\n};\n\n/*\n * Function to get the correctness of the response\n * @param {question} question contains the question object\n * @param {env} env contains the environment object\n * @param {answers} answers contains the answers object\n * @returns {string} returns the correctness\n * */\nconst getCorrectness = (question, env, answers = {}) => {\n if (env.mode === 'evaluate') {\n return getResponseCorrectness(question, answers, env);\n }\n};\n\n/*\n * Function to get the outcome score\n * @param {question} question contains the question object\n * @param {env} env contains the environment object\n * @param {answers} answers contains the answers object\n * @returns {number} returns the score\n * */\nconst getOutComeScore = (question, env, answers = {}) => {\n const correctness = getCorrectness(question, env, answers);\n return correctness === 'correct' ? 1 : 0;\n};\n\n// A player sends an untouched item's session as `{ id, element }`, without `answers`.\nconst isUnanswered = (session) => !session || isEmpty(session) || !session.answers;\n\n/*\n * Function to check outcome of the session\n * @param {model} model contains the model object\n * @param {session} session contains the session object\n * @param {env} env contains the environment object\n * @returns {Promise} returns the score\n */\nexport const outcome = (model, session, env) =>\n new Promise((resolve) => {\n if (isUnanswered(session)) {\n resolve({ score: 0, empty: true });\n } else {\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined });\n } else {\n resolve({ score: getOutComeScore(model, env, session.answers) });\n }\n }\n });\n\n/*\n * Function to check if the numerator of the response matches the numerator of the correct response\n * @param {correctResponse} correctResponse contains the correct response object\n * @param {response} response contains the response object\n * @returns {boolean} returns true if the numerators match\n * */\nconst numeratorCheck = (correctResponse, response) => {\n let correctNumerator = 0;\n let responseNumerator = 0;\n for (let i = 0; i < correctResponse.length; i++) {\n correctNumerator += correctResponse[i].value;\n }\n for (let i = 0; i < response.length; i++) {\n responseNumerator += response[i].value;\n }\n return correctNumerator === responseNumerator;\n};\n\n/*\n * Function to check if the response contains more than one partially-filled model\n * @param {response} response contains the response object\n * @param {partsPerModel} partsPerModel contains the number of parts per model\n * */\nconst partialFillCheck = (response, partsPerModel) => {\n if (response.length > 0) {\n let partialModelCount = 0;\n response.forEach((selection) => {\n if (selection.value !== partsPerModel) {\n partialModelCount++;\n }\n });\n return partialModelCount <= 1;\n } else {\n return false;\n }\n};\n\n/*\n * Function to create a default model\n * @param {model} model contains the model object\n * */\nexport const createDefaultModel = (model = {}) => ({\n ...defaults.model,\n ...model,\n});\n\n/*\n * Return the model object\n * */\nexport const model = (question, session, env) => {\n return new Promise((resolve) => {\n session = session || {};\n const model = createDefaultModel(question);\n let correctness, score;\n if (isUnanswered(session) && env.mode === 'evaluate') {\n correctness = 'unanswered';\n score = '0%';\n } else {\n correctness = getCorrectness(model, env, session && session.answers);\n score = `${getOutComeScore(model, env, session && session.answers) * 100}%`;\n }\n const correctInfo = {\n score,\n correctness,\n };\n const out = {\n env,\n ...model,\n view: env.mode === 'view' || env.mode === 'evaluate',\n };\n if (env.mode === 'evaluate') {\n Object.assign(out, {\n correctness: correctInfo,\n });\n }\n resolve(out);\n });\n};\n\n/*\n * Function to create a correct response session\n * @param {model} model contains the model object\n * @param {env} env contains the environment object\n * @returns {Promise} returns the correct response session\n * */\nexport const createCorrectResponseSession = (model, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { correctResponse, maxModelSelected, partsPerModel } = model;\n resolve({\n answers: {\n response: correctResponse,\n noOfModel: maxModelSelected,\n partsPerModel,\n },\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n/*\n * Function to validate the model\n * @param {model} model contains the model object\n * @param {config} config contains the config object\n * */\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n if (model.correctResponse.length === 0) {\n errors.correctResponse = 'To save the item, at least one section must be marked as correct.';\n }\n if (model.correctResponse.length > 0) {\n let partialModelCount = 0;\n model.correctResponse.forEach((selection) => {\n if (selection.value !== model.partsPerModel) {\n partialModelCount++;\n }\n });\n if (partialModelCount > 1) {\n errors.correctResponse = 'The correct answer should include no more than one partially-filled model';\n }\n }\n return errors;\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/controller/defaults.ts","../../../../src/controller/index.ts"],"sourcesContent":["import type { FractionModelModel, FractionModelResponse } from '../types.js';\n\n// Should be exactly the same as configure/defaults.js\nexport default {\n model: {\n correctResponse: [] as FractionModelResponse[],\n title: '',\n prompt: '',\n modelTypeSelected: 'bar',\n maxModelSelected: 1,\n partsPerModel: 5,\n allowedStudentConfig: false,\n showGraphLabels: false,\n },\n} satisfies { model: Omit<FractionModelModel, 'id' | 'element'> };\n","import { isEmpty } from '@pie-element/shared-lodash';\nimport type { PieEnvironment } from '@pie-element/shared-types';\nimport defaults from './defaults.js';\nimport type {\n FractionModelAnswers,\n FractionModelConfiguration,\n FractionModelModel,\n FractionModelResponse,\n FractionModelSession,\n} from '../types.js';\n\n/** Whether a response matches the correct response */\nexport type FractionModelCorrectness = 'correct' | 'incorrect';\n\n/** What `outcome()` resolves: empty for an unanswered session, no score outside evaluate mode */\nexport type FractionModelOutcome =\n | { score: number; empty: true }\n | { score: undefined; completed: undefined }\n | { score: number };\n\n/** Messages `validate()` returns, keyed by the model property they concern */\nexport type FractionModelValidationErrors = {\n correctResponse?: string;\n};\n\n/*\n * Function to check the correctness of the response\n * @param {model} model contains the model object\n * @param {answers} answers contains the answers object\n * @param {env} env contains the environment object\n * @returns {string} returns the correctness of the response\n * */\nexport const getResponseCorrectness = (\n model: Partial<FractionModelModel>,\n answers: Partial<FractionModelAnswers>,\n _env: Partial<PieEnvironment> = {}\n): FractionModelCorrectness => {\n let correct;\n // An absent `correctResponse` or `response` throws below, as it did untyped.\n if (model.allowedStudentConfig) {\n correct = !!(\n answers.partsPerModel === model.partsPerModel &&\n partialFillCheck(answers.response!, model.partsPerModel) &&\n numeratorCheck(model.correctResponse!, answers.response!)\n );\n } else {\n correct = !!(\n partialFillCheck(answers.response!, model.partsPerModel) && numeratorCheck(model.correctResponse!, answers.response!)\n );\n }\n return correct ? 'correct' : 'incorrect';\n};\n\n/*\n * Function to get the correctness of the response\n * @param {question} question contains the question object\n * @param {env} env contains the environment object\n * @param {answers} answers contains the answers object\n * @returns {string} returns the correctness\n * */\nconst getCorrectness = (\n question: Partial<FractionModelModel>,\n env: PieEnvironment,\n answers: Partial<FractionModelAnswers> = {}\n): FractionModelCorrectness | undefined => {\n if (env.mode === 'evaluate') {\n return getResponseCorrectness(question, answers, env);\n }\n};\n\n/*\n * Function to get the outcome score\n * @param {question} question contains the question object\n * @param {env} env contains the environment object\n * @param {answers} answers contains the answers object\n * @returns {number} returns the score\n * */\nconst getOutComeScore = (\n question: Partial<FractionModelModel>,\n env: PieEnvironment,\n answers: Partial<FractionModelAnswers> = {}\n): number => {\n const correctness = getCorrectness(question, env, answers);\n return correctness === 'correct' ? 1 : 0;\n};\n\n// A player sends an untouched item's session as `{ id, element }`, without `answers`.\nconst isUnanswered = (session: FractionModelSession | null | undefined) =>\n !session || isEmpty(session) || !session.answers;\n\n/*\n * Function to check outcome of the session\n * @param {model} model contains the model object\n * @param {session} session contains the session object\n * @param {env} env contains the environment object\n * @returns {Promise} returns the score\n */\nexport const outcome = (\n model: FractionModelModel,\n session: FractionModelSession | null | undefined,\n env: PieEnvironment\n): Promise<FractionModelOutcome> =>\n new Promise((resolve) => {\n if (isUnanswered(session)) {\n resolve({ score: 0, empty: true });\n } else {\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined });\n } else {\n // isUnanswered() ruled out a missing session.\n resolve({ score: getOutComeScore(model, env, session?.answers) });\n }\n }\n });\n\n/*\n * Function to check if the numerator of the response matches the numerator of the correct response\n * @param {correctResponse} correctResponse contains the correct response object\n * @param {response} response contains the response object\n * @returns {boolean} returns true if the numerators match\n * */\nconst numeratorCheck = (correctResponse: FractionModelResponse[], response: FractionModelResponse[]) => {\n let correctNumerator = 0;\n let responseNumerator = 0;\n for (let i = 0; i < correctResponse.length; i++) {\n correctNumerator += correctResponse[i].value;\n }\n for (let i = 0; i < response.length; i++) {\n responseNumerator += response[i].value;\n }\n return correctNumerator === responseNumerator;\n};\n\n/*\n * Function to check if the response contains more than one partially-filled model\n * @param {response} response contains the response object\n * @param {partsPerModel} partsPerModel contains the number of parts per model\n * */\nconst partialFillCheck = (response: FractionModelResponse[], partsPerModel: number | undefined) => {\n if (response.length > 0) {\n let partialModelCount = 0;\n response.forEach((selection) => {\n if (selection.value !== partsPerModel) {\n partialModelCount++;\n }\n });\n return partialModelCount <= 1;\n } else {\n return false;\n }\n};\n\n/*\n * Function to create a default model\n * @param {model} model contains the model object\n * */\nexport const createDefaultModel = (model: Partial<FractionModelModel> = {}) => ({\n ...defaults.model,\n ...model,\n});\n\n/** A model with the controller defaults applied */\nexport type FractionModelNormalizedModel = ReturnType<typeof createDefaultModel>;\n\n/** What `model()` resolves */\nexport type FractionModelViewModel = FractionModelNormalizedModel & {\n env: PieEnvironment;\n /** Whether the student can no longer change the response */\n view: boolean;\n /** Set in evaluate mode */\n correctness?: {\n /** The score as a percentage, e.g. `100%` */\n score: string;\n correctness: FractionModelCorrectness | 'unanswered' | undefined;\n };\n};\n\n/*\n * Return the model object\n * */\nexport const model = (\n question: FractionModelModel,\n session: FractionModelSession | null | undefined,\n env: PieEnvironment\n): Promise<FractionModelViewModel> => {\n return new Promise((resolve) => {\n session = session || {};\n const model = createDefaultModel(question);\n let correctness: FractionModelCorrectness | 'unanswered' | undefined, score: string;\n if (isUnanswered(session) && env.mode === 'evaluate') {\n correctness = 'unanswered';\n score = '0%';\n } else {\n correctness = getCorrectness(model, env, session && session.answers);\n score = `${getOutComeScore(model, env, session && session.answers) * 100}%`;\n }\n const correctInfo = {\n score,\n correctness,\n };\n const out: FractionModelViewModel = {\n env,\n ...model,\n view: env.mode === 'view' || env.mode === 'evaluate',\n };\n if (env.mode === 'evaluate') {\n Object.assign(out, {\n correctness: correctInfo,\n });\n }\n resolve(out);\n });\n};\n\n/*\n * Function to create a correct response session\n * @param {model} model contains the model object\n * @param {env} env contains the environment object\n * @returns {Promise} returns the correct response session\n * */\nexport const createCorrectResponseSession = (\n model: FractionModelModel,\n env: PieEnvironment\n): Promise<FractionModelSession | null> => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { correctResponse, maxModelSelected, partsPerModel } = model;\n resolve({\n answers: {\n // A model without `correctResponse` yields a session without `response`.\n response: correctResponse as FractionModelResponse[],\n noOfModel: maxModelSelected,\n partsPerModel,\n },\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n/*\n * Function to validate the model\n * @param {model} model contains the model object\n * @param {config} config contains the config object\n * */\nexport const validate = (\n model: Partial<FractionModelModel> = {},\n _config: FractionModelConfiguration = {}\n): FractionModelValidationErrors => {\n const errors: FractionModelValidationErrors = {};\n // An absent `correctResponse` throws here, as it did untyped.\n if (model.correctResponse!.length === 0) {\n errors.correctResponse = 'To save the item, at least one section must be marked as correct.';\n }\n if (model.correctResponse!.length > 0) {\n let partialModelCount = 0;\n model.correctResponse!.forEach((selection) => {\n if (selection.value !== model.partsPerModel) {\n partialModelCount++;\n }\n });\n if (partialModelCount > 1) {\n errors.correctResponse = 'The correct answer should include no more than one partially-filled model';\n }\n }\n return errors;\n};\n"],"mappings":"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"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { FractionModelResponse } from '../types.js';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
model: {
|
|
3
|
-
correctResponse:
|
|
4
|
+
correctResponse: FractionModelResponse[];
|
|
4
5
|
title: string;
|
|
5
6
|
prompt: string;
|
|
6
|
-
modelTypeSelected:
|
|
7
|
+
modelTypeSelected: "bar";
|
|
7
8
|
maxModelSelected: number;
|
|
8
9
|
partsPerModel: number;
|
|
9
|
-
allowedStudentConfig:
|
|
10
|
-
showGraphLabels:
|
|
10
|
+
allowedStudentConfig: false;
|
|
11
|
+
showGraphLabels: false;
|
|
11
12
|
};
|
|
12
13
|
};
|
|
13
14
|
export default _default;
|
|
@@ -1,15 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { PieEnvironment } from '@pie-element/shared-types';
|
|
2
|
+
import type { FractionModelAnswers, FractionModelConfiguration, FractionModelModel, FractionModelResponse, FractionModelSession } from '../types.js';
|
|
3
|
+
/** Whether a response matches the correct response */
|
|
4
|
+
export type FractionModelCorrectness = 'correct' | 'incorrect';
|
|
5
|
+
/** What `outcome()` resolves: empty for an unanswered session, no score outside evaluate mode */
|
|
6
|
+
export type FractionModelOutcome = {
|
|
7
|
+
score: number;
|
|
8
|
+
empty: true;
|
|
9
|
+
} | {
|
|
10
|
+
score: undefined;
|
|
11
|
+
completed: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
score: number;
|
|
14
|
+
};
|
|
15
|
+
/** Messages `validate()` returns, keyed by the model property they concern */
|
|
16
|
+
export type FractionModelValidationErrors = {
|
|
17
|
+
correctResponse?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const getResponseCorrectness: (model: Partial<FractionModelModel>, answers: Partial<FractionModelAnswers>, _env?: Partial<PieEnvironment>) => FractionModelCorrectness;
|
|
20
|
+
export declare const outcome: (model: FractionModelModel, session: FractionModelSession | null | undefined, env: PieEnvironment) => Promise<FractionModelOutcome>;
|
|
21
|
+
export declare const createDefaultModel: (model?: Partial<FractionModelModel>) => {
|
|
22
|
+
correctResponse: FractionModelResponse[];
|
|
5
23
|
title: string;
|
|
6
24
|
prompt: string;
|
|
7
|
-
modelTypeSelected:
|
|
25
|
+
modelTypeSelected: "bar" | "pie";
|
|
8
26
|
maxModelSelected: number;
|
|
9
27
|
partsPerModel: number;
|
|
10
28
|
allowedStudentConfig: boolean;
|
|
11
29
|
showGraphLabels: boolean;
|
|
30
|
+
language?: string | undefined;
|
|
31
|
+
spellCheckEnabled?: boolean | undefined;
|
|
32
|
+
toolbarEditorPosition?: "bottom" | "top" | undefined;
|
|
33
|
+
extraCSSRules?: import("@pie-element/shared-types").ExtraCSSRules | undefined;
|
|
34
|
+
id?: string | undefined;
|
|
35
|
+
element?: string | undefined;
|
|
36
|
+
accessibilityCatalogs?: import("@pie-element/shared-types").AccessibilityCatalog[] | undefined;
|
|
37
|
+
};
|
|
38
|
+
/** A model with the controller defaults applied */
|
|
39
|
+
export type FractionModelNormalizedModel = ReturnType<typeof createDefaultModel>;
|
|
40
|
+
/** What `model()` resolves */
|
|
41
|
+
export type FractionModelViewModel = FractionModelNormalizedModel & {
|
|
42
|
+
env: PieEnvironment;
|
|
43
|
+
/** Whether the student can no longer change the response */
|
|
44
|
+
view: boolean;
|
|
45
|
+
/** Set in evaluate mode */
|
|
46
|
+
correctness?: {
|
|
47
|
+
/** The score as a percentage, e.g. `100%` */
|
|
48
|
+
score: string;
|
|
49
|
+
correctness: FractionModelCorrectness | 'unanswered' | undefined;
|
|
50
|
+
};
|
|
12
51
|
};
|
|
13
|
-
export declare const model: (question:
|
|
14
|
-
export declare const createCorrectResponseSession: (model:
|
|
15
|
-
export declare const validate: (model?:
|
|
52
|
+
export declare const model: (question: FractionModelModel, session: FractionModelSession | null | undefined, env: PieEnvironment) => Promise<FractionModelViewModel>;
|
|
53
|
+
export declare const createCorrectResponseSession: (model: FractionModelModel, env: PieEnvironment) => Promise<FractionModelSession | null>;
|
|
54
|
+
export declare const validate: (model?: Partial<FractionModelModel>, _config?: FractionModelConfiguration) => FractionModelValidationErrors;
|
package/dist/controller/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/fraction-model@7.0.4/dist/schemas/configuration.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"baseInputConfiguration": {
|
|
7
|
+
"$ref": "#/definitions/EditableHtmlConfigureProp",
|
|
8
|
+
"description": "Base editable html input configuration regarding plugins that are enabled/disabled E.g. audio, video, image"
|
|
9
|
+
},
|
|
10
|
+
"title": {
|
|
11
|
+
"$ref": "#/definitions/FractionModelFieldConfiguration",
|
|
12
|
+
"description": "Configuration for html input configuration regarding plugins that are enabled/disabled on item title E.g. audio, video, image"
|
|
13
|
+
},
|
|
14
|
+
"prompt": {
|
|
15
|
+
"$ref": "#/definitions/FractionModelFieldConfiguration",
|
|
16
|
+
"description": "Configuration for html input configuration regarding plugins that are enabled/disabled on question stem E.g. audio, video, image"
|
|
17
|
+
},
|
|
18
|
+
"modelOptions": {
|
|
19
|
+
"$ref": "#/definitions/FractionModelOptionsConfiguration",
|
|
20
|
+
"description": "Configuration for model options selection like Parts per model, max no. of models etc"
|
|
21
|
+
},
|
|
22
|
+
"mathMlOptions": {
|
|
23
|
+
"$ref": "#/definitions/ConfigureMathMLProp",
|
|
24
|
+
"description": "Configuration for editable-html"
|
|
25
|
+
},
|
|
26
|
+
"language": {
|
|
27
|
+
"$ref": "#/definitions/ConfigurePropWithEnabled",
|
|
28
|
+
"description": "Language configuration"
|
|
29
|
+
},
|
|
30
|
+
"languageChoices": {
|
|
31
|
+
"$ref": "#/definitions/ConfigureLanguageOptions",
|
|
32
|
+
"description": "Language choices configuration Only available if language is enabled"
|
|
33
|
+
},
|
|
34
|
+
"contentDimensions": {
|
|
35
|
+
"$ref": "#/definitions/ContentDimensions",
|
|
36
|
+
"description": "Dimensions of the authoring container"
|
|
37
|
+
},
|
|
38
|
+
"spellCheck": {
|
|
39
|
+
"$ref": "#/definitions/ConfigurePropWithEnabled",
|
|
40
|
+
"description": "Not read by this element: the model's `spellCheckEnabled` sets spellcheck"
|
|
41
|
+
},
|
|
42
|
+
"settingsPanelDisabled": {
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"description": "Not read by this element: the settings panel is always hidden"
|
|
45
|
+
},
|
|
46
|
+
"feedback": {
|
|
47
|
+
"$ref": "#/definitions/ConfigureProp",
|
|
48
|
+
"description": "Not read by this element: it has no feedback"
|
|
49
|
+
},
|
|
50
|
+
"showPrompt": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"description": "Not read by this element: the prompt is always shown"
|
|
53
|
+
},
|
|
54
|
+
"promptLabel": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Not read by this element: `prompt.label` labels the prompt"
|
|
57
|
+
},
|
|
58
|
+
"settingsPartialScoring": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"description": "Not read by this element: it has no partial scoring"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"description": "Config Object for `@pie-element/fraction-model`",
|
|
64
|
+
"definitions": {
|
|
65
|
+
"EditableHtmlConfigureProp": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"properties": {
|
|
68
|
+
"math": {
|
|
69
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
70
|
+
},
|
|
71
|
+
"audio": {
|
|
72
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
73
|
+
},
|
|
74
|
+
"video": {
|
|
75
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
76
|
+
},
|
|
77
|
+
"image": {
|
|
78
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
79
|
+
},
|
|
80
|
+
"customPlugins": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": {
|
|
83
|
+
"$ref": "#/definitions/CustomPlugin"
|
|
84
|
+
},
|
|
85
|
+
"description": "An array of objects that determine custom plugins. A custom plugin is an object which determines how the button will look like (icon) and the event name that will be triggered when the button gets pressed (event)."
|
|
86
|
+
},
|
|
87
|
+
"blockquote": {
|
|
88
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
89
|
+
},
|
|
90
|
+
"h3": {
|
|
91
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
92
|
+
},
|
|
93
|
+
"characters": {
|
|
94
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
95
|
+
},
|
|
96
|
+
"bold": {
|
|
97
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
98
|
+
},
|
|
99
|
+
"html": {
|
|
100
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
101
|
+
},
|
|
102
|
+
"italic": {
|
|
103
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
104
|
+
},
|
|
105
|
+
"ol_list": {
|
|
106
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
107
|
+
},
|
|
108
|
+
"redo": {
|
|
109
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
110
|
+
},
|
|
111
|
+
"strikethrough": {
|
|
112
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
113
|
+
},
|
|
114
|
+
"sub": {
|
|
115
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
116
|
+
},
|
|
117
|
+
"sup": {
|
|
118
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
119
|
+
},
|
|
120
|
+
"table": {
|
|
121
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
122
|
+
},
|
|
123
|
+
"ul_list": {
|
|
124
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
125
|
+
},
|
|
126
|
+
"underline": {
|
|
127
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
128
|
+
},
|
|
129
|
+
"undo": {
|
|
130
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
131
|
+
},
|
|
132
|
+
"textAlign": {
|
|
133
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
134
|
+
},
|
|
135
|
+
"showParagraphs": {
|
|
136
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
137
|
+
},
|
|
138
|
+
"separateParagraphs": {
|
|
139
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
140
|
+
},
|
|
141
|
+
"pasteFormatting": {
|
|
142
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
143
|
+
},
|
|
144
|
+
"superscript": {
|
|
145
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
146
|
+
},
|
|
147
|
+
"subscript": {
|
|
148
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
149
|
+
},
|
|
150
|
+
"languageCharacters": {
|
|
151
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
152
|
+
},
|
|
153
|
+
"responseArea": {
|
|
154
|
+
"$ref": "#/definitions/EditableHtmlButtonConfigure"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"description": "Toolbar plugins of an editable-html field, keyed by plugin name."
|
|
158
|
+
},
|
|
159
|
+
"EditableHtmlButtonConfigure": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"properties": {
|
|
162
|
+
"disabled": {
|
|
163
|
+
"type": "boolean",
|
|
164
|
+
"description": "Indicates if the plugin is disabled or not"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"CustomPlugin": {
|
|
169
|
+
"type": "object",
|
|
170
|
+
"properties": {
|
|
171
|
+
"event": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"description": "The name of the custom event. It needs to be valid (only letters, numbers and \"_\" can be used). The event is emitted with the \"PIE-\" prefix."
|
|
174
|
+
},
|
|
175
|
+
"iconAlt": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"description": "The alt for the custom button icon"
|
|
178
|
+
},
|
|
179
|
+
"iconType": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"description": "The icon type. Currently, only \"SVG\" is supported."
|
|
182
|
+
},
|
|
183
|
+
"icon": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"description": "The icon string. Currently, only SVG is supported, so it needs to be a valid svg."
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"required": [
|
|
189
|
+
"event",
|
|
190
|
+
"iconAlt",
|
|
191
|
+
"iconType",
|
|
192
|
+
"icon"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"FractionModelFieldConfiguration": {
|
|
196
|
+
"type": "object",
|
|
197
|
+
"properties": {
|
|
198
|
+
"settings": {
|
|
199
|
+
"type": "boolean",
|
|
200
|
+
"description": "Not read by this element: it has no settings panel"
|
|
201
|
+
},
|
|
202
|
+
"label": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"description": "Indicates the label of the field"
|
|
205
|
+
},
|
|
206
|
+
"enabled": {
|
|
207
|
+
"type": "boolean",
|
|
208
|
+
"description": "Not read by this element: the field is always shown"
|
|
209
|
+
},
|
|
210
|
+
"inputConfiguration": {
|
|
211
|
+
"$ref": "#/definitions/EditableHtmlConfigureProp",
|
|
212
|
+
"description": "Configuration for editable-html"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"description": "Configuration for an editable field of the author"
|
|
216
|
+
},
|
|
217
|
+
"FractionModelOptionsConfiguration": {
|
|
218
|
+
"type": "object",
|
|
219
|
+
"properties": {
|
|
220
|
+
"maxOfModel": {
|
|
221
|
+
"$ref": "#/definitions/FractionModelNumberOption",
|
|
222
|
+
"description": "Indicates the max number of models for item"
|
|
223
|
+
},
|
|
224
|
+
"partsPerModel": {
|
|
225
|
+
"$ref": "#/definitions/FractionModelNumberOption",
|
|
226
|
+
"description": "Indicates the parts per model for item"
|
|
227
|
+
},
|
|
228
|
+
"modelTypeChoices": {
|
|
229
|
+
"type": "array",
|
|
230
|
+
"items": {
|
|
231
|
+
"$ref": "#/definitions/FractionModelTypeChoice"
|
|
232
|
+
},
|
|
233
|
+
"description": "Indicates the model types of item"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"description": "Configuration for model options selection like Parts per model, max no. of models etc"
|
|
237
|
+
},
|
|
238
|
+
"FractionModelNumberOption": {
|
|
239
|
+
"type": "object",
|
|
240
|
+
"properties": {
|
|
241
|
+
"min": {
|
|
242
|
+
"type": "number",
|
|
243
|
+
"description": "Indicates the min value for number model"
|
|
244
|
+
},
|
|
245
|
+
"max": {
|
|
246
|
+
"type": "number",
|
|
247
|
+
"description": "Indicates the max value for number model"
|
|
248
|
+
},
|
|
249
|
+
"default": {
|
|
250
|
+
"type": "number",
|
|
251
|
+
"description": "Not read by this element: the controller defaults set the starting value"
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"description": "Bounds of a number the author sets"
|
|
255
|
+
},
|
|
256
|
+
"FractionModelTypeChoice": {
|
|
257
|
+
"type": "object",
|
|
258
|
+
"properties": {
|
|
259
|
+
"value": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"enum": [
|
|
262
|
+
"bar",
|
|
263
|
+
"pie"
|
|
264
|
+
],
|
|
265
|
+
"description": "Indicates the value for model choice"
|
|
266
|
+
},
|
|
267
|
+
"label": {
|
|
268
|
+
"type": "string",
|
|
269
|
+
"description": "Indicates the label for model choice"
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"required": [
|
|
273
|
+
"value",
|
|
274
|
+
"label"
|
|
275
|
+
],
|
|
276
|
+
"description": "A model type the author can choose"
|
|
277
|
+
},
|
|
278
|
+
"ConfigureMathMLProp": {
|
|
279
|
+
"type": "object",
|
|
280
|
+
"properties": {
|
|
281
|
+
"mmlOutput": {
|
|
282
|
+
"type": "boolean",
|
|
283
|
+
"description": "Indicates if model should have mathML output instead of latex"
|
|
284
|
+
},
|
|
285
|
+
"mmlEditing": {
|
|
286
|
+
"type": "boolean",
|
|
287
|
+
"description": "Indicates if mathML that's already in model should be editable"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"ConfigurePropWithEnabled": {
|
|
292
|
+
"type": "object",
|
|
293
|
+
"properties": {
|
|
294
|
+
"settings": {
|
|
295
|
+
"type": "boolean",
|
|
296
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel"
|
|
297
|
+
},
|
|
298
|
+
"label": {
|
|
299
|
+
"type": "string",
|
|
300
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel"
|
|
301
|
+
},
|
|
302
|
+
"enabled": {
|
|
303
|
+
"type": "boolean",
|
|
304
|
+
"description": "Indicates the value of the item if it affects config-ui (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)"
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"ConfigureLanguageOptions": {
|
|
309
|
+
"type": "object",
|
|
310
|
+
"properties": {
|
|
311
|
+
"label": {
|
|
312
|
+
"type": "string"
|
|
313
|
+
},
|
|
314
|
+
"options": {
|
|
315
|
+
"type": "array",
|
|
316
|
+
"items": {
|
|
317
|
+
"$ref": "#/definitions/ConfigureLanguageOptionsProp"
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"required": [
|
|
322
|
+
"label",
|
|
323
|
+
"options"
|
|
324
|
+
]
|
|
325
|
+
},
|
|
326
|
+
"ConfigureLanguageOptionsProp": {
|
|
327
|
+
"type": "object",
|
|
328
|
+
"properties": {
|
|
329
|
+
"value": {
|
|
330
|
+
"type": "string",
|
|
331
|
+
"description": "Value of the language option"
|
|
332
|
+
},
|
|
333
|
+
"label": {
|
|
334
|
+
"type": "string",
|
|
335
|
+
"description": "Label of the language option"
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"required": [
|
|
339
|
+
"value",
|
|
340
|
+
"label"
|
|
341
|
+
]
|
|
342
|
+
},
|
|
343
|
+
"ContentDimensions": {
|
|
344
|
+
"type": "object",
|
|
345
|
+
"properties": {
|
|
346
|
+
"maxHeight": {
|
|
347
|
+
"type": [
|
|
348
|
+
"string",
|
|
349
|
+
"number"
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
"maxWidth": {
|
|
353
|
+
"type": [
|
|
354
|
+
"string",
|
|
355
|
+
"number"
|
|
356
|
+
]
|
|
357
|
+
},
|
|
358
|
+
"minHeight": {
|
|
359
|
+
"type": [
|
|
360
|
+
"string",
|
|
361
|
+
"number"
|
|
362
|
+
]
|
|
363
|
+
},
|
|
364
|
+
"minWidth": {
|
|
365
|
+
"type": [
|
|
366
|
+
"string",
|
|
367
|
+
"number"
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
"description": "Indicates the dimensions configuration for the authoring container. Note: Some items have a default minimum width because of their content, but if a lower minWidth is provided, it will be used."
|
|
372
|
+
},
|
|
373
|
+
"ConfigureProp": {
|
|
374
|
+
"type": "object",
|
|
375
|
+
"properties": {
|
|
376
|
+
"settings": {
|
|
377
|
+
"type": "boolean",
|
|
378
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel"
|
|
379
|
+
},
|
|
380
|
+
"label": {
|
|
381
|
+
"type": "string",
|
|
382
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel"
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
"description": "Building blocks of an element's authoring configuration: the object a host passes to the `<tag>-config` custom element to decide which settings the author sees and how editors behave.\n\nEach element declares its own `<Name>Configuration` interface from these, and its JSON Schema is generated from that interface. Descriptions are carried over from the legacy `pie-elements` config schemas, so they appear in the generated schemas unchanged."
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"additionalProperties": false
|
|
389
|
+
}
|