import{Q as o}from"./QuestionsList.4ae2bac5.js";import{a as n,b as r}from"./mistake.4e233ae2.js";import{A as m}from"./AQCard.8a0f8a13.js";import{A as l}from"./ActionBar.1725b1a3.js";import{n as c}from"./vueComponentNormalizer.9ef17bb1.js";import"./QuestionItem.1944680c.js";/* empty css                */import"./questionInfoMapJsonTrans.58e126b5.js";import"./index.f5168bf8.js";/* empty css                                                              */var d=function(){var s=this,t=s.$createElement,e=s._self._c||t;return e("div",{staticClass:"exam-paper"},[e("div",{directives:[{name:"loading",rawName:"v-loading",value:s.page_is_loading,expression:"page_is_loading"}],staticClass:"paper-main"},[s.mode===5?e("div",{staticClass:"aq-card"},[e("AQCard",{attrs:{questions:s.questions,answers:s.answers,mode:s.mode},on:{smooth:s.aqItemOnClick,submit:s.submitMistakes,cancel:s.cancelMistakeExam}})],1):s._e(),e("div",{staticClass:"questions-area"},[e("QuestionsList",{ref:"questionList",attrs:{questions:s.questions,mode:s.mode,paperStyle:0},on:{answers:s.userAnswerChanged}})],1)]),[4,1].includes(s.mode)?e("ActionBar",{staticStyle:{"margin-bottom":"10px"},attrs:{noCencel:"",center:"",confirmTxt:"\u9000\u51FA"},on:{onConfirm:function(i){return s.$router.go(-1)}}}):s._e()],1)},u=[];const _={components:{QuestionsList:o,AQCard:m,ActionBar:l},data:()=>({questions:[],answers:[],mode:1,page_is_loading:!1}),activated(){this.questions=[],this.answers=[],this.$route.params.mode==="1"?(this.getMistakesList(1),this.mode=4):this.$route.params.mode==="2"?(this.getMistakesList(0),this.mode=5):this.$route.params.mode==="3"&&(this.getMistakesList(1),this.mode=1)},methods:{submitMistakes(){this.page_is_loading=!0,n(this.$route.params.classifyId,this.answers).then(s=>{const{data:t}=s,{pass:e,faild:i}=t;this.$alert(`\u672C\u6B21\u7B54\u9898\u6B63\u786E${e}\u9053\uFF0C\u9519\u8BEF${i}\u9053\u3002`,"\u63D0\u793A",{callback:()=>{this.$router.go(-1)}})}).finally(s=>{this.page_is_loading=!1})},cancelMistakeExam(){this.$router.go(-1)},aqItemOnClick(s){const t=document.querySelector(`[tag="${s.id}"]`);t.scrollIntoView({block:"start",behavior:"smooth"}),t.classList.add("shine"),setTimeout(()=>{t.classList.remove("shine")},2e3)},userAnswerChanged(s){this.answers=s},getMistakesList(s=1){this.page_is_loading=!0,r(this.$route.params.classifyId,s).then(t=>{this.questions=t.data}).finally(t=>{this.page_is_loading=!1})}}},a={};var p=c(_,d,u,!1,h,"7e20b761",null,null);function h(s){for(let t in a)this[t]=a[t]}const M=function(){return p.exports}();export{M as default};
