PageSourceSearch

https://www.mucosolvan.com/.resources-v2/opella-lm-templates/themes/templates/dist/js/quiz-BMvHgJvl.js

js mucosolvan.com collected 2026-10-10 02:24:33 UTC 2,370 bytes, 2 lines download raw bytes

1import{b as t}from"./baseForm-CXB6JOsU.js";const e=t=>t.getAttribute("name"),s=t=>{let e=0;switch((t=>t.getAttribute("type"))(t)){case"checkbox":return t.checked?(t=>t.getAttribute("data-true-value"))(t):(t=>t.getAttribute("data-false-value"))(t);case"radio":if(t.checked)return e=t.value,e;break;default:return t.value}};var i=i=>({...i,...t(),page:1,formName:"quiz",steps:{complete:"complete",error:"error"},totalSteps:0,step:"",hasSubmitted:!1,quizTotal:0,disabledBtn:!1,valuesTotal:{},goToPage(t){this.page=t,this.$scrollTo(this.$root,{behavior:"instant"})},init(){this.totalSteps=this.stepCount,this.step="0",this.$track({event:"cmp_event",event_type:"quiz",action:"start",name:this.formName})},getStepIndex(t){return Object.values(this.steps).indexOf(t)},async isValidStep(t,i){var r;this.checkFormValidation()?(this.goToStep(t),r=this.valuesTotal,this.$root.querySelectorAll(["input","select"]).forEach(t=>{console.log(s(t)),e(t)&&(r[e(t)]=parseInt(s(t)))}),this.isCurrentStep("complete")&&this.submit()):(i.preventDefault(),this.markAllFieldsAsTouched(),await this.getFormErrors(),this.focusFirstInvalid())},goToStep(t){this.step=this.steps[t],t===this.steps[0]&&(this.page=1),this.$scrollTo(this.$root),this.$track({event:"cmp_event",name:this.formName,event_type:"quiz_step",step_name:t,step_number:this.getStepIndex(t),interaction_type:"form",length:4,option:t})},focusOnFirstInput(){this.$nextTick(()=>{if(this._isFormStarted){const t=this.$root.querySelector("input, select, textarea");this.$focus.focus(t)}})},goToPrevStep(t){this.$root.querySelectorAll("[x-model]").forEach(t=>{const e=t.getAttribute("x-model").replace(/^formData\./,"");delete this._formSchema[e]}),this.goToStep(t)},isCurrentStep(t){return!!this.$isEditMode()||this.step==t},isCurrentEnding(t){return!!this.$isEditMode()||this.quizTotal<t&&this.hasSubmitted},setQuizSteps(t){if(this.steps)for(let e=0;e<t;e++)this.steps[e]=`${e}`},reset(t){this.step="0",this.clearForm(t),this.hasSubmitted=!1,this.quizTotal=0,this.valuesTotal={},this.formData={},this._formSchema={},this.focusOnFirstInput()},async submit(){var t;this.hasSubmitted=!0,this.errorMessage="",this.quizTotal=(t=this.valuesTotal,Object.values(t).reduce((t,e)=>t+e,0)),this.quizTotal<0&&this.goToStep(this.steps.error),this.$focus.focus(this.$refs.resetBtn)}});export{i as default};
2//# sourceMappingURL=quiz-BMvHgJvl.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.