|
|
|
@ -256,11 +256,12 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
this.setevaluationlist(newevaluationlist);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getfilepath=(e,shixunfilepath)=>{
|
|
|
|
|
getfilepath=(e,shixunfilepath,type)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
evaluationvisible: true,
|
|
|
|
|
selectpath:e.target.value,
|
|
|
|
|
selectpatharr:[],
|
|
|
|
|
pathtype:type
|
|
|
|
|
});
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let url ="/shixuns/"+id+"/repository.json";
|
|
|
|
@ -283,9 +284,9 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sendgetfilepath=(newpath,type)=>{
|
|
|
|
|
sendgetfilepath=(newpath,type,newpathtype)=>{
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let{path,main}=this.state;
|
|
|
|
|
let{path,main,pathtype}=this.state;
|
|
|
|
|
let ary=main;
|
|
|
|
|
let paths=path;
|
|
|
|
|
|
|
|
|
@ -329,10 +330,18 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(pathtype===2){
|
|
|
|
|
this.setState({
|
|
|
|
|
selectpath: newpathtype,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
goblakepath=(path,key)=>{
|
|
|
|
|
let {main,selectpath} =this.state;
|
|
|
|
|
let {main,selectpath,pathtype} =this.state;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let newmain=[]
|
|
|
|
|
for(var i=0;i<=key;i++){
|
|
|
|
|
newmain.push(main[i])
|
|
|
|
@ -355,6 +364,17 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(pathtype===2){
|
|
|
|
|
// var str=path;
|
|
|
|
|
// str.slice(0,str.length-1)
|
|
|
|
|
// debugger
|
|
|
|
|
// console.log(str)
|
|
|
|
|
this.setState({
|
|
|
|
|
selectpath: path,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// delesavegetfilepath=(value)=>{
|
|
|
|
|
// let {selectpatharr} = this.state
|
|
|
|
@ -381,30 +401,9 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
savegetfilepath=(value)=>{
|
|
|
|
|
let {selectpath,saveshixunfilepath} = this.state
|
|
|
|
|
// 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]+ ";"
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let {selectpath,saveshixunfilepath,pathtype} = this.state
|
|
|
|
|
|
|
|
|
|
if(pathtype===1){
|
|
|
|
|
let newselectpath;
|
|
|
|
|
|
|
|
|
|
if(saveshixunfilepath==="shixunfilepathplay"){
|
|
|
|
@ -430,6 +429,32 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
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]+ ";"
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
evaluationenter=()=>{
|
|
|
|
@ -650,9 +675,10 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
selectpath:e.target.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
updatepath=(e,name)=>{
|
|
|
|
|
updatepath=(e,name,type)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
[name]:e.target.value
|
|
|
|
|
[name]:e.target.value,
|
|
|
|
|
pathtype:type
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -818,8 +844,8 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
placeholder="请选择版本库中的代码文件。例: src/step1/HelloWorld.java"
|
|
|
|
|
value={shixunfilepath}
|
|
|
|
|
style={{ width:StudentTaskPapers===true?'100%':""}}
|
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepath")}
|
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepath")}
|
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepath",1)}
|
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepath",1)}
|
|
|
|
|
/>
|
|
|
|
|
<p className="color-grey-9 mt15">该文件将直接显示给学生,需要学生在其中填写代码</p>
|
|
|
|
|
</div>
|
|
|
|
@ -844,7 +870,7 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
{
|
|
|
|
|
main.length===0?"":main.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<a className="f14 fb" onClick={()=>this.goblakepath(item.path,key)}>{item.val}</a>
|
|
|
|
|
<a className="f14 fb" onClick={()=>this.goblakepath(item.path,key,item)}>{item.val}</a>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -853,7 +879,7 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
return(
|
|
|
|
|
<li className="entry" key={key}>
|
|
|
|
|
<div className="filename_no_report hidden">{
|
|
|
|
|
item.type==="tree"?<a onClick={()=>this.sendgetfilepath(item.name,item.type)} data-remote="true">
|
|
|
|
|
item.type==="tree"?<a onClick={()=>this.sendgetfilepath(item.name,item.type,path+item.name)} data-remote="true">
|
|
|
|
|
<i className="iconfont icon-wenjianjia color-blue mr2"></i>
|
|
|
|
|
{path+item.name}</a>:<a data-remote="true">
|
|
|
|
|
<i className="iconfont icon-zuoye color-blue mr2"></i>
|
|
|
|
@ -873,7 +899,7 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
<div className="clearfix mt20">
|
|
|
|
|
<label className="fl mt5 directory_filepath">选中的文件路径:</label>
|
|
|
|
|
<Input id="points_tusi" placeholder="选中的文件路径" className="fl input-60-40"
|
|
|
|
|
style={{width:"440px"}}
|
|
|
|
|
style={{width:"400px"}}
|
|
|
|
|
onInput={(e)=>this.saveselectpath(e)}
|
|
|
|
|
value={selectpath}/>
|
|
|
|
|
</div>
|
|
|
|
@ -897,8 +923,8 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
placeholder="请选择版本库中的代码文件。例:src/step1/HelloWorldTest.java"
|
|
|
|
|
value={shixunfilepathplay}
|
|
|
|
|
style={{width:StudentTaskDocs===true?'100%':""}}
|
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepathplay")}
|
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepathplay")}
|
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepathplay",1)}
|
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepathplay",1)}
|
|
|
|
|
/>
|
|
|
|
|
<p className="color-grey-9 mt15">该文件由平台执行,用来测试平台学员代码是否正确</p>
|
|
|
|
|
</div>
|
|
|
|
@ -958,8 +984,8 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
id="shixun_file_expect_picture_path" name="challenge[original_picture_path]"
|
|
|
|
|
placeholder="请选择版本库中存储了待处理图片的路径。例:src/step1/expectedimages"
|
|
|
|
|
value={shixunfileexpectpicturepath}
|
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfileexpectpicturepath")}
|
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath")}
|
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfileexpectpicturepath",2)}
|
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath",2)}
|
|
|
|
|
/>
|
|
|
|
|
<p className="color-grey-9 mt15">
|
|
|
|
|
该路径下的文件将在学员评测本关任务时,作为原始图片显示在查看效果页,供学员参考,任务为图片处理时请指定该路径,并注意与程序文件所在文件夹分开
|
|
|
|
@ -980,8 +1006,8 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
id="shixun_file_standard_picture_path" name="challenge[expect_picture_path]"
|
|
|
|
|
placeholder="请选择版本库中存储了标准答案代码输出文件的路径。例:src/step1/expectedimages"
|
|
|
|
|
value={shixunfilestandardpicturepath}
|
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilestandardpicturepath")}
|
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath")}
|
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilestandardpicturepath",2)}
|
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath",2)}
|
|
|
|
|
/>
|
|
|
|
|
<p className="color-grey-9 mt15">
|
|
|
|
|
该路径下的文件将在学员评测本关任务时,作为参考答案显示在查看效果页,供学员参考任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开
|
|
|
|
@ -1001,8 +1027,8 @@ export default class TPMevaluation extends Component {
|
|
|
|
|
<input type="text" className="input-100-45 change" autoComplete="off"
|
|
|
|
|
id="shixun_file_picture_path" name="challenge[picture_path]"
|
|
|
|
|
value={shixunfilepicturepath}
|
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepicturepath")}
|
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath")}
|
|
|
|
|
onInput={(e)=>this.updatepath(e,"shixunfilepicturepath",2)}
|
|
|
|
|
onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath",2)}
|
|
|
|
|
placeholder="请在版本库中指定用来保存学员代码实际输出结果的路径。例:src/step1/outputimages"/>
|
|
|
|
|
<p className="color-grey-9 mt15">
|
|
|
|
|
学员评测本关任务时生成的文件将保存在该路径下,并作为实际输出显示在查看效果页,供学员确认任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开
|
|
|
|
|