viewTheTestPaperViews.e369a782.js 5.4 KB

1
  1. import{n as m,b as u,r as _,o as R}from"./index.9d8a3e8d.js";import{u as b}from"./TestQuestionsServers.746d0f29.js";import{b as h,T as Q,a as P}from"./TestQuestionOptions.9f3e9957.js";import{L as O}from"./LJFlexBox.d22f832a.js";import{a as q}from"./composables.2846c723.js";import{c as L}from"./index.b24663c5.js";import{L as J}from"./LJWWData.05f5d8d0.js";import"./sortable.esm.e6c96bc0.js";const $={__name:"TestQuestionResults",props:{padding:{type:String,default:"16px 0"},answer:{type:String},user_answer:{type:String},options:{type:Array,default:()=>[]},analysis:{type:String}},setup(c){const s=c,t={success:{icon:"el-icon-success",text:"\u56DE\u7B54\u6B63\u786E"},error:{icon:"el-icon-error",text:"\u56DE\u7B54\u9519\u8BEF"}},e=u(()=>!s.answer||!s.user_answer?"error":s.answer===s.user_answer?"success":"error"),a=u(()=>{const i=s.options.findIndex(r=>r.optionName===s.user_answer);return i>-1?s.options[i].optionContent:""});return{__sfc:!0,props:s,RESULTS_STATUS:t,results_status:e,successAnswerContent:a,LJFlexBox:O}}};var T=function(){var s=this,t=s._self._c,e=s._self._setupProxy;return t("div",{staticClass:"test-question-results",style:{padding:s.padding}},[t(e.LJFlexBox,{staticClass:"results-status",class:{[e.results_status]:e.results_status}},[t("i",{class:e.RESULTS_STATUS[e.results_status].icon,staticStyle:{"font-size":"16px","margin-left":"5px"}}),t("div",{staticClass:"label",staticStyle:{"font-size":"14px","margin-top":"-2px"}},[s._v(s._s(e.RESULTS_STATUS[e.results_status].text))])]),e.results_status==="error"?t("div",{staticClass:"test-question-explain"},[t("div",{staticClass:"answer-label"},[s._v("\u6B63\u786E\u7B54\u6848\uFF1A"),t("span",[s._v(s._s(s.answer)+"\u3001"+s._s(e.successAnswerContent))])]),t("div",{staticClass:"analysis-label"},[s._v("\u3010\u7B54\u6848\u89E3\u6790\u3011")]),t("div",{staticClass:"analysis"},[s._v(s._s(s.analysis))])]):s._e()],1)},j=[];T._withStripped=!0;var w=m($,T,j,!1,null,"d84b3c41",null,null);w.options.__file="E:/\u5341\u4E8C\u79D1\u6280/\u9879\u76EE/\u4E5D\u53F7\u540C\u4E8B/salary-management-web/src/components/TestQuestions/TestQuestionResults.vue";const A=w.exports;const E={__name:"viewTheTestPaperViews",setup(c){const s=q(),t=_(s.query.id||null),e=_({}),a=_(s.query.test_paper),i=_({}),r=_([]),p=u(()=>e.value.id?e.value.test_paper.total_num:0),C=u(()=>e.value.id?e.value.test_paper.name:0),g=u(()=>e.value.id?L(e.value.right_count,p.value):0);function d(){HTTP.getReadById("test_record",t.value).then(n=>{e.value=n.data,v()}).catch(n=>{console.log("error:",n)})}const v=()=>{HTTP.getReadById("test_paper",a.value).then(n=>{i.value=n.data;let l=n.data.test_paper_Questions.map(o=>(o.options=JSON.parse(o.option),o.user_answer="",o));b(l,n.data.total_score),r.value=JSON.parse(JSON.stringify(l)),f()}).catch(n=>{console.log("error:",n)})};function f(){HTTP.get("test_question_record",{test_record:t.value,fields:"id,test_record,test_question,answer"}).then(n=>{n.code===0&&n.data.results.map(l=>{const o=r.value.findIndex(S=>S.id===l.test_question);o>-1&&(r.value[o].user_answer=l.answer)})}).catch(n=>{console.log("error:",n)})}return R(()=>{d()}),{__sfc:!0,route:s,testRecordId:t,testRecordObj:e,testPaperId:a,testPaperObj:i,test_questions_list:r,total_num:p,test_paper_name:C,correctRate:g,getTestRecord:d,getTestQuestions:v,getTestQuestionRecord:f,TestQuestionOptions:h,TestQuestions:Q,TestQuestionTitle:P,TestQuestionResults:A,LJWWData:J}}};var y=function(){var s=this,t=s._self._c,e=s._self._setupProxy;return t("div",{staticClass:"view-the-test-paper-views"},[t("div",{staticClass:"test-name"},[s._v(s._s(e.test_paper_name))]),t("div",{staticClass:"test-header"},[t("div",{staticClass:"test-info"},[t("div",{staticClass:"user-info"},[t("div",{staticClass:"user-content"},[t("div",{staticClass:"user-name"},[t(e.LJWWData,{attrs:{type:"2",openid:e.testRecordObj.name}})],1),t("div",{staticClass:"user-department"},[t(e.LJWWData,{attrs:{type:"1",openid:e.testRecordObj.dept_name}})],1)]),t("div",{staticClass:"time"},[s._v(s._s(e.testRecordObj.commit_time))])]),t("div",{staticClass:"statistics"},[t("div",{staticClass:"item"},[t("div",{staticClass:"value"},[s._v(s._s(e.total_num))]),t("div",{staticClass:"label"},[s._v("\u9898\u6570")])]),t("div",{staticClass:"item"},[t("div",{staticClass:"value"},[s._v(s._s(e.testRecordObj.right_count))]),t("div",{staticClass:"label"},[s._v("\u7B54\u5BF9")])]),t("div",{staticClass:"item"},[t("div",{staticClass:"value",staticStyle:{color:"#4284F4"}},[s._v(s._s(e.correctRate)+"%")]),t("div",{staticClass:"label"},[s._v("\u6B63\u786E\u7387")])])])])]),t("div",{staticClass:"test-questions-lists"},s._l(e.test_questions_list,function(a,i){return t(e.TestQuestions,{key:a.id,attrs:{padding:"15px 0",item:i}},[t(e.TestQuestionTitle,{attrs:{type:"details",score:a.score,index:i},model:{value:a.content,callback:function(r){s.$set(a,"content",r)},expression:"item.content"}}),t(e.TestQuestionOptions,{attrs:{type:"details",options:a.options,"show-answer":!1,padding:"5px 2em"},model:{value:a.user_answer,callback:function(r){s.$set(a,"user_answer",r)},expression:"item.user_answer"}}),t(e.TestQuestionResults,{attrs:{answer:a.answer,user_answer:a.user_answer,options:a.options,analysis:a.analysis,padding:"5px 2em"}})],1)}),1)])},I=[];y._withStripped=!0;var x=m(E,y,I,!1,null,"6dd13c93",null,null);x.options.__file="E:/\u5341\u4E8C\u79D1\u6280/\u9879\u76EE/\u4E5D\u53F7\u540C\u4E8B/salary-management-web/src/views/personnelRoot/myExam/viewTheTestPaperViews.vue";const D=x.exports;export{D as default};