@pie-element/ebsr 12.2.3-next.5 → 12.2.3-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configure/package.json +1 -1
- package/controller/package.json +2 -2
- package/module/configure.js +1 -1
- package/module/controller.js +138 -156
- package/module/element.js +1 -1
- package/module/manifest.json +2 -2
- package/module/print.js +1 -1
- package/package.json +4 -4
package/configure/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
11
|
"@pie-element/multiple-choice": "^11.4.0",
|
|
12
12
|
"@pie-framework/pie-configure-events": "^1.2.0",
|
|
13
|
-
"@pie-lib/config-ui": "^11.
|
|
13
|
+
"@pie-lib/config-ui": "^11.29.0",
|
|
14
14
|
"lodash": "^4.17.15",
|
|
15
15
|
"prop-types": "^15.6.2",
|
|
16
16
|
"react": "^16.8.1",
|
package/controller/package.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@pie-lib/controller-utils": "^0.
|
|
11
|
-
"@pie-lib/translator": "^2.
|
|
10
|
+
"@pie-lib/controller-utils": "^0.22.0",
|
|
11
|
+
"@pie-lib/translator": "^2.23.0",
|
|
12
12
|
"lodash": "^4.17.15"
|
|
13
13
|
},
|
|
14
14
|
"author": "",
|
package/module/configure.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_dll_react as e,_dll_prop_types as t,_dll_material_ui__core_styles as i,_dll_lodash as a,_dll_react_dom as s}from"../../../@pie-lib/shared-module@^1.14.9/module/index.js";import o from"@pie-element/multiple-choice/configure/lib";import{_dll_pie_lib__config_ui as n}from"../../../@pie-lib/config-module@^2.19.9/module/index.js";var l={};Object.defineProperty(l,"__esModule",{value:!0});class r extends CustomEvent{constructor(e,t=!1){super(r.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}r.TYPE="model.updated";var c=l.ModelUpdatedEvent=r;class d extends CustomEvent{constructor(e,t){super(d.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}d.TYPE="delete.image",l.DeleteImageEvent=d;class h extends CustomEvent{constructor(e){super(h.TYPE,{bubbles:!0,detail:e}),this.handler=e}}h.TYPE="insert.image",l.InsertImageEvent=h;class p extends CustomEvent{constructor(e,t){super(p.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}p.TYPE="delete.sound",l.DeleteSoundEvent=p;class g extends CustomEvent{constructor(e){super(g.TYPE,{bubbles:!0,detail:e}),this.handler=e}}g.TYPE="insert.sound",l.InsertSoundEvent=g;const u=e,b=t,{withStyles:m}=i,{settings:_}=n,{layout:f}=n,{Panel:C,toggle:E,radio:A,dropdown:v}=_;class L extends u.Component{constructor(...e){super(...e),L.prototype.__init.call(this),L.prototype.__init2.call(this)}static __initStatic(){this.propTypes={classes:b.object,configuration:b.object,model:b.object,onModelChanged:b.func,onConfigurationChanged:b.func}}__init(){this.removeExtraChoices=e=>{let t=!1;return(e||[]).map((e=>t?(e.correct=!1,e):(e.correct&&(t=!0),e)))}}__init2(){this.onModelChanged=(e,t)=>{const{onModelChanged:i}=this.props;return"partA.choiceMode"===t&&"radio"===e.partA.choiceMode?(e.partA.choices=this.removeExtraChoices(e.partA.choices),i(e,!0)):"partB.choiceMode"===t&&"radio"===e.partB.choiceMode?(e.partB.choices=this.removeExtraChoices(e.partB.choices),i(e,!0)):i(e)}}render(){const{classes:e,model:t,configuration:i,onConfigurationChanged:a}=this.props,{partLabelType:s,partA:o,partB:n,extraCSSRules:l}=t,{contentDimensions:r={},partA:c={},partB:d={},partialScoring:h={},settingsPanelDisabled:p,scoringType:g={},language:b={},languageChoices:m={},..._}=i,{feedback:L={},choiceMode:y={},choicePrefix:B={},lockChoiceOrder:P={},prompt:M={},teacherInstructions:x={},studentInstructions:k={},choicesLayout:I={},gridColumns:S={},rationale:T={},spellCheck:D={}}=c||{},{feedback:Y={},choiceMode:O={},choicePrefix:w={},lockChoiceOrder:$={},prompt:j={},teacherInstructions:N={},studentInstructions:U={},choicesLayout:z={},gridColumns:R={},rationale:q={},spellCheck:H={}}=d||{},F="Numbers"===(s||"Numbers"),G="Part "+(F?"1":"A"),W="Part "+(F?"2":"B"),J={partA:o.choices&&o.choices.length?Array.from({length:o.choices.length},((e,t)=>`${t+1}`)):[],partB:n.choices&&n.choices.length?Array.from({length:n.choices.length},((e,t)=>`${t+1}`)):[]},K={partLabels:_.partLabels.settings&&E(_.partLabels.label),partLabelType:t.partLabels&&v("",["Numbers","Letters"]),partialScoring:h.settings&&E(h.label),scoringType:g.settings&&A(g.label,["auto","rubric"]),"language.enabled":b.settings&&E(b.label,!0),language:b.settings&&b.enabled&&v(m.label,m.options)},Q={"partA.choiceMode":y.settings&&A(y.label,["checkbox","radio"]),"partA.choicePrefix":B.settings&&A(B.label,["numbers","letters"]),"partA.lockChoiceOrder":P.settings&&E(P.label),"partA.choicesLayout":I.settings&&v(I.label,["vertical","grid","horizontal"]),"partA.gridColumns":I.settings&&"grid"===o.choicesLayout&&J.partA.length>0&&v(S.label,J.partA)},V={"partA.feedbackEnabled":L.settings&&E(L.label),"partA.promptEnabled":M.settings&&E(M.label),"partA.teacherInstructionsEnabled":x.settings&&E(x.label),"partA.studentInstructionsEnabled":k.settings&&E(k.label),"partA.rationaleEnabled":T.settings&&E(T.label),"partA.spellCheckEnabled":D.settings&&E(D.label)},X={"partB.choiceMode":O.settings&&A(O.label,["checkbox","radio"]),"partB.choicePrefix":w.settings&&A(w.label,["numbers","letters"]),"partB.lockChoiceOrder":$.settings&&E($.label),"partB.choicesLayout":z.settings&&v(z.label,["vertical","grid","horizontal"]),"partB.gridColumns":z.settings&&"grid"===n.choicesLayout&&J.partB.length>0&&v(R.label,J.partB)},Z={"partB.feedbackEnabled":Y.settings&&E(Y.label),"partB.promptEnabled":j.settings&&E(j.label),"partB.teacherInstructionsEnabled":N.settings&&E(N.label),"partB.studentInstructionsEnabled":U.settings&&E(U.label),"partB.rationaleEnabled":q.settings&&E(q.label),"partB.spellCheckEnabled":H.settings&&E(H.label)};return u.createElement(f.ConfigLayout,{extraCSSRules:l,dimensions:r,hideSettings:p,settings:u.createElement(C,{model:t,onChangeModel:this.onModelChanged,configuration:i,onChangeConfiguration:a,groups:{"Settings for both":K,[`Settings ${G}`]:Q,[`Properties ${G}`]:V,[`Settings ${W}`]:X,[`Properties ${W}`]:Z}})},t.partLabels&&u.createElement("div",{className:e.partLabel},G),u.createElement("ebsr-multiple-choice-configure",{id:"A",key:"partA",ref:e=>{e&&(this.partA=e,this.partA._model={...this.props.model.partA,errors:this.props.model.errors&&this.props.model.errors.partA||{}},this.partA.configuration={...c,..._})}}),u.createElement("div",{className:e.divider}),t.partLabels&&u.createElement("div",{className:e.partLabel},W),u.createElement("ebsr-multiple-choice-configure",{id:"B",key:"partB",ref:e=>{e&&(this.partB=e,this.partB._model={...this.props.model.partB,errors:this.props.model.errors&&this.props.model.errors.partB||{}},this.partB.configuration={...d,..._})}}))}}L.__initStatic();const y=m((e=>({partLabel:{paddingBottom:2*e.spacing.unit},divider:{flex:1,height:2.5*e.spacing.unit}})))(L),{cloneDeep:B}=a,P={addChoiceButton:{settings:!0,label:"Add a Choice"},choiceMode:{settings:!0,label:"Response Type"},choicePrefix:{settings:!0,label:"Choice Labels"},deleteChoice:{settings:!0},feedback:{settings:!0,label:"Feedback"},lockChoiceOrder:{settings:!0,label:"Lock Choice Order"},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},rationale:{settings:!0,label:"Rationale",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},settingsPanelDisabled:!0,studentInstructions:{settings:!1,label:"Student Instructions"},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},choicesLayout:{settings:!1,label:"Choices Layout"},gridColumns:{label:"Grid columns"},spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},maxImageWidth:{teacherInstructions:300,prompt:300,rationale:636,choices:636},maxImageHeight:{teacherInstructions:300,prompt:300,rationale:300,choices:300},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},choices:{inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}}},baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}}},M=e=>({choiceMode:"radio",choicePrefix:"letters",choices:[],choicesLayout:"vertical",feedbackEnabled:!1,gridColumns:2,prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,spellCheckEnabled:!0,studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom",...e});var x={model:{partLabels:!0,partLabelType:"Letters",partA:M(),partB:M()},configuration:{baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},partialScoring:{label:"Allow Partial Scoring",settings:!1},scoringType:{settings:!1,label:"Scoring Type"},partA:B(P),partB:B(P),partLabels:{settings:!0,label:"Part Labels"},settingsPanelDisabled:!1,language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]}}};const k=e,I=s,{defaults:S}=a;function T(e){let t,i=e[0],a=1;for(;a<e.length;){const s=e[a],o=e[a+1];if(a+=2,("optionalAccess"===s||"optionalCall"===s)&&null==i)return;"access"===s||"optionalAccess"===s?(t=i,i=o(i)):"call"!==s&&"optionalCall"!==s||(i=o(((...e)=>i.call(t,...e))),t=void 0)}return i}const D=c.TYPE;customElements.get("ebsr-multiple-choice-configure")||customElements.define("ebsr-multiple-choice-configure",class extends o{});const Y=(e,t)=>({configuration:S(e,x.configuration),model:t}),{model:O}=x||{};class w extends HTMLElement{static __initStatic(){this.createDefaultModel=({partA:e={},partB:t={},...i}={},a=O)=>({...a,...i,partA:{...a.partA,...e,choicesLayout:e.choicesLayout||!1===e.verticalMode&&"horizontal"||a.partA.choicesLayout},partB:{...a.partB,...t,choicesLayout:t.choicesLayout||!1===t.verticalMode&&"horizontal"||a.partB.choicesLayout}})}constructor(){super(),w.prototype.__init.call(this),w.prototype.__init2.call(this),this._model=w.createDefaultModel(),this._configuration=x.configuration,this.onConfigurationChanged=this.onConfigurationChanged.bind(this)}set model(e){this._model=w.createDefaultModel(e,this._model),this._render()}dispatchModelUpdated(e){const t=!!e;this.dispatchEvent(new c(this._model,t))}__init(){this.onModelChanged=(e,t)=>{this._model=w.createDefaultModel(e,this._model),this.dispatchModelUpdated(t),this._render()}}set configuration(e){const t=Y(e,this._model),i={...x.configuration,...t.configuration};this._configuration=i,T([i,"optionalAccess",e=>e.language,"optionalAccess",e=>e.enabled])?T([i,"optionalAccess",e=>e.languageChoices,"optionalAccess",e=>e.options,"optionalAccess",e=>e.length])&&(this._model.language=T([i,"optionalAccess",e=>e.languageChoices,"access",e=>e.options,"access",e=>e[0],"access",e=>e.value])):i.language.settings&&this._model.language?(this._configuration.language.enabled=!0,this._configuration.languageChoices.options&&this._configuration.languageChoices.options.length||(this._configuration.languageChoices.options=[]),this._configuration.languageChoices.options.find((e=>e.value===this._model.language))||this._configuration.languageChoices.options.push({value:this._model.language,label:this._model.language})):delete this._model.language,this._render()}onConfigurationChanged(e){this._configuration=Y(e,this._model).configuration,this._model&&this.onModelChanged(this._model),this._render()}__init2(){this.onModelUpdated=e=>{if(e.target===this)return;e.preventDefault(),e.stopImmediatePropagation();const t=e.target&&e.target.getAttribute("id");t&&(e.update&&(this._model[`part${t}`]=e.update),this.dispatchEvent(new c(this._model)))}}connectedCallback(){this.addEventListener(D,this.onModelUpdated),this._render()}disconnectedCallback(){this.removeEventListener(D,this.onModelUpdated)}_render(){let e=k.createElement(y,{model:this._model,configuration:this._configuration,onModelChanged:this.onModelChanged,onConfigurationChanged:this.onConfigurationChanged});I.render(e,this)}}w.__initStatic();export{w as default};
|
|
1
|
+
import{_dll_react as e,_dll_prop_types as t,_dll_material_ui__core_styles as i,_dll_lodash as a,_dll_react_dom as s}from"../../../@pie-lib/shared-module@^1.17.0/module/index.js";import o from"@pie-element/multiple-choice/configure/lib";import{_dll_pie_lib__config_ui as n}from"../../../@pie-lib/config-module@^2.22.0/module/index.js";var l={};Object.defineProperty(l,"__esModule",{value:!0});class r extends CustomEvent{constructor(e,t=!1){super(r.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}r.TYPE="model.updated";var c=l.ModelUpdatedEvent=r;class d extends CustomEvent{constructor(e,t){super(d.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}d.TYPE="delete.image",l.DeleteImageEvent=d;class h extends CustomEvent{constructor(e){super(h.TYPE,{bubbles:!0,detail:e}),this.handler=e}}h.TYPE="insert.image",l.InsertImageEvent=h;class p extends CustomEvent{constructor(e,t){super(p.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}p.TYPE="delete.sound",l.DeleteSoundEvent=p;class g extends CustomEvent{constructor(e){super(g.TYPE,{bubbles:!0,detail:e}),this.handler=e}}g.TYPE="insert.sound",l.InsertSoundEvent=g;const u=e,b=t,{withStyles:m}=i,{settings:_}=n,{layout:f}=n,{Panel:C,toggle:E,radio:A,dropdown:v}=_;class L extends u.Component{constructor(...e){super(...e),L.prototype.__init.call(this),L.prototype.__init2.call(this)}static __initStatic(){this.propTypes={classes:b.object,configuration:b.object,model:b.object,onModelChanged:b.func,onConfigurationChanged:b.func}}__init(){this.removeExtraChoices=e=>{let t=!1;return(e||[]).map((e=>t?(e.correct=!1,e):(e.correct&&(t=!0),e)))}}__init2(){this.onModelChanged=(e,t)=>{const{onModelChanged:i}=this.props;return"partA.choiceMode"===t&&"radio"===e.partA.choiceMode?(e.partA.choices=this.removeExtraChoices(e.partA.choices),i(e,!0)):"partB.choiceMode"===t&&"radio"===e.partB.choiceMode?(e.partB.choices=this.removeExtraChoices(e.partB.choices),i(e,!0)):i(e)}}render(){const{classes:e,model:t,configuration:i,onConfigurationChanged:a}=this.props,{partLabelType:s,partA:o,partB:n,extraCSSRules:l}=t,{contentDimensions:r={},partA:c={},partB:d={},partialScoring:h={},settingsPanelDisabled:p,scoringType:g={},language:b={},languageChoices:m={},..._}=i,{feedback:L={},choiceMode:y={},choicePrefix:B={},lockChoiceOrder:P={},prompt:M={},teacherInstructions:x={},studentInstructions:k={},choicesLayout:I={},gridColumns:S={},rationale:T={},spellCheck:D={}}=c||{},{feedback:Y={},choiceMode:O={},choicePrefix:w={},lockChoiceOrder:$={},prompt:j={},teacherInstructions:N={},studentInstructions:U={},choicesLayout:z={},gridColumns:R={},rationale:q={},spellCheck:H={}}=d||{},F="Numbers"===(s||"Numbers"),G="Part "+(F?"1":"A"),W="Part "+(F?"2":"B"),J={partA:o.choices&&o.choices.length?Array.from({length:o.choices.length},((e,t)=>`${t+1}`)):[],partB:n.choices&&n.choices.length?Array.from({length:n.choices.length},((e,t)=>`${t+1}`)):[]},K={partLabels:_.partLabels.settings&&E(_.partLabels.label),partLabelType:t.partLabels&&v("",["Numbers","Letters"]),partialScoring:h.settings&&E(h.label),scoringType:g.settings&&A(g.label,["auto","rubric"]),"language.enabled":b.settings&&E(b.label,!0),language:b.settings&&b.enabled&&v(m.label,m.options)},Q={"partA.choiceMode":y.settings&&A(y.label,["checkbox","radio"]),"partA.choicePrefix":B.settings&&A(B.label,["numbers","letters"]),"partA.lockChoiceOrder":P.settings&&E(P.label),"partA.choicesLayout":I.settings&&v(I.label,["vertical","grid","horizontal"]),"partA.gridColumns":I.settings&&"grid"===o.choicesLayout&&J.partA.length>0&&v(S.label,J.partA)},V={"partA.feedbackEnabled":L.settings&&E(L.label),"partA.promptEnabled":M.settings&&E(M.label),"partA.teacherInstructionsEnabled":x.settings&&E(x.label),"partA.studentInstructionsEnabled":k.settings&&E(k.label),"partA.rationaleEnabled":T.settings&&E(T.label),"partA.spellCheckEnabled":D.settings&&E(D.label)},X={"partB.choiceMode":O.settings&&A(O.label,["checkbox","radio"]),"partB.choicePrefix":w.settings&&A(w.label,["numbers","letters"]),"partB.lockChoiceOrder":$.settings&&E($.label),"partB.choicesLayout":z.settings&&v(z.label,["vertical","grid","horizontal"]),"partB.gridColumns":z.settings&&"grid"===n.choicesLayout&&J.partB.length>0&&v(R.label,J.partB)},Z={"partB.feedbackEnabled":Y.settings&&E(Y.label),"partB.promptEnabled":j.settings&&E(j.label),"partB.teacherInstructionsEnabled":N.settings&&E(N.label),"partB.studentInstructionsEnabled":U.settings&&E(U.label),"partB.rationaleEnabled":q.settings&&E(q.label),"partB.spellCheckEnabled":H.settings&&E(H.label)};return u.createElement(f.ConfigLayout,{extraCSSRules:l,dimensions:r,hideSettings:p,settings:u.createElement(C,{model:t,onChangeModel:this.onModelChanged,configuration:i,onChangeConfiguration:a,groups:{"Settings for both":K,[`Settings ${G}`]:Q,[`Properties ${G}`]:V,[`Settings ${W}`]:X,[`Properties ${W}`]:Z}})},t.partLabels&&u.createElement("div",{className:e.partLabel},G),u.createElement("ebsr-multiple-choice-configure",{id:"A",key:"partA",ref:e=>{e&&(this.partA=e,this.partA._model={...this.props.model.partA,errors:this.props.model.errors&&this.props.model.errors.partA||{}},this.partA.configuration={...c,..._})}}),u.createElement("div",{className:e.divider}),t.partLabels&&u.createElement("div",{className:e.partLabel},W),u.createElement("ebsr-multiple-choice-configure",{id:"B",key:"partB",ref:e=>{e&&(this.partB=e,this.partB._model={...this.props.model.partB,errors:this.props.model.errors&&this.props.model.errors.partB||{}},this.partB.configuration={...d,..._})}}))}}L.__initStatic();const y=m((e=>({partLabel:{paddingBottom:2*e.spacing.unit},divider:{flex:1,height:2.5*e.spacing.unit}})))(L),{cloneDeep:B}=a,P={addChoiceButton:{settings:!0,label:"Add a Choice"},choiceMode:{settings:!0,label:"Response Type"},choicePrefix:{settings:!0,label:"Choice Labels"},deleteChoice:{settings:!0},feedback:{settings:!0,label:"Feedback"},lockChoiceOrder:{settings:!0,label:"Lock Choice Order"},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},rationale:{settings:!0,label:"Rationale",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},settingsPanelDisabled:!0,studentInstructions:{settings:!1,label:"Student Instructions"},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},choicesLayout:{settings:!1,label:"Choices Layout"},gridColumns:{label:"Grid columns"},spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},maxImageWidth:{teacherInstructions:300,prompt:300,rationale:636,choices:636},maxImageHeight:{teacherInstructions:300,prompt:300,rationale:300,choices:300},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},choices:{inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}}},baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}}},M=e=>({choiceMode:"radio",choicePrefix:"letters",choices:[],choicesLayout:"vertical",feedbackEnabled:!1,gridColumns:2,prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,spellCheckEnabled:!0,studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom",...e});var x={model:{partLabels:!0,partLabelType:"Letters",partA:M(),partB:M()},configuration:{baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},partialScoring:{label:"Allow Partial Scoring",settings:!1},scoringType:{settings:!1,label:"Scoring Type"},partA:B(P),partB:B(P),partLabels:{settings:!0,label:"Part Labels"},settingsPanelDisabled:!1,language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]}}};const k=e,I=s,{defaults:S}=a;function T(e){let t,i=e[0],a=1;for(;a<e.length;){const s=e[a],o=e[a+1];if(a+=2,("optionalAccess"===s||"optionalCall"===s)&&null==i)return;"access"===s||"optionalAccess"===s?(t=i,i=o(i)):"call"!==s&&"optionalCall"!==s||(i=o(((...e)=>i.call(t,...e))),t=void 0)}return i}const D=c.TYPE;customElements.get("ebsr-multiple-choice-configure")||customElements.define("ebsr-multiple-choice-configure",class extends o{});const Y=(e,t)=>({configuration:S(e,x.configuration),model:t}),{model:O}=x||{};class w extends HTMLElement{static __initStatic(){this.createDefaultModel=({partA:e={},partB:t={},...i}={},a=O)=>({...a,...i,partA:{...a.partA,...e,choicesLayout:e.choicesLayout||!1===e.verticalMode&&"horizontal"||a.partA.choicesLayout},partB:{...a.partB,...t,choicesLayout:t.choicesLayout||!1===t.verticalMode&&"horizontal"||a.partB.choicesLayout}})}constructor(){super(),w.prototype.__init.call(this),w.prototype.__init2.call(this),this._model=w.createDefaultModel(),this._configuration=x.configuration,this.onConfigurationChanged=this.onConfigurationChanged.bind(this)}set model(e){this._model=w.createDefaultModel(e,this._model),this._render()}dispatchModelUpdated(e){const t=!!e;this.dispatchEvent(new c(this._model,t))}__init(){this.onModelChanged=(e,t)=>{this._model=w.createDefaultModel(e,this._model),this.dispatchModelUpdated(t),this._render()}}set configuration(e){const t=Y(e,this._model),i={...x.configuration,...t.configuration};this._configuration=i,T([i,"optionalAccess",e=>e.language,"optionalAccess",e=>e.enabled])?T([i,"optionalAccess",e=>e.languageChoices,"optionalAccess",e=>e.options,"optionalAccess",e=>e.length])&&(this._model.language=T([i,"optionalAccess",e=>e.languageChoices,"access",e=>e.options,"access",e=>e[0],"access",e=>e.value])):i.language.settings&&this._model.language?(this._configuration.language.enabled=!0,this._configuration.languageChoices.options&&this._configuration.languageChoices.options.length||(this._configuration.languageChoices.options=[]),this._configuration.languageChoices.options.find((e=>e.value===this._model.language))||this._configuration.languageChoices.options.push({value:this._model.language,label:this._model.language})):delete this._model.language,this._render()}onConfigurationChanged(e){this._configuration=Y(e,this._model).configuration,this._model&&this.onModelChanged(this._model),this._render()}__init2(){this.onModelUpdated=e=>{if(e.target===this)return;e.preventDefault(),e.stopImmediatePropagation();const t=e.target&&e.target.getAttribute("id");t&&(e.update&&(this._model[`part${t}`]=e.update),this.dispatchEvent(new c(this._model)))}}connectedCallback(){this.addEventListener(D,this.onModelUpdated),this._render()}disconnectedCallback(){this.removeEventListener(D,this.onModelUpdated)}_render(){let e=k.createElement(y,{model:this._model,configuration:this._configuration,onModelChanged:this.onModelChanged,onConfigurationChanged:this.onConfigurationChanged});I.render(e,this)}}w.__initStatic();export{w as default};
|
package/module/controller.js
CHANGED
|
@@ -24,6 +24,26 @@ var defaults = {
|
|
|
24
24
|
partB: partModel(),
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
const enabled = (config, env, defaultValue) => {
|
|
28
|
+
// if model.partialScoring = false
|
|
29
|
+
// - if env.partialScoring = false || env.partialScoring = true => use dichotomous scoring
|
|
30
|
+
// else if model.partialScoring = true || undefined
|
|
31
|
+
// - if env.partialScoring = false, use dichotomous scoring
|
|
32
|
+
// - else if env.partialScoring = true, use partial scoring
|
|
33
|
+
config = config || {};
|
|
34
|
+
env = env || {};
|
|
35
|
+
|
|
36
|
+
if (config.partialScoring === false) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (env.partialScoring === false) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return typeof defaultValue === 'boolean' ? defaultValue : true;
|
|
45
|
+
};
|
|
46
|
+
|
|
27
47
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
28
48
|
|
|
29
49
|
/**
|
|
@@ -2231,90 +2251,67 @@ function isEmpty(value) {
|
|
|
2231
2251
|
|
|
2232
2252
|
var isEmpty_1 = isEmpty;
|
|
2233
2253
|
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
// - if env.partialScoring = false || env.partialScoring = true => use dichotomous scoring
|
|
2237
|
-
// else if model.partialScoring = true || undefined
|
|
2238
|
-
// - if env.partialScoring = false, use dichotomous scoring
|
|
2239
|
-
// - else if env.partialScoring = true, use partial scoring
|
|
2240
|
-
config = config || {};
|
|
2241
|
-
env = env || {};
|
|
2242
|
-
|
|
2243
|
-
if (config.partialScoring === false) {
|
|
2244
|
-
return false;
|
|
2245
|
-
}
|
|
2246
|
-
|
|
2247
|
-
if (env.partialScoring === false) {
|
|
2248
|
-
return false;
|
|
2249
|
-
}
|
|
2250
|
-
|
|
2251
|
-
return typeof defaultValue === 'boolean' ? defaultValue : true;
|
|
2252
|
-
};
|
|
2253
|
-
|
|
2254
|
-
var partialScoring = /*#__PURE__*/Object.freeze({
|
|
2255
|
-
__proto__: null,
|
|
2256
|
-
enabled: enabled
|
|
2257
|
-
});
|
|
2258
|
-
|
|
2259
|
-
const lg = n => console[n].bind(console, 'controller-utils:');
|
|
2260
|
-
|
|
2254
|
+
// eslint-disable-next-line no-console
|
|
2255
|
+
const lg = (n) => console[n].bind(console, 'controller-utils:');
|
|
2261
2256
|
const debug = lg('debug');
|
|
2262
2257
|
const log = lg('log');
|
|
2263
2258
|
const warn = lg('warn');
|
|
2264
2259
|
const error = lg('error');
|
|
2265
|
-
|
|
2260
|
+
|
|
2261
|
+
const compact = (arr) => {
|
|
2266
2262
|
if (Array.isArray(arr)) {
|
|
2267
|
-
return arr.filter(v => v !== null && v !== undefined);
|
|
2263
|
+
return arr.filter((v) => v !== null && v !== undefined);
|
|
2268
2264
|
}
|
|
2269
|
-
|
|
2270
2265
|
return arr;
|
|
2271
2266
|
};
|
|
2272
|
-
const getShuffledChoices = (choices, session, updateSession, choiceKey) => new Promise(resolve => {
|
|
2273
|
-
var _session$data;
|
|
2274
|
-
|
|
2275
|
-
log('updateSession type: ', typeof updateSession);
|
|
2276
|
-
log('session: ', session);
|
|
2277
|
-
const currentShuffled = compact((session == null ? void 0 : (_session$data = session.data) == null ? void 0 : _session$data.shuffledValues) || (session == null ? void 0 : session.shuffledValues) || []);
|
|
2278
|
-
|
|
2279
|
-
if (!session) {
|
|
2280
|
-
// eslint-disable-next-line quotes
|
|
2281
|
-
warn("unable to save shuffled choices because there's no session.");
|
|
2282
|
-
resolve(undefined);
|
|
2283
|
-
} else if (!isEmpty_1(currentShuffled)) {
|
|
2284
|
-
var _session$data2;
|
|
2285
|
-
|
|
2286
|
-
debug('use shuffledValues to sort the choices...', (_session$data2 = session.data) == null ? void 0 : _session$data2.shuffledValues);
|
|
2287
|
-
resolve(compact(currentShuffled.map(v => choices.find(c => c[choiceKey] === v))));
|
|
2288
|
-
} else {
|
|
2289
|
-
const shuffledChoices = shuffle_1(choices);
|
|
2290
2267
|
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
}
|
|
2306
|
-
} catch (e) {
|
|
2307
|
-
warn('unable to save shuffled order for choices');
|
|
2308
|
-
error(e);
|
|
2309
|
-
}
|
|
2268
|
+
const getShuffledChoices = (choices, session, updateSession, choiceKey) =>
|
|
2269
|
+
new Promise((resolve) => {
|
|
2270
|
+
log('updateSession type: ', typeof updateSession);
|
|
2271
|
+
log('session: ', session);
|
|
2272
|
+
|
|
2273
|
+
const currentShuffled = compact(session?.data?.shuffledValues || session?.shuffledValues || []);
|
|
2274
|
+
|
|
2275
|
+
if (!session) {
|
|
2276
|
+
// eslint-disable-next-line quotes
|
|
2277
|
+
warn("unable to save shuffled choices because there's no session.");
|
|
2278
|
+
resolve(undefined);
|
|
2279
|
+
} else if (!isEmpty_1(currentShuffled)) {
|
|
2280
|
+
debug('use shuffledValues to sort the choices...', session.data?.shuffledValues);
|
|
2281
|
+
resolve(compact(currentShuffled.map((v) => choices.find((c) => c[choiceKey] === v))));
|
|
2310
2282
|
} else {
|
|
2311
|
-
|
|
2312
|
-
} //save this shuffle to the session for later retrieval
|
|
2283
|
+
const shuffledChoices = shuffle_1(choices);
|
|
2313
2284
|
|
|
2285
|
+
if (updateSession && typeof updateSession === 'function') {
|
|
2286
|
+
try {
|
|
2287
|
+
//Note: session.id refers to the id of the element within a session
|
|
2288
|
+
const shuffledValues = compact(shuffledChoices.map((c) => c[choiceKey]));
|
|
2289
|
+
log('try to save shuffledValues to session...', shuffledValues);
|
|
2290
|
+
log('call updateSession... ', session.id, session.element);
|
|
2291
|
+
if (isEmpty_1(shuffledValues)) {
|
|
2292
|
+
error(
|
|
2293
|
+
`shuffledValues is an empty array? - refusing to call updateSession: shuffledChoices: ${JSON.stringify(
|
|
2294
|
+
shuffledChoices,
|
|
2295
|
+
)}, key: ${choiceKey}`,
|
|
2296
|
+
);
|
|
2297
|
+
} else {
|
|
2298
|
+
updateSession(session.id, session.element, { shuffledValues }).catch((e) =>
|
|
2299
|
+
// eslint-disable-next-line no-console
|
|
2300
|
+
console.error('update session failed for: ', session.id, e),
|
|
2301
|
+
);
|
|
2302
|
+
}
|
|
2303
|
+
} catch (e) {
|
|
2304
|
+
warn('unable to save shuffled order for choices');
|
|
2305
|
+
error(e);
|
|
2306
|
+
}
|
|
2307
|
+
} else {
|
|
2308
|
+
warn('unable to save shuffled choices, shuffle will happen every time.');
|
|
2309
|
+
}
|
|
2310
|
+
//save this shuffle to the session for later retrieval
|
|
2311
|
+
resolve(shuffledChoices);
|
|
2312
|
+
}
|
|
2313
|
+
});
|
|
2314
2314
|
|
|
2315
|
-
resolve(shuffledChoices);
|
|
2316
|
-
}
|
|
2317
|
-
});
|
|
2318
2315
|
/**
|
|
2319
2316
|
* If we return:
|
|
2320
2317
|
* - true - that means that the order of the choices will be ordinal (as is created in the configure item)
|
|
@@ -2325,7 +2322,6 @@ const getShuffledChoices = (choices, session, updateSession, choiceKey) => new P
|
|
|
2325
2322
|
* @param env - env to check if we should lock order
|
|
2326
2323
|
* @returns {boolean}
|
|
2327
2324
|
*/
|
|
2328
|
-
|
|
2329
2325
|
const lockChoices = (model, session, env) => {
|
|
2330
2326
|
if (model.lockChoiceOrder) {
|
|
2331
2327
|
return true;
|
|
@@ -2341,16 +2337,17 @@ const lockChoices = (model, session, env) => {
|
|
|
2341
2337
|
|
|
2342
2338
|
if (role === 'instructor') {
|
|
2343
2339
|
// TODO: .. in the future the instructor can toggle between ordinal and shuffled here, so keeping this code until then
|
|
2344
|
-
|
|
2345
2340
|
/*const alreadyShuffled = hasShuffledValues(session);
|
|
2346
|
-
|
|
2341
|
+
|
|
2342
|
+
if (alreadyShuffled) {
|
|
2347
2343
|
return false;
|
|
2348
2344
|
}
|
|
2349
|
-
return true;*/
|
|
2350
|
-
return true;
|
|
2351
|
-
} // here it's a student, so don't lock and it will shuffle if needs be
|
|
2352
2345
|
|
|
2346
|
+
return true;*/
|
|
2347
|
+
return true;
|
|
2348
|
+
}
|
|
2353
2349
|
|
|
2350
|
+
// here it's a student, so don't lock and it will shuffle if needs be
|
|
2354
2351
|
return false;
|
|
2355
2352
|
};
|
|
2356
2353
|
|
|
@@ -3864,7 +3861,7 @@ function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
3864
3861
|
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3865
3862
|
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3866
3863
|
var checkedLoadedFor = {};
|
|
3867
|
-
var Translator = function (_EventEmitter) {
|
|
3864
|
+
var Translator$1 = function (_EventEmitter) {
|
|
3868
3865
|
_inherits(Translator, _EventEmitter);
|
|
3869
3866
|
var _super = _createSuper$2(Translator);
|
|
3870
3867
|
function Translator(services) {
|
|
@@ -5473,7 +5470,7 @@ var I18n = function (_EventEmitter) {
|
|
|
5473
5470
|
s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
|
|
5474
5471
|
if (s.i18nFormat.init) s.i18nFormat.init(this);
|
|
5475
5472
|
}
|
|
5476
|
-
this.translator = new Translator(this.services, this.options);
|
|
5473
|
+
this.translator = new Translator$1(this.services, this.options);
|
|
5477
5474
|
this.translator.on('*', function (event) {
|
|
5478
5475
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
5479
5476
|
args[_key2 - 1] = arguments[_key2];
|
|
@@ -5833,7 +5830,7 @@ var I18n = function (_EventEmitter) {
|
|
|
5833
5830
|
clone.services.utils = {
|
|
5834
5831
|
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
|
5835
5832
|
};
|
|
5836
|
-
clone.translator = new Translator(clone.services, clone.options);
|
|
5833
|
+
clone.translator = new Translator$1(clone.services, clone.options);
|
|
5837
5834
|
clone.translator.on('*', function (event) {
|
|
5838
5835
|
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
5839
5836
|
args[_key4 - 1] = arguments[_key4];
|
|
@@ -5884,41 +5881,26 @@ instance.hasLoadedNamespace;
|
|
|
5884
5881
|
instance.loadNamespaces;
|
|
5885
5882
|
instance.loadLanguages;
|
|
5886
5883
|
|
|
5887
|
-
function _extends() {
|
|
5888
|
-
_extends = Object.assign || function (target) {
|
|
5889
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
5890
|
-
var source = arguments[i];
|
|
5891
|
-
|
|
5892
|
-
for (var key in source) {
|
|
5893
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
5894
|
-
target[key] = source[key];
|
|
5895
|
-
}
|
|
5896
|
-
}
|
|
5897
|
-
}
|
|
5898
|
-
|
|
5899
|
-
return target;
|
|
5900
|
-
};
|
|
5901
|
-
|
|
5902
|
-
return _extends.apply(this, arguments);
|
|
5903
|
-
}
|
|
5904
|
-
|
|
5905
5884
|
var en = {
|
|
5906
5885
|
translation: {
|
|
5907
5886
|
categorize: {
|
|
5908
|
-
limitMaxChoicesPerCategory:
|
|
5909
|
-
|
|
5887
|
+
limitMaxChoicesPerCategory:
|
|
5888
|
+
"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
|
|
5889
|
+
maxChoicesPerCategoryRestriction:
|
|
5890
|
+
'To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s].',
|
|
5910
5891
|
},
|
|
5911
5892
|
ebsr: {
|
|
5912
|
-
part: 'Part {{index}}'
|
|
5893
|
+
part: 'Part {{index}}',
|
|
5913
5894
|
},
|
|
5914
5895
|
numberLine: {
|
|
5915
5896
|
addElementLimit_one: 'You can only add {{count}} element',
|
|
5916
5897
|
addElementLimit_other: 'You can only add {{count}} elements',
|
|
5917
|
-
clearAll: 'Clear all'
|
|
5898
|
+
clearAll: 'Clear all',
|
|
5918
5899
|
},
|
|
5919
5900
|
imageClozeAssociation: {
|
|
5920
|
-
reachedLimit_one:
|
|
5921
|
-
|
|
5901
|
+
reachedLimit_one:
|
|
5902
|
+
'You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.',
|
|
5903
|
+
reachedLimit_other: 'Full',
|
|
5922
5904
|
},
|
|
5923
5905
|
drawingResponse: {
|
|
5924
5906
|
fillColor: 'Fill color',
|
|
@@ -5934,7 +5916,7 @@ var en = {
|
|
|
5934
5916
|
green: 'Green',
|
|
5935
5917
|
white: 'White',
|
|
5936
5918
|
black: 'Black',
|
|
5937
|
-
onDoubleClick: 'Double click to edit this text. Press Enter to submit.'
|
|
5919
|
+
onDoubleClick: 'Double click to edit this text. Press Enter to submit.',
|
|
5938
5920
|
},
|
|
5939
5921
|
charting: {
|
|
5940
5922
|
addCategory: 'Add category',
|
|
@@ -5946,8 +5928,8 @@ var en = {
|
|
|
5946
5928
|
keyLegend: {
|
|
5947
5929
|
incorrectAnswer: 'Student incorrect answer',
|
|
5948
5930
|
correctAnswer: 'Student correct answer',
|
|
5949
|
-
correctKeyAnswer: 'Answer key correct'
|
|
5950
|
-
}
|
|
5931
|
+
correctKeyAnswer: 'Answer key correct',
|
|
5932
|
+
},
|
|
5951
5933
|
},
|
|
5952
5934
|
graphing: {
|
|
5953
5935
|
point: 'Point',
|
|
@@ -5963,24 +5945,25 @@ var en = {
|
|
|
5963
5945
|
vector: 'Vector',
|
|
5964
5946
|
label: 'Label',
|
|
5965
5947
|
redo: 'Redo',
|
|
5966
|
-
reset: 'Reset'
|
|
5948
|
+
reset: 'Reset',
|
|
5967
5949
|
},
|
|
5968
5950
|
mathInline: {
|
|
5969
|
-
primaryCorrectWithAlternates:
|
|
5951
|
+
primaryCorrectWithAlternates:
|
|
5952
|
+
'Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct.',
|
|
5970
5953
|
},
|
|
5971
5954
|
multipleChoice: {
|
|
5972
5955
|
minSelections: 'Select at least {{minSelections}}.',
|
|
5973
5956
|
maxSelections_one: 'Only {{maxSelections}} answer is allowed.',
|
|
5974
5957
|
maxSelections_other: 'Only {{maxSelections}} answers are allowed.',
|
|
5975
5958
|
minmaxSelections_equal: 'Select {{minSelections}}.',
|
|
5976
|
-
minmaxSelections_range: 'Select between {{minSelections}} and {{maxSelections}}.'
|
|
5959
|
+
minmaxSelections_range: 'Select between {{minSelections}} and {{maxSelections}}.',
|
|
5977
5960
|
},
|
|
5978
5961
|
selectText: {
|
|
5979
5962
|
correctAnswerSelected: 'Correct',
|
|
5980
5963
|
correctAnswerNotSelected: 'Correct Answer Not Selected',
|
|
5981
5964
|
incorrectSelection: 'Incorrect Selection',
|
|
5982
|
-
key: 'Key'
|
|
5983
|
-
}
|
|
5965
|
+
key: 'Key',
|
|
5966
|
+
},
|
|
5984
5967
|
},
|
|
5985
5968
|
common: {
|
|
5986
5969
|
undo: 'Undo',
|
|
@@ -5989,31 +5972,35 @@ var en = {
|
|
|
5989
5972
|
incorrect: 'Incorrect',
|
|
5990
5973
|
showCorrectAnswer: 'Show correct answer',
|
|
5991
5974
|
hideCorrectAnswer: 'Hide correct answer',
|
|
5992
|
-
commonCorrectAnswerWithAlternates:
|
|
5975
|
+
commonCorrectAnswerWithAlternates:
|
|
5976
|
+
'Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.',
|
|
5993
5977
|
warning: 'Warning',
|
|
5994
5978
|
showNote: 'Show Note',
|
|
5995
5979
|
hideNote: 'Hide Note',
|
|
5996
|
-
cancel: 'Cancel'
|
|
5997
|
-
}
|
|
5980
|
+
cancel: 'Cancel',
|
|
5981
|
+
},
|
|
5998
5982
|
};
|
|
5999
5983
|
|
|
6000
5984
|
var es = {
|
|
6001
5985
|
translation: {
|
|
6002
5986
|
categorize: {
|
|
6003
|
-
limitMaxChoicesPerCategory:
|
|
6004
|
-
|
|
5987
|
+
limitMaxChoicesPerCategory:
|
|
5988
|
+
'Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.',
|
|
5989
|
+
maxChoicesPerCategoryRestriction:
|
|
5990
|
+
'Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta',
|
|
6005
5991
|
},
|
|
6006
5992
|
ebsr: {
|
|
6007
|
-
part: 'Parte {{index}}'
|
|
5993
|
+
part: 'Parte {{index}}',
|
|
6008
5994
|
},
|
|
6009
5995
|
numberLine: {
|
|
6010
5996
|
addElementLimit_one: 'Solo puedes agregar {{count}} elemento',
|
|
6011
5997
|
addElementLimit_other: 'Solo puedes agregar {{count}} elementos',
|
|
6012
|
-
clearAll: 'Borrar todo'
|
|
5998
|
+
clearAll: 'Borrar todo',
|
|
6013
5999
|
},
|
|
6014
6000
|
imageClozeAssociation: {
|
|
6015
|
-
reachedLimit_one:
|
|
6016
|
-
|
|
6001
|
+
reachedLimit_one:
|
|
6002
|
+
'Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.',
|
|
6003
|
+
reachedLimit_other: 'Lleno',
|
|
6017
6004
|
},
|
|
6018
6005
|
drawingResponse: {
|
|
6019
6006
|
fillColor: 'Color de relleno',
|
|
@@ -6029,7 +6016,7 @@ var es = {
|
|
|
6029
6016
|
green: 'Verde',
|
|
6030
6017
|
white: 'Blanco',
|
|
6031
6018
|
black: 'Negro',
|
|
6032
|
-
onDoubleClick: 'Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar'
|
|
6019
|
+
onDoubleClick: 'Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar',
|
|
6033
6020
|
},
|
|
6034
6021
|
charting: {
|
|
6035
6022
|
addCategory: 'Añadir categoría',
|
|
@@ -6041,8 +6028,8 @@ var es = {
|
|
|
6041
6028
|
keyLegend: {
|
|
6042
6029
|
incorrectAnswer: 'Respuesta incorrecta del estudiante',
|
|
6043
6030
|
correctAnswer: 'Respuesta correcta del estudiante',
|
|
6044
|
-
correctKeyAnswer: 'Clave de respuesta correcta'
|
|
6045
|
-
}
|
|
6031
|
+
correctKeyAnswer: 'Clave de respuesta correcta',
|
|
6032
|
+
},
|
|
6046
6033
|
},
|
|
6047
6034
|
graphing: {
|
|
6048
6035
|
point: 'Punto',
|
|
@@ -6058,24 +6045,25 @@ var es = {
|
|
|
6058
6045
|
vector: 'Vector',
|
|
6059
6046
|
label: 'Etiqueta',
|
|
6060
6047
|
redo: 'Rehacer',
|
|
6061
|
-
reset: 'Reiniciar'
|
|
6048
|
+
reset: 'Reiniciar',
|
|
6062
6049
|
},
|
|
6063
6050
|
mathInline: {
|
|
6064
|
-
primaryCorrectWithAlternates:
|
|
6051
|
+
primaryCorrectWithAlternates:
|
|
6052
|
+
'Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas.',
|
|
6065
6053
|
},
|
|
6066
6054
|
multipleChoice: {
|
|
6067
6055
|
minSelections: 'Seleccione al menos {{minSelections}}.',
|
|
6068
6056
|
maxSelections_one: 'Sólo se permite {{maxSelections}} respuesta.',
|
|
6069
6057
|
maxSelections_other: 'Sólo se permiten {{maxSelections}} respuestas.',
|
|
6070
6058
|
minmaxSelections_equal: 'Seleccione {{minSelections}}.',
|
|
6071
|
-
minmaxSelections_range: 'Seleccione entre {{minSelections}} y {{maxSelections}}.'
|
|
6059
|
+
minmaxSelections_range: 'Seleccione entre {{minSelections}} y {{maxSelections}}.',
|
|
6072
6060
|
},
|
|
6073
6061
|
selectText: {
|
|
6074
6062
|
correctAnswerSelected: 'Respuesta Correcta',
|
|
6075
6063
|
correctAnswerNotSelected: 'Respuesta Correcta No Seleccionada',
|
|
6076
6064
|
incorrectSelection: 'Selección Incorrecta',
|
|
6077
|
-
key: 'Clave'
|
|
6078
|
-
}
|
|
6065
|
+
key: 'Clave',
|
|
6066
|
+
},
|
|
6079
6067
|
},
|
|
6080
6068
|
common: {
|
|
6081
6069
|
undo: 'Deshacer',
|
|
@@ -6084,12 +6072,13 @@ var es = {
|
|
|
6084
6072
|
incorrect: 'Incorrect',
|
|
6085
6073
|
showCorrectAnswer: 'Mostrar respuesta correcta',
|
|
6086
6074
|
hideCorrectAnswer: 'Ocultar respuesta correcta',
|
|
6087
|
-
commonCorrectAnswerWithAlternates:
|
|
6075
|
+
commonCorrectAnswerWithAlternates:
|
|
6076
|
+
'Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.',
|
|
6088
6077
|
warning: 'Advertencia',
|
|
6089
6078
|
showNote: 'Mostrar Nota',
|
|
6090
6079
|
hideNote: 'Ocultar Nota',
|
|
6091
|
-
cancel: 'Cancelar'
|
|
6092
|
-
}
|
|
6080
|
+
cancel: 'Cancelar',
|
|
6081
|
+
},
|
|
6093
6082
|
};
|
|
6094
6083
|
|
|
6095
6084
|
instance.init({
|
|
@@ -6098,15 +6087,15 @@ instance.init({
|
|
|
6098
6087
|
debug: true,
|
|
6099
6088
|
resources: {
|
|
6100
6089
|
en: en,
|
|
6101
|
-
es: es
|
|
6102
|
-
}
|
|
6090
|
+
es: es,
|
|
6091
|
+
},
|
|
6103
6092
|
});
|
|
6104
|
-
|
|
6105
|
-
|
|
6093
|
+
|
|
6094
|
+
var Translator = {
|
|
6095
|
+
translator: {
|
|
6096
|
+
...instance,
|
|
6106
6097
|
t: (key, options) => {
|
|
6107
|
-
const {
|
|
6108
|
-
lng
|
|
6109
|
-
} = options;
|
|
6098
|
+
const { lng } = options;
|
|
6110
6099
|
|
|
6111
6100
|
switch (lng) {
|
|
6112
6101
|
// these keys don't work with plurals, don't know why, so I added a workaround to convert them to the correct lng
|
|
@@ -6114,7 +6103,6 @@ var index = {
|
|
|
6114
6103
|
case 'en-US':
|
|
6115
6104
|
options.lng = 'en';
|
|
6116
6105
|
break;
|
|
6117
|
-
|
|
6118
6106
|
case 'es_ES':
|
|
6119
6107
|
case 'es-ES':
|
|
6120
6108
|
case 'es_MX':
|
|
@@ -6122,22 +6110,16 @@ var index = {
|
|
|
6122
6110
|
options.lng = 'es';
|
|
6123
6111
|
break;
|
|
6124
6112
|
}
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
}
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
value: 'en_US',
|
|
6133
|
-
label: 'English (US)'
|
|
6134
|
-
}, {
|
|
6135
|
-
value: 'es_ES',
|
|
6136
|
-
label: 'Spanish'
|
|
6137
|
-
}]
|
|
6113
|
+
return instance.t(key, { lng, ...options });
|
|
6114
|
+
},
|
|
6115
|
+
},
|
|
6116
|
+
languageOptions: [
|
|
6117
|
+
{ value: 'en_US', label: 'English (US)' },
|
|
6118
|
+
{ value: 'es_ES', label: 'Spanish' },
|
|
6119
|
+
],
|
|
6138
6120
|
};
|
|
6139
6121
|
|
|
6140
|
-
const { translator } =
|
|
6122
|
+
const { translator } = Translator;
|
|
6141
6123
|
|
|
6142
6124
|
const prepareChoice = (model, env, defaultFeedback) => (choice) => {
|
|
6143
6125
|
const out = {
|
|
@@ -6341,7 +6323,7 @@ function outcome(config, session, env) {
|
|
|
6341
6323
|
if (value) {
|
|
6342
6324
|
const { partA, partB } = value || {};
|
|
6343
6325
|
|
|
6344
|
-
const partialScoringEnabled =
|
|
6326
|
+
const partialScoringEnabled = enabled(config, env);
|
|
6345
6327
|
|
|
6346
6328
|
const scoreA = getScore(config, partA, 'partA', partialScoringEnabled);
|
|
6347
6329
|
const scoreB = getScore(config, partB, 'partB', partialScoringEnabled);
|