dev_forum
杨树林 5 years ago
parent 8c242888b3
commit d28c6e85b7

@ -89,10 +89,6 @@ const Trainingjobsetting= Loadable({
loading: Loading, loading: Loading,
}) })
//实训作业列表教师 //实训作业列表教师
const Listofworks= Loadable({
loader: () => import('./shixunHomework/Listofworks'),
loading: Loading,
})
// //实训作业列表学生未完成的 // //实训作业列表学生未完成的
// const Studentnotcompleted= Loadable({ // const Studentnotcompleted= Loadable({
@ -773,11 +769,6 @@ class CoursesIndex extends Component{
} }
></Route> ></Route>
{/*/!*实训作品列表教师*!/*/} {/*/!*实训作品列表教师*!/*/}
{/*<Route path="/courses/:coursesId/:homeworkid/list"*/}
{/* render={*/}
{/* (props) => (<Listofworks {...this.props} {...props} {...this.state} />)*/}
{/* }*/}
{/*></Route>*/}
{/*提交总结*/} {/*提交总结*/}
<Route path="/courses/:coursesId/shixun_homeworks/:id/commitsummary/:homeworkid" <Route path="/courses/:coursesId/shixun_homeworks/:id/commitsummary/:homeworkid"
render={ render={

@ -66,7 +66,7 @@ class Listofworksstudentone extends Component {
pages: 1, pages: 1,
limit: 20, limit: 20,
loadingstate: true, loadingstate: true,
order: "updated_at", order: "update_time",
search: null, search: null,
day: 0, day: 0,
hour: 0, hour: 0,
@ -96,23 +96,23 @@ class Listofworksstudentone extends Component {
<span> <span>
{record.number === undefined ? {record.number === undefined ?
<span style={{ <span style={{
"color": '#9A9A9A', color: '#9A9A9A',
"text-align": "center" textAlign: "center"
}}> --</span> }}> --</span>
: record.number === "" ? : record.number === "" ?
<span style={{ <span style={{
"color": '#9A9A9A', color: '#9A9A9A',
"text-align": "center" textAlign: "center"
}}>--</span> }}>--</span>
: record.number === "--" ? : record.number === "--" ?
<span style={{ <span style={{
"color": '#9A9A9A', color: '#9A9A9A',
"text-align": "center" textAlign: "center"
}}>--</span> }}>--</span>
: :
<span style={{ <span style={{
"color": '#07111B', color: '#07111B',
"text-align": "center" textAlign: "center"
}}> {record.number}</span> }}> {record.number}</span>
} }
</span> </span>
@ -900,6 +900,8 @@ class Listofworksstudentone extends Component {
}, },
], ],
yslpros:false, yslpros:false,
datajs:[],
} }
// console.log("902"); // console.log("902");
// console.log("902"); // console.log("902");
@ -930,22 +932,34 @@ class Listofworksstudentone extends Component {
// //
// } // }
componentDidMount() { componentDidMount() {
console.log("componentDidMount"); // console.log("componentDidMount ");
// console.log("调用子组件 ");
// console.log(this.props.isAdmin()); // console.log(this.props);
if(this.props.isAdmin() === true){ // console.log(this.props.isAdmin())
this.tearchar();
// console.log("909");
}else{
this.student(); this.student();
// console.log("911");
} }
isupdatas = () => {
var homeworkid = this.props.match.params.homeworkid;
// this.Gettitleinformation(homeworkid);
this.Getalistofworks(homeworkid);
} }
/////////老师操作
// tearchar=()=>{
// var homeworkid = this.props.match.params.homeworkid;
// // console.log(homeworkid)
// // this.Gettitleinformation(homeworkid);
// this.Getalistofworkst(homeworkid);
// let query = this.props.location.pathname;
// const type = query.split('/');
// this.setState({
// shixuntypes: type[3]
// })
// this.props.triggerRef(this)
// }
student=()=>{ student=()=>{
// console.log("914"); // console.log("914");
// debugger // debugger
this.props.triggerRef(this);
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;
@ -953,6 +967,7 @@ class Listofworksstudentone extends Component {
this.setState({ this.setState({
shixuntypes: type[3] shixuntypes: type[3]
}) })
this.props.triggerRef(this);
} }
@ -977,12 +992,11 @@ class Listofworksstudentone extends Component {
course_group: "", course_group: "",
} }
axios.post(urll, data).then((result) => { axios.post(urll, data).then((result) => {
console.log("980000000____________________");
if(result === undefined){ if(result === undefined){
return return
} }
// console.log("951");
// console.log(result);
// debugger
this.setState({ this.setState({
teacherdata: result.data, teacherdata: result.data,
task_status: result.data.task_status, task_status: result.data.task_status,
@ -996,13 +1010,17 @@ class Listofworksstudentone 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,
view_report: result.data.view_report, view_report: result.data.view_report,
allow_late:result.data.allow_late,
loadingstate: false,
}) })
this.props.Getdataback(result,result.data); this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1);
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 {
this.seacthdatas(result.data, result.data.student_works); this.seacthdatas(result.data, result.data.student_works);
} }
this.props.Getdataback(result,result.data);
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
@ -1052,12 +1070,12 @@ 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 {
this.seacthdatas(result.data,result.data.student_works); this.seacthdatas(result.data,result.data.student_works);
} }
this.props.Getdataback(result,result.data);
} }
}).catch((error) => { }).catch((error) => {
@ -1152,7 +1170,8 @@ class Listofworksstudentone extends Component {
if (student_works !== undefined) { if (student_works !== undefined) {
for (var i = 0; i <student_works.length; i++) { for (var i = 0; i <student_works.length; i++) {
// console.log("11157==--=-=-=-=");
// console.log(student_works);
var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm'); var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm');
datalists.push({ datalists.push({
myid: student_works[i].id, myid: student_works[i].id,
@ -1413,8 +1432,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.props.Getdataback(result,result.data);
this.seacthdata(result.data); this.seacthdata(result.data);
this.props.Getdataback(result,result.data);
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -1468,77 +1487,6 @@ class Listofworksstudentone extends Component {
} }
/////////老师操作
tearchar=()=>{
this.props.triggerRef(this)
var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid)
// this.Gettitleinformation(homeworkid);
this.Getalistofworkst(homeworkid);
let query = this.props.location.pathname;
const type = query.split('/');
this.setState({
shixuntypes: type[3]
})
}
isupdatas = () => {
var homeworkid = this.props.match.params.homeworkid;
// this.Gettitleinformation(homeworkid);
this.Getalistofworkst(homeworkid);
}
// 获取作品列表
Getalistofworkst = (homeworkid) => {
// console.log("获取作品列表");7009
// debugger
let urll = `/homework_commons/${homeworkid}/works_list.json`;
// console.log(homeworkid);
// search:搜索关键字
// order:排序方式更新时间update_time最终成绩work_score学号student_id
// b_order:desc倒序 asc顺序
// work_status:0:未提交, 1:按时提交, 2:延时提交,“”不限
// course_group:分班情况 [232, 231] []:不限(空数组)
var data = {
search: "",
order: this.state.orders,
b_order: "desc",
work_status: "",
course_group: "",
page:1,
limit:20,
}
axios.post(urll, data).then((result) => {
if (result) {
// console.log(url)
// console.log("作品列表6789077")
// console.log(JSON.stringify(result))
this.setState({
teacherdata: result.data,
task_status: result.data.task_status,
allow_late:result.data.allow_late,
course_group_info: result.data.course_group_info,
loadingstate: false,
jobsettingsdata: result,
publish_immediately: result.data.publish_immediately,
work_efficiency: result.data.work_efficiency,
end_immediately: result.data.end_immediately,
code_review: result.data.code_review,
challenges_count:result.data.challenges_count,
})
this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1);
this.props.Getdataback(result,result.data);
}
}).catch((error) => {
console.log(error)
this.setState({
loadingstate: false,
})
})
}
//开始排序操作 //开始排序操作
Startsortingt = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => { Startsortingt = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => {
//要提交的作品状态checkedValuesine //要提交的作品状态checkedValuesine
@ -1607,14 +1555,19 @@ class Listofworksstudentone extends Component {
seacthdatat = (teacherdata,student_works,work_efficiency,course_group_info) => { seacthdatat = (teacherdata,student_works,work_efficiency,course_group_info) => {
let {page, limit} = this.state; let {page, limit} = this.state;
let datalist = []; let datalistjs = [];
let columns = this.state.columns; let columns = this.state.columns;
var columns2=[]; var columns2js=[];
if (teacherdata !== undefined) { // console.log("1614++++++++++++++++++++++=");
// console.log(student_works);
// console.log(teacherdata);
if (student_works !== undefined) {
// console.log("1618____________________");
// console.log(student_works);
// console.log("1588"); // console.log("1588");
for (var i = 0; i < student_works.length; i++) { for (var i = 0; i < student_works.length; i++) {
var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm'); var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm');
datalist.push({ datalistjs.push({
myid: student_works[i].id, myid: student_works[i].id,
number: (parseInt(page) - 1) * parseInt(limit) + (i + 1), number: (parseInt(page) - 1) * parseInt(limit) + (i + 1),
name: student_works[i].user_name, name: student_works[i].user_name,
@ -1635,8 +1588,6 @@ class Listofworksstudentone extends Component {
user_name: student_works[i].user_name, user_name: student_works[i].user_name,
user_login: student_works[i].user_login, user_login: student_works[i].user_login,
}) })
// console.log(datalist);
// console.log("1612");
} }
@ -1659,7 +1610,7 @@ class Listofworksstudentone extends Component {
else if(this.props.isNotMember()===true&&item.title==="学号") { else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{ }else{
columns2.push(item); columns2js.push(item);
} }
} }
@ -1677,7 +1628,7 @@ class Listofworksstudentone extends Component {
else if(this.props.isNotMember()===true&&item.title==="学号") { else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{ }else{
columns2.push(item); columns2js.push(item);
} }
} }
@ -1691,7 +1642,7 @@ class Listofworksstudentone extends Component {
else if(this.props.isNotMember()===true&&item.title==="学号") { else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{ }else{
columns2.push(item); columns2js.push(item);
} }
} }
} }
@ -1707,7 +1658,7 @@ class Listofworksstudentone extends Component {
else if(this.props.isNotMember()===true&&item.title==="学号") { else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{ }else{
columns2.push(item); columns2js.push(item);
} }
} }
@ -1723,11 +1674,11 @@ class Listofworksstudentone extends Component {
else if(this.props.isNotMember()===true&&item.title==="学号") { else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{ }else{
columns2.push(item); columns2js.push(item);
} }
} }
} }
columns2=this.state.columnss; columns2js=this.state.columnss;
} }
} }
@ -1737,8 +1688,8 @@ class Listofworksstudentone extends Component {
// console.log(datalist); // console.log(datalist);
// console.log("1712"); // console.log("1712");
this.setState({ this.setState({
data: datalist, datajs: datalistjs,
columns: columns2, columns: columns2js,
loadingstate: false, loadingstate: false,
}) })
} }
@ -2265,18 +2216,19 @@ class Listofworksstudentone extends Component {
}) })
} }
render() { render() {
let {columns,course_groupysls,isAdmin, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; let {columns,course_groupysls,datajs,isAdmin, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state;
// console.log(this.state.data); // console.log(this.state.student_works);
// console.log("841"); // console.log("841");
// console.log(this.state.columns); // console.log(this.state.columns);
// console.log(data); // console.log(datajs);
// console.log("2202"); // console.log("2202");
// console.log(this.props.isAdmin()); // console.log(this.props.isAdmin());
return ( return (
this.props.isAdmin() === true ? this.props.isAdmin() === true ?
(
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}> <div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{visible === true ? <ModulationModal {visible === true ? <ModulationModal
visible={visible} visible={visible}
@ -2518,9 +2470,9 @@ class Listofworksstudentone extends Component {
{orders === "update_time" ? "时间" : orders === "work_score" ? "成绩" : orders === "student_id" ? "学号" : ""}排序</a> {orders === "update_time" ? "时间" : orders === "work_score" ? "成绩" : orders === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 "></i> <i className="iconfont icon-xiajiantou ml5 font-12 "></i>
<ul className="edu-position-hide undis mt10"> <ul className="edu-position-hide undis mt10">
<li> <a onClick={(e) => this.funordert("update_time")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>更新时间</a></li> <li> <a onClick={(e) => this.funordert("update_time")} data-remote="true" className=" font-12" style={{textAlign: "center"}}>更新时间</a></li>
<li> <a onClick={(e) => this.funordert("work_score")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>最终成绩</a></li> <li> <a onClick={(e) => this.funordert("work_score")} data-remote="true" className=" font-12" style={{textAlign: "center"}}>最终成绩</a></li>
<li> <a onClick={(e) => this.funordert("student_id")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>学生学号</a></li> <li> <a onClick={(e) => this.funordert("student_id")} data-remote="true" className=" font-12" style={{textAlign: "center"}}>学生学号</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -2531,13 +2483,13 @@ class Listofworksstudentone extends Component {
</div> </div>
{ {
JSON.stringify(data) === "[]" ? JSON.stringify(datajs) === "[]" ?
<div id="forum_list" className="forum_table"> <div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white"> <div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center"> <div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/> <img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">没有数据可以显示</p> <p className="edu-nodata-p mb30">没有数据可以显示.</p>
</div> </div>
</div> </div>
@ -2558,8 +2510,8 @@ class Listofworksstudentone extends Component {
} }
`}</style> `}</style>
<div className="edu-table edu-back-white ant-tables"> <div className="edu-table edu-back-white ant-tables">
{data === undefined ? "" : <Table {datajs === undefined ? "" : <Table
dataSource={data} dataSource={datajs}
columns={columns} columns={columns}
pagination={false} pagination={false}
loading={loadingstate} loading={loadingstate}
@ -2582,7 +2534,9 @@ class Listofworksstudentone extends Component {
</div> </div>
</div> </div>
)
: :
(
<div> <div>
{ {
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) === "[]" ?
@ -2679,8 +2633,8 @@ class Listofworksstudentone extends Component {
<div> <div>
<div id="graduation_work_list" <div id="graduation_work_list"
style={{ style={{
"padding": '20px 20px 10px 20px', padding: '20px 20px 10px 20px',
"margin-bottom": "10px" marginBottom: "10px"
}}> }}>
<div className="clearfix"> <div className="clearfix">
@ -2694,7 +2648,7 @@ class Listofworksstudentone extends Component {
} }
{teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" :
<span className="ml20" <span className="ml20"
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span> style={{color: '#FF6800'}}>{teacherdata.left_time.time}</span>
} }
</span> </span>
@ -2747,7 +2701,7 @@ class Listofworksstudentone extends Component {
<div className="edu-tab-con-box clearfix edu-txt-center"> <div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" <img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/> src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">没有数据可以显示</p> <p className="edu-nodata-p mb30">没有数据可以显示,,</p>
</div> </div>
</div> </div>
@ -2808,8 +2762,8 @@ class Listofworksstudentone extends Component {
{JSON.stringify(datas) !== "[]" ? {JSON.stringify(datas) !== "[]" ?
<div> <div>
<div id="graduation_work_list" style={{ <div id="graduation_work_list" style={{
"padding": '20px 20px 10px 20px', padding: '20px 20px 10px 20px',
"margin-bottom": "10px" marginBottom: "10px"
}}> }}>
<div className="clearfix"> <div className="clearfix">
<span className="fl color-grey-6 font-12"> <span className="fl color-grey-6 font-12">
@ -2821,7 +2775,7 @@ class Listofworksstudentone extends Component {
<span className="ml20">{teacherdata.left_time.status}</span>} <span className="ml20">{teacherdata.left_time.status}</span>}
{teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" :
<span className="ml20" <span className="ml20"
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>} style={{color: '#FF6800'}}>{teacherdata.left_time.time}</span>}
</span> </span>
<style> <style>
@ -2937,7 +2891,7 @@ class Listofworksstudentone extends Component {
<div className="edu-tab-con-box clearfix edu-txt-center"> <div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" <img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/> src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">没有数据可以显示</p> <p className="edu-nodata-p mb30">没有数据可以显示..</p>
</div> </div>
</div> </div>
@ -2955,6 +2909,7 @@ class Listofworksstudentone extends Component {
</div> </div>
} }
</div> </div>
)
) )
} }

@ -25,8 +25,8 @@ class ShixunHomeworkPage extends Component {
// this.answerMdRef = React.createRef(); // this.answerMdRef = React.createRef();
this.state = { this.state = {
tab: ["0"], tab: ["0"],
jobsettingsdata: undefined, jobsettingsdatapage: undefined,
teacherdata: undefined, teacherdatapage: undefined,
code_review: false, code_review: false,
view_report: false, view_report: false,
visible: false, visible: false,
@ -59,14 +59,15 @@ class ShixunHomeworkPage extends Component {
// console.log(teacherdata); // console.log(teacherdata);
this.setState({ this.setState({
jobsettingsdata: jobsettingsdata, jobsettingsdatapage: jobsettingsdata,
teacherdata: teacherdata, teacherdatapage: teacherdata,
code_review: teacherdata.code_review, code_review: teacherdata.code_review,
view_report: teacherdata.view_report, view_report: teacherdata.view_report,
}) })
} }
componentDidMount() { componentDidMount() {
console.log("父组件加载框");
const query = this.props.location.search; const query = this.props.location.search;
const type = query.split('?tab='); const type = query.split('?tab=');
// let sum = [] // let sum = []
@ -112,7 +113,7 @@ class ShixunHomeworkPage extends Component {
///////////////教师截止 ///////////////教师截止
render() { render() {
let {tab, teacherdata, jobsettingsdata} = this.state; let {tab, teacherdatapage, jobsettingsdatapage} = this.state;
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
@ -123,26 +124,26 @@ class ShixunHomeworkPage extends Component {
<div className="educontent mb20"> <div className="educontent mb20">
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue " <ActionBtn className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn> to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn <ActionBtn
className=" btn colorgrey fl hovercolorblue " 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> to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn> <WordsBtn className="fl">作业详情</WordsBtn>
</p> </p>
</div> </div>
<div className="educontent mb20"> <div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth: "33px"}}> <p className=" fl color-black summaryname" style={{heigth: "33px"}}>
{teacherdata === undefined ? "" : teacherdata.homework_name} {teacherdatapage === undefined ? "" : teacherdatapage.homework_name}
</p> </p>
<CoursesListType <CoursesListType
typelist={teacherdata === undefined ? [""] : teacherdata.homework_status} typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status}
/> />
<a className="color-grey-9 fr font-16 summaryname ml20 mr20" <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> href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>返回</a>
<a className="color-grey-9 fr font-16 mr20" <a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdata === undefined ? "" : teacherdata.shixun_identifier}/challenges`} href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a> target={"_blank"}>实训详情</a>
@ -154,7 +155,7 @@ class ShixunHomeworkPage extends Component {
<a className={parseInt(tab) === 0 ? "active" : ""} onClick={(e) => this.ChangeTab(0)}>作品列表</a> <a className={parseInt(tab) === 0 ? "active" : ""} onClick={(e) => this.ChangeTab(0)}>作品列表</a>
<a className={parseInt(tab) === 1 ? "active" : ""} onClick={(e) => this.ChangeTab(1)}>作业问答</a> <a className={parseInt(tab) === 1 ? "active" : ""} onClick={(e) => this.ChangeTab(1)}>作业问答</a>
{this.props.isAdmin() ? {this.props.isAdmin() ?
this.state.code_review === true || jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0] === "未发布" ? "" : this.state.code_review === true || jobsettingsdatapage === undefined ? [""] : jobsettingsdatapage.data.homework_status[0] === "未发布" ? "" :
<a <a
className={parseInt(tab) === 2 ? "active" : ""} className={parseInt(tab) === 2 ? "active" : ""}
onClick={(e) => this.ChangeTab(2)}> onClick={(e) => this.ChangeTab(2)}>
@ -213,32 +214,32 @@ class ShixunHomeworkPage extends Component {
</ul> </ul>
</li> : ""} </li> : ""}
{this.props.isAdmin() ? {this.props.isAdmin() ?
teacherdata && teacherdata.end_immediately === true ? teacherdatapage && teacherdatapage.end_immediately === true ?
<a className="fr color-blue font-16" onClick={(child)=>this.homeworkendss(this.child)}>立即截止</a> <a className="fr color-blue font-16" onClick={(child)=>this.homeworkendss(this.child)}>立即截止</a>
: "" : ""
: ""} : ""}
{this.props.isAdmin() ? {this.props.isAdmin() ?
teacherdata && teacherdata.publish_immediately === true ? teacherdatapage && teacherdatapage.publish_immediately === true ?
<a className="fr color-blue font-16" onClick={(child)=>this.homeworkstarts(this.child)}>立即发布</a> <a className="fr color-blue font-16" onClick={(child)=>this.homeworkstarts(this.child)}>立即发布</a>
: "" : ""
: ""} : ""}
{this.props.isAdmin() ? {this.props.isAdmin() ?
teacherdata && teacherdata.code_review === true ? teacherdatapage && teacherdatapage.code_review === true ?
<a className="fr color-blue font-16" onClick={(child)=>this.workshowmodels(this.child)}>代码查重</a> <a className="fr color-blue font-16" onClick={(child)=>this.workshowmodels(this.child)}>代码查重</a>
: "" : ""} : "" : ""}
{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.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata&&teacherdata.work_id}/shixun_work_report`}> to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}>
查看实训报告 查看实训报告
</Link> : ""} </Link> : ""}
{ {
teacherdata === undefined ? "" teacherdatapage === undefined ? ""
: teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" : : teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" :
<a className="fr color-blue font-16" <a className="fr color-blue font-16"
href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdata.commit_des}</a> href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
} }
{teacherdata === undefined ? "" : <Startshixuntask {teacherdatapage === undefined ? "" : <Startshixuntask
{...this.props} {...this.props}
data={teacherdata} data={teacherdatapage}
/>} />}
</div> </div>
</div> </div>
@ -252,10 +253,10 @@ class ShixunHomeworkPage extends Component {
{/*/>*/} {/*/>*/}
{parseInt(tab) === 0 ?<Listofworksstudentone key={Math.random()} triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>:""} {parseInt(tab) === 0 ?<Listofworksstudentone triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>:""}
{parseInt(tab) === 1 ?<Workquestionandanswer key={Math.random()} triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Workquestionandanswer>:""} {parseInt(tab) === 1 ?<Workquestionandanswer triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Workquestionandanswer>:""}
{parseInt(tab) === 2 ?<ShixunStudentWork key={Math.random()} triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>:""} {parseInt(tab) === 2 ?<ShixunStudentWork triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>:""}
{parseInt(tab) === 3 ?<Trainingjobsetting key={Math.random()} triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>:""} {parseInt(tab) === 3 ?<Trainingjobsetting triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>:""}
</div> </div>
</div> </div>

@ -78,8 +78,9 @@ class ShixunStudentWork extends Component {
componentDidMount() { componentDidMount() {
console.log("ShixunStudentWork"); console.log("ShixunStudentWork");
console.log("componentDidMount"); console.log("componentDidMount");
this.props.triggerRef(this);
this.getTrainingjobsettings(); this.getTrainingjobsettings();
this.props.triggerRef(this);
} }
// componentWillReceiveProps(nextProps) { // componentWillReceiveProps(nextProps) {
// // console.log("+++++++++916"); // // console.log("+++++++++916");

@ -291,7 +291,7 @@ class ShixunhomeWorkItem extends Component{
} }
`}</style> `}</style>
<h6> <h6>
{/*/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?<a href={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0"} this.props.isAdmin?<a href={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0"}

@ -131,13 +131,14 @@ class Trainingjobsetting extends Component {
componentDidMount() { componentDidMount() {
console.log("Trainingjobsetting"); console.log("Trainingjobsetting");
console.log("componentDidMount"); console.log("componentDidMount");
this.props.triggerRef(this);
this.getTrainingjobsetting(); this.getTrainingjobsetting();
let query = this.props.location.pathname; let query = this.props.location.pathname;
const type = query.split('/'); const type = query.split('/');
this.setState({ this.setState({
shixuntypes:type[3] shixuntypes:type[3]
}) })
this.props.triggerRef(this);
@ -167,7 +168,7 @@ class Trainingjobsetting extends Component {
// console.log(url); // console.log(url);
// console.log(result); // console.log(result);
if (result!=undefined) { if (result!=undefined) {
this.props.Getdataback(result,result.data);
// console.log(result.data.code_review) // console.log(result.data.code_review)
// console.log("设置页") // console.log("设置页")
// console.log(JSON.stringify(result)) // console.log(JSON.stringify(result))
@ -285,6 +286,7 @@ class Trainingjobsetting extends Component {
challenge_settings: result.data.challenge_settings, challenge_settings: result.data.challenge_settings,
code_review:result.data.code_review code_review:result.data.code_review
}) })
this.props.Getdataback(result,result.data);
} }
}) })
@ -2131,7 +2133,7 @@ class Trainingjobsetting extends Component {
}} disabled={!flagPageEdit} className="c_grey mt20 ml30" }} disabled={!flagPageEdit} className="c_grey mt20 ml30"
value={"自定义分值"} style={{"color":"#666666"}}>自定义分值 value={"自定义分值"} style={{"color":"#666666"}}>自定义分值
{testscripttiptype===true? {testscripttiptype===true?
<div className="invite-tipysls clearfix " id="test_script_tip" style={{left: '148px',width: '322px',zIndex: '10'}}> <div className="invite-tipysls clearfix " id="test_script_tip" style={{left: '158px',width: '322px',zIndex: '10'}}>
<span className="right-black-trangles"></span> <span className="right-black-trangles"></span>
<div className="padding20 invitecontent clearfix"> <div className="padding20 invitecontent clearfix">
<p className="font-12 edu-txt-left"> <p className="font-12 edu-txt-left">

@ -84,7 +84,6 @@ class Workquestionandanswer extends Component {
componentDidMount() { componentDidMount() {
console.log("Workquestionandanswer"); console.log("Workquestionandanswer");
console.log("componentDidMount"); console.log("componentDidMount");
this.props.triggerRef(this);
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)
@ -93,6 +92,8 @@ class Workquestionandanswer extends Component {
this.setState({ this.setState({
shixuntypes: type[3] shixuntypes: type[3]
}) })
this.props.triggerRef(this);
} }
// componentWillReceiveProps(nextProps) { // componentWillReceiveProps(nextProps) {
// // console.log("+++++++++916"); // // console.log("+++++++++916");

Loading…
Cancel
Save