!function(){var e=["questionJson","studentAnswerJson","answerResult"];function n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function t(e){for(var t=1;t=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function s(e,n,t,r,i,s,a){try{var o=e[s](a),u=o.value}catch(l){return void t(l)}o.done?n(u):Promise.resolve(u).then(r,i)}function a(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var a=e.apply(n,t);function o(e){s(a,r,i,o,u,"next",e)}function u(e){s(a,r,i,o,u,"throw",e)}o(void 0)}))}}var o=document.createElement("style");o.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(o),System.register(["./index-legacy.90c82f08.js","./icon-question-nums-legacy.7080fe5e.js","./index-legacy.39834207.js","./index-legacy.84457c4c.js","./index-legacy.f3e5e283.js","./index-legacy.64e3b474.js","./index-legacy.eb4bc59e.js","./index-legacy.2870cc6d.js","./index-legacy.e4343e46.js","./index-legacy.92c1b9d6.js"],(function(n){"use strict";var r,s,o,u,l,c,d,f,p,m,w,y,g,h,v,x,_,q,b,A,O,S,R,j,T,E,I,k,C,L,D,P;return{setters:[function(e){r=e.d,s=e.ah,o=e.ag,u=e.R,l=e.r,c=e.$,d=e.g,f=e.b3,p=e.c,m=e.aj,w=e.a5,y=e.q,g=e.B,h=e.al,v=e.m,x=e._,_=e.an},function(e){q=e.i},function(e){b=e.e,A=e.Q,O=e.C,S=e.D,R=e.K,j=e.P,T=e.i,E=e.A},function(e){I=e.O},function(e){k=e.C},function(e){C=e.S,L=e.a},function(e){D=e.I},function(e){P=e.A},function(){},function(){}],execute:function(){var N="_unitDetail_1qg73_1",U="_unitSection_1qg73_4",H="_unitTitle_1qg73_11",F="_unitCount_1qg73_16",B="_qNums_1qg73_22",J="_num_1qg73_29",K="_icon_1qg73_32",z="_wapList_1qg73_37";n("default",r({name:"unit-detail",setup:function(){var n=s(),r=o(),G=u(),Q=l({id:n.query.id,examDetail:{},visiableAnswer:!1,currentIndex:0,questionList:[],time:0,resultInfo:{},answerResult:[],nextStatus:!1,swipeHeight:"auto"}),M=function(){var n=a(regeneratorRuntime.mark((function n(){var r,s,a,o,u,l,c;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,v.post("/api-student/studentUnitExamination/detail",{requestType:"form",data:{studentUnitExaminationId:Q.id}});case 3:r=n.sent,s=r.data,a=s.questionJson,o=s.studentAnswerJson,u=s.answerResult,l=i(s,e),c=a||[],Q.answerResult=u?JSON.parse(u):[],console.log(Q.answerResult,c),c.forEach((function(e){e.userAnswer=$(e,o),e.showAnalysis=!0,e.showScore=!0,e.analysis={message:e.answerAnalysis,topic:!0,userResult:V(e.id)}})),Q.questionList=c,Q.examDetail=t({},l)||{},n.next=16;break;case 14:n.prev=14,n.t0=n.catch(0);case 16:case"end":return n.stop()}}),n,null,[[0,14]])})));return function(){return n.apply(this,arguments)}}(),X=function(){var e=a(regeneratorRuntime.mark((function e(){var t,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v.post(d.platformApi+"/classGroupUnitExamination/report",{requestType:"form",data:{classGroupUnitExaminationId:Q.id,level:n.query.level}});case 3:t=e.sent,r=t.data,Q.examDetail={unitExaminationName:r.unitExaminationName,questionNum:r.questionNum||0},(i=r.examinationQuestionAdds||[]).forEach((function(e){var n=e.rightAnswers||[];e.userAnswer=Y(n),e.showAnalysis=!0,e.showRate=!0,e.showScore=!1,e.analysis={message:e.answerAnalysis,topic:!1}})),Q.questionList=i,console.log(Q.questionList,"state.questionList"),e.next=14;break;case 12:e.prev=12,e.t0=e.catch(0);case 14:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(){return e.apply(this,arguments)}}(),Y=function(e){var n=[];return e.forEach((function(t){if(t.rightAnswerFlag){var r=e.find((function(e){return e.questionExtra===t.questionExtra}));n.push({answer:t.questionAnswer,answerId:t.examinationQuestionAnswerId,answerExtra:r?r.questionExtra:null})}})),n||[]},$=function(e,n){if(!n)return[];var t=n||[];return t[e.id]?t[e.id]:[]},V=function(e){var n=!1;return Q.answerResult.forEach((function(t){t.questionId===e&&(n=t.rightFlag)})),n},W=0,Z=function e(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];x((function(){n&&window.scrollTo(0,0),setTimeout((function(){var t,r=null===(t=document.querySelectorAll(".van-swipe-item")[Q.currentIndex])||void 0===t?void 0:t.querySelector(".swipe-item-question"),i=r.querySelectorAll(".answerTitleImg img"),s=!0;i.forEach((function(e){console.log(e.complete),e.complete||(s=!1)})),!s&&W<3&&setTimeout((function(){W+=1,e(n)}),300),s&&(W=0);var a=_(r);console.log("🚀 ~ setTimeout ~ rect",a,Q.currentIndex),Q.swipeHeight=a.height}),100)}))},ee=function(){var e=a(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{Q.nextStatus=!0,Q.questionList.length===Q.currentIndex+1&&(b.emit("unitAudioStop"),r.back()),null===(n=G.value)||void 0===n||n.next(),Q.nextStatus=!1}catch(t){Q.nextStatus=!1}case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return c(a(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("TEACHER"!==d.platformType&&"SCHOOL"!==d.platformType){e.next=5;break}return e.next=3,X();case 3:e.next=7;break;case 5:return e.next=7,M();case 7:Z();case 8:case"end":return e.stop()}}),e)})))),f((function(){b.emit("unitAudioStop")})),function(){var e,n;return p("div",{class:N},[p(m,null,null),p(k,{center:!0,class:U,border:!1},{title:function(){return p("div",{class:H},[Q.examDetail.unitExaminationName])},label:function(){return p("div",{class:F},[p("div",{class:B},[p(w,{class:K,name:q},null),y("题目数量")," ",p("span",{class:J,style:{paddingLeft:"6px"}},[Q.currentIndex+1]),y("/"),Q.examDetail.questionNum||0])])}}),p(C,{loop:!1,showIndicators:!1,ref:G,duration:300,touchable:!1,lazyRender:!0,style:{paddingBottom:"12px"},height:Q.swipeHeight,onChange:function(e){b.emit("unitAudioStop"),Q.currentIndex=e,Z()}},(n=e=Q.questionList.map((function(e,n){return p(L,null,{default:function(){return[p("div",{class:"swipe-item-question"},[e.questionTypeCode===A.RADIO&&p(O,{value:e.userAnswer,"onUpdate:value":function(n){return e.userAnswer=n},index:n+1,data:e,readOnly:!0,type:"radio",showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null),e.questionTypeCode===A.CHECKBOX&&p(O,{value:e.userAnswer,"onUpdate:value":function(n){return e.userAnswer=n},index:n+1,data:e,readOnly:!0,type:"checkbox",showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null),e.questionTypeCode===A.SORT&&p(S,{readOnly:!0,value:e.userAnswer,"onUpdate:value":function(n){return e.userAnswer=n},data:e,index:n+1,showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null),e.questionTypeCode===A.LINK&&p(R,{readOnly:!0,value:e.userAnswer,"onUpdate:value":function(n){return e.userAnswer=n},data:e,index:n+1,showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null),e.questionTypeCode===A.PLAY&&p(j,{readOnly:!0,value:e.userAnswer,"onUpdate:value":function(n){return e.userAnswer=n},data:e,index:n+1,unitId:Q.id,showScore:e.showScore,showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null)])]}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!h(n)?e:{default:function(){return[e]}})),p(I,{position:"bottom",background:"white"},{default:function(){return[p("div",{class:["btnGroup btnMore"]},[Q.currentIndex>0&&p(g,{round:!0,block:!0,type:"primary",plain:!0,onClick:function(){var e;null===(e=G.value)||void 0===e||e.prev()}},{default:function(){return[y("上一题")]}}),p(g,{block:!0,round:!0,type:"primary",onClick:ee,loading:Q.nextStatus,disabled:Q.nextStatus},{default:function(){return[Q.questionList.length===Q.currentIndex+1?"确定":"下一题"]}}),p(D,{src:T,class:[z,"van-haptics-feedback"],onClick:function(){return Q.visiableAnswer=!0}},null)])]}}),p(P,{show:Q.visiableAnswer,"onUpdate:show":function(e){return Q.visiableAnswer=e},title:"题目列表",safeAreaInsetBottom:!0},{default:function(){return[p(E,{value:Q.questionList,answerResult:Q.answerResult,index:Q.currentIndex,lookType:"STUDENT"===d.platformType?"RESULT":"CLICK",statusList:"STUDENT"===d.platformType?[{text:"答对",color:"#71B0FF"},{text:"答错",color:"#FF8486"}]:[],onSelect:function(e){var n;null===(n=G.value)||void 0===n||n.swipeTo(e,{immediate:!0}),Q.visiableAnswer=!1}},null)]}})])}}}))}}}))}();