@pie-element/ebsr 12.0.1-next.19 → 12.0.1-next.28

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.
@@ -10,7 +10,7 @@
10
10
  "@material-ui/core": "^3.9.2",
11
11
  "@pie-element/multiple-choice": "^11.1.0",
12
12
  "@pie-framework/pie-configure-events": "^1.2.0",
13
- "@pie-lib/config-ui": "^11.25.0",
13
+ "@pie-lib/config-ui": "^11.25.1",
14
14
  "lodash": "^4.17.15",
15
15
  "prop-types": "^15.6.2",
16
16
  "react": "^16.8.1",
@@ -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.18.0",
11
- "@pie-lib/translator": "^2.19.0",
10
+ "@pie-lib/controller-utils": "^0.19.4",
11
+ "@pie-lib/translator": "^2.20.4",
12
12
  "lodash": "^4.17.15"
13
13
  },
14
14
  "author": "",
@@ -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.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.19.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};
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.5/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.5/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};
@@ -24,26 +24,6 @@ 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
-
47
27
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
48
28
 
49
29
  /**
@@ -2251,67 +2231,90 @@ function isEmpty(value) {
2251
2231
 
2252
2232
  var isEmpty_1 = isEmpty;
2253
2233
 
2254
- // eslint-disable-next-line no-console
2255
- const lg = (n) => console[n].bind(console, 'controller-utils:');
2234
+ const enabled = (config, env, defaultValue) => {
2235
+ // if model.partialScoring = false
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
+
2256
2261
  const debug = lg('debug');
2257
2262
  const log = lg('log');
2258
2263
  const warn = lg('warn');
2259
2264
  const error = lg('error');
2260
-
2261
- const compact = (arr) => {
2265
+ const compact = arr => {
2262
2266
  if (Array.isArray(arr)) {
2263
- return arr.filter((v) => v !== null && v !== undefined);
2267
+ return arr.filter(v => v !== null && v !== undefined);
2264
2268
  }
2269
+
2265
2270
  return arr;
2266
2271
  };
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);
2267
2290
 
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))));
2282
- } else {
2283
- const shuffledChoices = shuffle_1(choices);
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);
2291
+ if (updateSession && typeof updateSession === 'function') {
2292
+ try {
2293
+ //Note: session.id refers to the id of the element within a session
2294
+ const shuffledValues = compact(shuffledChoices.map(c => c[choiceKey]));
2295
+ log('try to save shuffledValues to session...', shuffledValues);
2296
+ log('call updateSession... ', session.id, session.element);
2297
+
2298
+ if (isEmpty_1(shuffledValues)) {
2299
+ error(`shuffledValues is an empty array? - refusing to call updateSession: shuffledChoices: ${JSON.stringify(shuffledChoices)}, key: ${choiceKey}`);
2300
+ } else {
2301
+ updateSession(session.id, session.element, {
2302
+ shuffledValues
2303
+ }).catch(e => // eslint-disable-next-line no-console
2304
+ console.error('update session failed for: ', session.id, e));
2306
2305
  }
2307
- } else {
2308
- warn('unable to save shuffled choices, shuffle will happen every time.');
2306
+ } catch (e) {
2307
+ warn('unable to save shuffled order for choices');
2308
+ error(e);
2309
2309
  }
2310
- //save this shuffle to the session for later retrieval
2311
- resolve(shuffledChoices);
2312
- }
2313
- });
2310
+ } else {
2311
+ warn('unable to save shuffled choices, shuffle will happen every time.');
2312
+ } //save this shuffle to the session for later retrieval
2314
2313
 
2314
+
2315
+ resolve(shuffledChoices);
2316
+ }
2317
+ });
2315
2318
  /**
2316
2319
  * If we return:
2317
2320
  * - true - that means that the order of the choices will be ordinal (as is created in the configure item)
@@ -2322,6 +2325,7 @@ const getShuffledChoices = (choices, session, updateSession, choiceKey) =>
2322
2325
  * @param env - env to check if we should lock order
2323
2326
  * @returns {boolean}
2324
2327
  */
