|
|
|
|
webpackJsonp([242],{
|
|
|
|
|
|
|
|
|
|
/***/ 4269:
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css__ = __webpack_require__(165);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_tooltip_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip__ = __webpack_require__(164);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_tooltip__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_checkbox_style_css__ = __webpack_require__(295);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_checkbox_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_checkbox_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_checkbox__ = __webpack_require__(292);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_checkbox___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_checkbox__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_modal_style_css__ = __webpack_require__(30);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_modal_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_antd_lib_modal_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_modal__ = __webpack_require__(31);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_modal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_antd_lib_modal__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_input_style_css__ = __webpack_require__(67);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_input_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_antd_lib_input_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_input__ = __webpack_require__(68);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_input___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_antd_lib_input__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_radio_style_css__ = __webpack_require__(170);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_antd_lib_radio_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_antd_lib_radio_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_radio__ = __webpack_require__(168);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_antd_lib_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_antd_lib_radio__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_antd_lib_select_style_css__ = __webpack_require__(298);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_antd_lib_select_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_antd_lib_select_style_css__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_antd_lib_select__ = __webpack_require__(293);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_antd_lib_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_antd_lib_select__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_react__ = __webpack_require__(0);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_react__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_react_router_dom__ = __webpack_require__(45);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_axios__ = __webpack_require__(12);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14_axios__);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_educoder__ = __webpack_require__(5);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__css_TPMchallengesnew_css__ = __webpack_require__(344);
|
|
|
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__css_TPMchallengesnew_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16__css_TPMchallengesnew_css__);
|
|
|
|
|
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}// import "antd/dist/antd.css";
|
|
|
|
|
var origin=Object(__WEBPACK_IMPORTED_MODULE_15_educoder__["R" /* getUrl */])();var path=Object(__WEBPACK_IMPORTED_MODULE_15_educoder__["R" /* getUrl */])("/editormd/lib/");var $=window.$;var timeout=void 0;var currentValue=void 0;var Option=__WEBPACK_IMPORTED_MODULE_11_antd_lib_select___default.a.Option;var RadioGroup=__WEBPACK_IMPORTED_MODULE_9_antd_lib_radio___default.a.Group;var TextArea=__WEBPACK_IMPORTED_MODULE_7_antd_lib_input___default.a.TextArea;function create_editorMD(id,width,high,placeholder,imageUrl,callback){var editorName=window.editormd(id,{width:width,height:high,path:path,// "/editormd/lib/"
|
|
|
|
|
syncScrolling:"single",tex:true,tocm:true,emoji:true,taskList:true,codeFold:true,searchReplace:true,htmlDecode:"style,script,iframe",sequenceDiagram:true,autoFocus:false,toolbarIcons:function toolbarIcons(){// Or return editormd.toolbarModes[name]; // full, simple, mini
|
|
|
|
|
// Using "||" set icons align right.
|
|
|
|
|
return["bold","italic","|","list-ul","list-ol","|","code","code-block","|","testIcon","testIcon1",'|',"image","table",'|',"watch","clear"];},toolbarCustomIcons:{testIcon:"<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",testIcon1:"<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"},//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
|
|
|
|
saveHTMLToTextarea:true,// 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
|
|
|
|
|
dialogMaskOpacity:0.6,placeholder:placeholder,imageUpload:true,imageFormats:["jpg","jpeg","gif","png","bmp","webp","JPG","JPEG","GIF","PNG","BMP","WEBP"],imageUploadURL:imageUrl,//url
|
|
|
|
|
onload:function onload(){// this.previewing();
|
|
|
|
|
$("#"+id+" [type=\"latex\"]").bind("click",function(){editorName.cm.replaceSelection("```latex");editorName.cm.replaceSelection("\n");editorName.cm.replaceSelection("\n");editorName.cm.replaceSelection("```");var __Cursor=editorName.cm.getDoc().getCursor();editorName.cm.setCursor(__Cursor.line-1,0);});$("#"+id+" [type=\"inline\"]").bind("click",function(){editorName.cm.replaceSelection("`$$$$`");var __Cursor=editorName.cm.getDoc().getCursor();editorName.cm.setCursor(__Cursor.line,__Cursor.ch-3);editorName.cm.focus();});$("[type=\"inline\"]").attr("title","行内公式");$("[type=\"latex\"]").attr("title","多行公式");window.md_elocalStorage(editorName,'exercise__'+id,"Memochallengesnew");callback&&callback();}});return editorName;}var TPMevaluation=function(_Component){_inherits(TPMevaluation,_Component);function TPMevaluation(props){_classCallCheck(this,TPMevaluation);var _this=_possibleConstructorReturn(this,(TPMevaluation.__proto__||Object.getPrototypeOf(TPMevaluation)).call(this,props));_this.setevaluationlist=function(newevaluationlist){_this.setState({evaluationlist:newevaluationlist});console.log(newevaluationlist);};_this.addevaluationon=function(){var _this$state=_this.state,evaluationlist=_this$state.evaluationlist,markvalue=_this$state.markvalue;var newevaluationlist=evaluationlist;newevaluationlist.push({hidden:0,input:"",output:"",score:0});newevaluationlist=_this.oneditevaluationlist(newevaluationlist,markvalue);_this.setevaluationlist(newevaluationlist);};_this.del_test_array=function(key){var _this$state2=_this.state,evaluationlist=_this$state2.evaluationlist,markvalue=_this$state2.markvalue;var newevaluationlist=evaluationlist;newevaluationlist.splice(key,1);newevaluationlist=_this.oneditevaluationlist(newevaluationlist,markvalue);_this.setevaluationlist(newevaluationlist);};_this.getfilepath=function(e,shixunfilepath,type){_this.setState({evaluationvisible:true,selectpath:e.target.value,selectpatharr:[],pathtype:type});var id=_this.props.match.params.shixunId;var url="/shixuns/"+id+"/repository.json";__WEBPACK_IMPORTED_MODULE_14_axios___default.a.post(url,{path:""}).then(function(response){if(response.data.status===403||response.data.status===401||response.data.status===500){}else{_this.setState({trees:response.data.trees,saveshixunfilepath:shixunfilepath,path:"",main:[]});}}).catch(function(error){console.log(error);});};_this.sendgetfilepath=function(newpath,type,newpathtype){var id=_this.props.match.params.shixunId;var _this$state3=_this.state,path=_this$state3.path,main=_this$state3.main,pathtype=_this$state3.pathtype;var ary=main;var paths=path;_this.setState({selectpatharr:[]});if(paths===""&&type==="tree"){newpath=newpath+"/";paths="";if(main.length===0){ary.push({val:"根目录/",path:""},{val:newpath,path:paths+newpath});}else{ary.push({val:newpath,path:paths+newpath});}}else if(paths!=""&&type==="tree"){newpath=newpath+"/";ary.push({val:newpath,path:paths+newpath});}var url="/shixuns/"+id+"/repository.json";if(type==="tree"){__WEBPACK_IMPORTED_MODULE_14_axios___default.a.post(url,{path:paths+newpath}).then(function(response){if(response.data.status===403||response.data.status===401||response.data.status===500){}else{_this.setState({trees:response.data.trees,path:paths+newpath,main:ary// selectpath:""
|
|
|
|
|
});}}).catch(function(error){console.log(error);});}if(pathtype===2){_this.setState({selectpath:newpathtype});}};_this.goblakepath=function(path,key){var _this$state4=_this.state,main=_this$state4.main,selectpath=_this$state4.selectpath,pathtype=_this$state4.pathtype;var newmain=[];for(var i=0;i<=key;i++){newmain.push(main[i]);}var id=_this.props.match.params.shixunId;var url="/shixuns/"+id+"/repository.json";__WEBPACK_IMPORTED_MODULE_14_axios___default.a.post(url,{path:path}).then(function(response){if(response.data.status===403||response.data.status===401||response.data.status===500){}else{_this.setState({trees:response.data.trees,path:path,main:newmain// selectpath:selectpath
|
|
|
|
|
});}}).catch(function(error){console.log(error);});if(pathtype===2){var paths=path.substring(0,path.length-1);console.log(paths);_this.setState({selectpath:paths});}};_this.savegetfilepath=function(value){var _this$state5=_this.state,selectpath=_this$state5.selectpath,saveshixunfilepath=_this$state5.saveshixunfilepath,pathtype=_this$state5.pathtype;if(pathtype===1){var newselectpath=void 0;if(saveshixunfilepath==="shixunfilepathplay"){newselectpath=value;}else{var type=selectpath.split(';');var types=false;for(var i=0;i<type.length;i++){if(type[i]===value){types=true;return;}}if(types===false){newselectpath=selectpath+value+";";}else{newselectpath=selectpath;}}_this.setState({// selectpatharr:newarr,
|
|
|
|
|
selectpath:newselectpath});}// let newarr =selectpatharr;
|
|
|
|
|
// let arrtype=false;
|
|
|
|
|
// let arrsum=0;
|
|
|
|
|
// let newselectpath="";
|
|
|
|
|
// newarr.push(value)
|
|
|
|
|
// if(newarr.length>1&&arrtype===false){
|
|
|
|
|
// for(var i=0; i<newarr.length;i++){
|
|
|
|
|
// if(newarr[i]===value){
|
|
|
|
|
// arrsum=arrsum+1;
|
|
|
|
|
// if(arrsum===2){
|
|
|
|
|
// newarr.splice(i,1);
|
|
|
|
|
// arrtype=true;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// for(var z=0; z<newarr.length;z++){
|
|
|
|
|
// newselectpath=newselectpath+newarr[z]+ ";"
|
|
|
|
|
// }
|
|
|
|
|
};_this.evaluationenter=function(){var _this$state6=_this.state,saveshixunfilepath=_this$state6.saveshixunfilepath,selectpath=_this$state6.selectpath;_this.setState(_defineProperty({evaluationvisible:false},saveshixunfilepath,selectpath));};_this.evaluationhideModal=function(){_this.setState({evaluationvisible:false});};_this.handpathoptionvalue=function(value){_this.setState({pathoptionvalue:value,shixunfileexpectpicturepath:undefined,shixunfilestandardpicturepath:undefined,shixunfilepicturepath:undefined});};_this.showrepositoryurltip=function(type){if(type===1){_this.setState({showrepositoryurltiptype:true});}else{_this.setState({showrepositoryurltiptype:false});}};_this.evaluationonChange=function(e,key){var evaluationlist=_this.state.evaluationlist;var newevaluationlist=evaluationlist;var newtype=void 0;if(e===1){newtype=0;}else{newtype=1;}// newevaluationlist[key].is_public=newtype;
|
|
|
|
|
// for(var i=0; i<newevaluationlist.length; i++){
|
|
|
|
|
// if(i===key){
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
newevaluationlist[key].hidden=newtype;_this.setState({evaluationlist:newevaluationlist});_this.setevaluationlist(newevaluationlist);};_this.editpercentage=function(e,key){var _this$state7=_this.state,evaluationlist=_this$state7.evaluationlist,scoretype=_this$state7.scoretype;if(scoretype===key){_this.setState({scoretype:undefined});}var newevaluationlist=evaluationlist;var sum=parseInt(e.target.value);if(isNaN(sum)){sum=0;}newevaluationlist[key].score=sum;_this.setState({evaluationlist:newevaluationlist,markvalue:false});_this.setevaluationlist(newevaluationlist);};_this.changeEvaluationRule=function(e,key){var evaluationlist=_this.state.evaluationlist;var newevaluationlist=evaluationlist;newevaluationlist[key].match_rule=e.target.value;_this.setevaluationlist(newevaluationlist);};_this.evaluationoninputvalue=function(e,key,type){$.fn.autoHeight=function(){function autoHeight(elem){elem.style.height='auto';elem.style.maxHeight='140px';elem.scrollTop=0;//防抖动
|
|
|
|
|
elem.style.height=elem.scrollHeight+'px';}this.each(function(){autoHeight(this);$(this).on('keyup',function(){autoHeight(this);});});};$('textarea[autoHeight]').autoHeight();var evaluationlist=_this.state.evaluationlist;var newevaluationlist=evaluationlist;if(type==="sr"){newevaluationlist[key].input=e.target.value;}else if(type==="yq"){// 统一转成\r\n
|
|
|
|
|
newevaluationlist[key].output=e.target.value?e.target.value.replace(/\r?\n/g,"\r\n"):e.target.value;}_this.setevaluationlist(newevaluationlist);};_this.evaluationoninputvalueonload=function(){$.fn.autoHeight=function(){function autoHeight(elem){elem.style.height='auto';elem.style.maxHeight='140px';elem.scrollTop=0;//防抖动
|
|
|
|
|
elem.style.height=elem.scrollHeight+'px';}this.each(function(){autoHeight(this);$(this).on('keyup',function(){autoHeight(this);});});};$('textarea[autoHeight]').autoHeight();};_this.submitarbitrationevaluation=function(){var _this$state8=_this.state,evaluationlist=_this$state8.evaluationlist,shixunfilepath=_this$state8.shixunfilepath,shixunfilepathplay=_this$state8.shixunfilepathplay,shixunfileexpectpicturepath=_this$state8.shixunfileexpectpicturepath,shixunfilestandardpicturepath=_this$state8.shixunfilestandardpicturepath,shixunfilepicturepath=_this$state8.shixunfilepicturepath,pathoptionvalue=_this$state8.pathoptionvalue,scorevalue=_this$state8.scorevalue,markvalue=_this$state8.markvalue,web_route=_this$state8.web_route;var newscorevalue=void 0;if(scorevalue===false){newscorevalue=false;}else{//判断占比
|
|
|
|
|
newscorevalue=true;var sum=0;for(var i=0;i<evaluationlist.length;i++){if(evaluationlist[i].score>100){_this.props.showSnackbar("测试集的评分占比不能大于100");_this.setState({scoretype:i});return;}sum=sum+evaluationlist[i].score;}if(sum>100||sum<100){_this.props.showSnackbar("测试集的评分占比之和必须等于100");return;}}if(shixunfilepath===undefined||shixunfilepath===""||shixunfilepath===null){_this.props.showSnackbar("学员任务文件路径为空");_this.setState({StudentTaskPapers:true});$('html').animate({scrollTop:120},1000);return;}if(shixunfilepathplay===undefined||shixunfilepathplay===""||shixunfilepathplay===null){_this.props.showSnackbar("评测执行文件路径为空");_this.setState({StudentTaskDocs:true});$('html').animate({scrollTop:130},1000);return;}if(evaluationlist.length===0){_this.props.showSnackbar("测试集不能为空");return;}var id=_this.props.match.params.shixunId;var checkpointId=_this.state.checkpointId;var url="/shixuns/"+id+"/challenges/"+checkpointId+".json";var newchallenge={path:shixunfilepath,exec_path:shixunfilepathplay,show_type:pathoptionvalue,original_picture_path:pathoptionvalue===-1?undefined:shixunfileexpectpicturepath===undefined?null:shixunfileexpectpicturepath,expect_picture_path:pathoptionvalue===-1?undefined:shixunfilestandardpicturepath===undefined?null:shixunfilestandardpicturepath,picture_path:pathoptionvalue===-1?undefined:shixunfilepicturepath===undefined?null:shixunfilepicturepath,test_set_score:newscorevalue,test_set_average:markvalue,web_route:web_route===null?undefined:web_route};__WEBPACK_IMPORTED_MODULE_14_axios___default.a.put(url,{tab:1,challenge:newchallenge,test_set:evaluationlist}).then(function(response){_this.props.showSnackbar(response.data.messages);window.location.href='/shixuns/'+id+'/challenges/'+response.data.challenge_id+'/tab=3';// if(response.data.status===1){
|
|
|
|
|
// window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3"
|
|
|
|
|
// }
|
|
|
|
|
}).catch(function(error){console.log(error);});};_this.handpathoptionvalues=function(){_this.setState({handpathopt:true});};_this.handpathoptionvaluess=function(){_this.setState({handpathopt:false});};_this.saveselectpath=function(e){_this.setState({selectpath:e.target.value});};_this.updatepath=function(e,name,type){var _this$setState2;_this.setState((_this$setState2={},_defineProperty(_this$setState2,name,e.target.value),_defineProperty(_this$setState2,'pathtype',type),_this$setState2));};_this.oneditevaluationlist=function(newevaluationlist,markvalue){if(markvalue===true){if(100%newevaluationlist.length===0){var sum=100/newevaluationlist.length;for(var i=0;i<newevaluationlist.length;i++){newevaluationlist[i].score=sum;}}else{var _sum=parseInt(100/newevaluationlist.length);for(var i=0;i<newevaluationlist.length;i++){if(i+1!=newevaluationlist.length){newevaluationlist[i].score=_sum;}else{newevaluationlist[i].score=_sum+100%newevaluationlist.length;}}}}return newevaluationlist;};_this.onChangeRadioGroups=function(e){var _this$state9=_this.state,markvalue=_this$state9.markvalue,evaluationlist=_this$state9.evaluationlist;var newevaluationlist=evaluationlist;if(e.target.value===true){newevaluationlist=_this.oneditevaluationlist(newevaluationlist,markvalue);}_this.setState({scorevalue:e.target.value,evaluationlist:newevaluationlist});_this.setevaluationlist(newevaluationlist);};_this.onChangemarkvalue=function(e){var evaluationlist=_this.state.evaluationlist;if(e.target.value===true){var newevaluationlist=evaluationlist;newevaluationlist=_this.oneditevaluationlist(newevaluationlist,e.target.value);_this.setevaluationlist(newevaluationlist);}_this.setState({markvalue:e.target.value});};_this.updatewebroute=function(e){_this.setState({web_route:e.target.value});};_this.state={choice_url:undefined,practice_url:undefined,go_back_url:undefined,task_pass_default:undefined,submit_url:undefined,value:1,evaluationlist:[],shixunId:undefined,power:false,shixunfilepath:undefined,evaluationvisible:false,trees:undefined,path:"",main:[],saveshixunfilepath:undefined,selectpath:undefined,shixunfilepathplay:undefined,shixunfileexpectpicturepath:undefined,shixunfilestandardpicturepath:undefined,shixunfilepicturepath:undefined,pathoptionvalue:-1,showrepositoryurltiptype:false,prev_challenge:undefined,next_challenge:undefined,StudentTaskPapers:false,StudentTaskDocs:false,selectpatharr:[],handpathopt:false,scorevalue:false,markvalue:true,scoretype:undefined,web_route:null};return _this;}_createClass(TPMevaluation,[{key:'exerciseMD',value:function exerciseMD(initValue,id){var _this2=this;this.contentChanged=false;var placeholder="";// amp;
|
|
|
|
|
// 编辑时要传memoId
|
|
|
|
|
var imageUrl='/api/attachments.json';// 创建editorMd
|
|
|
|
|
var exercise_editormd=create_editorMD(id,'100%',400,placeholder,imageUrl,function(){setTimeout(function(){exercise_editormd.resize();exercise_editormd.cm&&exercise_editormd.cm.refresh();},500);if(initValue!=undefined){exercise_editormd.setValue(initValue);}exercise_editormd.cm.on("change",function(_cm,changeObj){console.log('....contentChanged');_this2.contentChanged=true;});});this.exercise_editormd=exercise_editormd;window.exercise_editormd=exercise_editormd;}},{key:'componentDidMount',value:function componentDidMount(){var _this3=this;var id=this.props.match.params.shixunId;var checkpointId=this.props.match.params.checkpointId;this.setState({shixunId:id,checkpointId:checkpointId});var newchoice_url="/shixuns/"+id+"/challenges/newquestion";var newpractice_url="/shixuns/"+id+"/challenges/new";var newgo_back_url="/shixuns/"+id+"/challenges";var url="/shixuns/"+id+"/challenges/"+checkpointId+"/edit.json?tab=1";__WEBPACK_IMPORTED_MODULE_14_axios___default.a.get(url).then(function(response){var newprev_challenge=response.data.prev_challenge;var next_challenge=response.data.next_challenge;if(newprev_challenge!=undefined){if(newprev_challenge.st===0){newprev_challenge="/shixuns/"+id+"/challenges/"+newprev_challenge.id+"/editcheckpoint";}else{newprev_challenge="/shixuns/"+id+"/challenges/"+newprev_challenge.id+"/editquestion";}}if(next_challenge!=undefined){if(next_challenge.st===0){next_challenge="/shixuns/"+id+"/challenges/"+next_challenge.id+"/editcheckpoint";}else{next_challenge="/shixuns/"+id+"/challenges/"+next_challenge.id+"/editquestion";}}var newevaluationlist=[];if(response.data.test_sets.length===0){var newlist=[{hidden:0,input:"",output:"",score:50},{hidden:0,input:"",output:"",score:50}];newevaluationlist=newlist;}else{newevaluationlist=response.data.test_sets;}_this3.setState({power:response.data.power,evaluationlist:newevaluationlist,shixunfilepath:response.data.path,shixunfilepathplay:response.data.exec_path,pathoptionvalue:response.data.show_type,shixunfileexpectpicturepath:response.data.original_picture_path,shixunfilestandardpicturepath:response.data.expect_picture_path,shixunfilepicturepath:response.data.picture_path,prev_challenge:newprev_challenge,next_challenge:next_challenge,choice_url:newchoice_url,// 导航中的新建选择题url
|
|
|
|
|
practice_url:newpractice_url,//string 导航中新建实践题url
|
|
|
|
|
go_back_url:newgo_back_url,//string 导航中的返回url
|
|
|
|
|
position:response.data.position,//int 关卡位置,导航栏中的第几关
|
|
|
|
|
scorevalue:response.data.test_set_score,markvalue:response.data.test_set_average,web_route:response.data.web_route,has_web_route:response.data.has_web_route});_this3.evaluationoninputvalueonload();if(response.data.power===false){_this3.props.showSnackbar("你没有权限修改");}if(response.data.answer===undefined){_this3.answerMD("","answerMD");}else{_this3.answerMD(response.data.answer,"answerMD");}}).catch(function(error){console.log(error);});}// delesavegetfilepath=(value)=>{
|
|
|
|
|
// let {selectpatharr} = this.state
|
|
|
|
|
// let newarr =selectpatharr;
|
|
|
|
|
// let newselectpath="";
|
|
|
|
|
// for(var i=0; i<newarr.length;i++){
|
|
|
|
|
// if(newarr[i]===value){
|
|
|
|
|
//
|
|
|
|
|
// newarr.splice(i,1);
|
|
|
|
|
// console.log(newarr)
|
|
|
|
|
// console.log(value)
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// for(var z=0; z<newarr.length;z++){
|
|
|
|
|
// newselectpath=newselectpath+newarr[z]+ ";"
|
|
|
|
|
// }
|
|
|
|
|
// this.setState({
|
|
|
|
|
// selectpatharr:newarr,
|
|
|
|
|
// selectpath: newselectpath
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// 填写分数百分比
|
|
|
|
|
// 修改测试集的匹配规则
|
|
|
|
|
//选择得分规范
|
|
|
|
|
//均匀比例
|
|
|
|
|
},{key:'render',value:function render(){var _this4=this;var _state=this.state,choice_url=_state.choice_url,practice_url=_state.practice_url,go_back_url=_state.go_back_url,position=_state.position,evaluationlist=_state.evaluationlist,shixunId=_state.shixunId,checkpointId=_state.checkpointId,power=_state.power,shixunfileexpectpicturepath=_state.shixunfileexpectpicturepath,shixunfilestandardpicturepath=_state.shixunfilestandardpicturepath,shixunfilepicturepath=_state.shixunfilepicturepath,shixunfilepath=_state.shixunfilepath,evaluationvisible=_state.evaluationvisible,trees=_state.trees,path=_state.path,main=_state.main,selectpath=_state.selectpath,shixunfilepathplay=_state.shixunfilepathplay,pathoptionvalue=_state.pathoptionvalue,showrepositoryurltiptype=_state.showrepositoryurltiptype,prev_challenge=_state.prev_challenge,next_challenge=_state.next_challenge,StudentTaskPapers=_state.StudentTaskPapers,StudentTaskDocs=_state.StudentTaskDocs,web_route=_state.web_route,scorevalue=_state.scorevalue,markvalue=_state.markvalue,scoretype=_state.scoretype,has_web_route=_state.has_web_route;var tab1url="/shixuns/"+shixunId+"/challenges/"+checkpointId+"/editcheckpoint";var tab2url="/shixuns/"+shixunId+"/challenges/"+checkpointId+"/tab=2";var tab3url="/shixuns/"+shixunId+"/challenges/"+checkpointId+"/tab=3";// console.log(this.props)
|
|
|
|
|
var radioStyle={display:'block',height:'30px',lineHeight:'30px',marginLeft:'20px'};return __WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_12_react___default.a.Fragment,null,__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{className:'educontent mt30 mb30'},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{className:'padding10-20 mb10 edu-back-white clearfix'},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('span',{className:'fl ring-blue mr10 mt7'},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('img',{src:Object(__WEBPACK_IMPORTED_MODULE_15_educoder__["M" /* getImageUrl */])("images/educoder/icon/code.svg"),'data-tip-down':'\u5B9E\u8BAD\u4EFB\u52A1',className:'fl mt2 ml2'})),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('span',{className:'font-16 task-hide fl TPMtaskName'},'\u7B2C',position,'\u5173'),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_13_react_router_dom__["b" /* Link */],{to:go_back_url===undefined?"":go_back_url,className:'color-grey-6 fr font-15 mt3'},'\u8FD4\u56DE'),prev_challenge===undefined?"":__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('a',{href:prev_challenge,className:'fr color-blue mr15 mt4'},'\u4E0A\u4E00\u5173'),next_challenge===undefined?"":__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('a',{href:next_challenge,className:'fr color-blue mr15 mt4'},'\u4E0B\u4E00\u5173'),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('a',{href:practice_url===undefined?"":practice_url,className:'fr color-blue mr15 mt4',style:{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'},'data-tip-down':'\u65B0\u589E\u4EE3\u7801\u7F16\u8F91\u7C7B\u578B\u7684\u4EFB\u52A1'},'+\xA0\u5B9E\u8DF5\u7C7B\u578B'),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('a',{href:choice_url===undefined?"":choice_url,className:'fr color-blue mr15 mt4',style:{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'},'data-tip-down':'\u65B0\u589E\u9009\u62E9\u9898\u7C7B\u578B\u7684\u4EFB\u52A1'},'+\xA0\u9009\u62E9\u9898\u7C7B\u578B')),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{className:'challenge_nav clearfix edu-back-white'},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('li',null,__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_13_react_router_dom__["b" /* Link */],{to:tab1url},'\u672C\u5173\u4EFB\u52A1')),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('li',{className:'active'},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_13_react_router_dom__["b" /* Link */],{to:tab2url},'\u8BC4\u6D4B\u8BBE\u7F6E')),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('li',{className:''},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_13_react_router_dom__["b" /* Link */],{to:tab3url},'\u53C2\u8003\u7B54\u6848'))),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('p',{className:'color-orange-tip font-12 padding20'},'\u8BF7\u5148\u4E0A\u4F20\u672C\u5173\u4EFB\u52A1\u7684\u6240\u6709\u4EE3\u7801\u6587\u4EF6\u3001\u6807\u51C6\u56FE\u7247\u7B49\u6240\u6709\u5FC5\u8981\u7684\u6587\u4EF6\u5230',__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('a',{href:"/shixuns/"+shixunId+"/repository",className:'color-bule-tip decoration',target:'_blank'},'\u7248\u672C\u5E93')),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{className:'edu-back-white mb10 clearfix'},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{className:'padding40-20'},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('p',{className:'color-grey-6 font-16 mb20'},'\u5B66\u5458\u4EFB\u52A1\u6587\u4EF6'),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{className:'df'},__WEBPACK_IMPORTED_MODULE_12_rea
|
|
|
|
|
,rows:3,onInput:function onInput(e){return _this4.evaluationoninputvalue(e,key,"sr");}}),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(TextArea,{className:'textareavalue',name:'test_set[output][]',placeholder:'\u9884\u671F\u8F93\u51FA',value:item.output,id:key+"textareavalue"// autoHeight="true"
|
|
|
|
|
,rows:5,onInput:function onInput(e){return _this4.evaluationoninputvalue(e,key,"yq");}}),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{className:'clearfix lineh-30'},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('span',{className:'fl mr10 color-grey-6'},'\u5339\u914D\u89C4\u5219\uFF1A'),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(RadioGroup,{className:'fl',value:item.match_rule,onChange:function onChange(e){return _this4.changeEvaluationRule(e,key);}},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9_antd_lib_radio___default.a,{value:'full'},'\u5B8C\u5168\u5339\u914D'),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9_antd_lib_radio___default.a,{value:'last'},'\u672B\u5C3E\u5339\u914D'))));}))),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('p',{className:'clearfix',onClick:this.addevaluationon},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('a',{className:'fl edu-default-btn edu-greyline-btn mt20 mb20 sample_icon_add'},'\u65B0\u589E\u6D4B\u8BD5\u96C6')),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('p',{className:'color-grey-9'},'\u6E29\u99A8\u63D0\u793A\uFF1A\u5EFA\u8BAE\u516C\u5F00\u6D4B\u8BD5\u96C6\u548C\u9690\u85CF\u6D4B\u8BD5\u96C6\u7ED3\u5408\u4F7F\u7528\uFF0C\u964D\u4F4E\u4F5C\u5F0A\u7684\u51E0\u7387\uFF1B\u9690\u85CF\u6D4B\u8BD5\u96C6\uFF0C\u5728\u201C\u63D0\u4EA4\u8BC4\u6D4B\u201D\u65F6\u4E5F\u5C06\u88AB\u81EA\u52A8\u68C0\u6D4B')))),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('div',{className:'clearfix mt30',style:{display:this.props.identity>4||this.props.identity===undefined||power===false?"none":"block"}},__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('a',{className:'defalutSubmitbtn fl mr20',onClick:this.submitarbitrationevaluation},'\u63D0\u4EA4'),__WEBPACK_IMPORTED_MODULE_12_react___default.a.createElement('a',{href:"/shixuns/"+shixunId+"/challenges",className:'defalutCancelbtn fl'},'\u53D6\u6D88'))));}}]);return TPMevaluation;}(__WEBPACK_IMPORTED_MODULE_12_react__["Component"]);/* harmony default export */ __webpack_exports__["default"] = (TPMevaluation);
|
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
|
|
|
|
});
|