1 |
- !function(){var e=document.createElement("style");e.innerHTML="._unitDetail_1qg73_1{overflow:hidden}._unitSection_1qg73_4{margin:.32rem .34667rem;padding:.34667rem .4rem;width:auto;overflow:hidden;border-radius:.26667rem}._unitSection_1qg73_4 ._unitTitle_1qg73_11{font-size:.42667rem;font-weight:500;color:#333}._unitSection_1qg73_4 ._unitCount_1qg73_16{padding-top:.13333rem;display:flex;align-items:center;justify-content:space-between}._unitSection_1qg73_4 ._qNums_1qg73_22{display:flex;align-items:center;font-size:.37333rem;color:#333;line-height:.53333rem}._unitSection_1qg73_4 ._qNums_1qg73_22 ._num_1qg73_29{color:#f67146}._unitSection_1qg73_4 ._icon_1qg73_32{width:.37333rem;height:.37333rem;margin-right:.10667rem}._wapList_1qg73_37{width:1.17333rem;height:1.17333rem;flex-shrink:0;margin-left:.48rem}\n",document.head.appendChild(e),System.register(["./index-legacy.eb062188.js","./icon-question-nums-legacy.7080fe5e.js","./index-legacy.b9c79165.js","./index-legacy.ad813f4d.js","./index-legacy.918b8c74.js","./index-legacy.fab451f1.js","./index-legacy.fecc738b.js","./index-legacy.8c254533.js","./index-legacy.761bf286.js","./index-legacy.11f1ea5f.js"],(function(e){"use strict";var t,n,s,i,a,o,l,r,u,c,d,w,m,y,p,g,h,_,f,q,x,A,v,S,b,T,R,E,I,C,L,j;return{setters:[function(e){t=e.d,n=e.ah,s=e.ag,i=e.R,a=e.r,o=e.$,l=e.g,r=e.b7,u=e.c,c=e.aj,d=e.a5,w=e.q,m=e.B,y=e.al,p=e.m,g=e._,h=e.an},function(e){_=e.i},function(e){f=e.e,q=e.Q,x=e.C,A=e.D,v=e.K,S=e.P,b=e.i,T=e.A},function(e){R=e.O},function(e){E=e.C},function(e){I=e.S,C=e.a},function(e){L=e.I},function(e){j=e.A},function(){},function(){}],execute:function(){var O="_unitDetail_1qg73_1",N="_unitSection_1qg73_4",U="_unitTitle_1qg73_11",k="_unitCount_1qg73_16",D="_qNums_1qg73_22",H="_num_1qg73_29",F="_icon_1qg73_32",B="_wapList_1qg73_37";e("default",t({name:"unit-detail",setup(){const e=n(),t=s(),K=i(),z=a({id:e.query.id,examDetail:{},visiableAnswer:!1,currentIndex:0,questionList:[],time:0,resultInfo:{},answerResult:[],nextStatus:!1,swipeHeight:"auto"}),G=e=>{const t=[];return e.forEach((n=>{if(n.rightAnswerFlag){const s=e.find((e=>e.questionExtra===n.questionExtra));t.push({answer:n.questionAnswer,answerId:n.examinationQuestionAnswerId,answerExtra:s?s.questionExtra:null})}})),t||[]},J=(e,t)=>{if(!t)return[];const n=t||[];return n[e.id]?n[e.id]:[]},Q=e=>{let t=!1;return z.answerResult.forEach((n=>{n.questionId===e&&(t=n.rightFlag)})),t};let M=0;const P=(e=!0)=>{g((()=>{e&&window.scrollTo(0,0),setTimeout((()=>{var t;const n=null===(t=document.querySelectorAll(".van-swipe-item")[z.currentIndex])||void 0===t?void 0:t.querySelector(".swipe-item-question"),s=n.querySelectorAll(".answerTitleImg img");let i=!0;s.forEach((e=>{console.log(e.complete),e.complete||(i=!1)})),!i&&M<3&&setTimeout((()=>{M+=1,P(e)}),300),i&&(M=0);const a=h(n);console.log("🚀 ~ setTimeout ~ rect",a,z.currentIndex),z.swipeHeight=a.height}),100)}))},X=async()=>{try{var e;z.nextStatus=!0,z.questionList.length===z.currentIndex+1&&(f.emit("unitAudioStop"),t.back()),null===(e=K.value)||void 0===e||e.next(),z.nextStatus=!1}catch{z.nextStatus=!1}};return o((async()=>{"TEACHER"===l.platformType||"SCHOOL"===l.platformType?await(async()=>{try{const{data:t}=await p.post(l.platformApi+"/classGroupUnitExamination/report",{requestType:"form",data:{classGroupUnitExaminationId:z.id,level:e.query.level}});z.examDetail={unitExaminationName:t.unitExaminationName,questionNum:t.questionNum||0};const n=t.examinationQuestionAdds||[];n.forEach((e=>{const t=e.rightAnswers||[];e.userAnswer=G(t),e.showAnalysis=!0,e.showRate=!0,e.showScore=!1,e.analysis={message:e.answerAnalysis,topic:!1}})),z.questionList=n,console.log(z.questionList,"state.questionList")}catch{}})():await(async()=>{try{const{data:e}=await p.post("/api-student/studentUnitExamination/detail",{requestType:"form",data:{studentUnitExaminationId:z.id}}),{questionJson:t,studentAnswerJson:n,answerResult:s,...i}=e,a=t||[];z.answerResult=s?JSON.parse(s):[],console.log(z.answerResult,a),a.forEach((e=>{e.userAnswer=J(e,n),e.showAnalysis=!0,e.showScore=!0,e.analysis={message:e.answerAnalysis,topic:!0,userResult:Q(e.id)}})),z.questionList=a,z.examDetail={...i}||{}}catch{}})(),P()})),r((()=>{f.emit("unitAudioStop")})),()=>{let e;return u("div",{class:O},[u(c,null,null),u(E,{center:!0,class:N,border:!1},{title:()=>u("div",{class:U},[z.examDetail.unitExaminationName]),label:()=>u("div",{class:k},[u("div",{class:D},[u(d,{class:F,name:_},null),w("题目数量")," ",u("span",{class:H,style:{paddingLeft:"6px"}},[z.currentIndex+1]),w("/"),z.examDetail.questionNum||0])])}),u(I,{loop:!1,showIndicators:!1,ref:K,duration:300,touchable:!1,lazyRender:!0,style:{paddingBottom:"12px"},height:z.swipeHeight,onChange:e=>{f.emit("unitAudioStop"),z.currentIndex=e,P()}},(t=e=z.questionList.map(((e,t)=>u(C,null,{default:()=>[u("div",{class:"swipe-item-question"},[e.questionTypeCode===q.RADIO&&u(x,{value:e.userAnswer,"onUpdate:value":t=>e.userAnswer=t,index:t+1,data:e,readOnly:!0,type:"radio",showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null),e.questionTypeCode===q.CHECKBOX&&u(x,{value:e.userAnswer,"onUpdate:value":t=>e.userAnswer=t,index:t+1,data:e,readOnly:!0,type:"checkbox",showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null),e.questionTypeCode===q.SORT&&u(A,{readOnly:!0,value:e.userAnswer,"onUpdate:value":t=>e.userAnswer=t,data:e,index:t+1,showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null),e.questionTypeCode===q.LINK&&u(v,{readOnly:!0,value:e.userAnswer,"onUpdate:value":t=>e.userAnswer=t,data:e,index:t+1,showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null),e.questionTypeCode===q.PLAY&&u(S,{readOnly:!0,value:e.userAnswer,"onUpdate:value":t=>e.userAnswer=t,data:e,index:t+1,unitId:z.id,showScore:e.showScore,showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null)])]}))),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!y(t)?e:{default:()=>[e]})),u(R,{position:"bottom",background:"white"},{default:()=>[u("div",{class:["btnGroup btnMore"]},[z.currentIndex>0&&u(m,{round:!0,block:!0,type:"primary",plain:!0,onClick:()=>{var e;null===(e=K.value)||void 0===e||e.prev()}},{default:()=>[w("上一题")]}),u(m,{block:!0,round:!0,type:"primary",onClick:X,loading:z.nextStatus,disabled:z.nextStatus},{default:()=>[z.questionList.length===z.currentIndex+1?"确定":"下一题"]}),u(L,{src:b,class:[B,"van-haptics-feedback"],onClick:()=>z.visiableAnswer=!0},null)])]}),u(j,{show:z.visiableAnswer,"onUpdate:show":e=>z.visiableAnswer=e,title:"题目列表",safeAreaInsetBottom:!0},{default:()=>[u(T,{value:z.questionList,answerResult:z.answerResult,index:z.currentIndex,lookType:"STUDENT"===l.platformType?"RESULT":"CLICK",statusList:"STUDENT"===l.platformType?[{text:"答对",color:"#71B0FF"},{text:"答错",color:"#FF8486"}]:[],onSelect:e=>{var t;null===(t=K.value)||void 0===t||t.swipeTo(e,{immediate:!0}),z.visiableAnswer=!1}},null)]})]);var t}}}))}}}))}();
|