Merge branch 'master' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
杨树明 5 years ago
commit 16808e2cf8

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

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

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

Loading…
Cancel
Save