|
|
webpackJsonp([173],{4037:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a(165),n=(a.n(s),a(164)),g=a.n(n),i=a(1536),o=(a.n(i),a(1535)),w=a.n(o),l=a(46),r=(a.n(l),a(47)),k=a.n(r),c=a(178),u=(a.n(c),a(179)),N=a.n(u),p=a(168),d=(a.n(p),a(167)),m=a.n(d),h=a(296),f=(a.n(h),a(291)),v=a.n(f),y=a(0),_=a.n(y),x=a(45),b=a(12),M=a.n(b),E=a(5),q=a(341),j=(a.n(q),a(4038)),I=a(4039),S=a(4040),R=function(e,t,a){return t&&D(e.prototype,t),a&&D(e,a),e};function D(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}Object(E.Q)(),Object(E.Q)("/editormd/lib/");for(var C=window.$,O=v.a.Option,T=(m.a.Group,[]),P=65,G=0;P<91;P++,G++)T[G]=String.fromCharCode(P);var H=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(V,y.Component),R(V,[{key:"componentDidMount",value:function(){var i=this;this.props.status;var s=this.props.match.params.shixunId,n=this.props.match.params.checkpointId;this.setState({mancheckpointId:s});var o="/shixuns/"+s+"/challenges/newquestion",l="/shixuns/"+s+"/challenges/new",r="/shixuns/"+s+"/challenges";if(void 0===this.props.match.params.choose_id)if(void 0===n){var e="/shixuns/"+s+"/challenges/new.json";M.a.get(e).then(function(e){403===e.data.status||401===e.data.status||500===e.data.status||(i.setState({choice_url:o,practice_url:l,go_back_url:r,position:e.data.position,task_pass_default:e.data.task_pass_default,submit_url:e.data.submit_url,power:!0,activetype:"first"}),403===e.data.status||401===e.data.status||500===e.data.status?i.setState({contentMdRefval:""}):(i.setState({contentMdRefval:e.data.task_pass_default}),i.contentMdRef.current.setValue(e.data.task_pass_default||"")),i.shixunsautoHeight())}).catch(function(e){console.log(e)})}else{var t="/shixuns/"+s+"/challenges/"+n+"/edit.json?st=1";M.a.get(t).then(function(e){if(403!==e.data.status&&401!==e.data.status&&500!==e.data.status){var t=e.data.prev_challenge,a=e.data.next_challenge;null!=t&&(t=0===t.st?"/shixuns/"+s+"/challenges/"+t.id+"/editcheckpoint":"/shixuns/"+s+"/challenges/"+t.id+"/editquestion"),null!=a&&(a=0===a.st?"/shixuns/"+s+"/challenges/"+a.id+"/editcheckpoint":"/shixuns/"+s+"/challenges/"+a.id+"/editquestion"),i.setState({questionaddtype:!1,newquestionaddtype:!1,activetype:"first",prev_challenge:t,next_challenge:a,questionsInputvalue:e.data.subject,questionaddarray:e.data.chooses,challenge_id:e.data.id,mancheckpointId:n,position:e.data.position,choice_url:o,practice_url:l,go_back_url:r,power:e.data.power,answer:e.data.answer}),i.setState({contentMdRefval:e.data.task_pass}),e.data.chooses.length,i.shixunsautoHeight()}}).catch(function(e){console.log(e)})}else{C("html").animate({scrollTop:10},500),this.state.challenge_id;var c=this.props.match.params.shixunId,a="/shixuns/"+c+"/challenges/"+n+"/edit.json?st=1";M.a.get(a).then(function(e){if(403!==e.data.status&&401!==e.data.status&&500!==e.data.status){var t=e.data.prev_challenge,a=e.data.next_challenge;null!=t&&(t=0===t.st?"/shixuns/"+c+"/challenges/"+t.id+"/editcheckpoint":"/shixuns/"+c+"/challenges/"+t.id+"/editquestion"),null!=a&&(a=0===a.st?"/shixuns/"+c+"/challenges/"+a.id+"/editcheckpoint":"/shixuns/"+c+"/challenges/"+a.id+"/editquestion"),i.setState({questionaddtype:!1,newquestionaddtype:!1,prev_challenge:t,next_challenge:a,questionsInputvalue:e.data.subject,questionaddarray:e.data.chooses,challenge_id:e.data.id,mancheckpointId:n,position:e.data.position,choice_url:o,practice_url:l,go_back_url:r,power:e.data.power}),i.setState({contentMdRefval:e.data.task_pass}),0===e.data.chooses.length&&i.questionadd(),i.shixunsautoHeight()}}).catch(function(e){console.log(e)});var u="/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/edit_choose_question.json?choose_id="+this.props.match.params.choose_id;M.a.get(u).then(function(e){if(200===e.status){for(var t=e.data.choose_contents,a=[],s=0;s<t.length;s++){var n=t[s];a.push({str:T[n.position],val:n.option_name,type:n.right_key})}i.setState({activetype:i.props.match.params.choose_id,editquestionaddtype:!0,questionaddtype:!1,newquestionaddtype:!1,editlist:e.data,questionlists:a,answeshixunsGroup:e.data.difficult,answeonshixunsmark:e.data.score,shixunsskillanswerlist:e.data.tags,challenge_choose_id:i.props.match.params.choose_id,standard_answer:e.data.standard_answer,subject:e.data.subject,answer:e.data.answer,neweditanswerRefval:e.data.subject,editanswersRefval:e.data.answer}),i.neweditanswerRef.current.setValue(e.data.subject||""),i.editanswersRef.current.setValue(e.data.answer||""),i.shixunsautoHeight()}}).catch(function(e){})}}},{key:"render",value:function(){var e,a=this,t=this.state,s=t.choice_url,n=t.practice_url,i=t.go_back_url,o=t.position,l=t.answeoptions,r=t.questionaddarray,c=t.questionaddtype,u=t.activetype,p=t.newquestionaddtype,d=t.editquestionaddtype,m=t.challenge_choose_id,h=t.prev_challenge,f=t.next_challenge;return t.answer,e=l.map(function(e,t){return _.a.createElement(O,{key:e,id:t},e)}),_.a.createElement(_.a.Fragment,null,_.a.createElement("div",{className:"educontent mt30 mb30"},_.a.createElement("div",{className:"padding10-20 mb10 edu-back-white clearfix"},_.a.createElement("span",{className:"fl ring-blue mr10 mt7",style:{lineHeight:"15px"}},_.a.createElement("img",{src:Object(E.M)("images/educoder/icon/choose.svg"),"data-tip-down":"实训任务"})),_.a.createElement("span",{className:"font-16 task-hide fl TPMtaskName"},"第",o,"关"),_.a.createElement(x.b,{to:void 0===i?"":i,className:"color-grey-6 fr font-15 mt3"},"返回"),void 0===h?"":_.a.createElement("a",{href:h,className:"fr color-blue mr15 mt4"},"上一关"),void 0===f?"":_.a.createElement("a",{href:f,className:"fr color-blue mr15 mt4"},"下一关"),_.a.createElement("a",{href:void 0===n?"":n,className:"fr color-blue mr15 mt4",style:{display:4<this.props.identity||void 0===this.props.identity||2===this.props.status||1===this.props.status?"none":"block"},"data-tip-down":"新增代码编辑类型的任务"},"+ 实践类型"),_.a.createElement("a",{href:void 0===s?"":s,className:"fr color-blue mr15 mt4",style:{display:4<this.props.identity||void 0===this.props.identity||2===this.props.status||1===this.props.status?"none":"block"},"data-tip-down":"新增选择题类型的任务"},"+ 选择题类型")),_.a.createElement("div",{className:"challenge_nav clearfix edu-back-white question_nav"},_.a.createElement(w.a,{title:"切换前请确认当前选择题已提交,否则不会保存你当前所有输入!",okText:"确定",cancelText:"取消",onConfirm:this.questionall},_.a.createElement("li",{className:"first"===u?"click_active active":""},_.a.createElement("a",null,"本关任务"))),0===r.length?"":r.map(function(e,t){return _.a.createElement("li",{key:t,className:parseInt(u)===e.choose_id?"click_active active":"",onClick:parseInt(u)===e.choose_id?function(){return a.questionlist(t,e.choose_id,e.type)}:""},0!=e.choose_id?_.a.createElement(w.a,{title:"切换前请确认当前选择题已提交,否则不会保存你当前所有输入!",okText:"确定",cancelText:"取消",onConfirm:function(){return a.gochooseid("/shixuns/"+a.props.match.params.shixunId+"/challenges/"+a.props.match.params.checkpointId+"/editquestion/"+e.choose_id)}},_.a.createElement("a",null,t+1,".",2===e.type?"多选题":1===e.type?"单选题":"选择题")):"first"===u?"":_.a.createElement("a",null,t+1,".",2===e.type?"多选题":1===e.type?"单选题":"选择题"))}),_.a.createElement("li",{onClick:this.questionadd,style:{display:!0===c||2===this.props.status?"none":"block"}},_.a.createElement(g.a,{placement:"bottom",title:"新增选择题"},_.a.createElement("a",{className:"add_choose_type",style:{width:"50px"}},"+")))),"first"===u?_.a.createElement(j.a,Object.assign({},this.props,this.state,{contentMdRef:this.contentMdRef,questionInputvalue:function(e){return a.questionInputvalue(e)},clickquestionsumit:function(e){return a.clickquestionsumit(e)}})):"",!0===p?_.a.createElement(I.a,Object.assign({},this.props,this.state,{newquestioMDMdRef:this.newquestioMDMdRef,newquestioMDMdCont:this.newquestioMDMdCont,options:e,selquestionlists:function(e){return a.selquestionlists(e)},onInputoquestionption:function(e,t){return a.onInputoquestionption(e,t)},delquestionlists:function(e){return a.delquestionlists(e)},addquestionlists:function(e){return a.addquestionlists(e)},onshixunGroupanswe:function(e){return a.onshixunGroupanswe(e)},onshixunsansweSelect:function(e){return a.onshixunsansweSelect(e)},shixunssanswerkill:function(e){return a.shixunssanswerkill(e)},clickshixunsanswerskill:function(e){return a.clickshixunsanswerskill(e)},delshixunssnswerllist:function(e){return a.delshixunssnswerllist(e)},answer_subit:function(){return a.answer_subit()}})):"",!0===d?_.a.createElement(S.a,Object.assign({},this.props,this.state,{neweditanswerRef:this.neweditanswerRef,editanswersRef:this.editanswersRef,options:e,selquestionlists:function(e){return a.selquestionlists(e)},onInputoquestionption:function(e,t){return a.onInputoquestionption(e,t)},delquestionlists:function(e){return a.delquestionlists(e)},addquestionlists:function(e){return a.addquestionlists(e)},onshixunGroupanswe:function(e){return a.onshixunGroupanswe(e)},onshixunsansweSelect:function(e){return a.onshixunsansweSelect(e)},shixunssanswerkill:function(e){return a.shixunssanswerkill(e)},clickshixunsanswerskill:function(e){return a.clickshixunsanswerskill(e)},delshixunssnswerllist:function(e){return a.delshixunssnswerllist(e)},answer_subit:function(){return a.answer_subit("edit",m)}})):""))}}]),V);function V(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,V);var q=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(V.__proto__||Object.getPrototypeOf(V)).call(this,e));return q.questionInputvalue=function(e){q.setState({questionsInputvalue:e.target.value})},q.clickquestionsumit=function(){q.setState({sumittype:!0});var e=q.props.match.params.checkpointId;if(2===q.props.status&&void 0===e)return q.props.showSnackbar("该实训已经发布不能新建"),void q.setState({sumittype:!1});var t=q.state.questionsInputvalue,a=q.contentMdRef.current.getValue().trim(),s=q.props.match.params.shixunId;if(null==t||""===t)return q.setState({questionInputvaluetype:!0}),C("html").animate({scrollTop:10},1e3),void q.setState({sumittype:!1});if(null===a||""===a)return q.setState({questionInputvaluetypes:!0}),C("html").animate({scrollTop:500},1e3),void q.setState({sumittype:!1});if(void 0===e){var n="/shixuns/"+s+"/challenges.json";M.a.post(n,{identifier:s,subject:t,task_pass:a,st:1}).then(function(e){q.props.showSnackbar(e.data.messages),window.location.href="/shixuns/"+s+"/challenges/"+e.data.challenge_id+"/editquestion"}).catch(function(e){console.log(e)})}else{var i="/shixuns/"+s+"/challenges/"+e+".json";M.a.put(i,{tab:0,subject:t,task_pass:a}).then(function(e){1===e.data.status&&q.setState({questionaddtype:!1,challenge_id:e.data.challenge_id}),C("html").animate({scrollTop:10},200),q.props.showSnackbar(e.data.messages),window.location.href="/shixuns/"+s+"/challenges/"+e.data.challenge_id+"/editquestion"}).catch(function(e){console.log(e)})}},q.questionall=function(){window.location.href="/shixuns/"+q.props.match.params.shixunId+"/challenges/"+q.props.match.params.checkpointId+"/editquestion"},q.questionadd=function(){var e=q.state.questionaddarray;if(9<e.length-1)q.props.showSnackbar("选择题目最大支持设置9道题");else{var a=e;a.map(function(e,t){0===e.choose_id&&a.splice(t,1)}),a.push({type:0,choose_id:0}),q.setState({activetype:0,questionaddarray:a,questionaddtype:!0,editquestionaddtype:!1,newquestionaddtype:!0,questionlists:[{str:"A",val:"",type:!1},{str:"B",val:"",type:!1},{str:"C",val:"",type:!1},{str:"D",val:"",type:!1}],answeshixunsGroup:1,answeoptions:[10,20],answeonshixunsmark:10,shixunssanswerkillvalue:"",shixunsskillanswerlist:[],contentMdRefval:"",newquestioMDMdContval:""}),setTimeout(function(){q.newquestioMDMdRef.current.setValue("")},1e3),setTimeout(function(){q.newquestioMDMdCont.current.setValue("")},1500)}},q.editquestionlists=function(e){for(var t=e,a=[],s=0;s<t.length;s++)!0===t[s].type&&a.push(t[s].str);q.setState({questionlists:e,questionlistss:a})},q.addquestionlists=function(){var e=q.state.questionlists,t=e,a={str:T[e.length],val:"",type:!1};t.push(a),q.editquestionlists(t)},q.delquestionlists=function(e){var t=q.state.questionlists;t.splice(e,1);for(var a=0;a<t.length;a++)t[a].str=T[a];q.editquestionlists(t)},q.selquestionlists=function(e){var t=q.state.questionlists;!0===t[e].type?t[e].type=!1:!1===t[e].type&&(t[e].type=!0),q.editquestionlists(t)},q.onshixunGroupanswe=function(e){var t=void 0,a=void 0;1===e.target.value?(t=[10,20],a=10):2===e.target.value?(t=[30,40,50,60],a=30):3===e.target.value&&(t=[70,80,90,100],a=70),q.setState({answeshixunsGroup:e.target.value,answeoptions:t,answeonshixunsmark:a})},q.shixunssanswerkill=function(e){q.setState({shixunssanswerkillvalue:e.target.value})},q.clickshixunsanswerskill=function(){var e=q.state,t=e.shixunssanswerkillvalue,a=e.shixunsskillanswerlist;if(""!==t&&void 0!==t)if(""==t||null==t||null==t||0<t.length&&0==t.trim().length)N.a.error("输入为空,不能保存!");else{var s=a;s.push(t),q.setState({shixunsskillanswerlist:s,shixunssanswerkillvalue:""})}},q.delshixunssnswerllist=function(e){var t=q.state.shixunsskillanswerlist;t.splice(e,1),q.setState({shixunsskillanswerlist:t})},q.onInputoquestionption=function(e,t){C.fn.autoHeight=function(){function e(e){e.style.height="auto",e.style.maxHeight="140px",e.scrollTop=0,e.style.height=e.scrollHeight+"px"}this.each(function(){e(this),C(this).on("keyup",function(){e(this)})})},C("#"+e.target.id).autoHeight();var a=q.state.questionlists;a[t].val=e.target.value,q.editquestionlists(a)},q.onshixunsansweSelect=function(e){q.setState({answeonshixunsmark:e})},q.answer_subit=function(e,t){C("html").animate({scrollTop:10},500);var a=q.state,s=a.challenge_id,n=a.questionlists,i=a.shixunsskillanswerlist,o=a.answeonshixunsmark,l=a.answeshixunsGroup,r=a.questionaddarray;if(void 0!==s){for(var c=n,u="",p=[],d=[],m=0,h=0;h<c.length;h++)!0===c[h].type?u+=c[h].str:m+=1,p.push(c[h].type),d.push(c[h].val);if(m===c.length)return q.setState({newcnttype:!0,newcnttypesum:0}),N.a.error("没有选择答案"),void C("html").animate({scrollTop:700},1e3);for(var f=0;f<d.length;f++){if(0===d.length)return q.setState({newcnttype:!0,newcnttypesum:1}),N.a.error("新增选项为空"),void C("html").animate({scrollTop:700},1e3);if(" "===d[f]||""===d[f])return q.setState({newcnttype:!0,newcnttypesum:1}),N.a.error("新增选项为空"),void C("html").animate({scrollTop:700},1e3)}if(0===i.length)return q.setState({challenge_tagtype:!0}),void N.a.error("技能标签为空");q.setState({challenge_tagtype:!1});for(var g=0;g<i.length;g++){if(""===i[g])return q.setState({challenge_tagtype:!0}),void N.a.error("技能标签为空");q.setState({challenge_tagtype:!1})}var w=q.props.match.params.shixunId,v=q.props.match.params.checkpointId,y=void 0;if("edit"===e){var _=q.neweditanswerRef.current.getValue().trim();if(""===_||"请输入选择题的题干内容"===_)return q.setState({newquestioMDvaluetype:!0}),C("html").animate({scrollTop:100},200),void N.a.error("题干为空");var x=q.editanswersRef.current.getValue().trim();console.log(x),""!==x&&" "!==x||(x=void 0),y="/shixuns/"+w+"/challenges/"+s+"/update_choose_question.json?choose_id="+t,M.a.post(y,{challenge_choose:{subject:_,answer:x,standard_answer:u,score:o,difficult:l},challenge_tag:i,question:{cnt:d},choice:{answer:p}}).then(function(e){C("html").animate({scrollTop:10},200),k.a.open({message:"提示",description:"修改成功,请点击右侧加号继续添加"}),q.setState({questionaddtype:!1,newquestioMDvaluetype:!1,newquestioMDvaluetypes:!1})}).catch(function(e){console.log(e)})}else{var b=q.newquestioMDMdRef.current.getValue().trim();if(""===b||"请输入选择题的题干内容"===b)return q.setState({newquestioMDvaluetype:!0}),C("html").animate({scrollTop:100},200),void N.a.error("题干为空");var E=q.newquestioMDMdCont.current.getValue().trim();""!==E&&" "!==E||(E=void 0),y="/shixuns/"+w+"/challenges/"+s+"/create_choose_question.json",M.a.post(y,{challenge_choose:{subject:b,answer:E,standard_answer:u,score:o,difficult:l},challenge_tag:i,question:{cnt:d},choice:{answer:p}}).then(function(e){var t=r.length,a=r;a[t-1].choose_id=e.data.challenge_choose_id,1===u.length?a[t-1].type=1:1<u.length&&(a[t-1].type=2),q.setState({challenge_choose_id:e.data.challenge_choose_id,questionaddtype:!1,editquestionaddtype:!1,newquestioMDvaluetype:!1,newquestioMDvaluetypes:!1,questionaddarray:a}),C("html").animate({scrollTop:10},200),k.a.open({message:"提示",description:"新建成功,请点击右侧加号继续添加"}),window.location.href="/shixuns/"+w+"/challenges/"+v+"/editquestion/"+e.data.challenge_choose_id}).catch(function(e){console.log(e)})}}else N.a.error("关卡id为空")},q.questionlist=function(e,i,t){C("html").animate({scrollTop:10},500);var a=q.state.challenge_id;if(""===i||0===t)q.setState({activetype:i,editquestionaddtype:!0,questionaddtype:!0,newquestionaddtype:!1,questionlists:[{str:"A",val:"",type:!1},{str:"B",val:"",type:!1},{str:"C",val:"",type:!1},{str:"D",val:"",type:!1}],answeshixunsGroup:1,answeoptions:[10,20],answeonshixunsmark:10,shixunssanswerkillvalue:"",shixunsskillanswerlist:[],neweditanswerRefval:"",editanswersRefval:""}),q.newquestioMDMdRef.current.setValue(""),q.newquestioMDMdCont.current.setValue("");else{var s="/shixuns/"+q.props.match.params.shixunId+"/challenges/"+a+"/edit_choose_question.json?choose_id="+i;M.a.get(s).then(function(e){if(200===e.status){for(var t=e.data.choose_contents,a=[],s=0;s<t.length;s++){var n=t[s];a.push({str:T[n.position],val:n.option_name,type:n.right_key})}q.setState({activetype:i,editquestionaddtype:!0,questionaddtype:!1,newquestionaddtype:!1,editlist:e.data,questionlists:a,answeshixunsGroup:e.data.difficult,answeonshixunsmark:e.data.score,shixunsskillanswerlist:e.data.tags,challenge_choose_id:i,standard_answer:e.data.standard_answer,subject:e.data.subject,answer:e.data.answer,neweditanswerRefval:e.data.subject,editanswersRefval:e.data.subject}),q.neweditanswerRef.current.setValue(e.data.subject||""),q.editanswersRef.current.setValue(e.data.answer||""),q.shixunsautoHeight()}}).catch(function(e){})}},q.shixunsautoHeight=function(){C.fn.autoHeight=function(){function e(e){e.style.height="auto",e.style.maxHeight="140px",(e.scrollTop=0)===e.scrollHeight?e.style.height="62px":e.style.height=e.scrollHeight+"px"}this.each(function(){e(this),C(this).on("keyup",function(){e(this)})})},C("textarea[autoHeight]").autoHeight()},q.gochooseid=function(e){window.location.href=e},q.contentMdRef=_.a.createRef(),q.newquestioMDMdRef=_.a.createRef(),q.newquestioMDMdCont=_.a.createRef(),q.neweditanswerRef=_.a.createRef(),q.editanswersRef=_.a.createRef(),q.state={choice_url:void 0,practice_url:void 0,go_back_url:void 0,position:void 0,task_pass_default:void 0,submit_url:void 0,questionsInputvalue:void 0,questionaddsum:0,questionaddarray:[],questionaddtype:!0,activetype:"",questionlists:[{str:"A",val:"",type:!1},{str:"B",val:"",type:!1},{str:"C",val:"",type:!1},{str:"D",val:"",type:!1}],answeshixunsGroup:1,answeoptions:[10,20],answeonshixunsmark:10,shixunssanswerkillvalue:"",shixunsskillanswerlist:[],challenge_id:"",challenge_choose_id:void 0,questionlistss:[],newcnttype:!1,newquestioMDvaluetype:!1,challenge_tagtype:!1,editquestionaddtype:!1,mancheckpointId:void 0,power:!1,questionInputvaluetype:!1,questioMD:"",standard_answer:"",subject:"",newquestioMDvaluetypes:!1,questionInputvaluetypes:!1,prev_challenge:void 0,next_challenge:void 0,newcnttypesum:1,marktype:!1,answer:"",sumittype:!1},q}t.default=H},4038:function(e,t,a){"use strict";var s=a(0),n=a.n(s),i=(a(45),a(309)),o=function(e,t,a){return t&&l(e.prototype,t),a&&l(e,a),e};function l(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}var r=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(c,s.Component),o(c,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){return n.a.createElement("div",null,n.a.createElement("div",{className:"edu-back-white mb10 clearfix"},n.a.createElement("div",{className:"padding40-20"},n.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"任务名称"),n.a.createElement("div",{className:"df"},n.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),n.a.createElement("div",{className:"flex1 mr20"},n.a.createElement("input",{type:"text",className:!0===this.props.questionInputvaluetype?"input-100-45 greyInpus wind100":"input-100-45 greyInput ",maxLength:"50",name:"challenge[subject]",value:this.props.questionsInputvalue,placeholder:"请输入任务名称(此信息将提前展示给学员),例:计算学生的课程成绩绩点",onInput:this.props.questionInputvalue})),n.a.createElement("div",{style:{width:"57px"}},n.a.createElement("span",{className:!0===this.props.questionInputvaluetype?"color-orange mt8 fl":"color-orange mt8 fl none",id:"new_shixun_name"},n.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"必填项"))))),n.a.createElement("div",{className:"edu-back-white padding40-20 mb20"},n.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"过关任务"),n.a.createElement("div",{className:"df"},n.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),n.a.createElement("div",{className:"flex1 mr20"},n.a.createElement(i.a,{ref:this.props.contentMdRef,placeholder:"请输入选择题的过关任务内容",mdID:"courseContentMD",refreshTimeout:1500,watch:!0,className:"courseMessageMD",initValue:this.props.contentMdRefval,height:700})),n.a.createElement("div",null,n.a.createElement("span",{className:!0===this.props.questionInputvaluetypes?"color-orange mt8 fl":"color-orange mt8 fl none",id:"new_shixun_pass"},n.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"必填项"))),n.a.createElement("p",{id:"e_tip_questioMDQuestion",className:"edu-txt-right color-grey-cd font-12 pdr20"}),n.a.createElement("p",{id:"e_tips_questioMDQuestion",className:"edu-txt-right color-grey-cd font-12 pdr20"})),n.a.createElement("div",{className:"clearfix mt30",style:{display:4<this.props.identity||void 0===this.props.identity||!1===this.props.power?"none":"block"}},n.a.createElement("a",{className:"defalutSubmitbtn fl mr20",onClick:!0===this.props.sumittype?"":this.props.clickquestionsumit},"提交"),n.a.createElement("a",{href:this.props.go_back_url,className:"defalutCancelbtn fl"},"取消")))}}]),c);function c(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,e));return t.state={},t}t.a=r},4039:function(e,t,a){"use strict";var s=a(66),n=(a.n(s),a(67)),i=a.n(n),o=a(165),l=(a.n(o),a(164)),r=a.n(l),c=a(168),u=(a.n(c),a(167)),p=a.n(u),d=a(296),m=(a.n(d),a(291)),h=a.n(m),f=a(0),g=a.n(f),w=(a(45),a(309)),v=function(e,t,a){return t&&y(e.prototype,t),a&&y(e,a),e};function y(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}h.a.Option;var _=p.a.Group,x=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(b,f.Component),v(b,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e,t,a,s=this;return g.a.createElement("div",null,g.a.createElement("div",{className:"edu-back-white mb10 clearfix"},g.a.createElement("div",{className:"padding40-20"},g.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"题干"),g.a.createElement("div",{className:"df"},g.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),g.a.createElement("div",{className:"flex1 mr20"},g.a.createElement(w.a,{ref:this.props.newquestioMDMdRef,placeholder:"请输入选择题的题干内容",mdID:"newquestioMDid",refreshTimeout:1500,needRecreate:!0,watch:!0,className:"courseMessageMD",initValue:this.props.contentMdRefval})),g.a.createElement("div",(e={style:{width:"57px"}},t="style",a={display:!0===this.props.newquestioMDvaluetype?"block":"none"},t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e),g.a.createElement("span",{className:"color-orange mt8 fl",id:"choose_name",style:{display:"inline"}},g.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"必填项"))),g.a.createElement("p",{id:"e_tip_newquestioMDsQuestion",className:"edu-txt-right color-grey-cd font-12 pdr20"}),g.a.createElement("p",{id:"e_tips_newquestioMDsQuestion",className:"edu-txt-right color-grey-cd font-12 pdr20"}),g.a.createElement("div",{id:"shixun_form",className:"mt10"},void 0===this.props.questionlists||0===this.props.questionlists.length?"":this.props.questionlists.map(function(e,t){return g.a.createElement("li",{className:"clearfix pr mb20 df questionli",key:t},g.a.createElement("label",{className:"fl"},g.a.createElement("span",{className:!0===e.type?"option-item fr mr10 color-grey select-choice check-option-bg":"option-item fr mr10 color-grey select-choice",onClick:function(){return s.props.selquestionlists(t)},name:"option_span","data-tip-down":"点击设置答案"},e.str)),g.a.createElement("textarea",{className:"input-flex-40 fl candiate_answer",name:"question[cnt][]",placeholder:"请输入选项内容",value:e.val,autoHeight:"true",id:"question"+t,onInput:function(e){return s.props.onInputoquestionption(e,t)},style:{resize:"none",height:"62px"}}),g.a.createElement("a",{className:"position-delete option_icon_remove",onClick:function(){return s.props.delquestionlists(t)}},g.a.createElement(r.a,{placement:"bottom",title:"删除"},g.a.createElement("i",{className:"fa fa-times-circle color-grey-c font-16 fl"}))))}),g.a.createElement("p",{className:"clearfix ml40"},g.a.createElement("a",{onClick:function(){return s.props.addquestionlists()},className:"fl edu-default-btn edu-greyline-btn mb20 option_icon_add"},"新增选项"),g.a.createElement("span",{className:"color-orange mt8 fr mr20",style:{display:!0===this.props.newcnttype?"block":"none"},id:"chooce_error"},g.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),0===this.props.newcnttypesum?"请选择答案":"选项内容不能为空")),g.a.createElement("li",{className:"clearfix color-grey-9 "},g.a.createElement("label",{className:"fl ml40"},"温馨提示:点击选项标题,可以直接设置答案;选择多个答案即为多选题"),g.a.createElement("label",{className:"fr mr20"},"标准答案:",g.a.createElement("span",{id:"current-option",className:"color-orange"},void 0===this.props.questionlistss?"请点击正确选项":0===this.props.questionlistss.length?g.a.createElement("span",null,this.props.standard_answer):this.props.questionlistss.map(function(e,t){return g.a.createElement("span",{key:t},e)}))))))),g.a.createElement("div",{className:"edu-back-white mb10 clearfix"},g.a.createElement("div",{className:"padding40-20"},g.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"参考答案"),g.a.createElement("div",{className:"df"},g.a.createElement("div",{className:"flex1 mr20"},g.a.createElement(w.a,{ref:this.props.newquestioMDMdCont,placeholder:"请输入各个选项的具体解析或其他相关信息",mdID:"newquestioMDMdConts",refreshTimeout:1500,needRecreate:!0,watch:!0,className:"courseMessageMD",initValue:this.props.newquestioMDMdContval})),g.a.createElement("div",{className:"choose_names",style:{display:!0===this.props.newquestioMDvaluetypes?"block":"none"}},g.a.createElement("span",{className:"color-orange mt8 fl",id:"choose_name",style:{display:"inline"}},g.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"必填项"))),g.a.createElement("p",{id:"e_tip_challenge_choose_answerQuestion",className:"edu-txt-right color-grey-cd font-12 pdr20"}),g.a.createElement("p",{id:"e_tips_challenge_choose_answerQuestion",className:"edu-txt-right color-grey-cd font-12 pdr20"}))),g.a.createElement("div",{className:"edu-back-white padding40-20 mb20"},g.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"难度系数"),g.a.createElement("div",{className:"clearfix mb40"},g.a.createElement(_,{value:this.props.answeshixunsGroup,className:"fl mr40",onChange:function(e){return s.props.onshixunGroupanswe(e)}},g.a.createElement(p.a,{value:1},"简单"),g.a.createElement(p.a,{value:2},"中等"),g.a.createElement(p.a,{value:3},"困难"))),g.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"奖励经验值"),g.a.createElement("div",{className:"clearfix"},g.a.createElement("span",{className:"fl mr30 color-orange pt10"},"*"),g.a.createElement(h.a,{style:{width:120},className:"winput-240-40 fl",id:"challenge_score",onChange:function(e){return s.props.onshixunsansweSelect(e)},value:this.props.answeonshixunsmark},this.props.options),g.a.createElement("p",{className:"fl color-grey-9 font-12 ml20"},"如果学员答题错误,则不能得到相应的经验值",g.a.createElement("br",null),"如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+10经验值、+10金币"),g.a.createElement("span",{className:"color-orange mt7 fl ml20 none",id:"ex_value_notice"},g.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"必填项"))),g.a.createElement("div",{className:"edu-back-white padding40-20 mb20"},g.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"技能标签"),g.a.createElement("div",{className:"clearfix df"},g.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),g.a.createElement("div",{className:"flex1"},g.a.createElement(i.a,{type:"text",className:"winput-240-40 fl mr20",id:"input_task_tag",placeholder:"添加标签",onInput:function(e){return s.props.shixunssanswerkill(e)},value:this.props.shixunssanswerkillvalue,onPressEnter:function(e){return s.props.clickshixunsanswerskill(e)},onBlur:function(e){return s.props.clickshixunsanswerskill(e)}}),g.a.createElement("div",{className:"ml15 color-grey-9 mt5"},"学员答题正确将获得技能,否则不能获得技能",g.a.createElement("span",{className:" color-orange ml20",style:{display:!0===this.props.challenge_tagtype?"inline-block":"none"},id:"stage_name_notice"},g.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"必填项")),g.a.createElement("div",{className:"mt20 clearfix",id:"task_tag_content"},0===this.props.shixunsskillanswerlist.length?"":this.props.shixunsskillanswerlist.map(function(e,t){return g.a.createElement("li",{className:"task_tag_span",key:t},g.a.createElement("span",null,e),g.a.createElement("a",{onClick:function(){return s.props.delshixunssnswerllist(t)}},"×"))}))))),g.a.createElement("div",{className:"clearfix mt30",style:{display:4<this.props.identity||void 0===this.props.identity||!1===this.props.power?"none":"block"}},g.a.createElement("a",{className:"defalutSubmitbtn fl mr20",onClick:this.props.answer_subit},"提交"),g.a.createElement("a",{href:this.props.go_back_url,className:"defalutCancelbtn fl"},"取消")))}}]),b);function b(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,b);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,e));return t.state={},t}t.a=x},4040:function(e,t,a){"use strict";var s=a(66),n=(a.n(s),a(67)),i=a.n(n),o=a(168),l=(a.n(o),a(167)),r=a.n(l),c=a(296),u=(a.n(c),a(291)),p=a.n(u),d=a(0),m=a.n(d),h=(a(45),a(12)),f=a.n(h),g=a(309),w=function(e,t,a){return t&&v(e.prototype,t),a&&v(e,a),e};function v(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}p.a.Option;var y=r.a.Group,_=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(x,d.Component),w(x,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e,t,a,s=this;return m.a.createElement("div",null,m.a.createElement("div",{className:"edu-back-white mb10 clearfix"},m.a.createElement("div",{className:"padding40-20"},m.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"题干"),m.a.createElement("div",{className:"df"},m.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),m.a.createElement("div",{className:"flex1 mr20"},m.a.createElement(g.a,{ref:this.props.neweditanswerRef,placeholder:"请输入选择题的题干内容",mdID:"editquestioMDid",refreshTimeout:1500,needRecreate:!0,watch:!0,className:"courseMessageMD",initValue:this.props.neweditanswerRefval})),m.a.createElement("div",(e={style:{width:"57px"}},t="style",a={display:!0===this.props.newquestioMDvaluetype?"block":"none"},t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e),m.a.createElement("span",{className:"color-orange mt8 fl",id:"choose_name",style:{display:"inline"}},m.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"必填项"))),m.a.createElement("p",{id:"e_tip_neweditanswerQuestion",className:"edu-txt-right color-grey-cd font-12 pdr20"}),m.a.createElement("p",{id:"e_tips_neweditanswerQuestion",className:"edu-txt-right color-grey-cd font-12 pdr20"}),m.a.createElement("div",{id:"shixun_form",className:"mt10"},void 0===this.props.questionlists||0===this.props.questionlists.length?"":this.props.questionlists.map(function(e,t){return m.a.createElement("li",{className:"clearfix pr mb20 df questionli",key:t},m.a.createElement("label",{className:"fl"},m.a.createElement("span",{className:!0===e.type?"option-item fr mr10 color-grey select-choice check-option-bg":"option-item fr mr10 color-grey select-choice",onClick:function(){return s.props.selquestionlists(t)},name:"option_span","data-tip-down":"点击设置答案"},e.str)),m.a.createElement("textarea",{className:"input-flex-40 fl candiate_answer",name:"question[cnt][]",placeholder:"请输入选项内容",value:e.val,autoHeight:"true",id:"question"+t,onInput:function(e){return s.props.onInputoquestionption(e,t)},style:{resize:"none",height:"62px"}}),m.a.createElement("a",{className:"position-delete option_icon_remove",onClick:function(){return s.props.delquestionlists(t)}},m.a.createElement("i",{className:"fa fa-times-circle color-grey-c font-16 fl"})))}),m.a.createElement("p",{className:"clearfix ml40"},m.a.createElement("a",{onClick:function(){return s.props.addquestionlists()},className:"fl edu-default-btn edu-greyline-btn mb20 option_icon_add"},"新增选项"),m.a.createElement("span",{className:"color-orange mt8 fr mr20",style:{display:!0===this.props.newcnttype?"block":"none"},id:"chooce_error"},m.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),0===this.props.newcnttypesum?"请选择答案":"选项内容不能为空")),m.a.createElement("li",{className:"clearfix color-grey-9 "},m.a.createElement("label",{className:"fl ml40"},"温馨提示:点击选项标题,可以直接设置答案;选择多个答案即为多选题"),m.a.createElement("label",{className:"fr mr20"},"标准答案:",m.a.createElement("span",{d:"current-option",className:"color-orange"},void 0===this.props.questionlistss?"请点击正确选项":0===this.props.questionlistss.length?m.a.createElement("span",null,this.props.standard_answer):this.props.questionlistss.map(function(e,t){return m.a.createElement("span",{key:t},e)}))))))),m.a.createElement("div",{className:"edu-back-white mb10 clearfix"},m.a.createElement("div",{className:"padding40-20"},m.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"参考答案"),m.a.createElement("div",{className:"df mr20"},m.a.createElement("div",{className:"flex1 mr20"},m.a.createElement(g.a,{ref:this.props.editanswersRef,placeholder:"请输入各个选项的具体解析或其他相关信息",mdID:"editanswersRefConts",refreshTimeout:1500,watch:!0,className:"courseMessageMD",initValue:this.props.editanswersRefval})),m.a.createElement("div",{className:"choose_names",style:{display:!0===this.props.newquestioMDvaluetypes?"block":"none"}},m.a.createElement("span",{className:"color-orange mt8 fl",id:"choose_name",style:{display:"inline"}},m.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"必填项"))),m.a.createElement("p",{id:"e_tip_editanswersQuestion",className:"edu-txt-right color-grey-cd font-12 pdr20"}),m.a.createElement("p",{id:"e_tips_editanswersQuestion",className:"edu-txt-right color-grey-cd font-12 pdr20"}))),m.a.createElement("div",{className:"edu-back-white padding40-20 mb20"},m.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"难度系数"),m.a.createElement("div",{className:"clearfix mb40"},m.a.createElement(y,{value:this.props.answeshixunsGroup,className:"fl mr40",disabled:2===this.props.status,onChange:2===this.props.status?"":function(e){return s.props.onshixunGroupanswe(e)}},m.a.createElement(r.a,{value:1},"简单"),m.a.createElement(r.a,{value:2},"中等"),m.a.createElement(r.a,{value:3},"困难"))),m.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"奖励经验值"),m.a.createElement("div",{className:"clearfix",id:"challenge_score"},m.a.createElement("span",{className:"fl mr30 color-orange pt10"},"*"),m.a.createElement(p.a,{style:{width:120},className:"winput-240-40 fl",disabled:2===this.props.status,onChange:2===this.props.status?"":function(e){return s.props.onshixunsansweSelect(e)},value:this.props.answeonshixunsmark},this.props.options),m.a.createElement("p",{className:"fl color-grey-9 font-12 ml20"},"如果学员答题错误,则不能得到相应的经验值",m.a.createElement("br",null),"如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+10经验值、+10金币"),m.a.createElement("span",{className:"color-orange mt7 fl ml20 none",id:"ex_value_notice"},m.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"必填项"))),m.a.createElement("div",{className:"edu-back-white padding40-20 mb20"},m.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"技能标签"),m.a.createElement("div",{className:"clearfix df"},m.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),m.a.createElement("div",{className:"flex1"},m.a.createElement(i.a,{type:"text",className:"winput-240-40 fl mr20",id:"input_task_tag",placeholder:"添加标签",onInput:function(e){return s.props.shixunssanswerkill(e)},value:this.props.shixunssanswerkillvalue,onPressEnter:function(e){return s.props.clickshixunsanswerskill(e)},onBlur:function(e){return s.props.clickshixunsanswerskill(e)}}),m.a.createElement("div",{className:"ml15 color-grey-9 mt5"},"学员答题正确将获得技能,否则不能获得技能",m.a.createElement("span",{className:" color-orange ml20",style:{display:!0===this.props.challenge_tagtype?"inline-block":"none"},id:"stage_name_notice"},m.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"必填项")),m.a.createElement("div",{className:"mt20 clearfix",id:"task_tag_content"},0===this.props.shixunsskillanswerlist.length?"":this.props.shixunsskillanswerlist.map(function(e,t){return m.a.createElement("li",{className:"task_tag_span",key:t},m.a.createElement("span",null,e),m.a.createElement("a",{onClick:function(){return s.props.delshixunssnswerllist(t)}},"×"))}))))),m.a.createElement("div",{className:"clearfix mt30",style:{display:4<this.props.identity||void 0===this.props.identity||!1===this.props.power?"none":"block"}},m.a.createElement("a",{className:"defalutSubmitbtn fl mr20",onClick:function(){return s.props.answer_subit()}},"提交"),m.a.createElement("a",{href:this.props.go_back_url,className:"defalutCancelbtn fl"},"取消"),m.a.createElement("a",{onClick:function(){return s.delecbtns()},className:"delectshixuncdbtn fr"},"删除")))}}]),x);function x(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,x);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,e));return t.delecbtns=function(){var e="/shixuns/"+t.props.match.params.shixunId+"/challenges/"+t.props.match.params.checkpointId+"/destroy_challenge_choose.json";f.a.delete(e,{data:{choose_id:t.props.match.params.choose_id}}).then(function(e){1===e.data.status&&(window.location.href="/shixuns/"+t.props.match.params.shixunId+"/challenges/"+t.props.match.params.checkpointId+"/editquestion")})},t.state={},t}t.a=_}}); |