hjm 5 years ago
commit f5b90a0897

@ -73,6 +73,10 @@ const WrappedCoursesNewApp= Loadable({
loading: Loading, loading: Loading,
}) })
const ShixunHomeworkPage =Loadable({
loader: () => import('./shixunHomework/ShixunHomeworkPage'),
loading: Loading,
})
//实训作业 //实训作业
const ShixunHomework= Loadable({ const ShixunHomework= Loadable({
loader: () => import('./shixunHomework/shixunHomework'), loader: () => import('./shixunHomework/shixunHomework'),
@ -95,7 +99,6 @@ const Listofworks= Loadable({
// loader: () => import('./shixunHomework/Listofworksstudentone'), // loader: () => import('./shixunHomework/Listofworksstudentone'),
// loading: Loading, // loading: Loading,
// }) // })
//实训作业列表完成的 //实训作业列表完成的
const Studenthascompleted= Loadable({ const Studenthascompleted= Loadable({
loader: () => import('./shixunHomework/Listofworksstudentone'), loader: () => import('./shixunHomework/Listofworksstudentone'),
@ -720,12 +723,12 @@ class CoursesIndex extends Component{
{/*实训查重列表*/} {/*实训查重列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/student_work" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/student_work"
render={ render={
(props) => (<ShixunStudentWork {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/student_work" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/student_work"
render={ render={
(props) => (<ShixunStudentWork {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
@ -744,24 +747,29 @@ class CoursesIndex extends Component{
{/*教师列表*/} {/*教师列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/list" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/list"
render={ render={
(props) => (<Listofworks {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/list" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/list"
render={ render={
(props) => (<Listofworks {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
}
></Route>
{/*实训作业page*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/Page"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/*实训作业设置*/} {/*实训作业设置*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/settings" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/settings"
render={ render={
(props) => (<Trainingjobsetting {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/settings" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/settings"
render={ render={
(props) => (<Trainingjobsetting {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/*/!*实训作品列表教师*!/*/} {/*/!*实训作品列表教师*!/*/}
@ -790,13 +798,13 @@ class CoursesIndex extends Component{
{/*实训学生作品列表已公布*/} {/*实训学生作品列表已公布*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/openlist" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/openlist"
render={ render={
(props) => (<Studenthascompleted {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/*实训学生作品列表已公布*/} {/*实训学生作品列表已公布*/}
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/openlist" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/openlist"
render={ render={
(props) => (<Studenthascompleted {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
@ -805,14 +813,14 @@ class CoursesIndex extends Component{
{/*实训作业问答主目录*/} {/*实训作业问答主目录*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/questions" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/questions"
render={ render={
(props) => (<Workquestionandanswer {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/*实训作业问答子目录*/} {/*实训作业问答子目录*/}
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/questions" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/questions"
render={ render={
(props) => (<Workquestionandanswer {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>

@ -98,7 +98,7 @@ class CommitSummary extends Component{
// console.log("提交总结接口") // console.log("提交总结接口")
// console.log(JSON.stringify(result)) // console.log(JSON.stringify(result))
// message.success(result.data.message); // message.success(result.data.message);
this.props.history.push(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/openlist`); this.props.history.push(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/openlist?tab=0`);
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -136,7 +136,7 @@ class CommitSummary extends Component{
</div> </div>
<div> <div>
<p className="ml29 fl color-black mt10 summaryname" onClick={this.asdasdsad}>提交总结</p> <p className="ml29 fl color-black mt10 summaryname" onClick={this.asdasdsad}>提交总结</p>
<a href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/openlist`} className="color-grey-6 fr font-16 ml30 mt10">返回</a> <a href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/openlist?tab=0`} className="color-grey-6 fr font-16 ml30 mt10">返回</a>
</div> </div>
{/*educontentbox*/} {/*educontentbox*/}
<div className="stud-class-set pt40 pb40"> <div className="stud-class-set pt40 pb40">
@ -171,7 +171,7 @@ class CommitSummary extends Component{
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20" > <Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20" >
提交 提交
</Button> </Button>
<a className="defalutCancelbtn fl" href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/openlist`}>取消</a> <a className="defalutCancelbtn fl" href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/openlist?tab=0`}>取消</a>
</div> </div>
</Form.Item> </Form.Item>
</Form> </Form>

@ -596,6 +596,8 @@ class Listofworks extends Component {
} }
componentDidMount() { componentDidMount() {
console.log("Listofworks");
console.log("componentDidMount");
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid) // console.log(homeworkid)
// this.Gettitleinformation(homeworkid); // this.Gettitleinformation(homeworkid);
@ -655,6 +657,7 @@ class Listofworks extends Component {
code_review: result.data.code_review, code_review: result.data.code_review,
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
}) })
this.props.Getdataback(result,result.data);
this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1); this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1);
} } } }
}).catch((error) => { }).catch((error) => {
@ -714,6 +717,7 @@ class Listofworks extends Component {
code_review: result.data.code_review, code_review: result.data.code_review,
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
}) })
this.props.Getdataback(result,result.data);
this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page); this.seacthdata(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page);
} }
} }
@ -1362,6 +1366,10 @@ class Listofworks extends Component {
DownloadMessageval:undefined DownloadMessageval:undefined
}) })
} }
ChangeTab=(e)=>{
this.props.ChangeTab(e);
}
render() { render() {
// console.log("Listofworks.js000") // console.log("Listofworks.js000")
@ -1371,7 +1379,7 @@ class Listofworks extends Component {
// console.log(course_group_info) // console.log(course_group_info)
// console.log(JSON.stringify(this.props)); // console.log(JSON.stringify(this.props));
return ( return (
<div className="newMain clearfix "> <div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{visible === true ? <ModulationModal {visible === true ? <ModulationModal
visible={visible} visible={visible}
Cancel={this.cancelModulationModel} Cancel={this.cancelModulationModel}
@ -1445,50 +1453,21 @@ class Listofworks extends Component {
typs={this.state.typs} typs={this.state.typs}
/> />
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<div className="educontent mb20">
<p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn
className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"":jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
</div>
<div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth:"33px"}}>
{teacherdata === undefined ? "" : teacherdata.homework_name}
</p>
<CoursesListType
typelist={teacherdata === undefined ? [""] : teacherdata.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20"
href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"": jobsettingsdata.data.category.category_id}`}>返回</a>
<a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdata === undefined ? "" : teacherdata.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a>
</div>
<div className="edu-back-white"> <div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE "> <div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list"> <div className=" clearfix edu-back-white poll_list">
<Link className="active" <a className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/list`}>作品列表</Link> <a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin() ? {this.props.isAdmin() ?
this.state.code_review === true ||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"? "" : <Link this.state.code_review === true ||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"? "" : <a
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`} // to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}> onClick={(e)=>this.ChangeTab(2)}>
代码查重</Link> : ""} 代码查重</a> : ""}
<Link <a
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`} onClick={(e)=>this.ChangeTab(3)}
>设置</Link> >设置</a>
{/*{this.props.isAdmin() ? <a*/} {/*{this.props.isAdmin() ? <a*/}
{/* className="fr color-blue font-16"*/} {/* className="fr color-blue font-16"*/}
{/* href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}*/} {/* href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}*/}
@ -1523,18 +1502,18 @@ class Listofworks extends Component {
</li>:""} </li>:""}
{this.props.isAdmin() ? {this.props.isAdmin() ?
teacherdata && teacherdata.end_immediately === true ? teacherdata && teacherdata.end_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a> : "" <a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
: ""
: ""} : ""}
{this.props.isAdmin() ? {this.props.isAdmin() ?
teacherdata && teacherdata.publish_immediately === true ? teacherdata && teacherdata.publish_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> : "" <a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>
: ""
: ""} : ""}
{/*<a className="fr color-blue font-16" href={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/commitsummary`}>提交总结</a>*/}
{this.props.isAdmin() ? {this.props.isAdmin() ?
this.state.code_review === false ? teacherdata && teacherdata.code_review === true ?
"" <a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
: <a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a> : ""} : "": ""}
</div> </div>
</div> </div>
@ -1755,3 +1734,31 @@ class Listofworks extends Component {
} }
export default Listofworks; export default Listofworks;
{/*<div className="educontent mb20">*/}
{/* <p className="clearfix mb20 mt10">*/}
{/* <ActionBtn className=" btn colorgrey fl hovercolorblue "*/}
{/* to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn>*/}
{/* <span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
{/* <ActionBtn*/}
{/* className=" btn colorgrey fl hovercolorblue "*/}
{/* to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"":jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>*/}
{/* <span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
{/* <WordsBtn className="fl">作业详情</WordsBtn>*/}
{/* </p>*/}
{/*</div>*/}
{/*<div className="educontent mb20">*/}
{/* <p className=" fl color-black summaryname" style={{heigth:"33px"}}>*/}
{/*{teacherdata === undefined ? "" : teacherdata.homework_name}*/}
{/*</p>*/}
{/*<CoursesListType*/}
{/*typelist={teacherdata === undefined ? [""] : teacherdata.homework_status}*/}
{/*/>*/}
{/*<a className="color-grey-9 fr font-16 summaryname ml20 mr20"*/}
{/*href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"": jobsettingsdata.data.category.category_id}`}>返回</a>*/}
{/*<a className="color-grey-9 fr font-16 mr20"*/}
{/*href={`/shixuns/${teacherdata === undefined ? "" : teacherdata.shixun_identifier}/challenges`}*/}
{/*target={"_blank"}>实训详情</a>*/}
{/*</div>*/}

@ -177,13 +177,13 @@ class Listofworksstudentone extends Component {
className:'font-14', className:'font-14',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<span style={record.submitstate === "延时提交" ? { <span style={record.submitstate === "延时提交" ? {
"color": '#DD1717', "color": '#DD1717',
"text-align": "center" "text-align": "center"
} : record.submitstate === "按时提交" ? {"color": '#29BD8B', "text-align": "center"} : { } : record.submitstate === "按时提交" ? {"color": '#29BD8B', "text-align": "center"} : {
"color": '#747A7F', "color": '#747A7F',
"text-align": "center" "text-align": "center"
}}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</span> }}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</span>
</span> </span>
), ),
@ -316,7 +316,8 @@ class Listofworksstudentone extends Component {
} }
componentDidMount() { componentDidMount() {
console.log("Listofworksstudentone");
console.log("componentDidMount");
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
this.Getalistofworks(homeworkid); this.Getalistofworks(homeworkid);
let query = this.props.location.pathname; let query = this.props.location.pathname;
@ -347,7 +348,9 @@ class Listofworksstudentone extends Component {
course_group: "", course_group: "",
} }
axios.post(urll, data).then((result) => { axios.post(urll, data).then((result) => {
if(result === undefined){
return
}
if (result.status === 200) { if (result.status === 200) {
if(this.props.isNotMember()===false) { if(this.props.isNotMember()===false) {
this.setState({ this.setState({
@ -364,7 +367,8 @@ class Listofworksstudentone extends Component {
challenges_count: result.data.challenges_count, challenges_count: result.data.challenges_count,
view_report: result.data.view_report, view_report: result.data.view_report,
}) })
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { this.props.Getdataback(result,result.data);
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata(result.data); this.seacthdata(result.data);
} else { } else {
this.seacthdatas(result.data, result.data.student_works); this.seacthdatas(result.data, result.data.student_works);
@ -421,6 +425,7 @@ class Listofworksstudentone extends Component {
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
view_report:result.data.view_report, view_report:result.data.view_report,
}) })
this.props.Getdataback(result,result.data);
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata(result.data); this.seacthdata(result.data);
} else { } else {
@ -785,7 +790,8 @@ class Listofworksstudentone extends Component {
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
view_report:result.data.view_report, view_report:result.data.view_report,
}) })
this.seacthdata(result.data); this.props.Getdataback(result,result.data);
this.seacthdata(result.data);
} }
} }
}).catch((error) => { }).catch((error) => {
@ -837,6 +843,9 @@ class Listofworksstudentone extends Component {
}); });
} }
ChangeTab=(e)=>{
this.props.ChangeTab(e);
}
render() { render() {
let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state;
// console.log(this.state.data); // console.log(this.state.data);
@ -845,7 +854,7 @@ class Listofworksstudentone extends Component {
return ( return (
teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ? teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ?
// 学生不能查看别人的 // 学生不能查看别人的
<div className="newMain clearfix "> <div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
<style> <style>
{` {`
.startbox{ .startbox{
@ -915,44 +924,18 @@ class Listofworksstudentone extends Component {
} }
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<div className="educontent mb30">
<p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn
className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id === undefined ? "" : jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
</div>
<div className="educontent mb30" style={{width: "1250px"}}>
<p className=" fl color-black summaryname" style={{heigth:"33px"}}>
{teacherdata === undefined ? "" : teacherdata.homework_name}
</p>
<CoursesListType
typelist={teacherdata === undefined ? [""] : teacherdata.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20"
href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id === undefined ? "" : jobsettingsdata.data.category.category_id}`}>返回</a>
<p className="color-grey-9 fr font-16"></p>
</div>
<div className="edu-back-white" style={{width: "1250px"}}> <div className="edu-back-white" style={{width: "1250px"}}>
<div className="stud-class-set bor-bottom-greyE "> <div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list"> <div className=" clearfix edu-back-white poll_list">
<Link className="active" <a className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/openlist`}>作品列表</Link> <a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
<Link <a
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link> onClick={(e)=>this.ChangeTab(3)}
<Link >设置</a>
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`} {this.state.view_report===true?<a className="fr color-blue font-16" target={"_blank"}
>设置</Link> href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/shixun_work_report`}>
{this.state.view_report===true?<Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/shixun_work_report`}>
查看实训报告 查看实训报告
</Link>:""} </a>:""}
{/*<a className="fr color-blue font-16">查看实训报告</a>*/} {/*<a className="fr color-blue font-16">查看实训报告</a>*/}
{ {
teacherdata === undefined ? "" teacherdata === undefined ? ""
@ -1054,7 +1037,7 @@ class Listofworksstudentone extends Component {
</div> </div>
: :
// 学生能查看别人的 // 学生能查看别人的
<div className="newMain clearfix "> <div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{visibles === true ? {visibles === true ?
<TraineetraininginformationModal <TraineetraininginformationModal
homeworkid={this.props.match.params.homeworkid} homeworkid={this.props.match.params.homeworkid}
@ -1096,13 +1079,9 @@ class Listofworksstudentone extends Component {
<div className="edu-back-white"> <div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE "> <div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list"> <div className=" clearfix edu-back-white poll_list">
<Link className="active" <Link className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</Link>
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/openlist`}>作品列表</Link> <Link onClick={(e)=>this.ChangeTab(1)}>作业问答</Link>
<Link <Link onClick={(e)=>this.ChangeTab(3)}>设置</Link>
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link>
{this.state.view_report===true?<Link className="fr color-blue font-16" target={"_blank"} {this.state.view_report===true?<Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/shixun_work_report`}> to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/shixun_work_report`}>
查看实训报告 查看实训报告

@ -0,0 +1,143 @@
import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu} from "antd";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn} from 'educoder';
import axios from 'axios';
import '../css/members.css';
import "../common/formCommon.css";
import '../css/Courses.css';
import './style.css';
import '../css/busyWork.css'
import '../poll/pollStyle.css'
import Listofworks from "./Listofworks";
import Listofworksstudentone from './Listofworksstudentone'
import Trainingjobsetting from './Trainingjobsetting'
import Workquestionandanswer from './Workquestionandanswer'
import CoursesListType from '../coursesPublic/CoursesListType';
import ShixunStudentWork from "./ShixunStudentWork";
class ShixunHomeworkPage extends Component {
constructor(props) {
super(props);
this.state={
tab:["0"],
jobsettingsdata:undefined,
teacherdata:undefined,
}
}
//切换tab
ChangeTab=(e)=>{
console.log(e);
this.setState({
tab:e
})
}
Getdataback = (jobsettingsdata,teacherdata)=>{
this.setState({
jobsettingsdata:jobsettingsdata,
teacherdata:teacherdata,
})
}
componentDidMount() {
const query =this.props.location.search;
const type = query.split('?tab=');
// let sum = []
// sum.push(type[1])
// console.log("componentDidMountcomponentDidMount");
// console.log(sum);
this.setState({
tab:type,
})
let querys = this.props.location.pathname;
const types = querys.split('/');
this.setState({
shixuntypes: types[3]
})
}
render() {
let {tab,jobsettingsdata,teacherdata}=this.state;
const isAdmin =this.props.isAdmin();
return (
<div className="newMain clearfix " >
<div className={"educontent mb20"} style={{width:"1200px"}}>
<div className="educontent mb20">
<p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn
className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"":jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
</div>
<div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth:"33px"}}>
{teacherdata === undefined ? "" : teacherdata.homework_name}
</p>
<CoursesListType
typelist={teacherdata === undefined ? [""] : teacherdata.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20"
href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"": jobsettingsdata.data.category.category_id}`}>返回</a>
<a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdata === undefined ? "" : teacherdata.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a>
</div>
{
// 教师列表
parseInt(tab)===0 ? (isAdmin===true ?
<Listofworks {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Listofworks>
:
<Listofworksstudentone {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Listofworksstudentone>)
:
parseInt(tab)===1 ?<Workquestionandanswer {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Workquestionandanswer>
:
parseInt(tab)===2? <ShixunStudentWork {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></ShixunStudentWork>
:
<Trainingjobsetting {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Trainingjobsetting>
}
</div>
</div>
)
}
}
export default ShixunHomeworkPage;
// <div className="edu-back-white mt10" >
// <div className="stud-class-set bor-bottom-greyE ">
// <div className=" clearfix edu-back-white pl30 pr30">
// <div className="fl task_menu_ul">
// {this.props.isAdmin() === true ?
//
// <Menu mode="horizontal" selectedKeys={tab} onClick={(e)=>this.changeTab(e)}>
// <Menu.Item key="0">作品列表</Menu.Item>
// <Menu.Item key="1">作业回答</Menu.Item>
// <Menu.Item key="2">代码查重</Menu.Item>
// <Menu.Item key="3">设置</Menu.Item>
// </Menu>
// :
// <Menu mode="horizontal" selectedKeys={tab} onClick={(e)=>this.changeTab(e)}>
// <Menu.Item key="0">作品列表</Menu.Item>
// <Menu.Item key="1">作业回答</Menu.Item>
// <Menu.Item key="2">代码查重</Menu.Item>
// </Menu>
// }
//
// </div>
// </div>
{/* </div>*/}
{/*</div>*/}

@ -73,6 +73,8 @@ class ShixunStudentWork extends Component {
} }
componentDidMount() { componentDidMount() {
console.log("ShixunStudentWork");
console.log("componentDidMount");
this.getupdata(); this.getupdata();
this.getTrainingjobsetting(); this.getTrainingjobsetting();
} }
@ -87,6 +89,8 @@ class ShixunStudentWork extends Component {
jobsettingsdata: result, jobsettingsdata: result,
}) })
this.props.Getdataback(result,result.data);
} }
}) })
} }
@ -502,6 +506,9 @@ class ShixunStudentWork extends Component {
DownloadMessageval:undefined DownloadMessageval:undefined
}) })
} }
ChangeTab=(e)=>{
this.props.ChangeTab(e);
}
render() { render() {
let { let {
data, data,
@ -582,7 +589,7 @@ class ShixunStudentWork extends Component {
} }
return ( return (
<div className="newMain clearfix "> <div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{this.state.showmodel===true?<ShixunWorkModal {this.state.showmodel===true?<ShixunWorkModal
{...this.props} {...this.props}
visible={this.state.showmodel} visible={this.state.showmodel}
@ -619,57 +626,14 @@ class ShixunStudentWork extends Component {
typs={this.state.typs} typs={this.state.typs}
/> />
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<div className="educontent mb20">
<p className="clearfix mb20 mt5">
<ActionBtn className=" btn colorgrey fl hovercolorblue mt5"
to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn>
{/*<ActionBtn className="btn colorgrey fl hovercolorblue" href={"/courses/"+data.course_id+"/students"}>{data.course_name}</ActionBtn>*/}
<span className="color-grey-9 fl ml3 mr3 mt5">&gt;</span>
<ActionBtn
className=" btn colorgrey fl hovercolorblue mt5"
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
{/*<ActionBtn className="btn colorgrey fl hovercolorblue" href={"/courses/"+data.course_id+"/"+this.state.shixuntypes+"/"+this.props.match.params.homeworkid}>实训作业</ActionBtn>*/}
{/*<ActionBtn className="btn colorgrey fl hovercolorblue" href={"/courses/"+data.course_id+"/"+this.state.shixuntypes+"/"+data.category.category_id}>{data.category.category_name}</ActionBtn>*/}
<span className="color-grey-9 fl ml3 mr3 mt5">&gt;</span>
<ActionBtn className="fl">作业详情</ActionBtn>
</p>
</div>
<div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth:"33px"}}>
{jobsettingsdata === undefined ? "" : jobsettingsdata.data.homework_name}
</p>
<CoursesListType
typelist={jobsettingsdata === undefined ? [] : jobsettingsdata.data.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20"
href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}`}>返回</a>
<a className={"color-grey-9 fr font-16 mr20"} href={`/shixuns/${jobsettingsdata===undefined?"":jobsettingsdata.data.shixun_identifier}/challenges`} target={"_blank"}>实训详情</a>
</div>
<div className="edu-back-white"> <div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE "> <div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list"> <div className=" clearfix edu-back-white poll_list">
<a onClick={(e)=>this.ChangeTab(0)}>作品列表</a>:
{/*<Link*/} <a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
{/* to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/listofworks`}>作品列表(教师)</Link>*/} {this.props.isAdmin()?<a className="active" onClick={(e)=>this.ChangeTab(2)}>代码查重</a>:""}
{this.props.isAdmin() === true? <a onClick={(e)=>this.ChangeTab(3)}>设置</a>
<Link to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/list`}>作品列表</Link>:
<Link to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/openlist`}>作品列表</Link>
}
{/*<Link*/}
{/*to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/Listofworksstudentone`}>作品列表(学生未完成)</Link>*/}
{/*<Link*/}
{/*to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/Listofworksstudenttwo`}>作品列表(学生完成)</Link>*/}
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin()?<Link className="active"
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>
代码查重</Link>:""}
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link>
<style>{` <style>{`
.drop_down_menu li a { .drop_down_menu li a {
padding: 0px; padding: 0px;
@ -701,15 +665,11 @@ class ShixunStudentWork extends Component {
</li> : ""} </li> : ""}
{this.props.isAdmin()? {this.props.isAdmin()?
data&&data.end_immediately===true? data&&data.end_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a> : "" : ""} <a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
:"": ""}
{this.props.isAdmin()? {this.props.isAdmin()?
data&&data.publish_immediately===true? data&&data.publish_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> : "" : ""} <a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> : "": ""}
{/*{this.props.isAdmin()?*/}
{/*jobsettingsdata&&jobsettingsdata.data.code_review===true?*/}
{/*<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>*/}
{/*:"":""}*/}
</div> </div>
</div> </div>
<style> <style>

@ -117,7 +117,7 @@ class ShixunWorkReport extends Component {
<span className={"color-grey-9"}>{data&&data.category.category_name}</span> <span className={"color-grey-9"}>{data&&data.category.category_name}</span>
</WordsBtn> </WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+homework_common_id+"/list"} className="fl color-grey-9">作业详情</WordsBtn> <WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+homework_common_id+"/list?tab=0"} className="fl color-grey-9">作业详情</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">{data&&data.username}</WordsBtn> <WordsBtn className="fl">{data&&data.username}</WordsBtn>
</p> </p>

@ -294,19 +294,19 @@ class ShixunhomeWorkItem extends Component{
{/*/courses/1309/9373/listofworks*/} {/*/courses/1309/9373/listofworks*/}
{/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/} {/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/}
{ {
this.props.isAdmin?<Link to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list"} this.props.isAdmin?<Link to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0"}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
} }
{ {
this.props.isStudent? <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/openlist`} this.props.isStudent? <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/openlist?tab=0`}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
} }
{ {
this.props.isNotMember===true? this.props.discussMessage.private_icon===true? this.props.isNotMember===true? this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</span> <span className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</span>
: <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/openlist`} : <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/openlist?tab=0`}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
} }
@ -360,7 +360,7 @@ class ShixunhomeWorkItem extends Component{
{this.props.isAdmin?<div className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}> {this.props.isAdmin?<div className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}>
<a className="btn colorblue font-16" href={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</a> <a className="btn colorblue font-16" href={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</a>
{this.props.isAdminOrCreator()?<a onClick={()=>this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名</a>:""} {this.props.isAdminOrCreator()?<a onClick={()=>this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名</a>:""}
<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings`} > 设置</WordsBtn> <WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>
</div>:""} </div>:""}

@ -188,7 +188,7 @@ class ShixunWorkModal extends Component{
// message:"提示", // message:"提示",
// description: response.data.message // description: response.data.message
// }); // });
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.homeworkid}/student_work`); this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.homeworkid}/student_work?tab=2`);
}else if(response.data.status === -1){ }else if(response.data.status === -1){
notification.open({ notification.open({
message:"提示", message:"提示",

@ -125,6 +125,8 @@ class Trainingjobsetting extends Component {
} }
componentDidMount() { componentDidMount() {
console.log("Trainingjobsetting");
console.log("componentDidMount");
this.getTrainingjobsetting(); this.getTrainingjobsetting();
let query = this.props.location.pathname; let query = this.props.location.pathname;
const type = query.split('/'); const type = query.split('/');
@ -143,46 +145,52 @@ class Trainingjobsetting extends Component {
// console.log(homeworkid) // console.log(homeworkid)
let url = `/homework_commons/${homeworkid}/settings.json`; let url = `/homework_commons/${homeworkid}/settings.json`;
axios.get(url).then((result) => { axios.get(url).then((result) => {
console.log(url);
console.log(result);
if (result!=undefined) { if (result!=undefined) {
// console.log(result.data.code_review) this.props.Getdataback(result,result.data);
// console.log(result.data.code_review)
// console.log("设置页") // console.log("设置页")
// console.log(JSON.stringify(result)) // console.log(JSON.stringify(result))
let array=[]; let array=[];
let arrays=[]; let arrays=[];
var rulesdatas=[]; var rulesdatas=[];
if(result.data.group_settings.length === 0){ if(result.data.group_settings !== undefined){
array.push({ if(result.data.group_settings.length === 0){
course_group_id:[], array.push({
course_group_name:[], course_group_id:[],
publish_time:undefined, course_group_name:[],
end_time:undefined, publish_time:undefined,
publish_flag:"", end_time:undefined,
end_flag:"", publish_flag:"",
class_flag:"", end_flag:"",
course_search:"", class_flag:"",
open:false course_search:"",
}) open:false
}else { })
for(var i=0;i<result.data.group_settings.length;i++) { }else {
if(result.data.group_settings[i].publish_time === null &&result.data.group_settings[i].end_time === null){ for(var i=0;i<result.data.group_settings.length;i++) {
if(result.data.group_settings[i].publish_time === null &&result.data.group_settings[i].end_time === null){
}else {
array.push({ }else {
course_group_id: result.data.group_settings[i].group_id, array.push({
course_group_name: result.data.group_settings[i].group_name, course_group_id: result.data.group_settings[i].group_id,
publish_time: result.data.group_settings[i].publish_time, course_group_name: result.data.group_settings[i].group_name,
end_time: result.data.group_settings[i].end_time, publish_time: result.data.group_settings[i].publish_time,
publish_flag: "", end_time: result.data.group_settings[i].end_time,
end_flag: "", publish_flag: "",
class_flag: "", end_flag: "",
course_search: "", class_flag: "",
open: false course_search: "",
}) open: false
})
}
} }
} }
} }
for(var i=0;i<result.data.group_settings.length;i++){ if(result.data.group_settings!== undefined){
for(var i=0;i<result.data.group_settings.length;i++){
arrays.push({ arrays.push({
course_group_id:result.data.group_settings[i].group_id, course_group_id:result.data.group_settings[i].group_id,
@ -192,20 +200,22 @@ class Trainingjobsetting extends Component {
course_choosed:0, course_choosed:0,
}) })
if(result.data.group_settings[i].group_id instanceof Array ) { if(result.data.group_settings[i].group_id instanceof Array ) {
rulesdatas.push({ rulesdatas.push({
group_id:result.data.group_settings[i].group_id, group_id:result.data.group_settings[i].group_id,
publish_time: moment( result.data.group_settings[i].publish_time).format('YYYY-MM-DD HH:mm') , publish_time: moment( result.data.group_settings[i].publish_time).format('YYYY-MM-DD HH:mm') ,
end_time: moment(result.data.group_settings[i].end_time ).format('YYYY-MM-DD HH:mm'), end_time: moment(result.data.group_settings[i].end_time ).format('YYYY-MM-DD HH:mm'),
}) })
}else { }else {
rulesdatas.push({ rulesdatas.push({
group_id:[result.data.group_settings[i].group_id], group_id:[result.data.group_settings[i].group_id],
publish_time: moment( result.data.group_settings[i].publish_time).format('YYYY-MM-DD HH:mm') , publish_time: moment( result.data.group_settings[i].publish_time).format('YYYY-MM-DD HH:mm') ,
end_time: moment(result.data.group_settings[i].end_time ).format('YYYY-MM-DD HH:mm'), end_time: moment(result.data.group_settings[i].end_time ).format('YYYY-MM-DD HH:mm'),
}) })
}
} }
} }
this.setState({ this.setState({
rules:array, rules:array,
rulest:arrays, rulest:arrays,
@ -259,7 +269,7 @@ class Trainingjobsetting extends Component {
if (datas[i].checked === true) { if (datas[i].checked === true) {
var object = { var object = {
challenge_id: datas[i].challenge_id, challenge_id: datas[i].challenge_id,
challenge_score: parseInt(datas[i].challenge_score), challenge_score: datas[i].challenge_score,
}; };
challenge_scoredata.push(datas[i].challenge_score); challenge_scoredata.push(datas[i].challenge_score);
array.push(object) array.push(object)
@ -1048,7 +1058,7 @@ class Trainingjobsetting extends Component {
var challenge_settings = this.state.challenge_settings; var challenge_settings = this.state.challenge_settings;
for (var i = 0; i < challenge_settings.length; i++) { for (var i = 0; i < challenge_settings.length; i++) {
if (i === index) { if (i === index) {
challenge_settings[i].challenge_score = parseInt(value); challenge_settings[i].challenge_score = value;
} }
} }
@ -1711,6 +1721,9 @@ class Trainingjobsetting extends Component {
} }
}
ChangeTab=(e)=>{
this.props.ChangeTab(e);
} }
render() { render() {
@ -1743,7 +1756,7 @@ class Trainingjobsetting extends Component {
// console.log(this.props.isAdmin()) // console.log(this.props.isAdmin())
// console.log(this.state.code_review===false) // console.log(this.state.code_review===false)
return ( return (
<div className="newMain clearfix " ref='targetElementTrainingjobsetting'> <div className=" clearfix " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
{this.state.showmodel===true?<ShixunWorkModal {this.state.showmodel===true?<ShixunWorkModal
{...this.props} {...this.props}
visible={this.state.showmodel} visible={this.state.showmodel}
@ -1786,43 +1799,12 @@ class Trainingjobsetting extends Component {
modalSave={modalSave} modalSave={modalSave}
></Modals> ></Modals>
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<div className="educontent mb20">
<p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn
className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
</div>
<div className="educontent mb20">
<p className=" fl color-black summaryname mt5" style={{heigth:"33px"}}>
{jobsettingsdata === undefined ? "" : jobsettingsdata.data.homework_name}
</p>
<CoursesListType
typelist={jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20" href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}`}>返回</a>
<a className="color-grey-9 fr font-16 mr20" href={`/shixuns/${jobsettingsdata===undefined?"":jobsettingsdata.data.shixun_identifier}/challenges`} target={"_blank"}>实训详情</a>
</div>
<div className="edu-back-white"> <div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE "> <div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list"> <div className=" clearfix edu-back-white poll_list">
{this.props.isAdmin() === true ? <Link <a onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/list`}>作品列表</Link> : <Link <a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/openlist`}>作品列表</Link> {this.props.isAdmin()?this.state.code_review===true||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"?"": <a onClick={(e)=>this.ChangeTab(2)}>代码查重</a> : ""}
}
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin()?this.state.code_review===true||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"?"": <Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>代码查重</Link> : ""}
<style>{ <style>{
` `
.poll_list a.active:after { .poll_list a.active:after {
@ -1836,12 +1818,9 @@ class Trainingjobsetting extends Component {
} }
` `
}</style> }</style>
<Link className="active" <a className="active"
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`} onClick={(e)=>this.ChangeTab(3)}
>设置</Link> >设置</a>
{/*<Link className="ml30" to={`/courses/${this.state.props.match.params.coursesId}/shixun_homeworks/${this.state.props.match.params.homeworkid}/shixun_work_report`}>*/}
{/*<a className="color-blue">查看实训报告</a>*/}
{/*</Link>*/}
<style>{` <style>{`
.drop_down_menu li a { .drop_down_menu li a {
padding: 0px; padding: 0px;
@ -1872,13 +1851,13 @@ class Trainingjobsetting extends Component {
</ul> </ul>
</li>: ""} </li>: ""}
{this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.end_immediately===true? {this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.end_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a> : "": ""} <a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
: "": ""}
{this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.publish_immediately===true? {this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.publish_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> : "": ""} <a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>: "" : ""}
{this.props.isAdmin()? {this.props.isAdmin()?
this.state.code_review===true?<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a> jobsettingsdata&&jobsettingsdata.data.code_review===true?
: "":""} <a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>: "":""}
</div> </div>
</div> </div>
{/*发布设置*/} {/*发布设置*/}

@ -81,6 +81,8 @@ class Workquestionandanswer extends Component {
} }
componentDidMount() { componentDidMount() {
console.log("Workquestionandanswer");
console.log("componentDidMount");
var homeworkid = this.props.match.params.homeworkid; var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid) // console.log(homeworkid)
this.Gettitleinformation(homeworkid) this.Gettitleinformation(homeworkid)
@ -108,6 +110,7 @@ class Workquestionandanswer extends Component {
jobsettingsdata: result, jobsettingsdata: result,
...result.data ...result.data
}) })
this.props.Getdataback(result,result.data);
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -345,6 +348,9 @@ class Workquestionandanswer extends Component {
DownloadMessageval:undefined DownloadMessageval:undefined
}) })
} }
ChangeTab=(e)=>{
this.props.ChangeTab(e);
}
render() { render() {
const dateFormat = 'YYYY-MM-DD HH:mm:ss'; const dateFormat = 'YYYY-MM-DD HH:mm:ss';
let { let {
@ -364,7 +370,7 @@ class Workquestionandanswer extends Component {
return ( return (
<div className="newMain clearfix "> <div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{this.state.showmodel === true ? <ShixunWorkModal {this.state.showmodel === true ? <ShixunWorkModal
{...this.props} {...this.props}
visible={this.state.showmodel} visible={this.state.showmodel}
@ -400,58 +406,22 @@ class Workquestionandanswer extends Component {
typs={this.state.typs} typs={this.state.typs}
/> />
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<div className="educontent mb20">
<p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue "
to={"/courses/" + this.props.match.params.coursesId + "/students"}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn
className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
</div>
<div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth:"33px"}}>
{jobsettingsdata === undefined ? "" : jobsettingsdata.data.homework_name}
</p>
<CoursesListType
typelist={jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20"
href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id}`}>返回</a>
<a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a>
</div>
<div className="edu-back-white"> <div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE "> <div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list"> <div className=" clearfix edu-back-white poll_list">
{this.props.isAdmin() === true ? <Link <a onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/list`}>作品列表</Link> :
<Link <a className="active" onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/openlist`}>作品列表</Link>
// :<Link
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/noopenlist`}>作品列表(学生完成)</Link>
}
<Link
className="active"
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin() ? {this.props.isAdmin() ?
this.state.code_review === true || jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0] === "未发布" ? "" : this.state.code_review === true || jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0] === "未发布" ? "" :
<Link <a
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`} // to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}> onClick={(e)=>this.ChangeTab(2)}>
代码查重</Link> : ""} 代码查重</a> : ""}
<Link <a
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`} onClick={(e)=>this.ChangeTab(3)}
>设置</Link> >设置</a>
{/*<a className="fr color-blue font-16" href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xls`}>导出成绩</a>*/}
<style>{` <style>{`
.drop_down_menu li a { .drop_down_menu li a {
padding: 0px; padding: 0px;
@ -483,15 +453,19 @@ class Workquestionandanswer extends Component {
</ul> </ul>
</li> : ""} </li> : ""}
{this.props.isAdmin() ? jobsettingsdata && jobsettingsdata.data.end_immediately === true ? {this.props.isAdmin() ? jobsettingsdata && jobsettingsdata.data.end_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a> : "" : ""} <a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
:""
: ""}
{this.props.isAdmin() ? jobsettingsdata && jobsettingsdata.data.publish_immediately === true ? {this.props.isAdmin() ? jobsettingsdata && jobsettingsdata.data.publish_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> : "" : ""} <a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>
: ""
: ""}
{this.props.isAdmin() ? {this.props.isAdmin() ?
this.state.code_review === true ? jobsettingsdata && jobsettingsdata.data.code_review === true ?
<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a> <a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
: "" : ""} : "" : ""}
</div> </div>
</div> </div>

Loading…
Cancel
Save