1import{a as e}from"./element-plus.80abf16b.js";import{c1 as o,bK as i,bM as t,bQ as s,bR as n,cn as l,bV as c,c2 as d,c3 as r,bP as a,bI as p,cI as u,ca as v,cd as m,cb as I,cY as f,co as b,c7 as w,cf as L,cp as y,ew as k,ep as h,eq as C}from"./commonmodules.b9c1dd40.js";import{_ as x,u as O,a as S}from"./index.d3bd9396.js";import{C as g,A as K}from"./model.a6a58c89.js";import"./lodash-es.480d1bd8.js";import"./axios.1263d4b1.js";import"./vue-router.5e13d197.js";const j=e=>(h("data-v-0c4d743e"),e=e(),C(),e),E={key:0,class:"slider"},T={class:"slider-item"},_=["id"],A=["onKeydown","onClick"],B={class:"point-label"},D={key:0,class:"icon-panel"},$={class:"break-word"},F={key:1,class:"slider-mobile"},P={class:"slider-label"},M={class:"label-item"},R={class:"slider"},W={class:"slider-item"},q=j((()=>v("div",{class:"point-label"},null,-1))),z=["id"],Q=["onKeydown","onClick"],V={class:"slider-option-list"},Y={class:"slider-option-list-item"},G={key:0,class:"icon-panel"},H={key:2,class:"correct-message"},J={key:3,class:"answer-message"},N={key:4,class:"slider"},U={class:"slider-item"},X=["id"],Z=["onKeydown","onClick"],ee={class:"point-label"},oe={class:"icon-panel"},ie={key:5,class:"slider-mobile"},te={class:"slider-label"},se={class:"label-item"},ne={class:"slider"},le={class:"slider-item"},ce=j((()=>v("div",{class:"point-label"},null,-1))),de=["id"],re=["onKeydown","onClick"],ae={class:"slider-option-list"},pe={class:"slider-option-list-item"},ue={class:"icon-panel"};var ve=x(o({__name:"Sliders",props:{optionList:null,selectedId:null,correctSelectedId:null,answerOptionList:null,isCorrect:{type:Boolean},componentType:null},emits:["onChange"],setup(o,{expose:h,emit:C}){const x=o,j=O();let ve,me=[],Ie=[];const fe=i((()=>{var e;return null!=(e=x.optionList.findIndex((e=>e.optionId===x.selectedId)))?e:-1})),be=i((()=>x.answerOptionList.findIndex((e=>e.optionId===x.correctSelectedId+"answer")))),we=i((()=>x.selectedId)),Le=i((()=>j.state.course.assessmentType&&x.componentType===g.Assessment)),ye=i((()=>j.state.course.assessmentType===K.Review)),ke=t(S.isMobileOrTablets()),he=(e,o)=>{ye.value||(C("onChange",o),null==ve||ve.remove(),ve=null,e>0&&l((()=>{Ce(x.optionList[0].optionId,o,!0)})))},Ce=(e,o,i,t)=>{const s=k.setLine(document.getElementById(e),document.getElementById(o));s.setOptions({color:i?"#BE0212":"#DFDFDF",size:4,path:"straight",startPlug:"behind",endPlug:"behind",startSocket:"left",endSocket:"right"}),s.show(),i&&!t?ve=s:t?Ie.push(s):me.push(s)},xe=()=>{for(let e=0;e<x.optionList.length-1;e++)Ce(x.optionList[e].optionId,x.optionList[e+1].optionId);if(Le.value&&!x.isCorrect){for(let e=0;e<x.answerOptionList.length-1;e++)Ce(x.answerOptionList[e].optionId,x.answerOptionList[e+1].optionId,!1,!0);Ce(x.answerOptionList[0].optionId,x.correctSelectedId+"answer",!0,!0)}x.selectedId&&Ce(x.optionList[0].optionId,x.selectedId,!0)};s((()=>Le.value),(()=>{Le.value&&!x.isCorrect&&l((()=>{for(let e=0;e<x.answerOptionList.length-1;e++)Ce(x.answerOptionList[e].optionId,x.answerOptionList[e+1].optionId,!1,!0);Ce(x.answerOptionList[0].optionId,x.correctSelectedId+"answer",!0,!0)}))})),s((()=>[ke.value]),(()=>{Oe(),l((()=>{xe()}))}));const Oe=()=>{l((()=>{me.forEach((e=>e.remove())),Ie.forEach((e=>e.remove())),null==ve||ve.remove(),ve=null,me=[],Ie=[]}))};return n((()=>{l((()=>{xe()}))})),c((()=>{Oe()})),h({updateDrawLine:()=>{l((()=>{me.map((e=>e.position())),Ie.map((e=>e.position())),null==ve||ve.position()}))},clearAllLines:Oe,clearAnswerLines:()=>{l((()=>{Ie.forEach((e=>e.remove())),null==ve||ve.remove(),ve=null,Ie=[]}))}}),(o,i)=>{const t=e;return d(),r(p,null,[a(ke)?(d(),r("div",F,[v("div",P,[(d(!0),r(p,null,u(x.optionList,((e,o)=>(d(),r("div",{style:y({minWidth:a(we)===e.optionId?100/x.optionList.length+"%":"0"})},[v("div",M,[v("div",null,L(a(we)===e.optionId?e.optionLabel:""),1)])],4)))),256))]),v("div",R,[(d(!0),r(p,null,u(x.optionList,((e,o)=>(d(),r("div",W,[q,v("div",{class:I(["slider-item-top",{"include-item":o<a(fe),"exclude-item":o>a(fe)}]),id:e.optionId},[v("div",{class:I(["point",{"curSelect-point":o===a(fe),"include-point":o<a(fe),"exclude-point":o>a(fe)}]),onKeydown:f(b((i=>he(o,e.optionId)),["prevent"]),["enter"]),onClick:i=>he(o,e.optionId),tabindex:"0"}
1,null,42,Q)],10,z),v("div",null,L(o+1),1)])))),256))]),v("div",V,[(d(!0),r(p,null,u(x.optionList,((e,o)=>(d(),r("div",Y,[a(Le)&&!x.isCorrect?(d(),r("div",G,[x.correctSelectedId===e.optionId?(d(),w(t,{key:0,class:"icon-ffl icon-ffl-check color-correct"})):m("",!0),x.selectedId===e.optionId?(d(),w(t,{key:1,class:"icon-ffl icon-ffl-Icon-close color-incorrect"})):m("",!0)])):m("",!0),v("div",null,L(`${o+1}: ${e.optionLabel} `),1)])))),256))])])):(d(),r("div",E,[(d(!0),r(p,null,u(x.optionList,((e,o)=>(d(),r("div",T,[v("div",{class:I(["slider-item-top",{"include-item":o<a(fe),"exclude-item":o>a(fe)}]),id:e.optionId},[v("div",{class:I(["point",{"curSelect-point":o===a(fe),"include-point":o<a(fe),"exclude-point":o>a(fe)}]),onKeydown:f(b((i=>he(o,e.optionId)),["prevent"]),["enter"]),onClick:i=>he(o,e.optionId),tabindex:"0"},null,42,A)],10,_),v("div",B,[a(Le)&&!x.isCorrect?(d(),r("div",D,[x.correctSelectedId===e.optionId?(d(),w(t,{key:0,class:"icon-ffl icon-ffl-check color-correct"})):m("",!0),x.selectedId===e.optionId?(d(),w(t,{key:1,class:"icon-ffl icon-ffl-Icon-close color-incorrect"})):m("",!0)])):m("",!0),v("div",$,L(e.optionLabel),1)])])))),256))])),a(Le)&&x.isCorrect?(d(),r("div",H,"Correct!")):m("",!0),a(Le)&&!x.isCorrect?(d(),r("div",J,"Correct answer:")):m("",!0),!a(Le)||x.isCorrect||a(ke)?m("",!0):(d(),r("div",N,[(d(!0),r(p,null,u(x.answerOptionList,((e,o)=>(d(),r("div",U,[v("div",{class:I(["slider-item-top",{"include-item":o<=a(be),"exclude-item":o>a(be)}]),id:e.optionId},[v("div",{class:I(["point",{"curSelect-point":o===a(be),"include-point":o<a(be),"exclude-point":o>a(be)}]),onKeydown:f(b((i=>he(o,e.optionId)),["prevent"]),["enter"]),onClick:i=>he(o,e.optionId),tabindex:"0"},null,42,Z)],10,X),v("div",ee,[v("div",oe,[x.correctSelectedId+"answer"===e.optionId?(d(),w(t,{key:0,class:"icon-ffl icon-ffl-check color-correct"})):m("",!0)]),v("div",null,L(e.optionLabel),1)])])))),256))])),a(Le)&&!x.isCorrect&&a(ke)?(d(),r("div",ie,[v("div",te,[(d(!0),r(p,null,u(x.answerOptionList,((e,o)=>(d(),r("div",{style:y({minWidth:x.correctSelectedId+"answer"===e.optionId?100/x.answerOptionList.length+"%":"0"})},[v("div",se,[v("div",null,L(x.correctSelectedId+"answer"===e.optionId?e.optionLabel:""),1)])],4)))),256))]),v("div",ne,[(d(!0),r(p,null,u(x.answerOptionList,((e,o)=>(d(),r("div",le,[ce,v("div",{class:I(["slider-item-top",{"include-item":o<a(be),"exclude-item":o>a(be)}]),id:e.optionId},[v("div",{class:I(["point",{"curSelect-point":o===a(be),"include-point":o<a(be),"exclude-point":o>a(be)}]),onKeydown:f(b((i=>he(o,e.optionId)),["prevent"]),["enter"]),onClick:i=>he(o,e.optionId),tabindex:"0"},null,42,re)],10,de),v("div",null,L(o+1),1)])))),256))]),v("div",ae,[(d(!0),r(p,null,u(x.answerOptionList,((e,o)=>(d(),r("div",pe,[v("div",ue,[x.correctSelectedId+"answer"===e.optionId?(d(),w(t,{key:0,class:"icon-ffl icon-ffl-check color-correct"})):m("",!0)]),v("div",null,L(`${o+1}: ${e.optionLabel} `),1)])))),256))])])):m("",!0)],64)}}}),[["__scopeId","data-v-0c4d743e"]]);export{ve as default};
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.