(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-268d386d"],{"7b75":function(e,t,s){"use strict";s.d(t,"a",(function(){return x}));var n=s("8ce4"),i=s("7b67");async function a(e){return Object(n["a"])(i["c"]+"consumer/studentschedule/list","get",e)}async function o(e){return Object(n["a"])(i["c"]+"consumer/studentschedule/save","post_json",e)}async function r(e){return Object(n["a"])(i["c"]+"consumer/studentschedule/update","post_json",e)}async function c(e){return Object(n["a"])(i["c"]+"consumer/studentschedule/delete","post_json",e)}async function l(e){return Object(n["a"])(i["b"]+"admin/schoolschedule/detailsByTeacher","post_json",e)}async function p(e){return Object(n["a"])(i["c"]+"consumer/studentschedule/modifyExperimentPermissions","post_json",e)}async function d(e){return Object(n["a"])(i["c"]+"consumer/studentschedule/list/student","get",e)}async function u(e){return Object(n["a"])(i["c"]+"consumer/studentschedule/list/fastResetList","get",e)}async function f(e){return Object(n["a"])(i["c"]+"consumer/studentexperiment/resetExperimentNum","post_json",e)}async function m(e){return Object(n["a"])(i["c"]+"consumer/studentexperiment/update","post_json",e)}async function h(e){return Object(n["a"])(i["b"]+"admin/experiment/info/"+e,"get",{})}var b=s("2ca2");class x{static async getList(e,t,s){let n={page:e,size:t};n=Object.assign(n,s);let[i]=await a(n);if(0===t)return i.data;{let e=b["a"].generateListMybatisPlus(i.data),t=e[0];return[t,e[1]]}}static async save(e){let[t]=await o(e);return 2e4===t.code}static async update(e){let[t]=await r(e);return 2e4===t.code}static async remove(e){let[t]=await c(e);return 2e4===t.code}static async modifyExperimentPermissions(e){let[t]=await p(e);return 2e4===t.code}static async getTeacherExperimentList(e){let[t]=await l({schoolid:e.schoolid,departmentid:e.departmentid});return 2e4===t.code&&t.data}static async getResetExperimentTimesList(e,t,s){let n={page:e,size:t};n=Object.assign(n,s);let[i]=await d(n);if(0===t)return i.data;{let e=b["a"].generateListMybatisPlus(i.data),t=e[0];return[t,e[1]]}}static async getFastResetExperimentTimesList(e){let t=Object.assign(e),[s]=await u(t);return s.data}static async resetExperimentTimesMultiple(e,t){let[s]=await f({ids:e,experimentnum:t});return 2e4===s.code}static async updateExperiment(e){let[t]=await m(e);return 2e4===t.code}static async getOneExperimentInfo(e){let[t]=await h(e);return 2e4===t.code?t.data:null}}},"8aa0":function(e,t,s){"use strict";s("d7fa")},"99c1":function(e,t,s){"use strict";s.r(t);s("e9f5"),s("910d");var n=function(){var e=this,t=e._self._c;return t("div",{staticClass:"page-container"},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"container"},[t("el-form",{staticClass:"flex flex-start flex-wrap"},[e.paper.id?t("el-form-item",{attrs:{label:"编号"}},[t("span",[e._v(e._s(e.paper.id))])]):e._e(),t("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:"名称"}},[t("span",[t("el-input",{staticStyle:{width:"300px"},model:{value:e.paper.name,callback:function(t){e.$set(e.paper,"name","string"===typeof t?t.trim():t)},expression:"paper.name"}})],1)]),t("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:"实验"}},[t("el-select",{staticStyle:{width:"250px"},attrs:{placeholder:"请选择实验",disabled:e.asEdit||e.isClickAdd},on:{change:e.test},model:{value:e.paper.experimentId,callback:function(t){e.$set(e.paper,"experimentId",t)},expression:"paper.experimentId"}},e._l(e.filter.experimentOption,(function(e,s){return t("el-option",{key:s,attrs:{value:e.value,label:e.label}})})),1)],1),e.paper.totalScore?t("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:"及格分数"}},[t("span",[t("el-input",{staticStyle:{width:"80px"},attrs:{type:"number"},model:{value:e.paper.passScore,callback:function(t){e.$set(e.paper,"passScore",e._n(t))},expression:"paper.passScore"}})],1)]):e._e(),e.paper.totalScore?t("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:"考卷总分"}},[t("span",[e._v(" "+e._s(e.paper.totalScore))])]):e._e(),t("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:"备注信息"}},[t("span",[t("el-input",{staticStyle:{width:"300px"},model:{value:e.paper.remark,callback:function(t){e.$set(e.paper,"remark",t)},expression:"paper.remark"}})],1)]),e.asEdit?e._e():t("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:""}},[t("span",{staticStyle:{width:"100px"}},[e.isClickAdd?e._e():t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.AddMethods().clickNewBtn()}}},[e._v("生成考卷")])],1)]),e.asEdit||e.isClickAdd?t("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:""}},[t("span",{staticStyle:{width:"100px","margin-left":"20px"}},[t("el-button",{attrs:{type:"success"},on:{click:function(t){e.AddMethods().clickRandomAddBtn()}}},[e._v("随机加题")])],1)]):e._e()],1)],1)]),t("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{title:"随机加题",visible:e.showSetPaperOption,width:"900px",center:""},on:{"update:visible":function(t){e.showSetPaperOption=t}}},[t("div",{staticClass:"add-new-option"},[t("div",{staticClass:"li"},[t("div",{staticClass:"title"},[e._v("请选择出题的题库")]),t("div",{staticClass:"box"},[t("el-select",{attrs:{placeholder:"请选择题库",multiple:""},on:{change:function(e){}},model:{value:e.setAddInfo.questionBankIds,callback:function(t){e.$set(e.setAddInfo,"questionBankIds",t)},expression:"setAddInfo.questionBankIds"}},e._l(e.filter.questionBankOption,(function(e,s){return t("el-option",{key:s,attrs:{value:e.value,label:e.label}})})),1)],1)]),t("div",{staticClass:"li"},[t("div",{staticClass:"title"},[e._v("请选择需要的题型")]),t("div",{staticClass:"box"},[t("el-checkbox-group",{model:{value:e.setAddInfo.chooseTypes,callback:function(t){e.$set(e.setAddInfo,"chooseTypes",t)},expression:"setAddInfo.chooseTypes"}},[t("el-checkbox",{attrs:{label:"Radio",value:"Radio"}},[e._v("单项选择")]),t("el-checkbox",{attrs:{label:"Multiple",value:"Multiple"}},[e._v("多项选择")]),t("el-checkbox",{attrs:{label:"Judge",value:"Judge"}},[e._v("判断题")])],1)],1)]),t("div",{staticClass:"li"},[t("div",{staticClass:"title"},[e._v("设置各个题型的数量")]),t("div",{staticClass:"box"},[e.setAddInfo.chooseTypes.indexOf("Radio")>-1?t("div",{staticClass:"q-li flex flex-between"},[t("span",{staticStyle:{"margin-right":"15px",width:"80px"}},[e._v("单项选择：")]),t("div",[e._v("题数 "),t("el-input-number",{staticStyle:{width:"110px","margin-top":"5px","margin-left":"10px"},attrs:{size:"small",min:0,label:"题数"},model:{value:e.setAddInfo.sectionInfos[0].questionTotal,callback:function(t){e.$set(e.setAddInfo.sectionInfos[0],"questionTotal",t)},expression:"setAddInfo.sectionInfos[0].questionTotal"}})],1),t("div",[e._v("每题分数 "),t("el-input-number",{staticStyle:{width:"110px","margin-top":"5px","margin-left":"10px"},attrs:{size:"small",min:0,label:"每题分数"},model:{value:e.setAddInfo.sectionInfos[0].scorePerQuestion,callback:function(t){e.$set(e.setAddInfo.sectionInfos[0],"scorePerQuestion",t)},expression:"setAddInfo.sectionInfos[0].scorePerQuestion"}})],1)]):e._e(),e.setAddInfo.chooseTypes.indexOf("Multiple")>-1?t("div",{staticClass:"q-li flex flex-between"},[t("span",{staticStyle:{"margin-right":"15px",width:"80px"}},[e._v("多项选择：")]),t("div",[e._v("题数 "),t("el-input-number",{staticStyle:{width:"110px","margin-top":"5px","margin-left":"10px"},attrs:{size:"small",min:0,label:"题数"},model:{value:e.setAddInfo.sectionInfos[1].questionTotal,callback:function(t){e.$set(e.setAddInfo.sectionInfos[1],"questionTotal",t)},expression:"setAddInfo.sectionInfos[1].questionTotal"}})],1),t("div",[e._v("每题分数 "),t("el-input-number",{staticStyle:{width:"110px","margin-top":"5px","margin-left":"10px"},attrs:{size:"small",min:0,label:"每题分数"},model:{value:e.setAddInfo.sectionInfos[1].scorePerQuestion,callback:function(t){e.$set(e.setAddInfo.sectionInfos[1],"scorePerQuestion",t)},expression:"setAddInfo.sectionInfos[1].scorePerQuestion"}})],1)]):e._e(),e.setAddInfo.chooseTypes.indexOf("Judge")>-1?t("div",{staticClass:"q-li flex flex-between"},[t("span",{staticStyle:{"margin-right":"15px",width:"80px"}},[e._v("判断题：")]),t("div",[e._v("题数 "),t("el-input-number",{staticStyle:{width:"110px","margin-top":"5px","margin-left":"10px"},attrs:{size:"small",min:0,label:"题数"},model:{value:e.setAddInfo.sectionInfos[2].questionTotal,callback:function(t){e.$set(e.setAddInfo.sectionInfos[2],"questionTotal",t)},expression:"setAddInfo.sectionInfos[2].questionTotal"}})],1),t("div",[e._v("每题分数 "),t("el-input-number",{staticStyle:{width:"110px","margin-top":"5px","margin-left":"10px"},attrs:{size:"small",min:0,label:"每题分数"},model:{value:e.setAddInfo.sectionInfos[2].scorePerQuestion,callback:function(t){e.$set(e.setAddInfo.sectionInfos[2],"scorePerQuestion",t)},expression:"setAddInfo.sectionInfos[2].scorePerQuestion"}})],1)]):e._e()])])]),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.AddMethods().clickSetPaperOptionAdd()}}},[e._v("生成试题并加入列表")])],1)]),e.asEdit||e.isClickAdd?t("div",{staticStyle:{"margin-top":"15px"}},[t("div",{staticClass:"container"},[t("el-tabs",{attrs:{id:"tabs",type:"border-card"},on:{"tab-click":(t,s)=>e.ListMethods().clickListTab(t,s)},model:{value:e.chooseQuestionType,callback:function(t){e.chooseQuestionType=t},expression:"chooseQuestionType"}},[t("el-tab-pane",{attrs:{label:"单项选择",name:"Radio"}},[t("div",{staticClass:"flex flex-between"},[e.paper.sections[e.paperSectionIndex["Radio"]]?t("el-form",{staticClass:"flex flex-start",attrs:{"label-width":"100px"}},[t("el-form-item",{attrs:{label:"本节描述:"}},[t("span",[t("el-input",{staticStyle:{width:"300px"},model:{value:e.paper.sections[e.paperSectionIndex["Radio"]].sectionName,callback:function(t){e.$set(e.paper.sections[e.paperSectionIndex["Radio"]],"sectionName",t)},expression:"paper.sections[paperSectionIndex['Radio']].sectionName"}})],1)]),t("el-form-item",{attrs:{label:"每题分数:"}},[t("span",[t("el-input-number",{staticStyle:{width:"100px"},attrs:{min:1,size:"small",label:"每题分数"},on:{change:t=>e.ListMethods().sectionPerScoreChange("Radio",t)},model:{value:e.paper.sections[e.paperSectionIndex["Radio"]].scorePerQuestion,callback:function(t){e.$set(e.paper.sections[e.paperSectionIndex["Radio"]],"scorePerQuestion",t)},expression:"paper.sections[paperSectionIndex['Radio']].scorePerQuestion"}})],1)]),t("el-form-item",{attrs:{label:"总题数:"}},[t("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Radio"]].questionTotal))])]),t("el-form-item",{attrs:{label:"章节总分:"}},[t("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Radio"]].sectionTotalScore))])])],1):e._e(),t("div",[t("el-button",{attrs:{type:"success"},on:{click:function(t){e.ListMethods().clickAddNewQuestion()}}},[e._v("手动加题")])],1)],1),e.paper.sections[e.paperSectionIndex["Radio"]]?t("el-table",{staticStyle:{width:"100%"},attrs:{id:"table-Radio",data:e.paper.sections[e.paperSectionIndex["Radio"]].sectionQuestions,border:"",fit:"","highlight-current-row":"","row-key":"sku"}},[t("el-table-column",{attrs:{label:"编号",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(s){return[t("span",[e._v(e._s(s.row.id))])]}}],null,!1,773642443)}),t("el-table-column",{attrs:{label:"问题描述",align:"center"},scopedSlots:e._u([{key:"default",fn:function(s){return["html"===s.row.contentType?t("div",{domProps:{innerHTML:e._s(s.row.content)}}):t("div",[e._v(e._s(s.row.content))])]}}],null,!1,2468084648)}),t("el-table-column",{attrs:{label:"问题选项(蓝色为正确选项)",align:"center"},scopedSlots:e._u([{key:"default",fn:function(s){return e._l(s.row.options,(function(n){return t("div",{class:n.choice===s.row.standardAnswer?"markRight":"",attrs:{label:n.choice,align:"center"}},[e._v(" "+e._s(n.choice+":"+n.content)+" ")])}))}}],null,!1,1933390226)}),t("el-table-column",{attrs:{align:"center",label:"操作",width:"80","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(s){return[t("el-button",{attrs:{type:"danger",size:"mini",round:""},on:{click:function(t){e.ListMethods().clickDelBtn("Radio",s.row.id,s.$index)}}},[e._v(" 删除 ")])]}}],null,!1,2787928971)})],1):e._e()],1),t("el-tab-pane",{attrs:{label:"多项选择",name:"Multiple"}},[t("div",{staticClass:"flex flex-between"},[e.paper.sections[e.paperSectionIndex["Multiple"]]?t("el-form",{staticClass:"flex flex-start",attrs:{"label-width":"100px"}},[t("el-form-item",{attrs:{label:"本节描述:"}},[t("span",[t("el-input",{staticStyle:{width:"300px"},model:{value:e.paper.sections[e.paperSectionIndex["Multiple"]].sectionName,callback:function(t){e.$set(e.paper.sections[e.paperSectionIndex["Multiple"]],"sectionName",t)},expression:"paper.sections[paperSectionIndex['Multiple']].sectionName"}})],1)]),t("el-form-item",{attrs:{label:"每题分数:"}},[t("span",[t("el-input-number",{staticStyle:{width:"100px"},attrs:{min:1,size:"small",label:"每题分数"},on:{change:t=>e.ListMethods().sectionPerScoreChange("Multiple",t)},model:{value:e.paper.sections[e.paperSectionIndex["Multiple"]].scorePerQuestion,callback:function(t){e.$set(e.paper.sections[e.paperSectionIndex["Multiple"]],"scorePerQuestion",t)},expression:"paper.sections[paperSectionIndex['Multiple']].scorePerQuestion"}})],1)]),t("el-form-item",{attrs:{label:"总题数:"}},[t("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Multiple"]].questionTotal))])]),t("el-form-item",{attrs:{label:"章节总分:"}},[t("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Multiple"]].sectionTotalScore))])])],1):e._e(),t("div",[t("el-button",{attrs:{type:"success"},on:{click:function(t){e.ListMethods().clickAddNewQuestion()}}},[e._v("手动加题")])],1)],1),e.paper.sections[e.paperSectionIndex["Multiple"]]?t("el-table",{staticStyle:{width:"100%"},attrs:{id:"table-Multiple",data:e.paper.sections[e.paperSectionIndex["Multiple"]].sectionQuestions,border:"",fit:"","highlight-current-row":"","row-key":"id"}},[t("el-table-column",{attrs:{label:"编号",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(s){return[t("span",[e._v(e._s(s.row.id))])]}}],null,!1,773642443)}),t("el-table-column",{attrs:{label:"问题描述",align:"center"},scopedSlots:e._u([{key:"default",fn:function(s){return["html"===s.row.contentType?t("div",{domProps:{innerHTML:e._s(s.row.content)}}):t("div",[e._v(e._s(s.row.content))])]}}],null,!1,2468084648)}),t("el-table-column",{attrs:{label:"问题选项(蓝色为正确选项)",align:"center"},scopedSlots:e._u([{key:"default",fn:function(s){return e._l(s.row.options,(function(n){return t("div",{class:s.row.standardAnswers.includes(n.choice)?"markRight":"",attrs:{label:n.choice,align:"center"}},[e._v(" "+e._s(n.choice+":"+n.content)+" ")])}))}}],null,!1,425019484)}),t("el-table-column",{attrs:{align:"center",label:"操作",width:"150","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(s){return[t("el-button",{attrs:{type:"danger",size:"mini",round:""},on:{click:function(t){e.ListMethods().clickDelBtn("Multiple",s.row.id,s.$index)}}},[e._v(" 删除 ")])]}}],null,!1,1666097194)})],1):e._e()],1),t("el-tab-pane",{attrs:{label:"判断题",name:"Judge"}},[t("div",{staticClass:"flex flex-between"},[e.paper.sections[e.paperSectionIndex["Judge"]]?t("el-form",{staticClass:"flex flex-start",attrs:{"label-width":"100px"}},[t("el-form-item",{attrs:{label:"本节描述:"}},[t("span",[t("el-input",{staticStyle:{width:"300px"},model:{value:e.paper.sections[e.paperSectionIndex["Judge"]].sectionName,callback:function(t){e.$set(e.paper.sections[e.paperSectionIndex["Judge"]],"sectionName",t)},expression:"paper.sections[paperSectionIndex['Judge']].sectionName"}})],1)]),t("el-form-item",{attrs:{label:"每题分数:"}},[t("span",[t("el-input-number",{staticStyle:{width:"100px"},attrs:{min:1,size:"small",label:"每题分数"},on:{change:t=>e.ListMethods().sectionPerScoreChange("Judge",t)},model:{value:e.paper.sections[e.paperSectionIndex["Judge"]].scorePerQuestion,callback:function(t){e.$set(e.paper.sections[e.paperSectionIndex["Judge"]],"scorePerQuestion",t)},expression:"paper.sections[paperSectionIndex['Judge']].scorePerQuestion"}})],1)]),t("el-form-item",{attrs:{label:"总题数:"}},[t("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Judge"]].questionTotal))])]),t("el-form-item",{attrs:{label:"章节总分:"}},[t("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Judge"]].sectionTotalScore))])])],1):e._e(),t("div",[t("el-button",{attrs:{type:"success"},on:{click:function(t){e.ListMethods().clickAddNewQuestion()}}},[e._v("手动加题")])],1)],1),e.paper.sections[e.paperSectionIndex["Judge"]]?t("el-table",{staticStyle:{width:"100%"},attrs:{id:"table-Judge",data:e.paper.sections[e.paperSectionIndex["Judge"]].sectionQuestions,border:"",fit:"","highlight-current-row":""}},[t("el-table-column",{attrs:{label:"编号",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(s){return[t("span",[e._v(e._s(s.row.id))])]}}],null,!1,773642443)}),t("el-table-column",{attrs:{label:"问题描述",align:"center"},scopedSlots:e._u([{key:"default",fn:function(s){return["html"===s.row.contentType?t("div",{domProps:{innerHTML:e._s(s.row.content)}}):t("div",[e._v(e._s(s.row.content))])]}}],null,!1,2468084648)}),t("el-table-column",{attrs:{label:"参考答案",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.enums.questionJudgeAnswer[t.row.standardAnswer])+" ")]}}],null,!1,2545058169)}),t("el-table-column",{attrs:{align:"center",label:"操作",width:"150","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(s){return[t("el-button",{attrs:{type:"danger",size:"mini",round:""},on:{click:function(t){e.ListMethods().clickDelBtn("Judge",s.row.id,s.$index)}}},[e._v(" 删除 ")])]}}],null,!1,2486707267)})],1):e._e()],1)],1)],1)]):e._e(),t("div",{staticClass:"page-bottom-container"},[e.asEdit?t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"warning",icon:"el-icon-success"},on:{click:e.clickSaveBtn}},[e._v("保 存 ")]):e._e(),e.asEdit&&e.paper.id?t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"warning"},on:{click:e.clickViewBtn}},[e._v("预 览 ")]):e._e(),!e.asEdit&&e.isClickAdd?t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"warning",icon:"el-icon-success"},on:{click:function(t){e.AddMethods().clickAddBtn()}}},[e._v("新 增 考 卷 ")]):e._e()],1),t("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{title:"选择试题",visible:e.chooseDialogShow,width:"70%",center:""},on:{"update:visible":function(t){e.chooseDialogShow=t}}},[e.showQuestionListComponent?t("page-question-list",{ref:"question-list",attrs:{"as-select":!0,"experiment-id":e.paper.experimentId},on:{onListSelected:t=>e.SelectMethods().getSelectList(t)}}):e._e(),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.SelectMethods().clickSelectSureBtn()}}},[e._v("确认选择")])],1)],1)],1)},i=[],a=(s("14d9"),s("7d54"),s("a020")),o=s("5c8a"),r=s("2ca2"),c=s("cf45"),l=s("c471"),p=s("a888"),d=s("2f62"),u=s("d808"),f=s("7b75"),m=s("ac02"),h=s("4953"),b={name:"teacherExamPaperEdit",components:{pageQuestionList:l["default"]},directives:{elDragDialog:p["a"]},computed:{asEdit:function(){return this.$route.query.hasOwnProperty("paperId")},paperId:{get(){return this.$route.query["paperId"]},set(e){return e}},...Object(d["b"])({userInfo:e=>e.user})},data(){return{EnumsModel:u["a"],enums:{questionJudgeAnswer:u["a"].questionJudgeAnswer,questionType:u["a"].questionType},paper:{name:"课堂考卷",sectionObj:{},sections:[{sectionType:"Radio",sectionName:"单项选择",sectionQuestions:[],scorePerQuestion:1},{sectionType:"Multiple",sectionName:"多项选择",sectionQuestions:[],scorePerQuestion:1},{sectionType:"Judge",sectionName:"判断题",sectionQuestions:[],scorePerQuestion:1}]},startTimeOptions:{disabledDate(e){r1}},paperSectionIndex:{},filter:{experimentOption:[],experimentObject:{},experimentOrigin:[],questionBankOption:[],questionBankObject:{},questionBankOrigin:[]},chooseQuestionType:"Radio",tabOrders:["Radio","Multiple","Judge"],chooseDialogShow:!1,showQuestionListComponent:!0,isClickAdd:!1,showSetPaperOption:!1,setAddInfo:{questionBankIds:[],chooseTypes:["Radio","Multiple","Judge"],sectionInfos:[{sectionType:"Radio",questionTotal:1,scorePerQuestion:1},{sectionType:"Multiple",questionTotal:1,scorePerQuestion:1},{sectionType:"Judge",questionTotal:1,scorePerQuestion:1}]}}},activated(){},mounted(){this.asEdit?this.getPaperInfo():this.paper.name="课堂考卷 "+Object(c["f"])(new Date,"yyyy-MM-dd HH:mm"),this.getFilterInfo()},methods:{test(e){this.$forceUpdate()},async getPaperInfo(){this.paperId=this.$route.query["paperId"];let e=await a["a"].getOne(this.paperId);if(e){let t=JSON.parse(JSON.stringify(e));this.paper=this.paperDataInit(t)}else Object(o["d"])("未找到该考卷！")},paperDataInit(e){let t=[];this.asEdit&&(e.sections=JSON.parse(e.sectionInfos)),e.sections.forEach((e,s)=>{this.asEdit||e.scorePerQuestion||(e.scorePerQuestion=1),this.paperSectionIndex[e.sectionType]=s,t.push(e.sectionType),0===s&&(e["sectionName"]="单项选择题")});let s=e.sections.length;return this.tabOrders.forEach(n=>{-1===t.indexOf(n)&&(this.paperSectionIndex[n]=s,e.sections.push({sectionType:n,sectionTotalQuestion:0,scorePerQuestion:1,sectionQuestions:[]}),s+=1)}),e.totalScore&&(e.passScore=Math.round(.6*e.totalScore)),e},async getFilterInfo(){let e=await f["a"].getTeacherExperimentList(this.userInfo),t=r["a"].generateListFilterOptions("name","id",e,!1);this.filter.experimentOption=t[0],this.filter.experimentObject=t[1],this.filter.experimentOrigin=e,this.paper.experimentId||(this.paper.experimentId=e[0]["id"]);let[s]=await m["a"].getList(1,500,{schoolId:this.userInfo.schoolId,departmentId:this.userInfo.departmentid,experimentId:this.paper.experimentId,userId:this.userInfo.userid}),n=r["a"].generateListFilterOptions("name","id",s,!1);this.filter.questionBankOption=n[0],this.filter.questionBankObject=n[1],this.filter.questionBankOrigin=s},async clickSaveBtn(){let e={};if(e=this.prePaperPost(),e&&await Object(o["a"])("确认要修改该考卷信息吗？")){Object(c["i"])("paperId")&&(e.id=Object(c["i"])("paperId"));let t=await a["a"].update(e);t&&Object(o["e"])("修改考卷信息成功")}},clickViewBtn(){this.$router.push({name:"teacherExamPaper",query:{id:this.paper.id,asType:"teacherView"}})},prePaperPost(){let e=JSON.parse(JSON.stringify(this.paper)),t=JSON.parse(JSON.stringify(this.paper));if(this.beforeSave()){if(e.passScore&&e.passScore>e.totalScore)return Object(o["d"])("请填写及格分数且及格分不能超过总分"),!1;t.sections=[],t.questionNumber=0;for(let s=0;s<e.sections.length;s++)if(t.questionNumber+=e.sections[s].sectionQuestions.length,e.sections[s].sectionQuestions.length>0){if(!e.sections[s].sectionName)return console.log("题型英文",e.sections[s].sectionType),Object(o["d"])(this.enums.questionType[e.sections[s].sectionType]+" 题型没有填写本节描述文字"),!1;e.sections[s]["questionIds"]=[],e.sections[s].sectionQuestions.forEach(t=>{e.sections[s]["questionIds"].push(t.id)}),e.sections[s].sectionQuestions=[],t.sections.push(e.sections[s])}return t.sectionInfos=JSON.stringify(t.sections),this.asEdit||(t.creatorId=this.userInfo.userid),t}return!1},ListMethods(){let e=this;return{clickListTab(e,t){},async clickDelBtn(t,s,n){t=e.paperSectionIndex[t],await Object(o["a"])("确定要从考卷中删除该题吗？")&&(e.paper.sections[t].sectionQuestions.splice(n,1),this.calScore(t))},calScore(t){console.log(t);let s=e.paper.sections[t].scorePerQuestion,n=e.paper.sections[t].sectionQuestions.length,i=Object(c["c"])(s,n);e.$set(e.paper.sections[t],"questionTotal",n),e.$set(e.paper.sections[t],"sectionTotalScore",i);let a=0;e.paper.sections.forEach(e=>{e.sectionTotalScore&&(a=Object(c["b"])(a,e.sectionTotalScore))}),e.$set(e.paper,"totalScore",a),e.$set(e.paper,"passScore",Math.round(.6*a))},sectionPerScoreChange(t,s){t=e.paperSectionIndex[t],this.calScore(t)},clickAddNewQuestion(){e.chooseDialogShow=!0,e.$nextTick(()=>{e.showQuestionListComponent=!0})}}},SelectMethods(){let e=this;return{clickSelectSureBtn(){e.$refs["question-list"].ListMethods().parentSureSelect(),e.chooseDialogShow=!1},getSelectList(t){console.log("已选择题目列表如下"),console.log(t);for(let s in t)if(t.hasOwnProperty(s)){let n=t[s],i=e.paperSectionIndex[s];n.forEach(t=>{let n=!1;for(let s=0;s<e.paper.sections[i].sectionQuestions.length;s++)if(e.paper.sections[i].sectionQuestions[s].id===t.id){n=!0;break}n||(e.paper.sections[i].questionTotal+=1,e.paper.sections[i].sectionQuestions.push(t)),e.ListMethods().calScore(e.paperSectionIndex[s])})}e.$nextTick(()=>{e.showQuestionListComponent=!1})}}},beforeSave(){return this.paper.name?this.paper.experimentId?this.paper.passScore?!!this.paper.totalScore||(Object(o["d"])("请先填写或计算总分!"),!1):(Object(o["d"])("请先填写及格分数!"),!1):(Object(o["d"])("请先选择科目!"),!1):(Object(o["d"])("请先填写名称!"),!1)},AddMethods(){let e=this;return{clickNewBtn(){if(!e.paper.hasOwnProperty("experimentId"))return Object(o["d"])("请先选择实验!"),!1;e.isClickAdd=!0,e.getFilterInfo(),e.paper=e.paperDataInit(e.paper)},clickRandomAddBtn(){e.showSetPaperOption=!0},async clickSetPaperOptionAdd(){let t=[];for(let n=0;n<e.setAddInfo.chooseTypes.length;n++){let s=e.setAddInfo.chooseTypes[n];e.tabOrders.indexOf(s)>-1&&t.push(e.setAddInfo.sectionInfos[e.tabOrders.indexOf(s)])}for(let n=0;n<t.length;n++){let s=t[n];if(!s.questionTotal)return Object(o["d"])(e.enums.questionType[s.sectionType]+" 需要输入总题数"),!1;if(!s.scorePerQuestion)return Object(o["d"])(e.enums.questionType[s.sectionType]+" 需要输每题分数"),!1}if(0===e.setAddInfo.questionBankIds.length)return Object(o["d"])("请选择出题的题库！"),!1;let s=await h["a"].getRandomQuestionList(e.setAddInfo);s&&(s.forEach(t=>{let s=0,n="";"Radio"===t["sectionType"]&&(s=0,n="单选题"),"Multiple"===t["sectionType"]&&(s=1,n="多选题"),"Judge"===t["sectionType"]&&(s=2,n="判断选题");t["questionList"].forEach(t=>{let[n]=Object(c["h"])("id",t.id,e.paper.sections[s].sectionQuestions);-1===n?e.paper.sections[s].sectionQuestions.push(t):0}),e.ListMethods().calScore(s)}),e.showSetPaperOption=!1,e.paper=e.paperDataInit(e.paper))},async clickAddBtn(){if(await Object(o["a"])("确定要新增该考卷吗？")){let t=e.prePaperPost();if(console.log(t),t){let s=await a["a"].save(t);s&&(Object(o["e"])("新增考卷成功"),e.$router.push("/teacher/exam"))}}}}}}},x=b,g=(s("8aa0"),s("2877")),y=Object(g["a"])(x,n,i,!1,null,"2394d81f",null);t["default"]=y.exports},a020:function(e,t,s){"use strict";s.d(t,"a",(function(){return u}));var n=s("8ce4"),i=s("7b67");async function a(e){return Object(n["a"])(i["c"]+"consumer/questionPaper/list","get",e)}async function o(e){return Object(n["a"])(i["c"]+"consumer/questionPaper/save","post_json",e)}async function r(e){return Object(n["a"])(i["c"]+"consumer/questionPaper/update","post_json",e)}async function c(e){return Object(n["a"])(i["c"]+"consumer/questionPaper/delete","post_json",e)}async function l(e){return Object(n["a"])(i["c"]+"consumer/questionPaper/info/"+e,"get",{})}async function p(e){return Object(n["a"])(i["c"]+"consumer/questionPaper/deleteOnePaper/"+e,"get",{})}var d=s("2ca2");class u{static async getList(e,t,s){let n={page:e,size:t};n=Object.assign(n,s);let[i]=await a(n);if(0===t)return i.data;{let e=d["a"].generateListMybatisPlus(i.data),t=e[0];return[t,e[1]]}}static async save(e){let[t]=await o(e);return 2e4===t.code&&t.data}static async update(e){let[t]=await r(e);return 2e4===t.code}static async remove(e){let[t]=await c(e);return 2e4===t.code}static async deleteOnePaper(e){let[t]=await p(e);return 2e4===t.code}static async getOne(e){let[t]=await l(e);return 2e4===t.code&&t.data}}},d7fa:function(e,t,s){}}]);