@pie-element/inline-dropdown 10.2.2-beta.5 → 10.2.2-beta.6

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 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_lodashEs","require","_controllerUtils","_defaults","_interopRequireDefault","_utils","getFeedback","correct","normalize","question","defaults","exports","model","session","env","updateSession","normalizedQuestion","value","choices","reduce","obj","area","key","map","choice","feedback","mode","allCorrectResponses","getAllCorrectResponses","respAreaLength","Object","keys","length","correctResponses","i","result","answer","correctChoice","isCorrect","lockChoiceOrder","lockChoices","shuffledValues","us","part","id","element","update","Promise","resolve","storedValues","getShuffledChoices","Array","isArray","isEmpty","catch","e","console","error","teacherInstructions","rationale","choicesWillNullRationales","acc","currentValue","role","rationaleEnabled","teacherInstructionsEnabled","choiceRationaleEnabled","out","disabled","prompt","promptEnabled","displayType","markup","responseCorrect","getScore","undefined","language","extraCSSRules","config","maxScore","correctCount","total","str","toFixed","parseFloat","getLogTrace","traceLog","responseAreaKeys","totalAreas","push","selectedAreas","entries","filter","val","trim","forEach","areaKey","studentSelection","correctOptions","parseInt","opt","join","partialScoringEnabled","partialScoring","enabled","score","outcome","empty","Math","floor","createCorrectResponseSession","correctChoices","c","getInnerText","html","replaceAll","getContent","replace","validate","maxResponseAreas","maxResponseAreaChoices","errors","field","required","nbOfResponseAreas","match","responseAreasError","choiceKey","responseAreaChoicesError"],"sources":["../src/index.js"],"sourcesContent":["import { isEmpty, map, reduce } from 'lodash-es';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';\nimport defaults from './defaults';\n\nimport { getAllCorrectResponses } from './utils';\n\nconst getFeedback = (correct) => {\n if (correct) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport async function model(question, session, env, updateSession) {\n const normalizedQuestion = normalize(question);\n const { value = {} } = session || {};\n let choices = reduce(\n normalizedQuestion.choices,\n (obj, area, key) => {\n obj[key] = map(area, (choice) => choice);\n\n return obj;\n },\n {},\n );\n\n let feedback = {};\n\n if (env.mode === 'evaluate') {\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n const respAreaLength = Object.keys(allCorrectResponses).length;\n let correctResponses = 0;\n\n for (let i = 0; i < respAreaLength; i++) {\n const result = reduce(\n allCorrectResponses,\n (obj, choices, key) => {\n const answer = (value && value[key]) || '';\n const correctChoice = choices[i] || '';\n const isCorrect = answer && correctChoice && correctChoice === answer;\n\n obj.feedback[key] = getFeedback(isCorrect);\n\n if (isCorrect) {\n obj.correctResponses += 1;\n }\n\n return obj;\n },\n { correctResponses: 0, feedback: {} },\n );\n\n if (result.correctResponses >= correctResponses) {\n correctResponses = result.correctResponses;\n feedback = result.feedback;\n }\n\n if (result.correctResponses === respAreaLength) {\n break;\n }\n }\n }\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n const shuffledValues = {};\n const keys = Object.keys(choices);\n\n const us = (part) => (id, element, update) => {\n return new Promise((resolve) => {\n shuffledValues[part] = update.shuffledValues;\n resolve();\n });\n };\n\n let i;\n\n for (i = 0; i < keys.length; i++) {\n const key = keys[i];\n const storedValues = session?.shuffledValues?.[key];\n\n choices[key] = await getShuffledChoices(\n choices[key],\n // the shuffledValues structure was updated to an object like { choice_key: [] }\n // and we need to override shuffledValues if it's not an array\n { shuffledValues: Array.isArray(storedValues) ? storedValues : [] },\n us(key),\n 'value',\n );\n }\n\n if (!isEmpty(shuffledValues)) {\n if (session && updateSession && typeof updateSession === 'function') {\n updateSession(session.id, session.element, {\n shuffledValues,\n }).catch((e) => {\n // eslint-disable-next-line no-console\n console.error('update session failed', e);\n });\n }\n }\n }\n\n let teacherInstructions = null;\n let rationale = null;\n\n const choicesWillNullRationales = (Object.keys(choices) || []).reduce((acc, currentValue) => {\n acc[currentValue] = (choices[currentValue] || []).map((choice) => ({\n ...choice,\n rationale: null,\n }));\n\n return acc;\n }, {});\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n\n choices = normalizedQuestion.choiceRationaleEnabled ? normalizedQuestion.choices : choicesWillNullRationales;\n } else {\n rationale = null;\n teacherInstructions = null;\n choices = choicesWillNullRationales;\n }\n\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n displayType: normalizedQuestion.displayType,\n markup: normalizedQuestion.markup,\n choices,\n feedback,\n\n responseCorrect: env.mode === 'evaluate' ? getScore(normalizedQuestion, session) === 1 : undefined,\n rationale,\n teacherInstructions,\n language: normalizedQuestion.language,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n };\n\n return out;\n}\n\nexport const getScore = (config, session) => {\n const { value = {} } = session || {};\n const maxScore = config && config.choices ? Object.keys(config.choices).length : 0;\n const allCorrectResponses = getAllCorrectResponses(config);\n let correctCount = 0;\n\n for (let i = 0; i < maxScore; i++) {\n const result = reduce(\n allCorrectResponses,\n (total, choices, key) => {\n const answer = (value && value[key]) || '';\n const correctChoice = choices[i] || '';\n\n if (correctChoice && answer && correctChoice === answer) {\n return total;\n }\n\n return total - 1;\n },\n maxScore,\n );\n\n if (result > correctCount) {\n correctCount = result;\n }\n\n if (result === maxScore) {\n break;\n }\n }\n\n const str = (correctCount / maxScore).toFixed(2);\n\n return parseFloat(str);\n};\n\n/**\n * Generates detailed trace log for scoring evaluation\n * @param {Object} model - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array} traceLog - array of trace messages\n */\nexport const getLogTrace = (model, session, env) => {\n const traceLog = [];\n const { value = {} } = session || {};\n const allCorrectResponses = getAllCorrectResponses(model);\n const responseAreaKeys = Object.keys(allCorrectResponses);\n const totalAreas = responseAreaKeys.length;\n \n traceLog.push(`${totalAreas} dropdown response area(s) defined in this question.`);\n \n if (value && Object.keys(value).length > 0) {\n const selectedAreas = Object.entries(value).filter(([key, val]) => val && val.trim()).length;\n traceLog.push(`Student selected options in ${selectedAreas} out of ${totalAreas} dropdown(s).`);\n \n responseAreaKeys.forEach((areaKey) => {\n const studentSelection = (value && value[areaKey]) || '';\n const correctOptions = allCorrectResponses[areaKey] || [];\n \n if (studentSelection.trim()) {\n traceLog.push(`Dropdown ${parseInt(areaKey) + 1}: student selected '${studentSelection}' (correct options: [${correctOptions.map(opt => `'${opt}'`).join(', ')}]).`);\n } else {\n traceLog.push(`Dropdown ${parseInt(areaKey) + 1}: no selection made (correct options: [${correctOptions.map(opt => `'${opt}'`).join(', ')}]).`);\n }\n });\n } else {\n traceLog.push('Student did not make any selections in the dropdowns.');\n }\n\n const partialScoringEnabled = partialScoring.enabled(model, env);\n traceLog.push(\n `Scoring method: ${\n partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring'\n }.`\n );\n\n const score = getScore(model, session);\n traceLog.push(`Final score: ${score}.`);\n\n return traceLog;\n}\n\n/**\n *\n * The score is partial by default for checkbox mode, allOrNothing for radio mode.\n * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =\n * false. the value in `env` will override the value in `model`.\n * @param {Object} model - the main model\n * @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)\n * @param {*} session\n * @param {Object} env\n * @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides\n * `model.partialScoring`.\n */\nexport function outcome(model, session, env = {}) {\n return new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n traceLog: ['Student did not make any selections in the dropdowns. Score is 0.'] \n });\n } else {\n const traceLog = getLogTrace(model, session, env);\n const score = getScore(model, session);\n const partialScoringEnabled = partialScoring.enabled(model, env);\n\n resolve({\n score: partialScoringEnabled ? score : Math.floor(score),\n empty: false,\n traceLog\n });\n }\n });\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { choices } = question;\n const value = {};\n\n if (choices) {\n Object.keys(choices).forEach((key, i) => {\n const correctChoices = choices[key] && choices[key].filter((c) => c.correct);\n\n value[i] = correctChoices && correctChoices[0].value;\n });\n }\n\n resolve({\n id: '1',\n value,\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { markup, choices } = model;\n const { maxResponseAreas, maxResponseAreaChoices } = config;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const nbOfResponseAreas = ((markup || '').match(/\\{\\{(\\d+)\\}\\}/g) || []).length;\n\n if (nbOfResponseAreas > maxResponseAreas) {\n errors.responseAreasError = `No more than ${maxResponseAreas} response areas should be defined.`;\n } else if (nbOfResponseAreas < 1) {\n errors.responseAreasError = 'There should be defined at least 1 response area.';\n }\n\n (Object.keys(choices) || []).forEach((choiceKey) => {\n if (choices[choiceKey] && choices[choiceKey].length > maxResponseAreaChoices) {\n errors.responseAreaChoicesError = `No more than ${maxResponseAreaChoices} choices per response area should be defined.`;\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,MAAMK,WAAW,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,GAAAA,QAAA","ignoreList":[]}
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getAllCorrectResponses = void 0;
7
- var _lodashEs = require("lodash-es");
8
- const getAllCorrectResponses = ({
9
- choices,
10
- alternateResponse
11
- }) => {
12
- alternateResponse = alternateResponse || {};
13
- const correctAnswers = {};
14
- (0, _lodashEs.forEach)(choices, (respArea, key) => {
15
- if (!correctAnswers[key]) {
16
- correctAnswers[key] = [];
17
- }
18
- if (respArea) {
19
- respArea.forEach(choice => {
20
- if (choice.correct) {
21
- correctAnswers[key].push(choice.value);
22
- if (alternateResponse[key]) {
23
- correctAnswers[key] = [...correctAnswers[key], ...alternateResponse[key]];
24
- }
25
- }
26
- });
27
- }
28
- });
29
- return correctAnswers;
30
- };
31
- exports.getAllCorrectResponses = getAllCorrectResponses;
32
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","names":["_lodashEs","require","getAllCorrectResponses","choices","alternateResponse","correctAnswers","forEach","respArea","key","choice","correct","push","value","exports"],"sources":["../src/utils.js"],"sourcesContent":["import { forEach } from 'lodash-es';\n\nexport const getAllCorrectResponses = ({ choices, alternateResponse }) => {\n alternateResponse = alternateResponse || {};\n const correctAnswers = {};\n\n forEach(choices, (respArea, key) => {\n if (!correctAnswers[key]) {\n correctAnswers[key] = [];\n }\n\n if (respArea) {\n respArea.forEach((choice) => {\n if (choice.correct) {\n correctAnswers[key].push(choice.value);\n\n if (alternateResponse[key]) {\n correctAnswers[key] = [...correctAnswers[key], ...alternateResponse[key]];\n }\n }\n });\n }\n });\n\n return correctAnswers;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEO,MAAMC,sBAAsB,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAAkB,CAAC,KAAK;EACxEA,iBAAiB,GAAGA,iBAAiB,IAAI,CAAC,CAAC;EAC3C,MAAMC,cAAc,GAAG,CAAC,CAAC;EAEzB,IAAAC,iBAAO,EAACH,OAAO,EAAE,CAACI,QAAQ,EAAEC,GAAG,KAAK;IAClC,IAAI,CAACH,cAAc,CAACG,GAAG,CAAC,EAAE;MACxBH,cAAc,CAACG,GAAG,CAAC,GAAG,EAAE;IAC1B;IAEA,IAAID,QAAQ,EAAE;MACZA,QAAQ,CAACD,OAAO,CAAEG,MAAM,IAAK;QAC3B,IAAIA,MAAM,CAACC,OAAO,EAAE;UAClBL,cAAc,CAACG,GAAG,CAAC,CAACG,IAAI,CAACF,MAAM,CAACG,KAAK,CAAC;UAEtC,IAAIR,iBAAiB,CAACI,GAAG,CAAC,EAAE;YAC1BH,cAAc,CAACG,GAAG,CAAC,GAAG,CAAC,GAAGH,cAAc,CAACG,GAAG,CAAC,EAAE,GAAGJ,iBAAiB,CAACI,GAAG,CAAC,CAAC;UAC3E;QACF;MACF,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;EAEF,OAAOH,cAAc;AACvB,CAAC;AAACQ,OAAA,CAAAX,sBAAA,GAAAA,sBAAA","ignoreList":[]}
package/lib/index.js DELETED
@@ -1,86 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _client = require("react-dom/client");
11
- var _piePlayerEvents = require("@pie-framework/pie-player-events");
12
- var _mathRendering = require("@pie-lib/math-rendering");
13
- var _inlineDropdown = _interopRequireDefault(require("./inline-dropdown"));
14
- class RootInlineDropdown extends HTMLElement {
15
- constructor() {
16
- super();
17
- (0, _defineProperty2.default)(this, "_render", () => {
18
- if (this._model && this._session) {
19
- let elem = /*#__PURE__*/_react.default.createElement(_inlineDropdown.default, {
20
- model: this._model,
21
- prompt: this._model.prompt,
22
- rationale: this._model.rationale,
23
- teacherInstructions: this._model.teacherInstructions,
24
- disabled: this._model.disabled,
25
- displayType: this._model.displayType,
26
- markup: this._model.markup,
27
- mode: this._model.mode,
28
- choices: this._model.choices,
29
- value: this._session.value,
30
- feedback: this._model.feedback,
31
- language: this._model.language,
32
- onChange: this.changeSession
33
- });
34
- this.setLangAttribute();
35
- if (!this._root) {
36
- this._root = (0, _client.createRoot)(this);
37
- }
38
- this._root.render(elem);
39
- queueMicrotask(() => {
40
- (0, _mathRendering.renderMath)(this);
41
- });
42
- }
43
- });
44
- (0, _defineProperty2.default)(this, "dispatchChangedEvent", () => {
45
- this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(this.tagName.toLowerCase(), this.session && !!this.session.value));
46
- });
47
- (0, _defineProperty2.default)(this, "changeSession", value => {
48
- this.session.value = value;
49
- this.dispatchChangedEvent();
50
- this._render();
51
- });
52
- this._model = null;
53
- this._session = null;
54
- this._root = null;
55
- }
56
- set model(m) {
57
- this._model = m;
58
- this.dispatchEvent(new _piePlayerEvents.ModelSetEvent(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model));
59
- this._render();
60
- }
61
- set session(s) {
62
- this._session = s;
63
- this._render();
64
- }
65
- get session() {
66
- return this._session;
67
- }
68
- setLangAttribute() {
69
- const language = this._model && typeof this._model.language ? this._model.language : '';
70
- const lang = language ? language.slice(0, 2) : 'en';
71
- this.setAttribute('lang', lang);
72
- }
73
- connectedCallback() {
74
- this.setAttribute('aria-label', 'Inline Dropdown Question');
75
- this.setAttribute('role', 'region');
76
- this._render();
77
- }
78
- disconnectedCallback() {
79
- if (this._root) {
80
- this._root.unmount();
81
- this._root = null;
82
- }
83
- }
84
- }
85
- exports.default = RootInlineDropdown;
86
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_client","_piePlayerEvents","_mathRendering","_inlineDropdown","RootInlineDropdown","HTMLElement","constructor","_defineProperty2","default","_model","_session","elem","React","createElement","InlineDropdown","model","prompt","rationale","teacherInstructions","disabled","displayType","markup","mode","choices","value","feedback","language","onChange","changeSession","setLangAttribute","_root","createRoot","render","queueMicrotask","renderMath","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","session","dispatchChangedEvent","_render","m","ModelSetEvent","s","lang","slice","setAttribute","connectedCallback","disconnectedCallback","unmount","exports"],"sources":["../src/index.js"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport InlineDropdown from './inline-dropdown';\n\nexport default class RootInlineDropdown extends HTMLElement {\n constructor() {\n super();\n this._model = null;\n this._session = null;\n this._root = null;\n }\n set model(m) {\n this._model = m;\n this.dispatchEvent(\n new ModelSetEvent(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model),\n );\n\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n setLangAttribute() {\n const language = this._model && typeof this._model.language ? this._model.language : '';\n const lang = language ? language.slice(0, 2) : 'en';\n this.setAttribute('lang', lang);\n }\n\n _render = () => {\n if (this._model && this._session) {\n let elem = React.createElement(InlineDropdown, {\n model: this._model,\n prompt: this._model.prompt,\n rationale: this._model.rationale,\n teacherInstructions: this._model.teacherInstructions,\n disabled: this._model.disabled,\n displayType: this._model.displayType,\n markup: this._model.markup,\n mode: this._model.mode,\n choices: this._model.choices,\n value: this._session.value,\n feedback: this._model.feedback,\n language: this._model.language,\n onChange: this.changeSession,\n });\n\n this.setLangAttribute();\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(elem);\n queueMicrotask(() => {\n renderMath(this);\n });\n }\n };\n\n dispatchChangedEvent = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.session && !!this.session.value));\n };\n\n changeSession = (value) => {\n this.session.value = value;\n this.dispatchChangedEvent();\n this._render();\n };\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Inline Dropdown Question');\n this.setAttribute('role', 'region');\n\n this._render();\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEe,MAAMK,kBAAkB,SAASC,WAAW,CAAC;EAC1DC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA,mBA6BA,MAAM;MACd,IAAI,IAAI,CAACC,MAAM,IAAI,IAAI,CAACC,QAAQ,EAAE;QAChC,IAAIC,IAAI,gBAAGC,cAAK,CAACC,aAAa,CAACC,uBAAc,EAAE;UAC7CC,KAAK,EAAE,IAAI,CAACN,MAAM;UAClBO,MAAM,EAAE,IAAI,CAACP,MAAM,CAACO,MAAM;UAC1BC,SAAS,EAAE,IAAI,CAACR,MAAM,CAACQ,SAAS;UAChCC,mBAAmB,EAAE,IAAI,CAACT,MAAM,CAACS,mBAAmB;UACpDC,QAAQ,EAAE,IAAI,CAACV,MAAM,CAACU,QAAQ;UAC9BC,WAAW,EAAE,IAAI,CAACX,MAAM,CAACW,WAAW;UACpCC,MAAM,EAAE,IAAI,CAACZ,MAAM,CAACY,MAAM;UAC1BC,IAAI,EAAE,IAAI,CAACb,MAAM,CAACa,IAAI;UACtBC,OAAO,EAAE,IAAI,CAACd,MAAM,CAACc,OAAO;UAC5BC,KAAK,EAAE,IAAI,CAACd,QAAQ,CAACc,KAAK;UAC1BC,QAAQ,EAAE,IAAI,CAAChB,MAAM,CAACgB,QAAQ;UAC9BC,QAAQ,EAAE,IAAI,CAACjB,MAA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AI,CAACgC,OAAO,CAAC,CAAC;EAChB;EAEA,IAAIF,OAAOA,CAACK,CAAC,EAAE;IACb,IAAI,CAAClC,QAAQ,GAAGkC,CAAC;IACjB,IAAI,CAACH,OAAO,CAAC,CAAC;EAChB;EAEA,IAAIF,OAAOA,CAAA,EAAG;IACZ,OAAO,IAAI,CAAC7B,QAAQ;EACtB;EAEAmB,gBAAgBA,CAAA,EAAG;IACjB,MAAMH,QAAQ,GAAG,IAAI,CAACjB,MAAM,IAAI,OAAO,IAAI,CAACA,MAAM,CAACiB,QAAQ,GAAG,IAAI,CAACjB,MAAM,CAACiB,QAAQ,GAAG,EAAE;IACvF,MAAMmB,IAAI,GAAGnB,QAAQ,GAAGA,QAAQ,CAACoB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI;IACnD,IAAI,CAACC,YAAY,CAAC,MAAM,EAAEF,IAAI,CAAC;EACjC;EA0CAG,iBAAiBA,CAAA,EAAG;IAClB,IAAI,CAACD,YAAY,CAAC,YAAY,EAAE,0BAA0B,CAAC;IAC3D,IAAI,CAACA,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC;IAEnC,IAAI,CAACN,OAAO,CAAC,CAAC;EAChB;EAEAQ,oBAAoBA,CAAA,EAAG;IACrB,IAAI,IAAI,CAACnB,KAAK,EAAE;MACd,IAAI,CAACA,KAAK,CAACoB,OAAO,CAAC,CAAC;MACpB,IAAI,CAACpB,KAAK,GAAG,IAAI;IACnB;EACF;AACF;AAACqB,OAAA,CAAA3C,OAAA,GAAAJ,kBAAA","ignoreList":[]}
@@ -1,176 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.InlineDropdown = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _react = _interopRequireDefault(require("react"));
11
- var _reactDom = _interopRequireDefault(require("react-dom"));
12
- var _propTypes = _interopRequireDefault(require("prop-types"));
13
- var _lodashEs = require("lodash-es");
14
- var _correctAnswerToggle = _interopRequireDefault(require("@pie-lib/correct-answer-toggle"));
15
- var _maskMarkup = require("@pie-lib/mask-markup");
16
- var _renderUi = require("@pie-lib/render-ui");
17
- var _mathRendering = require("@pie-lib/math-rendering");
18
- var _styles = require("@mui/material/styles");
19
- const StyledUiLayout = (0, _styles.styled)(_renderUi.UiLayout)({
20
- color: _renderUi.color.text(),
21
- backgroundColor: _renderUi.color.background()
22
- });
23
- const StyledCollapsible = (0, _styles.styled)(_renderUi.Collapsible)(({
24
- theme
25
- }) => ({
26
- marginBottom: theme.spacing(2)
27
- }));
28
- const ChoiceRationaleWrapper = (0, _styles.styled)('div')(({
29
- theme
30
- }) => ({
31
- '&:not(:last-child)': {
32
- marginBottom: theme.spacing(2)
33
- }
34
- }));
35
- const ChoiceRationale = (0, _styles.styled)('div')({
36
- display: 'flex',
37
- whiteSpace: 'break-spaces'
38
- });
39
- const ChoiceRationaleLabel = (0, _styles.styled)('div')(({
40
- correct
41
- }) => ({
42
- display: 'flex',
43
- ...(correct ? {
44
- color: _renderUi.color.correct()
45
- } : {
46
- color: _renderUi.color.incorrectWithIcon()
47
- })
48
- }));
49
- const SrOnly = (0, _styles.styled)('h2')({
50
- position: 'absolute',
51
- left: '-10000px',
52
- top: 'auto',
53
- width: '1px',
54
- height: '1px',
55
- overflow: 'hidden'
56
- });
57
- class InlineDropdown extends _react.default.Component {
58
- constructor(...args) {
59
- super(...args);
60
- (0, _defineProperty2.default)(this, "state", {
61
- showCorrectAnswer: false
62
- });
63
- (0, _defineProperty2.default)(this, "toggleShowCorrect", () => {
64
- this.setState({
65
- showCorrectAnswer: !this.state.showCorrectAnswer
66
- });
67
- });
68
- }
69
- UNSAFE_componentWillReceiveProps(nextProps) {
70
- if ((0, _lodashEs.isEmpty)(nextProps.feedback)) {
71
- this.setState({
72
- showCorrectAnswer: false
73
- });
74
- }
75
- }
76
- componentDidUpdate() {
77
- // eslint-disable-next-line
78
- const domNode = _reactDom.default.findDOMNode(this);
79
- (0, _mathRendering.renderMath)(domNode);
80
- }
81
- render() {
82
- const {
83
- showCorrectAnswer
84
- } = this.state;
85
- const {
86
- prompt,
87
- mode,
88
- model,
89
- rationale,
90
- teacherInstructions,
91
- choices,
92
- displayType,
93
- language
94
- } = this.props;
95
- const {
96
- extraCSSRules
97
- } = model || {};
98
- const showCorrectAnswerToggle = mode === 'evaluate';
99
- let choiceRationalesHaveText = false;
100
- const showRationale = rationale && ((0, _renderUi.hasText)(rationale) || (0, _renderUi.hasMedia)(rationale));
101
- const showTeacherInstructions = teacherInstructions && ((0, _renderUi.hasText)(teacherInstructions) || (0, _renderUi.hasMedia)(teacherInstructions));
102
- const choiceRationales = (Object.keys(choices) || []).map(key => (choices[key] || []).reduce((acc, currentValue) => {
103
- if (currentValue.rationale && (0, _renderUi.hasText)(currentValue.rationale)) {
104
- choiceRationalesHaveText = true;
105
- acc.push(currentValue);
106
- }
107
- return acc;
108
- }, []));
109
- return /*#__PURE__*/_react.default.createElement(StyledUiLayout, {
110
- extraCSSRules: extraCSSRules,
111
- style: {
112
- display: `${displayType}`
113
- }
114
- }, mode === 'gather' && /*#__PURE__*/_react.default.createElement(SrOnly, null, "Inline Dropdown Question"), showTeacherInstructions && /*#__PURE__*/_react.default.createElement(StyledCollapsible, {
115
- labels: {
116
- hidden: 'Show Teacher Instructions',
117
- visible: 'Hide Teacher Instructions'
118
- }
119
- }, /*#__PURE__*/_react.default.createElement(_renderUi.PreviewPrompt, {
120
- prompt: teacherInstructions
121
- })), prompt && /*#__PURE__*/_react.default.createElement(_renderUi.PreviewPrompt, {
122
- prompt: prompt
123
- }), /*#__PURE__*/_react.default.createElement(_correctAnswerToggle.default, {
124
- show: showCorrectAnswerToggle,
125
- toggled: showCorrectAnswer,
126
- onToggle: this.toggleShowCorrect,
127
- language: language
128
- }), /*#__PURE__*/_react.default.createElement(_maskMarkup.InlineDropdown, (0, _extends2.default)({}, this.props, {
129
- showCorrectAnswer: showCorrectAnswer
130
- })), choiceRationalesHaveText && /*#__PURE__*/_react.default.createElement(StyledCollapsible, {
131
- labels: {
132
- hidden: 'Show Rationale for choices',
133
- visible: 'Hide Rationale for choices'
134
- }
135
- }, choiceRationales.map((choices, index) => /*#__PURE__*/_react.default.createElement(ChoiceRationaleWrapper, {
136
- key: index
137
- }, choices?.length > 0 && choices.map(choice => /*#__PURE__*/_react.default.createElement(ChoiceRationale, {
138
- key: choice.label
139
- }, /*#__PURE__*/_react.default.createElement(ChoiceRationaleLabel, {
140
- correct: choice.correct,
141
- dangerouslySetInnerHTML: {
142
- __html: `${choice.label}: `
143
- }
144
- }), /*#__PURE__*/_react.default.createElement(_renderUi.PreviewPrompt, {
145
- prompt: choice.rationale
146
- })))))), showRationale && /*#__PURE__*/_react.default.createElement(_renderUi.Collapsible, {
147
- labels: {
148
- hidden: 'Show Rationale',
149
- visible: 'Hide Rationale'
150
- }
151
- }, /*#__PURE__*/_react.default.createElement(_renderUi.PreviewPrompt, {
152
- prompt: rationale
153
- })));
154
- }
155
- }
156
- exports.InlineDropdown = InlineDropdown;
157
- (0, _defineProperty2.default)(InlineDropdown, "propTypes", {
158
- prompt: _propTypes.default.string,
159
- disabled: _propTypes.default.bool,
160
- markup: _propTypes.default.string,
161
- mode: _propTypes.default.string,
162
- displayType: _propTypes.default.string,
163
- rationale: _propTypes.default.string,
164
- teacherInstructions: _propTypes.default.string,
165
- model: _propTypes.default.object.isRequired,
166
- choices: _propTypes.default.object,
167
- value: _propTypes.default.object,
168
- feedback: _propTypes.default.object,
169
- onChange: _propTypes.default.func,
170
- language: _propTypes.default.string
171
- });
172
- (0, _defineProperty2.default)(InlineDropdown, "defaultProps", {
173
- value: {}
174
- });
175
- var _default = exports.default = InlineDropdown;
176
- //# sourceMappingURL=inline-dropdown.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-dropdown.js","names":["_react","_interopRequireDefault","require","_reactDom","_propTypes","_lodashEs","_correctAnswerToggle","_maskMarkup","_renderUi","_mathRendering","_styles","StyledUiLayout","styled","UiLayout","color","text","backgroundColor","background","StyledCollapsible","Collapsible","theme","marginBottom","spacing","ChoiceRationaleWrapper","ChoiceRationale","display","whiteSpace","ChoiceRationaleLabel","correct","incorrectWithIcon","SrOnly","position","left","top","width","height","overflow","InlineDropdown","React","Component","constructor","args","_defineProperty2","default","showCorrectAnswer","setState","state","UNSAFE_componentWillReceiveProps","nextProps","isEmpty","feedback","componentDidUpdate","domNode","ReactDOM","findDOMNode","renderMath","render","prompt","mode","model","rationale","teacherInstructions","choices","displayType","language","props","extraCSSRules","showCorrectAnswerToggle","choiceRationalesHaveText","showRationale","hasText","hasMedia","showTeacherInstructions","choiceRationales","Object","keys","map","key","reduce","acc","currentValue","push","createElement","style","labels","hidden","visible","PreviewPrompt","show","toggled","onToggle","toggleShowCorrect","_extends2","index","length","choice","label","dangerouslySetInnerHTML","__html","exports","PropTypes","string","disabled","bool","markup","object","isRequired","value","onChange","func","_default"],"sources":["../src/inline-dropdown.jsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { isEmpty } from 'lodash-es';\nimport CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';\nimport { InlineDropdown as DropDown } from '@pie-lib/mask-markup';\nimport { color, Collapsible, hasText, hasMedia, PreviewPrompt, UiLayout } from '@pie-lib/render-ui';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { styled } from '@mui/material/styles';\n\nconst StyledUiLayout = styled(UiLayout)({\n color: color.text(),\n backgroundColor: color.background(),\n});\n\nconst StyledCollapsible = styled(Collapsible)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nconst ChoiceRationaleWrapper = styled('div')(({ theme }) => ({\n '&:not(:last-child)': {\n marginBottom: theme.spacing(2),\n },\n}));\n\nconst ChoiceRationale = styled('div')({\n display: 'flex',\n whiteSpace: 'break-spaces',\n});\n\nconst ChoiceRationaleLabel = styled('div')(({ correct }) => ({\n display: 'flex',\n ...(correct\n ? {\n color: color.correct(),\n }\n : {\n color: color.incorrectWithIcon(),\n }),\n}));\n\nconst SrOnly = styled('h2')({\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n});\n\nexport class InlineDropdown extends React.Component {\n static propTypes = {\n prompt: PropTypes.string,\n disabled: PropTypes.bool,\n markup: PropTypes.string,\n mode: PropTypes.string,\n displayType: PropTypes.string,\n rationale: PropTypes.string,\n teacherInstructions: PropTypes.string,\n model: PropTypes.object.isRequired,\n choices: PropTypes.object,\n value: PropTypes.object,\n feedback: PropTypes.object,\n onChange: PropTypes.func,\n language: PropTypes.string,\n };\n\n static defaultProps = {\n value: {},\n };\n\n state = {\n showCorrectAnswer: false,\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (isEmpty(nextProps.feedback)) {\n this.setState({ showCorrectAnswer: false });\n }\n }\n\n componentDidUpdate() {\n // eslint-disable-next-line\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n toggleShowCorrect = () => {\n this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });\n };\n\n render() {\n const { showCorrectAnswer } = this.state;\n const { prompt, mode, model, rationale, teacherInstructions, choices, displayType, language } = this.props;\n const { extraCSSRules } = model || {};\n const showCorrectAnswerToggle = mode === 'evaluate';\n let choiceRationalesHaveText = false;\n const showRationale = rationale && (hasText(rationale) || hasMedia(rationale));\n const showTeacherInstructions =\n teacherInstructions && (hasText(teacherInstructions) || hasMedia(teacherInstructions));\n\n const choiceRationales = (Object.keys(choices) || []).map((key) =>\n (choices[key] || []).reduce((acc, currentValue) => {\n if (currentValue.rationale && hasText(currentValue.rationale)) {\n choiceRationalesHaveText = true;\n\n acc.push(currentValue);\n }\n\n return acc;\n }, []),\n );\n\n return (\n <StyledUiLayout extraCSSRules={extraCSSRules} style={{ display: `${displayType}` }}>\n {mode === 'gather' && <SrOnly>Inline Dropdown Question</SrOnly>}\n\n {showTeacherInstructions && (\n <StyledCollapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n <PreviewPrompt prompt={teacherInstructions} />\n </StyledCollapsible>\n )}\n\n {prompt && <PreviewPrompt prompt={prompt} />}\n\n <CorrectAnswerToggle\n show={showCorrectAnswerToggle}\n toggled={showCorrectAnswer}\n onToggle={this.toggleShowCorrect}\n language={language}\n />\n\n <DropDown {...this.props} showCorrectAnswer={showCorrectAnswer} />\n\n {choiceRationalesHaveText && (\n <StyledCollapsible\n labels={{ hidden: 'Show Rationale for choices', visible: 'Hide Rationale for choices' }}\n >\n {choiceRationales.map((choices, index) => (\n <ChoiceRationaleWrapper key={index}>\n {choices?.length > 0 &&\n choices.map((choice) => (\n <ChoiceRationale key={choice.label}>\n <ChoiceRationaleLabel\n correct={choice.correct}\n dangerouslySetInnerHTML={{ __html: `${choice.label}: ` }}\n />\n <PreviewPrompt prompt={choice.rationale} />\n </ChoiceRationale>\n ))}\n </ChoiceRationaleWrapper>\n ))}\n </StyledCollapsible>\n )}\n\n {showRationale && (\n <Collapsible labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}>\n <PreviewPrompt prompt={rationale} />\n </Collapsible>\n )}\n </StyledUiLayout>\n );\n }\n}\n\nexport default InlineDropdown;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;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