(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0625fcfd"],{1862:function(e,t,n){},"196a":function(e,t,n){"use strict";n("f0e8")},"7ad6":function(e,t,n){},8256:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loadJs,expression:"loadJs"}],staticClass:"tinymce-container",class:{fullscreen:e.fullscreen},style:{width:e.containerWidth}},[n("textarea",{staticClass:"tinymce-textarea",attrs:{id:e.tinymceId}}),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.showUploadFile,expression:"showUploadFile"}],staticClass:"editor-custom-btn-container"},[n("editorImage",{staticClass:"editor-upload-btn",attrs:{color:"#1890ff"},on:{successCBK:e.imageSuccessCBK}})],1)])},a=[],s=(n("99af"),n("4160"),n("c975"),n("a9e3"),n("b680"),n("ac1f"),n("1276"),n("159b"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"upload-container"},[n("el-button",{style:{background:e.color,borderColor:e.color},attrs:{icon:"el-icon-upload",size:"mini",type:"primary"},on:{click:function(t){e.dialogVisible=!0}}},[e._v(" 上传文件 ")]),n("el-dialog",{attrs:{visible:e.dialogVisible,"append-to-body":""},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-upload",{staticClass:"editor-slide-upload",staticStyle:{width:"50%"},attrs:{multiple:!0,"file-list":e.fileList,"show-file-list":!0,"on-error":e.handleError,"on-remove":e.handleRemove,"on-success":e.handleSuccess,"before-upload":e.beforeUpload,"http-request":e.uploadRequest,action:"void"}},[n("el-button",{attrs:{size:"small",type:"primary"}},[e._v(" 点击上传 ")])],1),n("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(" 取 消 ")]),n("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v(" 确 定 ")])],1)],1)}),r=[],o=(n("a623"),n("d81d"),n("b64b"),n("d3b7"),n("3ca3"),n("ddb0"),n("2b3d"),n("96cf"),n("1da1")),l=n("e698"),c={name:"EditorSlideUpload",props:{color:{type:String,default:"#1890ff"}},data:function(){return{dialogVisible:!1,listObj:{},fileList:[],errList:""}},methods:{checkAllSuccess:function(){var e=this;return Object.keys(this.listObj).every((function(t){return e.listObj[t].hasSuccess}))},handleSubmit:function(){var e=this,t=Object.keys(this.listObj).map((function(t){return e.listObj[t]}));if(!this.checkAllSuccess())return Object.keys(this.listObj).forEach((function(t,n){e.listObj[t].hasSuccess||(e.errList=e.errList+(n+1)+",")})),void this.$message("第"+this.errList+"个文件上传失败，请删除这些，保存后重新再上传");this.$emit("successCBK",t),this.listObj={},this.fileList=[],this.dialogVisible=!1},handleSuccess:function(e,t){for(var n=t.uid,i=Object.keys(this.listObj),a=0,s=i.length;a<s;a++)if(this.listObj[i[a]].uid===n)return this.listObj[i[a]].url=e.data,void(this.listObj[i[a]].hasSuccess=!0)},handleError:function(e){return!0},handleRemove:function(e){for(var t=e.uid,n=Object.keys(this.listObj),i=0,a=n.length;i<a;i++)if(this.listObj[n[i]].uid===t)return void delete this.listObj[n[i]]},beforeUpload:function(e){var t=this,n=l["a"].getFileType(e)[0];switch(n){case"image":if(!l["a"].checkFileSize(l["a"].fileSizeLimit.questionContentImg,e))return!1;n;break;case"video":if(!l["a"].checkFileSize(l["a"].fileSizeLimit.questionContentVideo,e))return!1;n;break;case"audio":if(!l["a"].checkFileSize(l["a"].fileSizeLimit.questionContentAudio,e))return!1;n;break;default:if(!l["a"].checkFileSize(l["a"].fileSizeLimit.questionContentOther,e))return!1;"other";break}window.URL||window.webkitURL;var i=e.uid;this.listObj[i]={},t.listObj[i]={hasSuccess:!0,uid:e.uid}},uploadRequest:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t,i=e.file,n.next=4,new Promise((function(e,t){l["a"].qiNiuUpload(i,{next:function(e){},error:function(t){console.log(t),e(!1),alert("上传失败")},complete:function(t){var n=l["a"].getBucketDomain(i),a=n+"/"+t.key;e({data:a})}})}));case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),n)})))()}}},d=c,u=(n("196a"),n("2877")),p=Object(u["a"])(d,s,r,!1,null,"407cb1a8",null),f=p.exports,m=["advlist anchor autolink autosave colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak powerpaste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount"],h=m,b=["searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent  blockquote undo redo removeformat subscript superscript code codesample","hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen"],g=b,v=n("b85c"),x=[];function w(){return window.tinymce}var y=function(e,t){var n=document.getElementById(e),i=t||function(){};if(!n){var a=document.createElement("script");a.src=e,a.id=e,document.body.appendChild(a),x.push(i);var s="onload"in a?r:o;s(a)}function r(t){t.onload=function(){this.onerror=this.onload=null;var e,n=Object(v["a"])(x);try{for(n.s();!(e=n.n()).done;){var i=e.value;i(null,t)}}catch(a){n.e(a)}finally{n.f()}x=null},t.onerror=function(){this.onerror=this.onload=null,i(new Error("Failed to load "+e),t)}}function o(e){e.onreadystatechange=function(){if("complete"===this.readyState||"loaded"===this.readyState){this.onreadystatechange=null;var t,n=Object(v["a"])(x);try{for(n.s();!(t=n.n()).done;){var i=t.value;i(null,e)}}catch(a){n.e(a)}finally{n.f()}x=null}}}n&&i&&(w()?i(null,n):x.push(i))},k=y,_=n("780f"),S="https://resouce.cdzyhd.com/tinymce-all-in-one-4.9.3/tinymce.min.js",O="https://resouce.cdzyhd.com/powerpaste-2.1.10/plugin.min.js",I={name:"Tinymce",components:{editorImage:f},props:{id:{type:String,default:function(){return"vue-tinymce-"+ +new Date+(1e3*Math.random()).toFixed(0)}},value:{type:String,default:""},toolbar:{type:Array,required:!1,default:function(){return[]}},menubar:{type:String,default:"file edit insert view format table"},height:{type:[Number,String],required:!1,default:360},width:{type:[Number,String],required:!1,default:"auto"}},data:function(){return{editorShowUploadList:_["c"],loadJs:!1,hasChange:!1,hasInit:!1,tinymceId:this.id,fullscreen:!1,showUploadFile:!1,languageTypeList:{zh:"zh_CN"}}},computed:{language:function(){return"zh_CN"},containerWidth:function(){var e=this.width;return/^[\d]+(\.[\d]+)?$/.test(e)?"".concat(e,"px"):e}},watch:{value:function(e){var t=this;!this.hasChange&&this.hasInit&&this.$nextTick((function(){return window.tinymce.get(t.tinymceId).setContent(e||"")}))},language:function(){var e=this;this.destroyTinymce(),this.$nextTick((function(){return e.initTinymce()}))}},mounted:function(){this.init();var e=JSON.parse(sessionStorage.getItem("expUserInfo")),t=e["schoolId"],n=e["rolename"];this.editorShowUploadList.indexOf(t)>-1&&"teacher"===n&&(this.showUploadFile=!0)},activated:function(){window.tinymce&&this.initTinymce()},deactivated:function(){this.destroyTinymce()},destroyed:function(){this.destroyTinymce()},methods:{init:function(){var e=this;this.loadJs=!0,k(S,(function(t){e.loadJs=!1,t?e.$message.error(t.message):e.initTinymce()}))},initTinymce:function(){var e=this,t=this;window.tinymce.init({language:this.language,selector:"#".concat(this.tinymceId),height:this.height,body_class:"panel-body ",object_resizing:!1,toolbar:this.toolbar.length>0?this.toolbar:g,menubar:this.menubar,external_plugins:{powerpaste:O},plugins:h,end_container_on_empty_block:!0,paste_retain_style_properties:"all",paste_word_valid_elements:"*[*]",paste_data_images:!0,paste_convert_word_fake_lists:!1,paste_webkit_styles:"all",paste_merge_formats:!0,powerpaste_word_import:"prompt",powerpaste_html_import:"prompt",powerpaste_allow_local_images:!0,code_dialog_height:450,code_dialog_width:1e3,advlist_bullet_styles:"square",advlist_number_styles:"default",imagetools_cors_hosts:["www.tinymce.com","codepen.io"],default_link_target:"_blank",link_title:!1,nonbreaking_force_tab:!0,init_instance_callback:function(n){t.value&&n.setContent(t.value),t.hasInit=!0,n.on("NodeChange Change KeyUp SetContent",(function(){e.hasChange=!0,e.$emit("input",n.getContent())}))},setup:function(e){e.on("FullscreenStateChanged",(function(e){t.fullscreen=e.state}))},convert_urls:!1,images_dataimg_filter:function(e){return e},images_upload_handler:function(e,t,n,i){i(0);var a=new File([e.blob()],l["a"].getUuid()+".png",{type:"image/png"});l["a"].qiNiuUpload(a,{next:function(e){},error:function(e){console.log(e),alert("上传失败")},complete:function(e){var n=l["a"].getBucketDomain(a),s=n+"/"+e.key;t(s),i(100)}})}}).then((function(t){console.log("Tinymce初始化完毕"),e.$emit("initEd")}))},destroyTinymce:function(){var e=window.tinymce.get(this.tinymceId);this.fullscreen&&e.execCommand("mceFullScreen"),e&&e.destroy()},setContent:function(e){window.tinymce.get(this.tinymceId).setContent(e)},getContent:function(){window.tinymce.get(this.tinymceId).getContent()},imageSuccessCBK:function(e){var t=this;e.forEach((function(e){var n=e.url.split("."),i=n[n.length-1],a=e.url.split("/")[3];l["a"].fileSuffixEnum.image.indexOf(i)>-1?window.tinymce.get(t.tinymceId).insertContent('<img class="tinymce-upload-img" src="'.concat(e.url,'" >')):l["a"].fileSuffixEnum.video.indexOf(i)>-1?window.tinymce.get(t.tinymceId).insertContent('<video class="tinymce-upload-video" src="'.concat(e.url,'" controls="controls">')):l["a"].fileSuffixEnum.audio.indexOf(i)>-1?window.tinymce.get(t.tinymceId).insertContent('<embed height="50" width="100" src="'.concat(e.url,'"/>')):window.tinymce.get(t.tinymceId).insertContent('<a class="tinymce-upload-other" href="'.concat(e.url,'" >').concat(a,"</a>"))}))}}},T=I,q=(n("96b9"),Object(u["a"])(T,i,a,!1,null,"58f430dd",null));t["a"]=q.exports},"96b9":function(e,t,n){"use strict";n("acbb")},"99c1":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page-container"},[n("el-card",{staticClass:"box-card"},[n("div",{staticClass:"container"},[n("el-form",{staticClass:"flex flex-start flex-wrap"},[e.paper.id?n("el-form-item",{attrs:{label:"编号"}},[n("span",[e._v(e._s(e.paper.id))])]):e._e(),n("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:"名称"}},[n("span",[n("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)]),n("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:"实验"}},[n("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,t){return n("el-option",{key:t,attrs:{value:e.value,label:e.label}})})),1)],1),e.paper.totalScore?n("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:"及格分数"}},[n("span",[n("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?n("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:"考卷总分"}},[n("span",[e._v(" "+e._s(e.paper.totalScore))])]):e._e(),n("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:"备注信息"}},[n("span",[n("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():n("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:""}},[n("span",{staticStyle:{width:"100px"}},[e.isClickAdd?e._e():n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.AddMethods().clickNewBtn()}}},[e._v("生成考卷")])],1)]),e.asEdit||e.isClickAdd?n("el-form-item",{staticStyle:{"margin-right":"15px","text-align":"center"},attrs:{label:""}},[n("span",{staticStyle:{width:"100px","margin-left":"20px"}},[n("el-button",{attrs:{type:"success"},on:{click:function(t){e.AddMethods().clickRandomAddBtn()}}},[e._v("随机加题")])],1)]):e._e()],1)],1)]),n("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}}},[n("div",{staticClass:"add-new-option"},[n("div",{staticClass:"li"},[n("div",{staticClass:"title"},[e._v("请选择出题的题库")]),n("div",{staticClass:"box"},[n("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,t){return n("el-option",{key:t,attrs:{value:e.value,label:e.label}})})),1)],1)]),n("div",{staticClass:"li"},[n("div",{staticClass:"title"},[e._v("请选择需要的题型")]),n("div",{staticClass:"box"},[n("el-checkbox-group",{model:{value:e.setAddInfo.chooseTypes,callback:function(t){e.$set(e.setAddInfo,"chooseTypes",t)},expression:"setAddInfo.chooseTypes"}},[n("el-checkbox",{attrs:{label:"Radio",value:"Radio"}},[e._v("单项选择")]),n("el-checkbox",{attrs:{label:"Multiple",value:"Multiple"}},[e._v("多项选择")]),n("el-checkbox",{attrs:{label:"Judge",value:"Judge"}},[e._v("判断题")])],1)],1)]),n("div",{staticClass:"li"},[n("div",{staticClass:"title"},[e._v("设置各个题型的数量")]),n("div",{staticClass:"box"},[e.setAddInfo.chooseTypes.indexOf("Radio")>-1?n("div",{staticClass:"q-li flex flex-between"},[n("span",{staticStyle:{"margin-right":"15px",width:"80px"}},[e._v("单项选择：")]),n("div",[e._v("题数 "),n("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),n("div",[e._v("每题分数 "),n("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?n("div",{staticClass:"q-li flex flex-between"},[n("span",{staticStyle:{"margin-right":"15px",width:"80px"}},[e._v("多项选择：")]),n("div",[e._v("题数 "),n("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),n("div",[e._v("每题分数 "),n("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?n("div",{staticClass:"q-li flex flex-between"},[n("span",{staticStyle:{"margin-right":"15px",width:"80px"}},[e._v("判断题：")]),n("div",[e._v("题数 "),n("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),n("div",[e._v("每题分数 "),n("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()])])]),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.AddMethods().clickSetPaperOptionAdd()}}},[e._v("生成试题并加入列表")])],1)]),e.asEdit||e.isClickAdd?n("div",{staticStyle:{"margin-top":"15px"}},[n("div",{staticClass:"container"},[n("el-tabs",{attrs:{id:"tabs",type:"border-card"},on:{"tab-click":function(t,n){return e.ListMethods().clickListTab(t,n)}},model:{value:e.chooseQuestionType,callback:function(t){e.chooseQuestionType=t},expression:"chooseQuestionType"}},[n("el-tab-pane",{attrs:{label:"单项选择",name:"Radio"}},[n("div",{staticClass:"flex flex-between"},[e.paper.sections[e.paperSectionIndex["Radio"]]?n("el-form",{staticClass:"flex flex-start",attrs:{"label-width":"100px"}},[n("el-form-item",{attrs:{label:"本节描述:"}},[n("span",[n("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)]),n("el-form-item",{attrs:{label:"每题分数:"}},[n("span",[n("el-input-number",{staticStyle:{width:"100px"},attrs:{min:1,size:"small",label:"每题分数"},on:{change:function(t){return 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)]),n("el-form-item",{attrs:{label:"总题数:"}},[n("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Radio"]].questionTotal))])]),n("el-form-item",{attrs:{label:"章节总分:"}},[n("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Radio"]].sectionTotalScore))])])],1):e._e(),n("div",[n("el-button",{attrs:{type:"success"},on:{click:function(t){e.ListMethods().clickAddNewQuestion()}}},[e._v("手动加题")])],1)],1),e.paper.sections[e.paperSectionIndex["Radio"]]?n("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"}},[n("el-table-column",{attrs:{label:"编号",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.id))])]}}],null,!1,773642443)}),n("el-table-column",{attrs:{label:"问题描述",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return["html"===t.row.contentType?n("div",{domProps:{innerHTML:e._s(t.row.content)}}):n("div",[e._v(e._s(t.row.content))])]}}],null,!1,2468084648)}),n("el-table-column",{attrs:{label:"问题选项(蓝色为正确选项)",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.options,(function(i){return n("div",{class:i.choice===t.row.standardAnswer?"markRight":"",attrs:{label:i.choice,align:"center"}},[e._v(" "+e._s(i.choice+":"+i.content)+" ")])}))}}],null,!1,1933390226)}),n("el-table-column",{attrs:{align:"center",label:"操作",width:"80","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{type:"danger",size:"mini",round:""},on:{click:function(n){e.ListMethods().clickDelBtn("Radio",t.row.id,t.$index)}}},[e._v(" 删除 ")])]}}],null,!1,2787928971)})],1):e._e()],1),n("el-tab-pane",{attrs:{label:"多项选择",name:"Multiple"}},[n("div",{staticClass:"flex flex-between"},[e.paper.sections[e.paperSectionIndex["Multiple"]]?n("el-form",{staticClass:"flex flex-start",attrs:{"label-width":"100px"}},[n("el-form-item",{attrs:{label:"本节描述:"}},[n("span",[n("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)]),n("el-form-item",{attrs:{label:"每题分数:"}},[n("span",[n("el-input-number",{staticStyle:{width:"100px"},attrs:{min:1,size:"small",label:"每题分数"},on:{change:function(t){return 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)]),n("el-form-item",{attrs:{label:"总题数:"}},[n("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Multiple"]].questionTotal))])]),n("el-form-item",{attrs:{label:"章节总分:"}},[n("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Multiple"]].sectionTotalScore))])])],1):e._e(),n("div",[n("el-button",{attrs:{type:"success"},on:{click:function(t){e.ListMethods().clickAddNewQuestion()}}},[e._v("手动加题")])],1)],1),e.paper.sections[e.paperSectionIndex["Multiple"]]?n("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"}},[n("el-table-column",{attrs:{label:"编号",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.id))])]}}],null,!1,773642443)}),n("el-table-column",{attrs:{label:"问题描述",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return["html"===t.row.contentType?n("div",{domProps:{innerHTML:e._s(t.row.content)}}):n("div",[e._v(e._s(t.row.content))])]}}],null,!1,2468084648)}),n("el-table-column",{attrs:{label:"问题选项(蓝色为正确选项)",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.options,(function(i){return n("div",{class:t.row.standardAnswers.includes(i.choice)?"markRight":"",attrs:{label:i.choice,align:"center"}},[e._v(" "+e._s(i.choice+":"+i.content)+" ")])}))}}],null,!1,425019484)}),n("el-table-column",{attrs:{align:"center",label:"操作",width:"150","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{type:"danger",size:"mini",round:""},on:{click:function(n){e.ListMethods().clickDelBtn("Multiple",t.row.id,t.$index)}}},[e._v(" 删除 ")])]}}],null,!1,1666097194)})],1):e._e()],1),n("el-tab-pane",{attrs:{label:"判断题",name:"Judge"}},[n("div",{staticClass:"flex flex-between"},[e.paper.sections[e.paperSectionIndex["Judge"]]?n("el-form",{staticClass:"flex flex-start",attrs:{"label-width":"100px"}},[n("el-form-item",{attrs:{label:"本节描述:"}},[n("span",[n("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)]),n("el-form-item",{attrs:{label:"每题分数:"}},[n("span",[n("el-input-number",{staticStyle:{width:"100px"},attrs:{min:1,size:"small",label:"每题分数"},on:{change:function(t){return 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)]),n("el-form-item",{attrs:{label:"总题数:"}},[n("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Judge"]].questionTotal))])]),n("el-form-item",{attrs:{label:"章节总分:"}},[n("span",[e._v(e._s(e.paper.sections[e.paperSectionIndex["Judge"]].sectionTotalScore))])])],1):e._e(),n("div",[n("el-button",{attrs:{type:"success"},on:{click:function(t){e.ListMethods().clickAddNewQuestion()}}},[e._v("手动加题")])],1)],1),e.paper.sections[e.paperSectionIndex["Judge"]]?n("el-table",{staticStyle:{width:"100%"},attrs:{id:"table-Judge",data:e.paper.sections[e.paperSectionIndex["Judge"]].sectionQuestions,border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{label:"编号",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.id))])]}}],null,!1,773642443)}),n("el-table-column",{attrs:{label:"问题描述",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return["html"===t.row.contentType?n("div",{domProps:{innerHTML:e._s(t.row.content)}}):n("div",[e._v(e._s(t.row.content))])]}}],null,!1,2468084648)}),n("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)}),n("el-table-column",{attrs:{align:"center",label:"操作",width:"150","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{type:"danger",size:"mini",round:""},on:{click:function(n){e.ListMethods().clickDelBtn("Judge",t.row.id,t.$index)}}},[e._v(" 删除 ")])]}}],null,!1,2486707267)})],1):e._e()],1)],1)],1)]):e._e(),n("div",{staticClass:"page-bottom-container"},[e.asEdit?n("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?n("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"warning"},on:{click:e.clickViewBtn}},[e._v("预 览 ")]):e._e(),!e.asEdit&&e.isClickAdd?n("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),n("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?n("page-question-list",{ref:"question-list",attrs:{"as-select":!0,"experiment-id":e.paper.experimentId},on:{onListSelected:function(t){return e.SelectMethods().getSelectList(t)}}}):e._e(),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.SelectMethods().clickSelectSureBtn()}}},[e._v("确认选择")])],1)],1)],1)},a=[],s=(n("4de4"),n("4160"),n("c975"),n("a434"),n("b0c0"),n("159b"),n("53ca")),r=n("3835"),o=(n("96cf"),n("1da1")),l=n("5530"),c=n("a020"),d=n("5c8a"),u=n("2ca2"),p=n("cf45"),f=n("c471"),m=n("a888"),h=n("2f62"),b=n("d808"),g=n("7b75"),v=n("ac02"),x=n("4953"),w={name:"teacherExamPaperEdit",components:{pageQuestionList:f["default"]},directives:{elDragDialog:m["a"]},computed:Object(l["a"])({asEdit:function(){return this.$route.query.hasOwnProperty("paperId")},paperId:{get:function(){return this.$route.query["paperId"]},set:function(e){return e}}},Object(h["b"])({userInfo:function(e){return e.user}})),data:function(){return{EnumsModel:b["a"],enums:{questionJudgeAnswer:b["a"].questionJudgeAnswer,questionType:b["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:function(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:function(){},mounted:function(){this.asEdit?this.getPaperInfo():this.paper.name="课堂考卷 "+Object(p["f"])(new Date,"yyyy-MM-dd HH:mm"),this.getFilterInfo()},methods:{test:function(e){this.$forceUpdate()},getPaperInfo:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var n,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.paperId=e.$route.query["paperId"],t.next=3,c["a"].getOne(e.paperId);case 3:n=t.sent,n?(i=JSON.parse(JSON.stringify(n)),e.paper=e.paperDataInit(i)):Object(d["d"])("未找到该考卷！");case 5:case"end":return t.stop()}}),t)})))()},paperDataInit:function(e){var t=this,n=[];this.asEdit&&(e.sections=JSON.parse(e.sectionInfos)),e.sections.forEach((function(e,i){t.asEdit||e.scorePerQuestion||(e.scorePerQuestion=1),t.paperSectionIndex[e.sectionType]=i,n.push(e.sectionType),0===i&&(e["sectionName"]="单项选择题")}));var i=e.sections.length;return this.tabOrders.forEach((function(a){-1===n.indexOf(a)&&(t.paperSectionIndex[a]=i,e.sections.push({sectionType:a,sectionTotalQuestion:0,scorePerQuestion:1,sectionQuestions:[]}),i+=1)})),e.totalScore&&(e.passScore=Math.round(.6*e.totalScore)),e},getFilterInfo:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var n,i,a,s,o,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,g["a"].getTeacherExperimentList(e.userInfo);case 2:return n=t.sent,i=u["a"].generateListFilterOptions("name","id",n,!1),e.filter.experimentOption=i[0],e.filter.experimentObject=i[1],e.filter.experimentOrigin=n,e.paper.experimentId||(e.paper.experimentId=n[0]["id"]),t.next=10,v["a"].getList(1,500,{schoolId:e.userInfo.schoolId,departmentId:e.userInfo.departmentid,experimentId:e.paper.experimentId,userId:e.userInfo.userid});case 10:a=t.sent,s=Object(r["a"])(a,1),o=s[0],l=u["a"].generateListFilterOptions("name","id",o,!1),e.filter.questionBankOption=l[0],e.filter.questionBankObject=l[1],e.filter.questionBankOrigin=o;case 17:case"end":return t.stop()}}),t)})))()},clickSaveBtn:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var n,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n={},n=e.prePaperPost(),!n){t.next=11;break}return t.next=5,Object(d["a"])("确认要修改该考卷信息吗？");case 5:if(!t.sent){t.next=11;break}return Object(p["i"])("paperId")&&(n.id=Object(p["i"])("paperId")),t.next=9,c["a"].update(n);case 9:i=t.sent,i&&Object(d["e"])("修改考卷信息成功");case 11:case"end":return t.stop()}}),t)})))()},clickViewBtn:function(){this.$router.push({name:"teacherExamPaper",query:{id:this.paper.id,asType:"teacherView"}})},prePaperPost:function(){var e=this,t=JSON.parse(JSON.stringify(this.paper)),n=JSON.parse(JSON.stringify(this.paper));if(this.beforeSave()){if(t.passScore&&t.passScore>t.totalScore)return Object(d["d"])("请填写及格分数且及格分不能超过总分"),!1;n.sections=[],n.questionNumber=0;for(var i=function(i){if(n.questionNumber+=t.sections[i].sectionQuestions.length,t.sections[i].sectionQuestions.length>0){if(!t.sections[i].sectionName)return console.log("题型英文",t.sections[i].sectionType),Object(d["d"])(e.enums.questionType[t.sections[i].sectionType]+" 题型没有填写本节描述文字"),{v:!1};t.sections[i]["questionIds"]=[],t.sections[i].sectionQuestions.forEach((function(e){t.sections[i]["questionIds"].push(e.id)})),t.sections[i].sectionQuestions=[],n.sections.push(t.sections[i])}},a=0;a<t.sections.length;a++){var r=i(a);if("object"===Object(s["a"])(r))return r.v}return n.sectionInfos=JSON.stringify(n.sections),this.asEdit||(n.creatorId=this.userInfo.userid),n}return!1},ListMethods:function(){var e=this;return{clickListTab:function(e,t){},clickDelBtn:function(t,n,i){var a=this;return Object(o["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t=e.paperSectionIndex[t],n.next=3,Object(d["a"])("确定要从考卷中删除该题吗？");case 3:if(!n.sent){n.next=6;break}e.paper.sections[t].sectionQuestions.splice(i,1),a.calScore(t);case 6:case"end":return n.stop()}}),n)})))()},calScore:function(t){console.log(t);var n=e.paper.sections[t].scorePerQuestion,i=e.paper.sections[t].sectionQuestions.length,a=Object(p["c"])(n,i);e.$set(e.paper.sections[t],"questionTotal",i),e.$set(e.paper.sections[t],"sectionTotalScore",a);var s=0;e.paper.sections.forEach((function(e){e.sectionTotalScore&&(s=Object(p["b"])(s,e.sectionTotalScore))})),e.$set(e.paper,"totalScore",s),e.$set(e.paper,"passScore",Math.round(.6*s))},sectionPerScoreChange:function(t,n){t=e.paperSectionIndex[t],this.calScore(t)},clickAddNewQuestion:function(){e.chooseDialogShow=!0,e.$nextTick((function(){e.showQuestionListComponent=!0}))}}},SelectMethods:function(){var e=this;return{clickSelectSureBtn:function(){e.$refs["question-list"].ListMethods().parentSureSelect(),e.chooseDialogShow=!1},getSelectList:function(t){console.log("已选择题目列表如下"),console.log(t);var n=function(n){if(t.hasOwnProperty(n)){var i=t[n],a=e.paperSectionIndex[n];i.forEach((function(t){for(var i=!1,s=0;s<e.paper.sections[a].sectionQuestions.length;s++)if(e.paper.sections[a].sectionQuestions[s].id===t.id){i=!0;break}i||(e.paper.sections[a].questionTotal+=1,e.paper.sections[a].sectionQuestions.push(t)),e.ListMethods().calScore(e.paperSectionIndex[n])}))}};for(var i in t)n(i);e.$nextTick((function(){e.showQuestionListComponent=!1}))}}},beforeSave:function(){return this.paper.name?this.paper.experimentId?this.paper.passScore?!!this.paper.totalScore||(Object(d["d"])("请先填写或计算总分!"),!1):(Object(d["d"])("请先填写及格分数!"),!1):(Object(d["d"])("请先选择科目!"),!1):(Object(d["d"])("请先填写名称!"),!1)},AddMethods:function(){var e=this;return{clickNewBtn:function(){if(!e.paper.hasOwnProperty("experimentId"))return Object(d["d"])("请先选择实验!"),!1;e.isClickAdd=!0,e.getFilterInfo(),e.paper=e.paperDataInit(e.paper)},clickRandomAddBtn:function(){e.showSetPaperOption=!0},clickSetPaperOptionAdd:function(){return Object(o["a"])(regeneratorRuntime.mark((function t(){var n,i,a,s,o,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:for([],n=[],i=0;i<e.setAddInfo.chooseTypes.length;i++)a=e.setAddInfo.chooseTypes[i],e.tabOrders.indexOf(a)>-1&&n.push(e.setAddInfo.sectionInfos[e.tabOrders.indexOf(a)]);s=0;case 4:if(!(s<n.length)){t.next=15;break}if(o=n[s],o.questionTotal){t.next=9;break}return Object(d["d"])(e.enums.questionType[o.sectionType]+" 需要输入总题数"),t.abrupt("return",!1);case 9:if(o.scorePerQuestion){t.next=12;break}return Object(d["d"])(e.enums.questionType[o.sectionType]+" 需要输每题分数"),t.abrupt("return",!1);case 12:s++,t.next=4;break;case 15:if(0!==e.setAddInfo.questionBankIds.length){t.next=18;break}return Object(d["d"])("请选择出题的题库！"),t.abrupt("return",!1);case 18:return t.next=20,x["a"].getRandomQuestionList(e.setAddInfo);case 20:l=t.sent,l&&(l.forEach((function(t){var n=0;"Radio"===t["sectionType"]&&(n=0),"Multiple"===t["sectionType"]&&(n=1),"Judge"===t["sectionType"]&&(n=2);t["questionList"].forEach((function(t){var i=Object(p["h"])("id",t.id,e.paper.sections[n].sectionQuestions),a=Object(r["a"])(i,1),s=a[0];-1===s?e.paper.sections[n].sectionQuestions.push(t):0})),e.ListMethods().calScore(n)})),e.showSetPaperOption=!1,e.paper=e.paperDataInit(e.paper));case 22:case"end":return t.stop()}}),t)})))()},clickAddBtn:function(){return Object(o["a"])(regeneratorRuntime.mark((function t(){var n,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(d["a"])("确定要新增该考卷吗？");case 2:if(!t.sent){t.next=10;break}if(n=e.prePaperPost(),console.log(n),!n){t.next=10;break}return t.next=8,c["a"].save(n);case 8:i=t.sent,i&&(Object(d["e"])("新增考卷成功"),e.$router.push("/teacher/exam"));case 10:case"end":return t.stop()}}),t)})))()}}}}},y=w,k=(n("d713"),n("2877")),_=Object(k["a"])(y,i,a,!1,null,"2394d81f",null);t["default"]=_.exports},"9e3e":function(e,t,n){"use strict";n("1862")},a020:function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var i=n("3835"),a=(n("96cf"),n("1da1")),s=n("d4ec"),r=n("bee2"),o=n("8ce4"),l=n("7b67");function c(e){return d.apply(this,arguments)}function d(){return d=Object(a["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(o["a"])(l["c"]+"consumer/questionPaper/list","get",t));case 1:case"end":return e.stop()}}),e)}))),d.apply(this,arguments)}function u(e){return p.apply(this,arguments)}function p(){return p=Object(a["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(o["a"])(l["c"]+"consumer/questionPaper/save","post_json",t));case 1:case"end":return e.stop()}}),e)}))),p.apply(this,arguments)}function f(e){return m.apply(this,arguments)}function m(){return m=Object(a["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(o["a"])(l["c"]+"consumer/questionPaper/update","post_json",t));case 1:case"end":return e.stop()}}),e)}))),m.apply(this,arguments)}function h(e){return b.apply(this,arguments)}function b(){return b=Object(a["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(o["a"])(l["c"]+"consumer/questionPaper/delete","post_json",t));case 1:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}function g(e){return v.apply(this,arguments)}function v(){return v=Object(a["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(o["a"])(l["c"]+"consumer/questionPaper/info/"+t,"get",{}));case 1:case"end":return e.stop()}}),e)}))),v.apply(this,arguments)}function x(e){return w.apply(this,arguments)}function w(){return w=Object(a["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(o["a"])(l["c"]+"consumer/questionPaper/deleteOnePaper/"+t,"get",{}));case 1:case"end":return e.stop()}}),e)}))),w.apply(this,arguments)}var y=n("2ca2"),k=function(){function e(){Object(s["a"])(this,e)}return Object(r["a"])(e,null,[{key:"getList",value:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t,n,a){var s,r,o,l,d,u;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return s={page:t,size:n},s=Object.assign(s,a),e.next=4,c(s);case 4:if(r=e.sent,o=Object(i["a"])(r,1),l=o[0],0!==n){e.next=11;break}return e.abrupt("return",l.data);case 11:return d=y["a"].generateListMybatisPlus(l.data),u=d[0],e.abrupt("return",[u,d[1]]);case 14:case"end":return e.stop()}}),e)})));function t(t,n,i){return e.apply(this,arguments)}return t}()},{key:"save",value:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t){var n,a,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,u(t);case 2:if(n=e.sent,a=Object(i["a"])(n,1),s=a[0],2e4!==s.code){e.next=9;break}return e.abrupt("return",s.data);case 9:return e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"update",value:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t){var n,a,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,f(t);case 2:if(n=e.sent,a=Object(i["a"])(n,1),s=a[0],2e4!==s.code){e.next=9;break}return e.abrupt("return",!0);case 9:return e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"remove",value:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t){var n,a,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,h(t);case 2:if(n=e.sent,a=Object(i["a"])(n,1),s=a[0],2e4!==s.code){e.next=9;break}return e.abrupt("return",!0);case 9:return e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"deleteOnePaper",value:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t){var n,a,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,x(t);case 2:if(n=e.sent,a=Object(i["a"])(n,1),s=a[0],2e4!==s.code){e.next=9;break}return e.abrupt("return",!0);case 9:return e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getOne",value:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t){var n,a,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,g(t);case 2:if(n=e.sent,a=Object(i["a"])(n,1),s=a[0],2e4!==s.code){e.next=9;break}return e.abrupt("return",s.data);case 9:return e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()}]),e}()},acbb:function(e,t,n){},c471:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page-container"},[n("div",{staticClass:"title-info"},[e.asSelect?e._e():n("div",{staticClass:"main-title"},[e._v(" 题库名称："+e._s(e.questionBank["name"])+" ")])]),n("div",{staticClass:"clearfix"},[n("list-search-filter",{attrs:{"search-filter":e.lists.searchFilter},on:{clickSearchFilterBtn:function(t){return e.ListMethods().clickSearchFilterBtn(t)}}},[!e.asSelect&&e.canEdit?n("div",{staticStyle:{"margin-bottom":"10px"},attrs:{slot:"right-container"},slot:"right-container"},[n("el-button",{staticClass:"el-button",attrs:{type:"success"},on:{click:function(t){e.ListMethods().clickAddQuestion()}}},[e._v("新增试题")])],1):e._e()])],1),n("el-tabs",{attrs:{type:"border-card"},on:{"tab-click":function(t,n){return e.ListMethods().clickListTab(t,n)}},model:{value:e.chooseQuestionType,callback:function(t){e.chooseQuestionType=t},expression:"chooseQuestionType"}},[n("el-tab-pane",{attrs:{label:"单项选择",name:"Radio"}},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.lists.list[0].loading,expression:"lists.list[0].loading"}],staticStyle:{width:"100%"},attrs:{data:e.lists.list[0].list,"element-loading-text":"加载中",border:"",fit:"","highlight-current-row":"",height:e.asSelect?"400":""},on:{"selection-change":function(t){return e.ListMethods().listSelectChange(t,0)}}},[e.asSelect?n("el-table-column",{attrs:{align:"center",type:"selection",width:"40"}}):e._e(),n("el-table-column",{attrs:{label:"编号",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.id))])]}}])}),n("el-table-column",{attrs:{label:"问题描述",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return["html"===t.row.contentType?n("div",{staticClass:"content-vhtml",domProps:{innerHTML:e._s(t.row.content)}}):n("div",[e._v(e._s(t.row.content))])]}}])}),n("el-table-column",{attrs:{label:"问题选项(蓝色为正确选项)",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.options,(function(i){return n("div",{class:i.choice===t.row.standardAnswer?"markRight":"",attrs:{label:i.choice,align:"center"}},[i.content?n("span",[e._v(e._s(i.choice+":"+i.content))]):e._e()])}))}}])}),!e.asSelect&&e.canEdit?n("el-table-column",{attrs:{align:"center",label:"操作",width:"150",fixed:"right","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{type:"primary",size:"mini",round:""},on:{click:function(n){e.ListMethods().clickEditBtn(0,t.row,t.$index)}}},[e._v(" 编辑 ")]),n("el-button",{attrs:{type:"danger",size:"mini",round:""},on:{click:function(n){e.ListMethods().clickDelBtn(0,t.row.id,t.$index)}}},[e._v(" 删除 ")])]}}],null,!1,276856338)}):e._e()],1),n("div",{staticClass:"pagination-container"},[n("el-pagination",{attrs:{background:"","current-page":e.lists.list[0].pages.page,"page-size":e.lists.list[0].pages.limit,layout:"total,prev, pager, next,sizes",total:e.lists.list[0].pages.totalNumber,"page-count":e.lists.list[0].pages.totalPage},on:{"current-change":function(t){return e.ListMethods().pageChange(0,t)},"size-change":function(t){return e.ListMethods().pageLimitChange(0,t)}}})],1)],1),n("el-tab-pane",{attrs:{label:"多项选择",name:"Multiple"}},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.lists.list[1].loading,expression:"lists.list[1].loading"}],staticStyle:{width:"100%"},attrs:{data:e.lists.list[1].list,"element-loading-text":"加载中",border:"",fit:"","highlight-current-row":"",height:e.asSelect?"400":""},on:{"selection-change":function(t){return e.ListMethods().listSelectChange(t,1)}}},[e.asSelect?n("el-table-column",{attrs:{align:"center",type:"selection",width:"40"}}):e._e(),n("el-table-column",{attrs:{label:"编号",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.id))])]}}])}),n("el-table-column",{attrs:{label:"问题描述",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return["html"===t.row.contentType?n("div",{staticClass:"content-vhtml",domProps:{innerHTML:e._s(t.row.content)}}):n("div",[e._v(e._s(t.row.content))])]}}])}),n("el-table-column",{attrs:{label:"问题选项(蓝色为正确选项)",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.options,(function(i){return n("div",{class:t.row.standardAnswers.includes(i.choice)?"markRight":"",attrs:{label:i.choice,align:"center"}},[i.content?n("span",[e._v(e._s(i.choice+":"+i.content))]):e._e()])}))}}])}),!e.asSelect&&e.canEdit?n("el-table-column",{attrs:{align:"center",label:"操作",width:"150",fixed:"right","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{type:"primary",size:"mini",round:""},on:{click:function(n){e.ListMethods().clickEditBtn(1,t.row,t.$index)}}},[e._v(" 编辑 ")]),n("el-button",{attrs:{type:"danger",size:"mini",round:""},on:{click:function(n){e.ListMethods().clickDelBtn(1,t.row.id,t.$index)}}},[e._v(" 删除 ")])]}}],null,!1,3508929842)}):e._e()],1),n("div",{staticClass:"pagination-container"},[n("el-pagination",{attrs:{background:"","current-page":e.lists.list[1].pages.page,"page-size":e.lists.list[1].pages.limit,layout:"total,prev, pager, next,sizes",total:e.lists.list[1].pages.totalNumber,"page-count":e.lists.list[1].pages.totalPage},on:{"current-change":function(t){return e.ListMethods().pageChange(1,t)},"size-change":function(t){return e.ListMethods().pageLimitChange(1,t)}}})],1)],1),n("el-tab-pane",{attrs:{label:"判断题",name:"Judge"}},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.lists.list[2].loading,expression:"lists.list[2].loading"}],staticStyle:{width:"100%"},attrs:{data:e.lists.list[2].list,"element-loading-text":"加载中",border:"",fit:"","highlight-current-row":"",height:e.asSelect?"400":""},on:{"selection-change":function(t){return e.ListMethods().listSelectChange(t,2)}}},[e.asSelect?n("el-table-column",{attrs:{align:"center",type:"selection",width:"40"}}):e._e(),n("el-table-column",{attrs:{label:"编号",align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.id))])]}}])}),n("el-table-column",{attrs:{label:"问题描述",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return["html"===t.row.contentType?n("div",{staticClass:"content-vhtml",domProps:{innerHTML:e._s(t.row.content)}}):n("div",[e._v(e._s(t.row.content))])]}}])}),n("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])+" ")]}}])}),!e.asSelect&&e.canEdit?n("el-table-column",{attrs:{align:"center",label:"操作",width:"150",fixed:"right","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{type:"primary",size:"mini",round:""},on:{click:function(n){e.ListMethods().clickEditBtn(2,t.row,t.$index)}}},[e._v(" 编辑 ")]),n("el-button",{attrs:{type:"danger",size:"mini",round:""},on:{click:function(n){e.ListMethods().clickDelBtn(2,t.row.id,t.$index)}}},[e._v(" 删除 ")])]}}],null,!1,4075331922)}):e._e()],1),n("div",{staticClass:"pagination-container"},[n("el-pagination",{attrs:{background:"","current-page":e.lists.list[2].pages.page,"page-size":e.lists.list[2].pages.limit,layout:"total,prev, pager, next,sizes",total:e.lists.list[2].pages.totalNumber,"page-count":e.lists.list[2].pages.totalPage},on:{"current-change":function(t){return e.ListMethods().pageChange(2,t)},"size-change":function(t){return e.ListMethods().pageLimitChange(2,t)}}})],1)],1)],1),n("div",{staticClass:"edit-container"},[n("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{title:"编辑试题",visible:e.detail.dialog,width:"60%",center:""},on:{"update:visible":function(t){return e.$set(e.detail,"dialog",t)},closed:function(t){e.DetailMethods().closeDialog()}}},[n("div",{staticClass:"dialog-container"},[n("el-form",{ref:"editForm",attrs:{"label-width":"90px",rules:e.detail.formRules,model:e.detail.edit}},["new"===e.detail.type?n("el-form-item",{attrs:{label:"试题类型:",prop:"questionType"}},[n("el-select",{attrs:{placeholder:"请选择试题类型"},on:{change:function(t){return e.DetailMethods().questionTypeChange(t)}},model:{value:e.detail.edit.questionType,callback:function(t){e.$set(e.detail.edit,"questionType",t)},expression:"detail.edit.questionType"}},[n("el-option",{key:"Radio",attrs:{value:"Radio",label:"单项选择"}}),n("el-option",{key:"Multiple",attrs:{value:"Multiple",label:"多项选择"}}),n("el-option",{key:"Judge",attrs:{value:"Judge",label:"判断题"}})],1)],1):e._e(),n("el-form-item",{attrs:{label:"试题内容:",prop:"content"}},[n("el-tabs",{model:{value:e.detail.edit.contentType,callback:function(t){e.$set(e.detail.edit,"contentType",t)},expression:"detail.edit.contentType"}},[n("el-tab-pane",{attrs:{label:"纯文本",name:"text"}},[n("el-input",{attrs:{type:"textarea"},model:{value:e.detail.edit.contentText,callback:function(t){e.$set(e.detail.edit,"contentText",t)},expression:"detail.edit.contentText"}})],1),n("el-tab-pane",{attrs:{label:"富文本",name:"html"}},[n("tinymce",{ref:"tinymce_content",attrs:{width:"99%",height:200},model:{value:e.detail.edit.contentHtml,callback:function(t){e.$set(e.detail.edit,"contentHtml",t)},expression:"detail.edit.contentHtml"}})],1)],1)],1),n("el-form-item",{attrs:{label:"设置答案:",prop:"answer"}},["Radio"===e.detail.edit.questionType?n("div",[n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[0]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[0].content,callback:function(t){e.$set(e.detail.edit.options[0],"content",t)},expression:"detail.edit.options[0].content"}},[n("template",{slot:"prepend"},[n("el-radio",{attrs:{label:"A"},model:{value:e.detail.edit.standardAnswer,callback:function(t){e.$set(e.detail.edit,"standardAnswer",t)},expression:"detail.edit.standardAnswer"}})],1)],2):e._e()],1),n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[1]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[1].content,callback:function(t){e.$set(e.detail.edit.options[1],"content",t)},expression:"detail.edit.options[1].content"}},[n("template",{slot:"prepend"},[n("el-radio",{attrs:{label:"B"},model:{value:e.detail.edit.standardAnswer,callback:function(t){e.$set(e.detail.edit,"standardAnswer",t)},expression:"detail.edit.standardAnswer"}})],1)],2):e._e()],1),n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[2]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[2].content,callback:function(t){e.$set(e.detail.edit.options[2],"content",t)},expression:"detail.edit.options[2].content"}},[n("template",{slot:"prepend"},[n("el-radio",{attrs:{label:"C"},model:{value:e.detail.edit.standardAnswer,callback:function(t){e.$set(e.detail.edit,"standardAnswer",t)},expression:"detail.edit.standardAnswer"}})],1)],2):e._e()],1),n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[3]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[3].content,callback:function(t){e.$set(e.detail.edit.options[3],"content",t)},expression:"detail.edit.options[3].content"}},[n("template",{slot:"prepend"},[n("el-radio",{attrs:{label:"D"},model:{value:e.detail.edit.standardAnswer,callback:function(t){e.$set(e.detail.edit,"standardAnswer",t)},expression:"detail.edit.standardAnswer"}})],1)],2):e._e()],1),n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[4]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[4].content,callback:function(t){e.$set(e.detail.edit.options[4],"content",t)},expression:"detail.edit.options[4].content"}},[n("template",{slot:"prepend"},[n("el-radio",{attrs:{label:"E"},model:{value:e.detail.edit.standardAnswer,callback:function(t){e.$set(e.detail.edit,"standardAnswer",t)},expression:"detail.edit.standardAnswer"}})],1)],2):e._e()],1),n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[5]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[5].content,callback:function(t){e.$set(e.detail.edit.options[5],"content",t)},expression:"detail.edit.options[5].content"}},[n("template",{slot:"prepend"},[n("el-radio",{attrs:{label:"F"},model:{value:e.detail.edit.standardAnswer,callback:function(t){e.$set(e.detail.edit,"standardAnswer",t)},expression:"detail.edit.standardAnswer"}})],1)],2):e._e()],1)]):e._e(),"Multiple"===e.detail.edit.questionType?n("div",[n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[0]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[0].content,callback:function(t){e.$set(e.detail.edit.options[0],"content",t)},expression:"detail.edit.options[0].content"}},[n("template",{slot:"prepend"},[n("el-checkbox",{attrs:{label:"A"},model:{value:e.detail.edit.standardAnswers,callback:function(t){e.$set(e.detail.edit,"standardAnswers",t)},expression:"detail.edit.standardAnswers"}})],1)],2):e._e()],1),n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[1]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[1].content,callback:function(t){e.$set(e.detail.edit.options[1],"content",t)},expression:"detail.edit.options[1].content"}},[n("template",{slot:"prepend"},[n("el-checkbox",{attrs:{label:"B"},model:{value:e.detail.edit.standardAnswers,callback:function(t){e.$set(e.detail.edit,"standardAnswers",t)},expression:"detail.edit.standardAnswers"}})],1)],2):e._e()],1),n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[2]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[2].content,callback:function(t){e.$set(e.detail.edit.options[2],"content",t)},expression:"detail.edit.options[2].content"}},[n("template",{slot:"prepend"},[n("el-checkbox",{attrs:{label:"C"},model:{value:e.detail.edit.standardAnswers,callback:function(t){e.$set(e.detail.edit,"standardAnswers",t)},expression:"detail.edit.standardAnswers"}})],1)],2):e._e()],1),n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[3]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[3].content,callback:function(t){e.$set(e.detail.edit.options[3],"content",t)},expression:"detail.edit.options[3].content"}},[n("template",{slot:"prepend"},[n("el-checkbox",{attrs:{label:"D"},model:{value:e.detail.edit.standardAnswers,callback:function(t){e.$set(e.detail.edit,"standardAnswers",t)},expression:"detail.edit.standardAnswers"}})],1)],2):e._e()],1),n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[4]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[4].content,callback:function(t){e.$set(e.detail.edit.options[4],"content",t)},expression:"detail.edit.options[4].content"}},[n("template",{slot:"prepend"},[n("el-checkbox",{attrs:{label:"E"},model:{value:e.detail.edit.standardAnswers,callback:function(t){e.$set(e.detail.edit,"standardAnswers",t)},expression:"detail.edit.standardAnswers"}})],1)],2):e._e()],1),n("div",{staticClass:"edit-choose-item"},[e.detail.edit.options[5]?n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.detail.edit.options[5].content,callback:function(t){e.$set(e.detail.edit.options[5],"content",t)},expression:"detail.edit.options[5].content"}},[n("template",{slot:"prepend"},[n("el-checkbox",{attrs:{label:"F"},model:{value:e.detail.edit.standardAnswers,callback:function(t){e.$set(e.detail.edit,"standardAnswers",t)},expression:"detail.edit.standardAnswers"}})],1)],2):e._e()],1)]):e._e(),"Judge"===e.detail.edit.questionType?n("div",[n("div",{staticClass:"edit-choose-item"},[n("el-radio",{attrs:{label:"true"},model:{value:e.detail.edit.standardAnswer,callback:function(t){e.$set(e.detail.edit,"standardAnswer",t)},expression:"detail.edit.standardAnswer"}},[e._v("正确 ")])],1),n("div",{staticClass:"edit-choose-item"},[n("el-radio",{attrs:{label:"false"},model:{value:e.detail.edit.standardAnswer,callback:function(t){e.$set(e.detail.edit,"standardAnswer",t)},expression:"detail.edit.standardAnswer"}},[e._v("错误 ")])],1)]):e._e()])],1)],1),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},["edit"===e.detail.type?n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.DetailMethods().clickEditBtn()}}},[e._v("修 改")]):e._e(),"edit"===e.detail.type?n("el-button",{attrs:{type:"danger"},on:{click:function(t){e.DetailMethods().clickDeleteBtn()}}},[e._v("删 除")]):e._e(),"new"===e.detail.type?n("el-button",{attrs:{type:"success"},on:{click:function(t){e.DetailMethods().clickAddBtn()}}},[e._v("新 增")]):e._e()],1)])],1),n("input",{staticStyle:{display:"none"},attrs:{id:"importFile",type:"file"},on:{change:function(t){e.ListMethods().importFileChange(t)}}})],1)},a=[],s=(n("4de4"),n("4160"),n("c975"),n("a434"),n("b0c0"),n("ac1f"),n("841c"),n("159b"),n("3835")),r=(n("96cf"),n("1da1")),o=n("5530"),l=n("4953"),c=n("e2f9"),d=n("2ca2"),u=n("a888"),p=n("5c8a"),f=n("cf45"),m=n("8256"),h=n("2f62"),b=(n("5c96"),n("d808")),g=n("ac02"),v={name:"QuestionList",components:{ListSearchFilter:c["a"],Tinymce:m["a"]},directives:{elDragDialog:u["a"]},watch:{"detail.edit.contentType":function(e,t){"html"===e?this.$set(this.detail.edit,"content",this.detail.edit.contentHtml):this.$set(this.detail.edit,"content",this.detail.edit.contentText)}},computed:Object(o["a"])({},Object(h["b"])({userInfo:function(e){return e.user}})),props:{asSelect:{type:Boolean,required:!1,default:!1},experimentId:{type:String,required:!1,default:null}},data:function(){var e=this,t=function(t,n,i){switch(e.detail.edit.questionType){case"Radio":e.detail.edit.standardAnswer||i(new Error("请设置试题答案"));break;case"Multiple":0===e.detail.edit.standardAnswers.length&&i(new Error("请设置试题答案"));break;case"Judge":e.detail.edit.standardAnswer||i(new Error("请设置试题答案"));break;default:break}i()},n=function(t,n,i){"text"===e.detail.edit.contentType?e.detail.edit.contentText||i(new Error("请输入试题内容")):e.detail.edit.contentHtml||i(new Error("请输入试题内容")),i()};return{find_obj_from_arr_by_id:f["h"],objectToLVArr:f["o"],arrToLVArr:f["e"],enums:{questionJudgeAnswer:b["a"].questionJudgeAnswer,questionOptionLabel:b["a"].questionOptionLabel,questionBankType:b["a"].questionBankType},questionBankId:this.$route.query["bankId"],chooseQuestionType:"Radio",tabOrders:["Radio","Multiple","Judge"],lists:{list:[{list:[],loading:!1,query:{questionType:"Radio"},queryOri:{questionType:"Radio"},pages:{limit:10},selectList:[]},{list:[],loading:!1,query:{questionType:"Multiple"},queryOri:{questionType:"Multiple"},pages:{limit:10},selectList:[]},{list:[],loading:!1,query:{questionType:"Judge"},queryOri:{questionType:"Judge"},pages:{limit:10},selectList:[]}],searchFilter:{search:[{type:"input",label:"问题描述",key:"content",value:""}],filter:[{type:"select",label:"选择题库",key:"questionBankId",value:"",data:[],hidden:!1,dataObject:{},dataOrigin:{},change:function(e){}}]}},detail:{dialog:!1,type:"edit",edit:{contentType:"text",standardAnswers:[]},formRules:{questionType:{required:!0,message:"请选择试题类型",trigger:"blur"},content:{required:!0,message:"请输入试题内容",validator:n},answer:{required:!0,message:"请设置试题答案",validator:t}}},questionBank:{},subject:{},canEdit:!0,importQuestionLoading:!1}},mounted:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.getBankInfo(),e.ListMethods().getList(0,1,e.lists.list[0].pages.limit,e.lists.list[0].query),e.ListMethods().initFilter();case 3:case"end":return t.stop()}}),t)})))()},methods:{getBankInfo:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.questionBankId){t.next=5;break}return t.next=3,g["a"].getOne(e.questionBankId);case 3:n=t.sent,n?(e.questionBank=n,e.canEdit=!0):Object(p["d"])("未找到该题库信息");case 5:case"end":return t.stop()}}),t)})))()},ListMethods:function(){var e=this;return{getList:function(t,n,i,a){return Object(r["a"])(regeneratorRuntime.mark((function r(){var o,c;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.asSelect||e.$set(e.lists.searchFilter.filter[0],"hidden",!0),e.lists.list[t].loading=!0,e.asSelect&&e.experimentId&&(a["experimentId"]=e.experimentId),e.$route.query["bankId"]&&(a["questionBankId"]=e.$route.query["bankId"]),r.next=6,l["a"].getList(n,i||10,a);case 6:o=r.sent,c=Object(s["a"])(o,2),e.lists.list[t].list=c[0],e.lists.list[t].pages=c[1],e.lists.list[t].loading=!1,e.lists.tabIndex=t;case 12:case"end":return r.stop()}}),r)})))()},pageChange:function(t,n){var i=this;return Object(r["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:i.getList(t,n,e.lists.list[t].pages.limit,e.lists.list[t].query);case 1:case"end":return a.stop()}}),a)})))()},pageLimitChange:function(t,n){var i=this;return Object(r["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:i.getList(t,e.lists.pages.list[t].page,n,e.lists.list[t].query);case 1:case"end":return a.stop()}}),a)})))()},initFilter:function(){return Object(r["a"])(regeneratorRuntime.mark((function t(){var n,i,a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.asSelect||!e.experimentId){t.next=9;break}return t.next=3,g["a"].getList(1,500,{experimentId:e.experimentId,schoolId:e.userInfo.schoolId,departmentId:e.userInfo.departmentid});case 3:n=t.sent,i=Object(s["a"])(n,1),a=i[0],console.log(a),r=d["a"].generateListFilterOptions("name","id",a,!0),e.$set(e.lists.searchFilter.filter,0,{type:"select",label:"选择题库",key:"questionBankId",value:"",data:r[0],dataObject:r[1],dataOrigin:a[0],change:function(e){}});case 9:case"end":return t.stop()}}),t)})))()},clickSearchFilterBtn:function(t){var n=e.tabOrders.indexOf(e.chooseQuestionType);e.lists.list[n].query=Object.assign(t,e.lists.list[n].queryOri),this.getList(n,1,e.lists.list[n].pages.limit?e.lists.list[n].pages.limit:10,e.lists.list[n].query)},clickEditBtn:function(t,n,i){JSON.parse(JSON.stringify(n));switch(e.detail.dialog=!0,e.detail.edit={},n.questionType){case"Radio":for(var a=n.options.length,s=6-a,r=0;r<s;r++)n.options.push({choice:e.enums.questionOptionLabel[a+r],content:""});break;case"Multiple":for(var o=n.options.length,l=6-o,c=0;c<l;c++)n.options.push({choice:e.enums.questionOptionLabel[o+c],content:""});break;case"Judge":break}e.detail.edit=n,"text"===e.detail.edit.contentType?(setTimeout((function(){e.$refs["tinymce_content"].setContent("")}),300),e.$set(e.detail.edit,"contentText",n.content)):(e.$set(e.detail.edit,"contentHtml",n.content),setTimeout((function(){e.$refs["tinymce_content"].setContent(n.content)}),300)),e.detail.type="edit",e.detail.index=t,e.detail.$index=i},clickDelBtn:function(t,n,i){return Object(r["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(p["a"])("确认删除该试题吗？删除后不可用恢复！");case 2:if(!a.sent){a.next=9;break}return a.next=5,l["a"].remove(n);case 5:if(!a.sent){a.next=9;break}e.lists.list[t].list.splice(i,1),e.$set(e.lists.list[t].pages,"totalNumber",e.lists.list[t].pages.totalNumber-1),Object(p["e"])("删除成功!");case 9:case"end":return a.stop()}}),a)})))()},clickListTab:function(t,n){var i=e.tabOrders.indexOf(t.name);e.lists.tabIndex=i,0===e.lists.list[i].list.length&&this.getList(i,1,e.lists.list[i].pages.limit,e.lists.list[i].query),e.$set(e.lists.searchFilter.search[0],"value","")},clickAddQuestion:function(){e.detail.type="new",e.detail.edit={contentType:"text",content:"",options:[]},e.detail.dialog=!0,setTimeout((function(){e.$refs["tinymce_content"].setContent("")}),500)},listSelectChange:function(t,n){e.lists.list[n]["selectList"]=t},parentSureSelect:function(){var t={};e.lists.list.forEach((function(n,i){n.selectList.length>0&&(t[e.tabOrders[i]]=n.selectList)})),e.$emit("onListSelected",t)},clickImportModel:function(){return Object(r["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,l["a"].downloadQuestionImportModel();case 2:t=e.sent,Object(p["e"])("请选择允许打开弹窗窗口，以下载模板文件"),window.open(t[0]);case 5:case"end":return e.stop()}}),e)})))()},clickImportBtn:function(){var e=document.getElementById("importFile");e.click()},importFileChange:function(t){return Object(r["a"])(regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=t.target.files[0],document.getElementById("importFile").value="",Object(p["e"])("试题导入中，请耐心等候，不要刷新页面！"),e.importQuestionLoading=!0,n.next=6,l["a"].importQuestion(i,e.questionBank.id);case 6:if(!n.sent){n.next=8;break}Object(p["e"])("导入试题成功，请刷新页面查看新列表");case 8:e.importQuestionLoading=!1;case 9:case"end":return n.stop()}}),n)})))()}}},DetailMethods:function(){var e=this;return{questionTypeChange:function(t){switch(t){case"Radio":for(var n=e.detail.edit.options.length,i=6-n,a=0;a<i;a++)e.detail.edit.options.push({choice:e.enums.questionOptionLabel[n+a],content:""});break;case"Multiple":for(var s=e.detail.edit.options.length,r=6-s,o=0;o<r;o++)e.detail.edit.options.push({choice:e.enums.questionOptionLabel[s+o],content:""});e.$set(e.detail.edit,"standardAnswers",[]);break;case"Judge":e.detail.edit.options=[];break}},clickEditBtn:function(){return Object(r["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$refs["editForm"].validate(function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(n){var i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=23;break}return t.next=3,Object(p["a"])("确定要修改该试题信息吗？");case 3:if(!t.sent){t.next=23;break}"text"===e.detail.edit.contentType?e.detail.edit.content=e.detail.edit.contentText:e.detail.edit.content=e.detail.edit.contentHtml,JSON.parse(JSON.stringify(e.detail.edit)),t.t0=e.detail.edit.questionType,t.next="Multiple"===t.t0?9:10;break;case 9:return t.abrupt("break",10);case 10:return{},t.next=13,l["a"].update(e.detail.edit);case 13:if(!t.sent){t.next=17;break}Object(p["e"])("修改试题信息成功"),e.detail.dialog=!1,e.detail.edit={options:[]};case 17:t.t1=e.detail.edit.questionType,t.next=20;break;case 20:return t.abrupt("break",21);case 21:i=e.lists.tabIndex,e.ListMethods().getList(i,e.lists.list[i].pages.number,e.lists.list[i].pages.size,e.lists.list[i].query);case 23:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()},clickDeleteBtn:function(){return Object(r["a"])(regeneratorRuntime.mark((function t(){var n,i,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.detail.edit.id,i=e.detail.index,a=e.detail.$index,t.next=5,Object(p["a"])("确认删除该试题吗？删除后不可恢复！");case 5:if(!t.sent){t.next=12;break}return t.next=8,l["a"].delQuestion(n);case 8:if(!t.sent){t.next=12;break}Object(p["e"])("删除成功!"),e.detail.dialog=!1,e.lists.list[i].list.splice(a,1);case 12:case"end":return t.stop()}}),t)})))()},clickAddBtn:function(){return Object(r["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$refs["editForm"].validate(function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(n){var i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=22;break}return t.next=3,Object(p["a"])("确定要新增该试题吗?");case 3:if(!t.sent){t.next=22;break}switch("text"===e.detail.edit.contentType?e.detail.edit.content=e.detail.edit.contentText:e.detail.edit.content=e.detail.edit.contentHtml,e.detail.edit.questionType){}return e.detail.edit.questionBankId=e.questionBankId,e.detail.edit.experimentId=e.questionBank.experimentId,e.detail.edit.creatorId=e.userInfo.userid,t.next=11,l["a"].save(e.detail.edit);case 11:if(!t.sent){t.next=22;break}Object(p["e"])("新增试题成功"),i=e.tabOrders.indexOf(e.chooseQuestionType),e.lists.list[i].list.push(e.detail.edit),e.$set(e.lists.list[i].pages,"totalNumber",e.lists.list[i].pages.totalNumber+1),e.detail.dialog=!1,e.detail.edit={options:[]},t.t0=e.detail.edit.questionType,t.next="Match"===t.t0?21:22;break;case 21:return t.abrupt("break",22);case 22:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()},closeDialog:function(){}}}}},x=v,w=(n("9e3e"),n("e7c7"),n("2877")),y=Object(w["a"])(x,i,a,!1,null,"1a059efc",null);t["default"]=y.exports},d060:function(e,t,n){},d713:function(e,t,n){"use strict";n("d060")},e7c7:function(e,t,n){"use strict";n("7ad6")},f0e8:function(e,t,n){}}]);