2328
+
2325
2329
  const lockChoices = (model, session, env) => {
2326
2330
  if (model.lockChoiceOrder) {
2327
2331
  return true;
@@ -2337,17 +2341,16 @@ const lockChoices = (model, session, env) => {
2337
2341
 
2338
2342
  if (role === 'instructor') {
2339
2343
  // TODO: .. in the future the instructor can toggle between ordinal and shuffled here, so keeping this code until then
2340
- /*const alreadyShuffled = hasShuffledValues(session);
2341
2344
 
2342
- if (alreadyShuffled) {
2345
+ /*const alreadyShuffled = hasShuffledValues(session);
2346
+ if (alreadyShuffled) {
2343
2347
  return false;
2344
2348
  }
2345
-
2346
- return true;*/
2349
+ return true;*/
2347
2350
  return true;
2348
- }
2351
+ } // here it's a student, so don't lock and it will shuffle if needs be
2352
+
2349
2353
 
2350
- // here it's a student, so don't lock and it will shuffle if needs be
2351
2354
  return false;
2352
2355
  };
2353
2356
 
@@ -3861,7 +3864,7 @@ function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) {
3861
3864
  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); }; }
3862
3865
  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; } }
3863
3866
  var checkedLoadedFor = {};
3864
- var Translator$1 = function (_EventEmitter) {
3867
+ var Translator = function (_EventEmitter) {
3865
3868
  _inherits(Translator, _EventEmitter);
3866
3869
  var _super = _createSuper$2(Translator);
3867
3870
  function Translator(services) {
@@ -5470,7 +5473,7 @@ var I18n = function (_EventEmitter) {
5470
5473
  s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
5471
5474
  if (s.i18nFormat.init) s.i18nFormat.init(this);
5472
5475
  }
5473
- this.translator = new Translator$1(this.services, this.options);
5476
+ this.translator = new Translator(this.services, this.options);
5474
5477
  this.translator.on('*', function (event) {
5475
5478
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
5476
5479
  args[_key2 - 1] = arguments[_key2];
@@ -5830,7 +5833,7 @@ var I18n = function (_EventEmitter) {
5830
5833
  clone.services.utils = {
5831
5834
  hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
5832
5835
  };
5833
- clone.translator = new Translator$1(clone.services, clone.options);
5836
+ clone.translator = new Translator(clone.services, clone.options);
5834
5837
  clone.translator.on('*', function (event) {
5835
5838
  for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
5836
5839
  args[_key4 - 1] = arguments[_key4];
@@ -5881,26 +5884,41 @@ instance.hasLoadedNamespace;
5881
5884
  instance.loadNamespaces;
5882
5885
  instance.loadLanguages;
5883
5886
 
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
+
5884
5905
  var en = {
5885
5906
  translation: {
5886
5907
  categorize: {
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].',
5908
+ limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
5909
+ maxChoicesPerCategoryRestriction: 'To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s].'
5891
5910
  },
5892
5911
  ebsr: {
5893
- part: 'Part {{index}}',
5912
+ part: 'Part {{index}}'
5894
5913
  },
5895
5914
  numberLine: {
5896
5915
  addElementLimit_one: 'You can only add {{count}} element',
5897
5916
  addElementLimit_other: 'You can only add {{count}} elements',
5898
- clearAll: 'Clear all',
5917
+ clearAll: 'Clear all'
5899
5918
  },
5900
5919
  imageClozeAssociation: {
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',
5920
+ reachedLimit_one: 'You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.',
5921
+ reachedLimit_other: 'Full'
5904
5922
  },
5905
5923
  drawingResponse: {
5906
5924
  fillColor: 'Fill color',
@@ -5916,7 +5934,7 @@ var en = {
5916
5934
  green: 'Green',
5917
5935
  white: 'White',
5918
5936
  black: 'Black',
5919
- onDoubleClick: 'Double click to edit this text. Press Enter to submit.',
5937
+ onDoubleClick: 'Double click to edit this text. Press Enter to submit.'
5920
5938
  },
5921
5939
  charting: {
5922
5940
  addCategory: 'Add category',
@@ -5928,8 +5946,8 @@ var en = {
5928
5946
  keyLegend: {
5929
5947
  incorrectAnswer: 'Student incorrect answer',
5930
5948
  correctAnswer: 'Student correct answer',
5931
- correctKeyAnswer: 'Answer key correct',
5932
- },
5949
+ correctKeyAnswer: 'Answer key correct'
5950
+ }
5933
5951
  },
5934
5952
  graphing: {
5935
5953
  point: 'Point',
@@ -5945,25 +5963,24 @@ var en = {
5945
5963
  vector: 'Vector',
5946
5964
  label: 'Label',
5947
5965
  redo: 'Redo',
5948
- reset: 'Reset',
5966
+ reset: 'Reset'
5949
5967
  },
5950
5968
  mathInline: {
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.',
5969
+ primaryCorrectWithAlternates: '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.'
5953
5970
  },
5954
5971
  multipleChoice: {
5955
5972
  minSelections: 'Select at least {{minSelections}}.',
5956
5973
  maxSelections_one: 'Only {{maxSelections}} answer is allowed.',
5957
5974
  maxSelections_other: 'Only {{maxSelections}} answers are allowed.',
5958
5975
  minmaxSelections_equal: 'Select {{minSelections}}.',
5959
- minmaxSelections_range: 'Select between {{minSelections}} and {{maxSelections}}.',
5976
+ minmaxSelections_range: 'Select between {{minSelections}} and {{maxSelections}}.'
5960
5977
  },
5961
5978
  selectText: {
5962
5979
  correctAnswerSelected: 'Correct',
5963
5980
  correctAnswerNotSelected: 'Correct Answer Not Selected',
5964
5981
  incorrectSelection: 'Incorrect Selection',
5965
- key: 'Key',
5966
- },
5982
+ key: 'Key'
5983
+ }
5967
5984
  },
5968
5985
  common: {
5969
5986
  undo: 'Undo',
@@ -5972,35 +5989,31 @@ var en = {
5972
5989
  incorrect: 'Incorrect',
5973
5990
  showCorrectAnswer: 'Show correct answer',
5974
5991
  hideCorrectAnswer: 'Hide correct answer',
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.',
5992
+ commonCorrectAnswerWithAlternates: '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.',
5977
5993
  warning: 'Warning',
5978
5994
  showNote: 'Show Note',
5979
5995
  hideNote: 'Hide Note',
5980
- cancel: 'Cancel',
5981
- },
5996
+ cancel: 'Cancel'
5997
+ }
5982
5998
  };
5983
5999
 
5984
6000
  var es = {
5985
6001
  translation: {
5986
6002
  categorize: {
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',
6003
+ limitMaxChoicesPerCategory: 'Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.',
6004
+ maxChoicesPerCategoryRestriction: 'Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta'
5991
6005
  },
5992
6006
  ebsr: {
5993
- part: 'Parte {{index}}',
6007
+ part: 'Parte {{index}}'
5994
6008
  },
5995
6009
  numberLine: {
5996
6010
  addElementLimit_one: 'Solo puedes agregar {{count}} elemento',
5997
6011
  addElementLimit_other: 'Solo puedes agregar {{count}} elementos',
5998
- clearAll: 'Borrar todo',
6012
+ clearAll: 'Borrar todo'
5999
6013
  },
6000
6014
  imageClozeAssociation: {
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',
6015
+ reachedLimit_one: 'Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.',
6016
+ reachedLimit_other: 'Lleno'
6004
6017
  },
6005
6018
  drawingResponse: {
6006
6019
  fillColor: 'Color de relleno',
@@ -6016,7 +6029,7 @@ var es = {
6016
6029
  green: 'Verde',
6017
6030
  white: 'Blanco',
6018
6031
  black: 'Negro',
6019
- onDoubleClick: 'Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar',
6032
+ onDoubleClick: 'Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar'
6020
6033
  },
6021
6034
  charting: {
6022
6035
  addCategory: 'Añadir categoría',
@@ -6028,8 +6041,8 @@ var es = {
6028
6041
  keyLegend: {
6029
6042
  incorrectAnswer: 'Respuesta incorrecta del estudiante',
6030
6043
  correctAnswer: 'Respuesta correcta del estudiante',
6031
- correctKeyAnswer: 'Clave de respuesta correcta',
6032
- },
6044
+ correctKeyAnswer: 'Clave de respuesta correcta'
6045
+ }
6033
6046
  },
6034
6047
  graphing: {
6035
6048
  point: 'Punto',
@@ -6045,25 +6058,24 @@ var es = {
6045
6058
  vector: 'Vector',
6046
6059
  label: 'Etiqueta',
6047
6060
  redo: 'Rehacer',
6048
- reset: 'Reiniciar',
6061
+ reset: 'Reiniciar'
6049
6062
  },
6050
6063
  mathInline: {
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.',
6064
+ primaryCorrectWithAlternates: '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.'
6053
6065
  },
6054
6066
  multipleChoice: {
6055
6067
  minSelections: 'Seleccione al menos {{minSelections}}.',
6056
6068
  maxSelections_one: 'Sólo se permite {{maxSelections}} respuesta.',
6057
6069
  maxSelections_other: 'Sólo se permiten {{maxSelections}} respuestas.',
6058
6070
  minmaxSelections_equal: 'Seleccione {{minSelections}}.',
6059
- minmaxSelections_range: 'Seleccione entre {{minSelections}} y {{maxSelections}}.',
6071
+ minmaxSelections_range: 'Seleccione entre {{minSelections}} y {{maxSelections}}.'
6060
6072
  },
6061
6073
  selectText: {
6062
6074
  correctAnswerSelected: 'Respuesta Correcta',
6063
6075
  correctAnswerNotSelected: 'Respuesta Correcta No Seleccionada',
6064
6076
  incorrectSelection: 'Selección Incorrecta',
6065
- key: 'Clave',
6066
- },
6077
+ key: 'Clave'
6078
+ }
6067
6079
  },
6068
6080
  common: {
6069
6081
  undo: 'Deshacer',
@@ -6072,13 +6084,12 @@ var es = {
6072
6084
  incorrect: 'Incorrect',
6073
6085
  showCorrectAnswer: 'Mostrar respuesta correcta',
6074
6086
  hideCorrectAnswer: 'Ocultar respuesta correcta',
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.',
6087
+ commonCorrectAnswerWithAlternates: '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.',
6077
6088
  warning: 'Advertencia',
6078
6089
  showNote: 'Mostrar Nota',
6079
6090
  hideNote: 'Ocultar Nota',
6080
- cancel: 'Cancelar',
6081
- },
6091
+ cancel: 'Cancelar'
6092
+ }
6082
6093
  };
6083
6094
 
6084
6095
  instance.init({
@@ -6087,15 +6098,15 @@ instance.init({
6087
6098
  debug: true,
6088
6099
  resources: {
6089
6100
  en: en,
6090
- es: es,
6091
- },
6101
+ es: es
6102
+ }
6092
6103
  });
6093
-
6094
- var Translator = {
6095
- translator: {
6096
- ...instance,
6104
+ var index = {
6105
+ translator: _extends({}, instance, {
6097
6106
  t: (key, options) => {
6098
- const { lng } = options;
6107
+ const {
6108
+ lng
6109
+ } = options;
6099
6110
 
6100
6111
  switch (lng) {
6101
6112
  // these keys don't work with plurals, don't know why, so I added a workaround to convert them to the correct lng
@@ -6103,6 +6114,7 @@ var Translator = {
6103
6114
  case 'en-US':
6104
6115
  options.lng = 'en';
6105
6116
  break;
6117
+
6106
6118
  case 'es_ES':
6107
6119
  case 'es-ES':
6108
6120
  case 'es_MX':
@@ -6110,16 +6122,22 @@ var Translator = {
6110
6122
  options.lng = 'es';
6111
6123
  break;
6112
6124
  }
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
- ],
6125
+
6126
+ return instance.t(key, _extends({
6127
+ lng
6128
+ }, options));
6129
+ }
6130
+ }),
6131
+ languageOptions: [{
6132
+ value: 'en_US',
6133
+ label: 'English (US)'
6134
+ }, {
6135
+ value: 'es_ES',
6136
+ label: 'Spanish'
6137
+ }]
6120
6138
  };
6121
6139
 
6122
- const { translator } = Translator;
6140
+ const { translator } = index;
6123
6141
 
6124
6142
  const prepareChoice = (model, env, defaultFeedback) => (choice) => {
6125
6143
  const out = {
@@ -6323,7 +6341,7 @@ function outcome(config, session, env) {
6323
6341
  if (value) {
6324
6342
  const { partA, partB } = value || {};
6325
6343
 
6326
- const partialScoringEnabled = enabled(config, env);
6344
+ const partialScoringEnabled = partialScoring.enabled(config, env);
6327
6345
 
6328
6346
  const scoreA = getScore(config, partA, 'partA', partialScoringEnabled);
6329
6347
  const scoreB = getScore(config, partB, 'partB', partialScoringEnabled);