|
|
@ -1,97 +1,32 @@
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
|
|
|
|
|
|
|
|
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Button,Icon,Tooltip} from 'antd';
|
|
|
|
import {Input, Select, Radio, Checkbox, Modal,Button,Tooltip} from 'antd';
|
|
|
|
|
|
|
|
|
|
|
|
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
|
|
|
|
import { Link} from "react-router-dom";
|
|
|
|
|
|
|
|
|
|
|
|
// import "antd/dist/antd.css";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
import { getImageUrl, toPath } from 'educoder';
|
|
|
|
import Bottomsubmit from "../../modals/Bottomsubmit";
|
|
|
|
|
|
|
|
|
|
|
|
import './css/TPMchallengesnew.css';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import {getUrl} from 'educoder';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let origin = getUrl();
|
|
|
|
import { getImageUrl } from 'educoder';
|
|
|
|
|
|
|
|
|
|
|
|
let path = getUrl("/editormd/lib/")
|
|
|
|
import './css/TPMchallengesnew.css';
|
|
|
|
|
|
|
|
|
|
|
|
const $ = window.$;
|
|
|
|
const $ = window.$;
|
|
|
|
|
|
|
|
|
|
|
|
let timeout;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let currentValue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Option = Select.Option;
|
|
|
|
const Option = Select.Option;
|
|
|
|
|
|
|
|
|
|
|
|
const RadioGroup = Radio.Group;
|
|
|
|
const RadioGroup = Radio.Group;
|
|
|
|
|
|
|
|
|
|
|
|
const { TextArea } = Input;
|
|
|
|
const { TextArea } = Input;
|
|
|
|
|
|
|
|
|
|
|
|
function create_editorMD(id, width, high, placeholder, imageUrl, callback) {
|
|
|
|
function isNulltpm( str ){
|
|
|
|
var editorName = window.editormd(id, {
|
|
|
|
if ( str == "" ) return true;
|
|
|
|
width: width,
|
|
|
|
var regu = "^[ ]+$";
|
|
|
|
height: high,
|
|
|
|
var re = new RegExp(regu);
|
|
|
|
path: path, // "/editormd/lib/"
|
|
|
|
return re.test(str);
|
|
|
|
|
|
|
|
|
|
|
|
syncScrolling: "single",
|
|
|
|
|
|
|
|
tex: true,
|
|
|
|
|
|
|
|
tocm: true,
|
|
|
|
|
|
|
|
emoji: true,
|
|
|
|
|
|
|
|
taskList: true,
|
|
|
|
|
|
|
|
codeFold: true,
|
|
|
|
|
|
|
|
searchReplace: true,
|
|
|
|
|
|
|
|
htmlDecode: "style,script,iframe",
|
|
|
|
|
|
|
|
sequenceDiagram: true,
|
|
|
|
|
|
|
|
autoFocus: false,
|
|
|
|
|
|
|
|
toolbarIcons: function () {
|
|
|
|
|
|
|
|
// 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 () {
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default class TPMevaluation extends Component {
|
|
|
|
export default class TPMevaluation extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
|
super(props)
|
|
|
|
super(props)
|
|
|
@ -127,39 +62,11 @@ export default class TPMevaluation extends Component {
|
|
|
|
scorevalue:false,
|
|
|
|
scorevalue:false,
|
|
|
|
markvalue:true,
|
|
|
|
markvalue:true,
|
|
|
|
scoretype:undefined,
|
|
|
|
scoretype:undefined,
|
|
|
|
web_route:null
|
|
|
|
web_route:null,
|
|
|
|
|
|
|
|
exec_time:undefined
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exerciseMD(initValue, id) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.contentChanged = false;
|
|
|
|
|
|
|
|
const placeholder = "";
|
|
|
|
|
|
|
|
// amp;
|
|
|
|
|
|
|
|
// 编辑时要传memoId
|
|
|
|
|
|
|
|
const imageUrl = `/api/attachments.json`;
|
|
|
|
|
|
|
|
// 创建editorMd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const exercise_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => {
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
exercise_editormd.resize()
|
|
|
|
|
|
|
|
exercise_editormd.cm && exercise_editormd.cm.refresh()
|
|
|
|
|
|
|
|
}, 500)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (initValue != undefined) {
|
|
|
|
|
|
|
|
exercise_editormd.setValue(initValue)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
exercise_editormd.cm.on("change", (_cm, changeObj) => {
|
|
|
|
|
|
|
|
console.log('....contentChanged')
|
|
|
|
|
|
|
|
this.contentChanged = true;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.exercise_editormd = exercise_editormd;
|
|
|
|
|
|
|
|
window.exercise_editormd = exercise_editormd;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
let checkpointId=this.props.match.params.checkpointId;
|
|
|
|
let checkpointId=this.props.match.params.checkpointId;
|
|
|
@ -193,8 +100,7 @@ export default class TPMevaluation extends Component {
|
|
|
|
let newevaluationlist=[]
|
|
|
|
let newevaluationlist=[]
|
|
|
|
if(response.data.test_sets.length===0){
|
|
|
|
if(response.data.test_sets.length===0){
|
|
|
|
let newlist=[
|
|
|
|
let newlist=[
|
|
|
|
{hidden:0,input:"",output:"",score:50},
|
|
|
|
{hidden:0,input:"",output:"",score:100},
|
|
|
|
{hidden:0,input:"",output:"",score:50}
|
|
|
|
|
|
|
|
]
|
|
|
|
]
|
|
|
|
newevaluationlist=newlist
|
|
|
|
newevaluationlist=newlist
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
@ -219,18 +125,16 @@ export default class TPMevaluation extends Component {
|
|
|
|
scorevalue:response.data.test_set_score,
|
|
|
|
scorevalue:response.data.test_set_score,
|
|
|
|
markvalue:response.data.test_set_average,
|
|
|
|
markvalue:response.data.test_set_average,
|
|
|
|
web_route:response.data.web_route,
|
|
|
|
web_route:response.data.web_route,
|
|
|
|
has_web_route:response.data.has_web_route
|
|
|
|
has_web_route:response.data.has_web_route,
|
|
|
|
|
|
|
|
responsedata:response.data,
|
|
|
|
|
|
|
|
exec_time:response.data.exec_time,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.evaluationoninputvalueonload();
|
|
|
|
this.evaluationoninputvalueonload();
|
|
|
|
if(response.data.power===false){
|
|
|
|
if(response.data.power===false){
|
|
|
|
this.props.showSnackbar("你没有权限修改");
|
|
|
|
this.props.showNotification("你没有权限修改");
|
|
|
|
}
|
|
|
|
|
|
|
|
if(response.data.answer===undefined){
|
|
|
|
|
|
|
|
this.answerMD("", "answerMD");
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.answerMD(response.data.answer, "answerMD");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
|
console.log(error)
|
|
|
|
console.log(error)
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -249,7 +153,7 @@ export default class TPMevaluation extends Component {
|
|
|
|
addevaluationon=()=>{
|
|
|
|
addevaluationon=()=>{
|
|
|
|
let {evaluationlist,markvalue}=this.state;
|
|
|
|
let {evaluationlist,markvalue}=this.state;
|
|
|
|
let newevaluationlist=evaluationlist;
|
|
|
|
let newevaluationlist=evaluationlist;
|
|
|
|
newevaluationlist.push({hidden:0,input:"",output:"",score:0});
|
|
|
|
newevaluationlist.push({hidden:0,input:"",output:"",score:0,match_rule:"full"});
|
|
|
|
newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue);
|
|
|
|
newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue);
|
|
|
|
this.setevaluationlist(newevaluationlist);
|
|
|
|
this.setevaluationlist(newevaluationlist);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -379,34 +283,6 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
savegetfilepath=(value)=>{
|
|
|
|
savegetfilepath=(value)=>{
|
|
|
|
let {selectpath,saveshixunfilepath,pathtype} = this.state
|
|
|
|
let {selectpath,saveshixunfilepath,pathtype} = this.state
|
|
|
|
|
|
|
|
|
|
|
@ -438,30 +314,6 @@ export default class TPMevaluation extends Component {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 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]+ ";"
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
evaluationenter=()=>{
|
|
|
|
evaluationenter=()=>{
|
|
|
@ -505,12 +357,6 @@ export default class TPMevaluation extends Component {
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
newtype=1;
|
|
|
|
newtype=1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// newevaluationlist[key].is_public=newtype;
|
|
|
|
|
|
|
|
// for(var i=0; i<newevaluationlist.length; i++){
|
|
|
|
|
|
|
|
// if(i===key){
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
newevaluationlist[key].hidden=newtype;
|
|
|
|
newevaluationlist[key].hidden=newtype;
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -597,7 +443,7 @@ export default class TPMevaluation extends Component {
|
|
|
|
$('textarea[autoHeight]').autoHeight();
|
|
|
|
$('textarea[autoHeight]').autoHeight();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
submitarbitrationevaluation=()=>{
|
|
|
|
submitarbitrationevaluation=()=>{
|
|
|
|
let{evaluationlist,shixunfilepath,shixunfilepathplay,shixunfileexpectpicturepath,shixunfilestandardpicturepath,shixunfilepicturepath,pathoptionvalue,scorevalue,markvalue,web_route}=this.state;
|
|
|
|
let{exec_time,evaluationlist,shixunfilepath,shixunfilepathplay,shixunfileexpectpicturepath,shixunfilestandardpicturepath,shixunfilepicturepath,pathoptionvalue,scorevalue,markvalue,web_route}=this.state;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let newscorevalue;
|
|
|
|
let newscorevalue;
|
|
|
@ -610,7 +456,7 @@ export default class TPMevaluation extends Component {
|
|
|
|
let sum=0;
|
|
|
|
let sum=0;
|
|
|
|
for(var i=0; i<evaluationlist.length; i++){
|
|
|
|
for(var i=0; i<evaluationlist.length; i++){
|
|
|
|
if(evaluationlist[i].score>100){
|
|
|
|
if(evaluationlist[i].score>100){
|
|
|
|
this.props.showSnackbar("测试集的评分占比不能大于100");
|
|
|
|
this.props.showNotification("测试集的评分占比不能大于100");
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
scoretype:i
|
|
|
|
scoretype:i
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -620,36 +466,52 @@ export default class TPMevaluation extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(sum>100||sum<100){
|
|
|
|
if(sum>100||sum<100){
|
|
|
|
this.props.showSnackbar("测试集的评分占比之和必须等于100");
|
|
|
|
this.props.showNotification("测试集的评分占比之和必须等于100");
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(exec_time===null||exec_time===undefined||exec_time === ""){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
shixunExec_timeType:true,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.props.scrollToAnchor("exec_timeid");
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isNulltpm(exec_time)) {
|
|
|
|
|
|
|
|
this.props.showNotification("评测时长,请勿输入空格");
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
shixunExec_timeType:true,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.props.scrollToAnchor("exec_timeid");
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(shixunfilepath===undefined||shixunfilepath===""||shixunfilepath===null){
|
|
|
|
if(shixunfilepath===undefined||shixunfilepath===""||shixunfilepath===null){
|
|
|
|
this.props.showSnackbar("学员任务文件路径为空");
|
|
|
|
// this.props.showSnackbar("学员任务文件路径为空");
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
StudentTaskPapers:true
|
|
|
|
StudentTaskPapers:true
|
|
|
|
})
|
|
|
|
})
|
|
|
|
$('html').animate({
|
|
|
|
this.props.scrollToAnchor("Studenttaskfile");
|
|
|
|
scrollTop: 120
|
|
|
|
|
|
|
|
}, 1000);
|
|
|
|
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(shixunfilepathplay===undefined||shixunfilepathplay===""||shixunfilepathplay===null){
|
|
|
|
if(shixunfilepathplay===undefined||shixunfilepathplay===""||shixunfilepathplay===null){
|
|
|
|
this.props.showSnackbar("评测执行文件路径为空");
|
|
|
|
// this.props.showSnackbar("评测执行文件路径为空");
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
StudentTaskDocs:true
|
|
|
|
StudentTaskDocs:true
|
|
|
|
})
|
|
|
|
})
|
|
|
|
$('html').animate({
|
|
|
|
this.props.scrollToAnchor("Benchmarkexecutable");
|
|
|
|
scrollTop: 130
|
|
|
|
|
|
|
|
}, 1000);
|
|
|
|
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(evaluationlist.length===0){
|
|
|
|
if(evaluationlist.length===0){
|
|
|
|
this.props.showSnackbar("测试集不能为空");
|
|
|
|
this.props.showSnackbar("测试集不能为空");
|
|
|
|
|
|
|
|
this.props.scrollToAnchor("Thetestset");
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
@ -664,7 +526,8 @@ export default class TPMevaluation extends Component {
|
|
|
|
picture_path:pathoptionvalue===-1?undefined:shixunfilepicturepath===undefined?null:shixunfilepicturepath,
|
|
|
|
picture_path:pathoptionvalue===-1?undefined:shixunfilepicturepath===undefined?null:shixunfilepicturepath,
|
|
|
|
test_set_score:newscorevalue,
|
|
|
|
test_set_score:newscorevalue,
|
|
|
|
test_set_average:markvalue,
|
|
|
|
test_set_average:markvalue,
|
|
|
|
web_route:web_route===null?undefined:web_route
|
|
|
|
web_route:web_route===null?undefined:web_route,
|
|
|
|
|
|
|
|
exec_time:exec_time
|
|
|
|
}
|
|
|
|
}
|
|
|
|
axios.put(url,{
|
|
|
|
axios.put(url,{
|
|
|
|
tab:1,
|
|
|
|
tab:1,
|
|
|
@ -672,7 +535,7 @@ export default class TPMevaluation extends Component {
|
|
|
|
test_set:evaluationlist
|
|
|
|
test_set:evaluationlist
|
|
|
|
}
|
|
|
|
}
|
|
|
|
).then((response) => {
|
|
|
|
).then((response) => {
|
|
|
|
this.props.showSnackbar(response.data.messages);
|
|
|
|
this.props.showNotification(response.data.messages);
|
|
|
|
window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/tab=3`;
|
|
|
|
window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/tab=3`;
|
|
|
|
// if(response.data.status===1){
|
|
|
|
// if(response.data.status===1){
|
|
|
|
// window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3"
|
|
|
|
// window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3"
|
|
|
@ -681,16 +544,7 @@ export default class TPMevaluation extends Component {
|
|
|
|
console.log(error)
|
|
|
|
console.log(error)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
handpathoptionvalues=()=>{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
handpathopt:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
handpathoptionvaluess=()=>{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
handpathopt:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
saveselectpath=(e)=>{
|
|
|
|
saveselectpath=(e)=>{
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -768,6 +622,24 @@ export default class TPMevaluation extends Component {
|
|
|
|
web_route:e.target.value
|
|
|
|
web_route:e.target.value
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gotocheckpoint=(url)=>{
|
|
|
|
|
|
|
|
this.props.history.replace(url);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setexec_time=(e)=>{
|
|
|
|
|
|
|
|
if(e.target.value===null||e.target.value===undefined||e.target.value === ""||e.target.value.match(/^[ ]*$/)){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
shixunExec_timeType:false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
exec_time:e.target.value
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
|
|
|
|
|
|
|
|
let {
|
|
|
|
let {
|
|
|
@ -799,7 +671,8 @@ export default class TPMevaluation extends Component {
|
|
|
|
scorevalue,
|
|
|
|
scorevalue,
|
|
|
|
markvalue,
|
|
|
|
markvalue,
|
|
|
|
scoretype,
|
|
|
|
scoretype,
|
|
|
|
has_web_route
|
|
|
|
has_web_route,
|
|
|
|
|
|
|
|
responsedata
|
|
|
|
} = this.state;
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint";
|
|
|
|
let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint";
|
|
|
@ -812,64 +685,115 @@ export default class TPMevaluation extends Component {
|
|
|
|
lineHeight: '30px',
|
|
|
|
lineHeight: '30px',
|
|
|
|
marginLeft: '20px',
|
|
|
|
marginLeft: '20px',
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<React.Fragment>
|
|
|
|
<React.Fragment>
|
|
|
|
<div className="educontent mt30 mb30">
|
|
|
|
<div className="educontent mt30 mb30">
|
|
|
|
<div className="padding10-20 mb10 edu-back-white clearfix">
|
|
|
|
<div className="TPMchallengesnewtitles edu-back-white clearfix borderbottomf4">
|
|
|
|
<span className="fl ring-blue mr10 mt7">
|
|
|
|
<span className="font-16 task-hide fl TPMtaskName">第{position}关:{responsedata&&responsedata.st === 0 ?"实践题":responsedata&&responsedata.st === 1?"选择题":""}</span>
|
|
|
|
<img src={getImageUrl("images/educoder/icon/code.svg")} data-tip-down="实训任务" className="fl mt2 ml2"/>
|
|
|
|
{this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"":<a href={practice_url === undefined ? "" : practice_url} className="fr ml15 mt13">
|
|
|
|
</span>
|
|
|
|
<Button type="primary" className="edu-default-btn edu-greenback-btn "
|
|
|
|
<span className="font-16 task-hide fl TPMtaskName">第{position}关</span>
|
|
|
|
>新增实践任务</Button></a>}
|
|
|
|
<Link to={go_back_url === undefined ? "" : go_back_url}
|
|
|
|
{this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"":<Link to={choice_url === undefined ? "" : choice_url}
|
|
|
|
className="color-grey-6 fr font-15 mt3">返回</Link>
|
|
|
|
className="fr ml15 mt13">
|
|
|
|
|
|
|
|
<Button type="primary"
|
|
|
|
{prev_challenge === undefined ? "" :
|
|
|
|
className="edu-default-btn edu-greenback-btn mr5"
|
|
|
|
<a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
|
|
|
|
>新增选择题任务</Button></Link>}
|
|
|
|
}
|
|
|
|
{next_challenge===undefined?"":
|
|
|
|
|
|
|
|
<Button type="primary" ghost onClick={()=>this.gotocheckpoint(next_challenge)}
|
|
|
|
{next_challenge === undefined ? "" :
|
|
|
|
className="edu-default-btn edu-greenback-btn mr5 fr ml15 mt13"
|
|
|
|
<a href={next_challenge} className="fr color-blue mr15 mt4">下一关</a>
|
|
|
|
>下一关</Button> }
|
|
|
|
}
|
|
|
|
{prev_challenge===undefined?"":
|
|
|
|
|
|
|
|
<Button type="primary" ghost onClick={()=>this.gotocheckpoint(prev_challenge)}
|
|
|
|
<a href={practice_url === undefined ? "" : practice_url}
|
|
|
|
className="edu-default-btn edu-greenback-btn mr5 fr ml15 mt13"
|
|
|
|
className="fr color-blue mr15 mt4"
|
|
|
|
>上一关</Button>}
|
|
|
|
style={{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1? "none":'block'}}
|
|
|
|
|
|
|
|
data-tip-down="新增代码编辑类型的任务">+ 实践类型</a>
|
|
|
|
|
|
|
|
<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="新增选择题类型的任务">+ 选择题类型</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="challenge_nav clearfix edu-back-white">
|
|
|
|
<div className="challenge_nav clearfix edu-back-white">
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<li>
|
|
|
|
<Link to={tab1url}>本关任务</Link>
|
|
|
|
<Link to={tab1url}>1、本关任务 </Link>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
{tab2url === "" ? "":<li> > </li>}
|
|
|
|
<li className="active">
|
|
|
|
<li className="active">
|
|
|
|
<Link to={tab2url}>评测设置</Link>
|
|
|
|
<Link to={tab2url} className={"color-blue"}>2、评测设置</Link>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
{tab3url === "" ? "":<li> > </li>}
|
|
|
|
<li className="">
|
|
|
|
<li className="">
|
|
|
|
<Link to={tab3url}>参考答案</Link>
|
|
|
|
<Link to={tab3url}> 3、参考答案</Link>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<p className="color-orange-tip font-12 padding20">
|
|
|
|
<p className="color-orange-tip font-14 padding10 edu-back-white text-centers">
|
|
|
|
|
|
|
|
<div className={"bor25510211"}>
|
|
|
|
请先上传本关任务的所有代码文件、标准图片等所有必要的文件到
|
|
|
|
请先上传本关任务的所有代码文件、标准图片等所有必要的文件到
|
|
|
|
<a href={"/shixuns/" + shixunId + "/repository"} className="color-bule-tip decoration" target="_blank">版本库</a>
|
|
|
|
<a href={"/shixuns/" + shixunId + "/repository"} className="color-bule-tip decoration" target="_blank">版本库</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="edu-back-white newpadding02020" id={"exec_timeid"} >
|
|
|
|
|
|
|
|
<p className="color-grey-6 font-16 mb20"> <span className="color-red mr5 fl">*</span> 评测时长限制<span className={"color-grey-8 font-14"}>(程序评测运行时间限制时长,单位:秒)</span></p>
|
|
|
|
|
|
|
|
<div className="clearfix mb5">
|
|
|
|
|
|
|
|
<div className="pr status_con" style={{'width':'233px'}}>
|
|
|
|
|
|
|
|
<Input value={this.state.exec_time}
|
|
|
|
|
|
|
|
className={this.state.shixunExec_timeType === true ?"panel-box-sizing task-form-100 task-height-40 bor-red":"panel-box-sizing task-form-100 task-height-40" }
|
|
|
|
|
|
|
|
placeholder="请输入评测时长" onInput={this.setexec_time}/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
className={this.state.shixunExec_timeType === true ? "color-red mt8 block ml5" : " none"}
|
|
|
|
|
|
|
|
id="new_shixun_name">必填项:不能为空</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="edu-back-white clearfix">
|
|
|
|
|
|
|
|
<div className="padding1020tpms mb10">
|
|
|
|
|
|
|
|
<p className="color-grey-6 font-16 mb20"><span className="color-red mr5 fl">*</span> 评测效果展现方式<span className={"color-grey-8 font-14"}>(学员评测本关任务时,查看效果页上需要展现的文件类型)</span></p>
|
|
|
|
|
|
|
|
<div className="pr">
|
|
|
|
|
|
|
|
<Select className="winput-240-40"
|
|
|
|
|
|
|
|
value={pathoptionvalue}
|
|
|
|
|
|
|
|
onChange={this.handpathoptionvalue}>
|
|
|
|
|
|
|
|
<Option value={-1}>无</Option>
|
|
|
|
|
|
|
|
<Option value={1}>图片</Option>
|
|
|
|
|
|
|
|
<Option value={2}>apk/exe</Option>
|
|
|
|
|
|
|
|
<Option value={3}>txt</Option>
|
|
|
|
|
|
|
|
<Option value={4}>html</Option>
|
|
|
|
|
|
|
|
<Option value={5}>mp3</Option>
|
|
|
|
|
|
|
|
<Option value={6}>mp4</Option>
|
|
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
<a className="ml10" onClick={()=>this.showrepositoryurltip(1)}><img src={getImageUrl("images/educoder/problem.png")}/></a>
|
|
|
|
|
|
|
|
<div className="invite-tip clearfix repository_url_tippostion" style={{display:showrepositoryurltiptype===true?"block":"none"}} id="repository_url_tip"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<span className="top-black-trangleft"></span>
|
|
|
|
|
|
|
|
<div className="padding20 invitecontent clearfix">
|
|
|
|
|
|
|
|
<p className="font-12 edu-txt-left">
|
|
|
|
|
|
|
|
图片:处理或输出图片类型的任务,请选填此项<br/>
|
|
|
|
|
|
|
|
可以通过设置图片路径和学员答案文件路径,展示代码对应的图片效果<br/><br/>
|
|
|
|
|
|
|
|
apk/exe:写可执行文件的任务,请选填此项<br/>
|
|
|
|
|
|
|
|
可以通过设置学员答案文件路径,展示二维码以供扫码下载<br/><br/>
|
|
|
|
|
|
|
|
txt:输出txt文档类型的任务,请选填此项<br/>
|
|
|
|
|
|
|
|
可以通过学员答案文件路径设置,展示txt文件内容<br/><br/>
|
|
|
|
|
|
|
|
html:web类型的任务,请选填此项<br/>
|
|
|
|
|
|
|
|
可以通过Web路由设置,展示html效果预览页<br/><br/>
|
|
|
|
|
|
|
|
mp3/mp4:mp3/mp4文件类型的任务,请选填此项<br/>
|
|
|
|
|
|
|
|
可以通过学员答案文件路径设置,展示mp3/mp4文件内容<br/><br/>
|
|
|
|
|
|
|
|
</p></div>
|
|
|
|
|
|
|
|
<p className="inviteTipbtn with100"><a onClick={()=>this.showrepositoryurltip(2)}
|
|
|
|
|
|
|
|
>知道了</a>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="edu-back-white mb10 clearfix">
|
|
|
|
<div className="edu-back-white clearfix">
|
|
|
|
<div className="padding40-20">
|
|
|
|
<div className="padding1020tpms mb10" id={"Studenttaskfile"}>
|
|
|
|
<p className="color-grey-6 font-16 mb20">学员任务文件</p>
|
|
|
|
<p className="color-grey-6 font-16 mb20"><span className="color-red mr5 fl">*</span> 学员任务文件<span className={"color-grey-8 font-14"}>(该文件将直接显示给学生,需要学生在其中填写代码)</span></p>
|
|
|
|
<div className="df">
|
|
|
|
<div>
|
|
|
|
<span className="mr30 color-orange pt10">*</span>
|
|
|
|
<div className="flex1">
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
<input type="text"
|
|
|
|
<input type="text" className="input-100-45 greyInput change" id="shixun_file_path"
|
|
|
|
className={StudentTaskPapers===true?"input-100-45 greyInput change bor-red":"input-100-45 greyInput change"}
|
|
|
|
|
|
|
|
id="shixun_file_path"
|
|
|
|
name="challenge[path]" autoComplete="off"
|
|
|
|
name="challenge[path]" autoComplete="off"
|
|
|
|
placeholder="请选择版本库中的代码文件。例: src/step1/HelloWorld.java"
|
|
|
|
placeholder="请选择版本库中的代码文件。例: src/step1/HelloWorld.java"
|
|
|
|
value={shixunfilepath}
|
|
|
|
value={shixunfilepath}
|
|
|
@ -877,15 +801,16 @@ export default class TPMevaluation extends Component {
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepath",1)}
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepath",1)}
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepath",1)}
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepath",1)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<p className="color-grey-9 mt15">该文件将直接显示给学生,需要学生在其中填写代码</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style={{width: '57px'}}>
|
|
|
|
<div>
|
|
|
|
<span className={StudentTaskPapers===true?"color-orange mt8 fl":"color-orange mt8 fl none"} id="student_task_name"><i
|
|
|
|
<span className={StudentTaskPapers===true?"color-red mt8 fl":" none"} id="student_task_name"> 必选项:不能为空</span>
|
|
|
|
className="fa fa-exclamation-circle mr3"></i>必填项</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
<Modal
|
|
|
|
keyboard={false}
|
|
|
|
keyboard={false}
|
|
|
|
title="文件路径"
|
|
|
|
title="文件路径"
|
|
|
@ -914,9 +839,6 @@ export default class TPMevaluation extends Component {
|
|
|
|
{path+item.name}</a>:<a data-remote="true">
|
|
|
|
{path+item.name}</a>:<a data-remote="true">
|
|
|
|
<i className="iconfont icon-zuoye color-blue mr2"></i>
|
|
|
|
<i className="iconfont icon-zuoye color-blue mr2"></i>
|
|
|
|
<span onClick={()=>this.savegetfilepath(path+item.name,item.type)}>{path+item.name}</span>
|
|
|
|
<span onClick={()=>this.savegetfilepath(path+item.name,item.type)}>{path+item.name}</span>
|
|
|
|
{/*<Tooltip placement="bottom" title={"点击删除下方所选文件路径"}>*/}
|
|
|
|
|
|
|
|
{/*<Icon className={"fr mt4"} type="close-circle" onClick={()=>this.delesavegetfilepath(path+item.name)}/>*/}
|
|
|
|
|
|
|
|
{/*</Tooltip>*/}
|
|
|
|
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -942,13 +864,12 @@ export default class TPMevaluation extends Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Modal>
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="edu-back-white mb10 clearfix">
|
|
|
|
<div className="edu-back-white clearfix">
|
|
|
|
<div className="padding40-20">
|
|
|
|
<div className="padding1020tpms mb10" id={"Benchmarkexecutable"}>
|
|
|
|
<p className="color-grey-6 font-16 mb20">评测执行文件</p>
|
|
|
|
<p className="color-grey-6 font-16 mb20"><span className="color-red mr5 fl">*</span>评测执行文件<span className={"color-grey-8 font-14"}>(若执行平台脚本,请输入学员任务文件路径;若使用自己设计的脚本测试学生代码,请输入设计的脚本文件路径)</span></p>
|
|
|
|
<div className="df">
|
|
|
|
<div>
|
|
|
|
<span className="mr30 color-orange pt10">*</span>
|
|
|
|
<div className="flex1">
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
<input type="text" className={StudentTaskDocs===true?"bor-red input-100-45 greyInput":"input-100-45 greyInput"} id="shixun_file_path_play"
|
|
|
|
<input type="text" className="input-100-45 greyInput" id="shixun_file_path_play"
|
|
|
|
|
|
|
|
name="challenge[exec_path]" autoComplete="off"
|
|
|
|
name="challenge[exec_path]" autoComplete="off"
|
|
|
|
placeholder="请选择版本库中的代码文件。例:src/step1/HelloWorldTest.java"
|
|
|
|
placeholder="请选择版本库中的代码文件。例:src/step1/HelloWorldTest.java"
|
|
|
|
value={shixunfilepathplay}
|
|
|
|
value={shixunfilepathplay}
|
|
|
@ -956,59 +877,19 @@ export default class TPMevaluation extends Component {
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepathplay",1)}
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepathplay",1)}
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepathplay",1)}
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepathplay",1)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<p className="color-grey-9 mt15">该文件由平台执行,用来测试平台学员代码是否正确</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style={{width: '57px'}}>
|
|
|
|
|
|
|
|
<span className={StudentTaskDocs===true?"color-orange mt8 fl":"color-orange mt8 fl none"} id="student_task_name"><i
|
|
|
|
|
|
|
|
className="fa fa-exclamation-circle mr3"></i>必填项</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<span className={StudentTaskDocs===true?"color-red mt8 fl":"none"} id="student_task_name">
|
|
|
|
|
|
|
|
必选项:不能为空
|
|
|
|
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="edu-back-white mb10 clearfix">
|
|
|
|
|
|
|
|
<div className="padding40-20">
|
|
|
|
|
|
|
|
<p className="color-grey-6 font-16 mb20">效果展现方式</p>
|
|
|
|
|
|
|
|
<div className="pr">
|
|
|
|
|
|
|
|
<Select className="winput-240-40"
|
|
|
|
|
|
|
|
value={pathoptionvalue}
|
|
|
|
|
|
|
|
onChange={this.handpathoptionvalue}>
|
|
|
|
|
|
|
|
<Option value={-1}>请选择效果展现方式</Option>
|
|
|
|
|
|
|
|
<Option value={1}>图片</Option>
|
|
|
|
|
|
|
|
<Option value={2}>apk/exe</Option>
|
|
|
|
|
|
|
|
<Option value={3}>txt</Option>
|
|
|
|
|
|
|
|
<Option value={4}>html</Option>
|
|
|
|
|
|
|
|
<Option value={5}>mp3</Option>
|
|
|
|
|
|
|
|
<Option value={6}>mp4</Option>
|
|
|
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
<a className="ml10" onClick={()=>this.showrepositoryurltip(1)}><img src={getImageUrl("images/educoder/problem.png")}/></a>
|
|
|
|
|
|
|
|
<div className="invite-tip clearfix repository_url_tippostion" style={{display:showrepositoryurltiptype===true?"block":"none"}} id="repository_url_tip"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<span className="top-black-trangleft"></span>
|
|
|
|
|
|
|
|
<div className="padding20 invitecontent clearfix">
|
|
|
|
|
|
|
|
<p className="font-12 edu-txt-left">
|
|
|
|
|
|
|
|
图片:处理或输出图片类型的任务,请选填此项<br/>
|
|
|
|
|
|
|
|
可以通过设置图片路径和学员答案文件路径,展示代码对应的图片效果<br/><br/>
|
|
|
|
|
|
|
|
apk/exe:写可执行文件的任务,请选填此项<br/>
|
|
|
|
|
|
|
|
可以通过设置学员答案文件路径,展示二维码以供扫码下载<br/><br/>
|
|
|
|
|
|
|
|
txt:输出txt文档类型的任务,请选填此项<br/>
|
|
|
|
|
|
|
|
可以通过学员答案文件路径设置,展示txt文件内容<br/><br/>
|
|
|
|
|
|
|
|
html:web类型的任务,请选填此项<br/>
|
|
|
|
|
|
|
|
可以通过Web路由设置,展示html效果预览页
|
|
|
|
|
|
|
|
</p></div>
|
|
|
|
|
|
|
|
<p className="inviteTipbtn with100"><a onClick={()=>this.showrepositoryurltip(2)}
|
|
|
|
|
|
|
|
>知道了</a>
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p className="color-grey-9 mt15">该选项用来配置学员评测本关任务时,查看效果页上需要展现的文件类型</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{pathoptionvalue===4&&web_route!=null||pathoptionvalue===4&&has_web_route===true?<div className="edu-back-white mb10 clearfix">
|
|
|
|
{pathoptionvalue===4&&web_route!=null||pathoptionvalue===4&&has_web_route===true?<div className="edu-back-white clearfix">
|
|
|
|
<div className="padding40-20">
|
|
|
|
<div className="padding1020tpms mb10">
|
|
|
|
<p className="color-grey-6 font-16 mb20">Web路由</p>
|
|
|
|
<p className="color-grey-6 font-16 mb20">Web路由<span className={"color-grey-8 font-14"}>(请注意将服务器程序的端口号映射到8080端口)</span></p>
|
|
|
|
<div className="df">
|
|
|
|
<div className="df">
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
<input type="text" className="input-100-45 change" autoComplete="off"
|
|
|
|
<input type="text" className="input-100-45 change" autoComplete="off"
|
|
|
@ -1021,9 +902,9 @@ export default class TPMevaluation extends Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>:""}
|
|
|
|
</div>:""}
|
|
|
|
|
|
|
|
|
|
|
|
{pathoptionvalue===1||pathoptionvalue===5||pathoptionvalue===6?<div className="edu-back-white mb10 clearfix">
|
|
|
|
{pathoptionvalue===1||pathoptionvalue===5||pathoptionvalue===6?<div className="edu-back-white clearfix">
|
|
|
|
<div className="padding40-20">
|
|
|
|
<div className="padding1020tpms mb10">
|
|
|
|
<p className="color-grey-6 font-16 mb20">待处理文件路径</p>
|
|
|
|
<p className="color-grey-6 font-16 mb20">待处理文件路径<span className={"color-grey-8 font-14"}>(该路径下的文件将在学员评测本关任务时,作为原始文件显示在查看效果页,供学员参考;请注意与程序文件所在文件夹分开)</span></p>
|
|
|
|
<div className="df">
|
|
|
|
<div className="df">
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
<input type="text" className="input-100-45" autoComplete="off"
|
|
|
|
<input type="text" className="input-100-45" autoComplete="off"
|
|
|
@ -1033,9 +914,6 @@ export default class TPMevaluation extends Component {
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfileexpectpicturepath",2)}
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfileexpectpicturepath",2)}
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath",2)}
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath",2)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<p className="color-grey-9 mt15">
|
|
|
|
|
|
|
|
该路径下的文件将在学员评测本关任务时,作为原始文件显示在查看效果页,供学员参考;任务为文件处理时请指定该路径,并注意与程序文件所在文件夹分开。
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -1043,9 +921,9 @@ export default class TPMevaluation extends Component {
|
|
|
|
</div>:""}
|
|
|
|
</div>:""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{pathoptionvalue===1||pathoptionvalue===5||pathoptionvalue===6? <div className="edu-back-white mb10 clearfix">
|
|
|
|
{pathoptionvalue===1||pathoptionvalue===5||pathoptionvalue===6? <div className="edu-back-white clearfix">
|
|
|
|
<div className="padding40-20">
|
|
|
|
<div className="padding1020tpms mb10">
|
|
|
|
<p className="color-grey-6 font-16 mb20">标准答案文件路径</p>
|
|
|
|
<p className="color-grey-6 font-16 mb20">标准答案文件路径<span className={"color-grey-8 font-14"}>(该路径下的文件将在学员评测本关任务时,作为参考答案显示在查看效果页,供学员参考;请注意与程序文件所在文件夹分开)</span></p>
|
|
|
|
<div className="df">
|
|
|
|
<div className="df">
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
<input type="text" className="input-100-45" autoComplete="off"
|
|
|
|
<input type="text" className="input-100-45" autoComplete="off"
|
|
|
@ -1055,9 +933,6 @@ export default class TPMevaluation extends Component {
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilestandardpicturepath",2)}
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilestandardpicturepath",2)}
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath",2)}
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath",2)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<p className="color-grey-9 mt15">
|
|
|
|
|
|
|
|
该路径下的文件将在学员评测本关任务时,作为参考答案显示在查看效果页,供学员参考;任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开。
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -1065,9 +940,9 @@ export default class TPMevaluation extends Component {
|
|
|
|
</div>:""}
|
|
|
|
</div>:""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{pathoptionvalue===-1?"":<div className="edu-back-white mb10 clearfix">
|
|
|
|
{pathoptionvalue===-1?"":<div className="edu-back-white clearfix">
|
|
|
|
<div className="padding40-20">
|
|
|
|
<div className="padding1020tpms mb10">
|
|
|
|
<p className="color-grey-6 font-16 mb20">学员答案文件路径</p>
|
|
|
|
<p className="color-grey-6 font-16 mb20">学员答案文件路径<span className={"color-grey-8 font-14"}>(学员评测本关任务时生成的文件将保存在该路径下,并作为实际输出显示在查看效果页,供学员确认;请注意与程序文件所在文件夹分开)</span></p>
|
|
|
|
<div className="df">
|
|
|
|
<div className="df">
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
<input type="text" className="input-100-45 change" autoComplete="off"
|
|
|
|
<input type="text" className="input-100-45 change" autoComplete="off"
|
|
|
@ -1076,9 +951,6 @@ export default class TPMevaluation extends Component {
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepicturepath",2)}
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepicturepath",2)}
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath",2)}
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath",2)}
|
|
|
|
placeholder="请在版本库中指定用来保存学员代码实际输出结果的路径。例:src/step1/outputfiles"/>
|
|
|
|
placeholder="请在版本库中指定用来保存学员代码实际输出结果的路径。例:src/step1/outputfiles"/>
|
|
|
|
<p className="color-grey-9 mt15">
|
|
|
|
|
|
|
|
学员评测本关任务时生成的文件将保存在该路径下,并作为实际输出显示在查看效果页,供学员确认;任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开。
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -1086,10 +958,10 @@ export default class TPMevaluation extends Component {
|
|
|
|
</div>}
|
|
|
|
</div>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="edu-back-white mb10 clearfix">
|
|
|
|
<div className="edu-back-white clearfix" id={"Thetestset"}>
|
|
|
|
<div className="padding40-20">
|
|
|
|
<div className="padding1020tpms mb20">
|
|
|
|
{/*<p className="color-grey-6 font-16">测试集</p>*/}
|
|
|
|
{/*<p className="color-grey-6 font-16">测试集</p>*/}
|
|
|
|
<p className="color-grey-6 font-16">测试集和系统评分规则</p>
|
|
|
|
<p className="color-grey-6 font-16 height40pxtpm borbottomeeetpm">测试集和系统评分规则</p>
|
|
|
|
<p className="color-grey-9 mt20"
|
|
|
|
<p className="color-grey-9 mt20"
|
|
|
|
style={{width:'100%',height:'60px'}}
|
|
|
|
style={{width:'100%',height:'60px'}}
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -1132,9 +1004,9 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
{evaluationlist===undefined?"":evaluationlist.length===0?"":evaluationlist.map((item,key)=>{
|
|
|
|
{evaluationlist===undefined?"":evaluationlist.length===0?"":evaluationlist.map((item,key)=>{
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
<div className="test_array_item mt30" key={key}>
|
|
|
|
<div className="test_array_item mt30 borbottomeeetpm pb20" key={key}>
|
|
|
|
<p className="clearfix pr mb20">
|
|
|
|
<p className="clearfix pr mb20">
|
|
|
|
<span className="fl mt5 mr10 color-orange">*</span>
|
|
|
|
<span className="fl mr10 color-red">*</span>
|
|
|
|
<span className="color-blue font-16 fl" name="sample_inputs_label">组{key+1}</span>
|
|
|
|
<span className="color-blue font-16 fl" name="sample_inputs_label">组{key+1}</span>
|
|
|
|
<span className="fl ml20 color-grey-6">
|
|
|
|
<span className="fl ml20 color-grey-6">
|
|
|
|
{/*checked={item.is_public===1?false:true}*/}
|
|
|
|
{/*checked={item.is_public===1?false:true}*/}
|
|
|
@ -1143,19 +1015,19 @@ export default class TPMevaluation extends Component {
|
|
|
|
style={{width: '25%',display:scorevalue===true?'inline-block':'none'}}
|
|
|
|
style={{width: '25%',display:scorevalue===true?'inline-block':'none'}}
|
|
|
|
onInput={(e)=>this.editpercentage(e,key)}
|
|
|
|
onInput={(e)=>this.editpercentage(e,key)}
|
|
|
|
value={item.score} />
|
|
|
|
value={item.score} />
|
|
|
|
<span className="mr15"
|
|
|
|
<span className="mr15 ml10"
|
|
|
|
style={{display:scorevalue===true?'inline-block':'none'}}
|
|
|
|
style={{display:scorevalue===true?'inline-block':'none'}}
|
|
|
|
>%</span>
|
|
|
|
>%</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Checkbox onChange={()=>this.evaluationonChange(item.hidden,key)} checked={item.hidden===1?true:false}>隐藏</Checkbox>
|
|
|
|
<Checkbox onChange={()=>this.evaluationonChange(item.hidden,key)} checked={item.hidden===1?true:false}>隐藏<span className={"color-grey-8 font-14"}>(选中则对学员隐藏本测试集内容)</span></Checkbox>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
<Tooltip placement="bottom" title={"删除"}>
|
|
|
|
<Tooltip placement="bottom" title={"删除"}>
|
|
|
|
<a className="fr del_array sample_icon_remove mr30" style={{display:key===0?"none":"block"}}
|
|
|
|
<div className="fr sample_icon_remove " style={{display:key===0?"none":"block"}}
|
|
|
|
onClick={()=>this.del_test_array(key)}>
|
|
|
|
onClick={()=>this.del_test_array(key)}>
|
|
|
|
<i className="fa fa-times-circle color-grey-c font-16 fl"></i>
|
|
|
|
<i className={"iconfont icon-shanchu_Hover font-16 fl"}></i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
<TextArea className="textareavalue mb15" name="test_set[input][]"
|
|
|
|
<TextArea className="textareavalue mb15" name="test_set[input][]"
|
|
|
@ -1174,11 +1046,11 @@ export default class TPMevaluation extends Component {
|
|
|
|
rows={5}
|
|
|
|
rows={5}
|
|
|
|
onInput={(e)=>this.evaluationoninputvalue(e,key,"yq")}
|
|
|
|
onInput={(e)=>this.evaluationoninputvalue(e,key,"yq")}
|
|
|
|
></TextArea>
|
|
|
|
></TextArea>
|
|
|
|
<div className="clearfix lineh-30">
|
|
|
|
<div className="clearfix lineh-30 mt20">
|
|
|
|
<span className="fl mr10 color-grey-6">匹配规则:</span>
|
|
|
|
<span className="fl mr10 color-grey-6">匹配规则:</span>
|
|
|
|
<RadioGroup className="fl" value={item.match_rule} onChange={(e)=>this.changeEvaluationRule(e,key)}>
|
|
|
|
<RadioGroup className="fl" value={item.match_rule} onChange={(e)=>this.changeEvaluationRule(e,key)}>
|
|
|
|
<Radio value='full'>完全匹配</Radio>
|
|
|
|
<Radio value='full'>完全匹配<span className={"color-grey-8 font-14"}>(实际输出与预期输出完全相同)</span></Radio>
|
|
|
|
<Radio value='last'>末尾匹配</Radio>
|
|
|
|
<Radio value='last'>末尾匹配<span className={"color-grey-8 font-14"}>(实际输出的末尾内容与预期输出完全相同)</span></Radio>
|
|
|
|
</RadioGroup>
|
|
|
|
</RadioGroup>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -1189,23 +1061,28 @@ export default class TPMevaluation extends Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<p className="clearfix" onClick={this.addevaluationon}>
|
|
|
|
<p className="clearfix" onClick={this.addevaluationon}>
|
|
|
|
<a className="fl edu-default-btn edu-greyline-btn mt20 mb20 sample_icon_add">
|
|
|
|
<Button type="primary" ghost className="edu-default-btn edu-greenback-btn mt20 mb20">新增测试集</Button>
|
|
|
|
新增测试集
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
<p className="color-grey-9">温馨提示:建议公开测试集和隐藏测试集结合使用,降低作弊的几率;隐藏测试集,在“提交评测”时也将被自动检测</p>
|
|
|
|
|
|
|
|
|
|
|
|
<p className="color-grey-9">温馨提示:公开测试集和隐藏测试集结合使用,可以降低作弊的几率;隐藏测试集,在“提交评测”时也将被系统自动检测</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="clearfix mt30" style={{display:this.props.identity>4||this.props.identity===undefined||power===false?"none":"block"}}>
|
|
|
|
|
|
|
|
<a className="defalutSubmitbtn fl mr20" onClick={this.submitarbitrationevaluation}>提交</a>
|
|
|
|
|
|
|
|
<a href={"/shixuns/" + shixunId + "/challenges"} className="defalutCancelbtn fl">取消</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{this.props.identity>4||this.props.identity===undefined||power===false?"":<div className="clearfix mt30">
|
|
|
|
</div>
|
|
|
|
{/*<a className="defalutSubmitbtn fl mr20" onClick={this.submitarbitrationevaluation}>提交</a>*/}
|
|
|
|
|
|
|
|
{/*/!*<a href={"/shixuns/" + shixunId + "/challenges"} className="defalutCancelbtn fl">取消</a>*!/*/}
|
|
|
|
|
|
|
|
{/*<Link to={"/shixuns/" + shixunId + "/challenges"} className="defalutCancelbtn fl">取消</Link>*/}
|
|
|
|
|
|
|
|
<Bottomsubmit url={"/shixuns/" + shixunId + "/challenges"}
|
|
|
|
|
|
|
|
bottomvalue={"提交"}
|
|
|
|
|
|
|
|
onSubmits={this.submitarbitrationevaluation}
|
|
|
|
|
|
|
|
{...this.props}
|
|
|
|
|
|
|
|
{...this.state}
|
|
|
|
|
|
|
|
loadings={false}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>}
|
|
|
|
</React.Fragment>
|
|
|
|
</React.Fragment>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|