dev_forum
杨树明 5 years ago
parent 969e163e74
commit d6a0a50b43

@ -325,7 +325,8 @@ class CoursesNew extends Component {
// fetching: true,
// });
this.setState({
fetching: true
fetching: true,
school: value
})
this.getschool(value)
}
@ -363,11 +364,16 @@ class CoursesNew extends Component {
}
}).then((result)=>{
if (result.data.status===0) {
this.setState({
searchlistscholl: result.data.school_names,
})
if(searchlistscholl.length!=0){
this.setState({
searchlistscholl: result.data.school_names,
fetching: false
})
}
}
}).catch((error)=>{
console.log(error)

@ -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">
学员评测本关任务时生成的文件将保存在该路径下并作为实际输出显示在查看效果页供学员确认任务输出结果为文件时请指定该路径并注意与程序文件所在文件夹分开

@ -742,10 +742,13 @@ class Newshixuns extends Component {
// }
onChangeTimePicker = (value, dateString) => {
debugger
this.setState({
TimePickervalue: handleDateStrings(dateString)
TimePickervalue: moment(handleDateStrings(dateString))
})
}
// 附件相关 START
handleChange = (info) => {
console.log("handleChange1");
@ -1279,13 +1282,14 @@ class Newshixuns extends Component {
<li className="fl">
<DatePicker
showToday={false}
showTime
locale={locale}
showTime={{ format: 'HH:mm' }}
style={{"width": "184px"}}
format="YYYY-MM-DD HH:mm"
placeholder="请选择开启时间"
onChange={this.onChangeTimePicker}
value={TimePickervalue && moment(TimePickervalue, "YYYY-MM-DD HH:mm")}
disabledTime={disabledDateTime}
dropdownClassName="hideDisable"
/>

Loading…
Cancel
Save