!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(c){return void t(c)}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.48c8d62c.js","./icon-question-nums-legacy.7080fe5e.js","./index-legacy.c57970b0.js","./index-legacy.8cf5f94f.js","./index-legacy.087e0425.js","./index-legacy.71047e87.js","./index-legacy.0e0de364.js","./index-legacy.b7e8815a.js","./index-legacy.8429fc95.js","./index-legacy.93204044.js"],(function(n){"use strict";var r,s,o,u,c,l,d,f,p,m,w,y,g,h,v,x,_,q,b,A,O,S,R,j,T,E,I,k,C,L,D;return{setters:[function(e){r=e.d,s=e.aV,o=e.ag,u=e.R,c=e.r,l=e.$,d=e.f,f=e.a_,p=e.c,m=e.a5,w=e.q,y=e.B,g=e.ak,h=e.m,v=e._,x=e.am},function(e){_=e.i},function(e){q=e.e,b=e.Q,A=e.C,O=e.D,S=e.K,R=e.P,j=e.i,T=e.A},function(e){E=e.O},function(e){I=e.C},function(e){k=e.S,C=e.a},function(e){L=e.I},function(e){D=e.A},function(){},function(){}],execute:function(){var P="_unitDetail_1qg73_1",N="_unitSection_1qg73_4",U="_unitTitle_1qg73_11",H="_unitCount_1qg73_16",F="_qNums_1qg73_22",B="_num_1qg73_29",J="_icon_1qg73_32",K="_wapList_1qg73_37";n("default",r({name:"unit-detail",setup:function(){var n=s(),r=o(),z=u(),G=c({id:n.query.id,examDetail:{},visiableAnswer:!1,currentIndex:0,questionList:[],time:0,resultInfo:{},answerResult:[],nextStatus:!1,swipeHeight:"auto"}),Q=function(){var n=a(regeneratorRuntime.mark((function n(){var r,s,a,o,u,c,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,h.post("/api-student/studentUnitExamination/detail",{requestType:"form",data:{studentUnitExaminationId:G.id}});case 3:r=n.sent,s=r.data,a=s.questionJson,o=s.studentAnswerJson,u=s.answerResult,c=i(s,e),l=a||[],G.answerResult=u?JSON.parse(u):[],console.log(G.answerResult,l),l.forEach((function(e){e.userAnswer=X(e,o),e.showAnalysis=!0,e.showScore=!0,e.analysis={message:e.answerAnalysis,topic:!0,userResult:Y(e.id)}})),G.questionList=l,G.examDetail=t({},c)||{},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)}}(),M=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,h.post(d.platformApi+"/classGroupUnitExamination/report",{requestType:"form",data:{classGroupUnitExaminationId:G.id,level:n.query.level}});case 3:t=e.sent,r=t.data,G.examDetail={unitExaminationName:r.unitExaminationName,questionNum:r.questionNum||0},(i=r.examinationQuestionAdds||[]).forEach((function(e){var n=e.rightAnswers||[];e.userAnswer=V(n),e.showAnalysis=!0,e.showRate=!0,e.showScore=!1,e.analysis={message:e.answerAnalysis,topic:!1}})),G.questionList=i,console.log(G.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)}}(),V=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||[]},X=function(e,n){if(!n)return[];var t=n||[];return t[e.id]?t[e.id]:[]},Y=function(e){var n=!1;return G.answerResult.forEach((function(t){t.questionId===e&&(n=t.rightFlag)})),n},$=0,W=function e(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];v((function(){n&&window.scrollTo(0,0),setTimeout((function(){var t,r=null===(t=document.querySelectorAll(".van-swipe-item")[G.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&&$<3&&setTimeout((function(){$+=1,e(n)}),300),s&&($=0);var a=x(r);console.log("🚀 ~ setTimeout ~ rect",a,G.currentIndex),G.swipeHeight=a.height}),100)}))},Z=function(){var e=a(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{G.nextStatus=!0,G.questionList.length===G.currentIndex+1&&(q.emit("unitAudioStop"),r.back()),null===(n=z.value)||void 0===n||n.next(),G.nextStatus=!1}catch(t){G.nextStatus=!1}case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return l(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,M();case 3:e.next=7;break;case 5:return e.next=7,Q();case 7:W();case 8:case"end":return e.stop()}}),e)})))),f((function(){q.emit("unitAudioStop")})),function(){var e,n;return p("div",{class:P},[p(I,{center:!0,class:N,border:!1},{title:function(){return p("div",{class:U},[G.examDetail.unitExaminationName])},label:function(){return p("div",{class:H},[p("div",{class:F},[p(m,{class:J,name:_},null),w("题目数量")," ",p("span",{class:B,style:{paddingLeft:"6px"}},[G.currentIndex+1]),w("/"),G.examDetail.questionNum||0])])}}),p(k,{loop:!1,showIndicators:!1,ref:z,duration:300,touchable:!1,lazyRender:!0,style:{paddingBottom:"12px"},height:G.swipeHeight,onChange:function(e){q.emit("unitAudioStop"),G.currentIndex=e,W()}},(n=e=G.questionList.map((function(e,n){return p(C,null,{default:function(){return[p("div",{class:"swipe-item-question"},[e.questionTypeCode===b.RADIO&&p(A,{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===b.CHECKBOX&&p(A,{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===b.SORT&&p(O,{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===b.LINK&&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===b.PLAY&&p(R,{readOnly:!0,value:e.userAnswer,"onUpdate:value":function(n){return e.userAnswer=n},data:e,index:n+1,unitId:G.id,showScore:e.showScore,showRate:e.showRate,showAnalysis:e.showAnalysis,analysis:e.analysis},null)])]}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!g(n)?e:{default:function(){return[e]}})),p(E,{position:"bottom",background:"white"},{default:function(){return[p("div",{class:["btnGroup btnMore"]},[G.currentIndex>0&&p(y,{round:!0,block:!0,type:"primary",plain:!0,onClick:function(){var e;null===(e=z.value)||void 0===e||e.prev()}},{default:function(){return[w("上一题")]}}),p(y,{block:!0,round:!0,type:"primary",onClick:Z,loading:G.nextStatus,disabled:G.nextStatus},{default:function(){return[G.questionList.length===G.currentIndex+1?"确定":"下一题"]}}),p(L,{src:j,class:[K,"van-haptics-feedback"],onClick:function(){return G.visiableAnswer=!0}},null)])]}}),p(D,{show:G.visiableAnswer,"onUpdate:show":function(e){return G.visiableAnswer=e},title:"题目列表",safeAreaInsetBottom:!0},{default:function(){return[p(T,{value:G.questionList,answerResult:G.answerResult,index:G.currentIndex,lookType:"STUDENT"===d.platformType?"RESULT":"CLICK",statusList:"STUDENT"===d.platformType?[{text:"答对",color:"#71B0FF"},{text:"答错",color:"#FF8486"}]:[],onSelect:function(e){var n;null===(n=z.value)||void 0===n||n.swipeTo(e,{immediate:!0}),G.visiableAnswer=!1}},null)]}})])}}}))}}}))}();