Latest build deployed.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
"use strict";(self.webpackChunkWebComponents=self.webpackChunkWebComponents||[]).push([[680],{84680:(e,t,r)=>{r.r(t);var s=r(78673);window.wwList={};class o extends s.A{constructor(e){super(e),this.useRunestoneServices=!0,this.multipleanswers=!1,this.divid=e.orig.id,this.correct=null,this.optional=!1,this.answerList=[],this.correctList=[],this.question=null,this.caption="WebWork",this.containerDiv=e.orig,this.answers={},this.percent=0,"fakeww-ww-rs"!==this.divid&&this.checkServer("webwork",!0),window.wwList[this.divid]=this}restoreAnswers(e){e.answer||(e.answer=""),this.answers=e.answer,this.correct=e.correct,this.percent=e.percent,console.log(`about to decorate the status of WW ${this.divid} ${this.correct}`),this.decorateStatus()}checkLocalStorage(){var e;if(!this.graderactive){localStorage.length;var t=localStorage.getItem(this.localStorageKey());if(null!==t){let r=!1;try{e=JSON.parse(t),this.answers=e.answer,this.correct=e.correct,this.percent=e.percent,this.decorateStatus()}catch(e){console.log(`Error parsing stored WebWork data for ${this.divid}: ${e.message}`),r=!0}if(r||e.timestamp<eBookConfig.termStartDate)return void localStorage.removeItem(this.localStorageKey())}}}setLocalStorage(e){var t=new Date,r={answer:e.answer,timestamp:t,correct:e.correct};localStorage.setItem(this.localStorageKey(),JSON.stringify(r))}processCurrentAnswers(e){let t=0,r=0,s="check:";this.answerObj={},this.lastAnswerRaw=e,this.answerObj.answers={},this.answerObj.mqAnswers={};for(let o of Object.keys(e.rh_result.answers)){let n;r+=1,1==e.rh_result.answers[o].score&&(t+=1),n=!("ww_version"in e)||e.ww_version.includes("2.16")||e.ww_version.includes("2.17")||e.ww_version.includes("2.18")?["Value (parserRadioButtons)","Value (PopUp)","Value (CheckboxList)"].includes(e.rh_result.answers[o].type)?e.rh_result.answers[o].student_value:e.rh_result.answers[o].original_student_ans:e.inputs_ref[o],this.answerObj.answers[o]=n;let i=`MaThQuIlL_${o}`;this.answerObj.mqAnswers[i]=e.inputs_ref[i],s+=`actual:${n}:expected:${e.rh_result.answers[o].correct_value}:`}let o=t/r;this.percent=o,this.actString=s+`correct:${t}:count:${r}:pct:${o}`,this.correct=1==o;let n={};n.answer=this.answerObj,n.correct=this.correct,n.percent=this.percent,this.setLocalStorage(n),this.decorateStatus()}async logCurrentAnswer(e){this.logBookEvent({event:"webwork",div_id:this.divid,act:this.actString,correct:this.correct,answer:JSON.stringify(this.answerObj)})}checkCurrentAnswer(){}}function n(e,t){if(eBookConfig.useRunestoneServices){let e=wwList[t.inputs_ref.problemUUID.replace("-ww-rs","")];e?(e.processCurrentAnswers(t),e.logCurrentAnswer()):console.log(`Error: Could not find webwork object ${t.inputs_ref.problemUUID}`)}}function i(e,t){if(eBookConfig.useRunestoneServices){let e=wwList[t.inputs_ref.problemUUID.replace("-ww-rs","")];e?e.logBookEvent({event:"webwork",div_id:t.inputs_ref.problemUUID,act:"show"}):console.log(`Error: Could not find webwork object ${t.inputs_ref.problemUUID}`)}}function c(e){return function(t,r){const s=void 0!==r?r:t.detail??t.originalEvent?.detail;void 0!==s&&e(t,s)}}function a(){window.jQuery?(window.jQuery("body").on("runestone_ww_check",c(n)),window.jQuery("body").on("runestone_show_correct",c(i))):(document.body.addEventListener("runestone_ww_check",c(n)),document.body.addEventListener("runestone_show_correct",c(i)))}void 0===window.component_factory&&(window.component_factory={}),window.component_factory.webwork=function(e){return new o(e)},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",a):a(),document.addEventListener("runestone:login-complete",(function(){for(let t of document.querySelectorAll("[data-component=webwork]")){var e={orig:t,useRunestoneServices:eBookConfig.useRunestoneServices};t.closest("[data-component=timedAssessment]")||(window.wwList[t.id]=new o(e))}}))}}]);
|
||||
//# sourceMappingURL=680.399919c86d64ef96.js.map
|
||||
Reference in New Issue
Block a user