|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
|
import {Link,NavLink} from 'react-router-dom';
|
|
|
|
|
import { WordsBtn ,ActionBtn} from 'educoder';
|
|
|
|
|
import React, {Component} from "react";
|
|
|
|
|
import {Link, NavLink} from 'react-router-dom';
|
|
|
|
|
import {WordsBtn, ActionBtn} from 'educoder';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import '../css/members.css';
|
|
|
|
|
import "../common/formCommon.css";
|
|
|
|
@ -14,39 +14,55 @@ import Trainingjobsetting from './Trainingjobsetting'
|
|
|
|
|
import Workquestionandanswer from './Workquestionandanswer'
|
|
|
|
|
import CoursesListType from '../coursesPublic/CoursesListType';
|
|
|
|
|
import ShixunStudentWork from "./ShixunStudentWork";
|
|
|
|
|
import Startshixuntask from "../coursesPublic/Startshixuntask";
|
|
|
|
|
|
|
|
|
|
class ShixunHomeworkPage extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state={
|
|
|
|
|
tab:["0"],
|
|
|
|
|
jobsettingsdata:undefined,
|
|
|
|
|
teacherdata:undefined,
|
|
|
|
|
this.state = {
|
|
|
|
|
tab: ["0"],
|
|
|
|
|
jobsettingsdata: undefined,
|
|
|
|
|
teacherdata: undefined,
|
|
|
|
|
code_review: false,
|
|
|
|
|
view_report: false,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//切换tab
|
|
|
|
|
ChangeTab=(e)=>{
|
|
|
|
|
console.log(e);
|
|
|
|
|
ChangeTab = (e) => {
|
|
|
|
|
// console.log(e);
|
|
|
|
|
this.setState({
|
|
|
|
|
tab:e
|
|
|
|
|
tab: e
|
|
|
|
|
})
|
|
|
|
|
try {
|
|
|
|
|
var currenturl = window.location.href;
|
|
|
|
|
var newUrl = (currenturl.split("?"))[0];
|
|
|
|
|
window.history.pushState('','',newUrl+'?tab='+e);
|
|
|
|
|
}catch (e) {
|
|
|
|
|
console.log(e);
|
|
|
|
|
console.log("44");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Getdataback = (jobsettingsdata,teacherdata)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
jobsettingsdata:jobsettingsdata,
|
|
|
|
|
teacherdata:teacherdata,
|
|
|
|
|
})
|
|
|
|
|
Getdataback = (jobsettingsdata, teacherdata) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
jobsettingsdata: jobsettingsdata,
|
|
|
|
|
teacherdata: teacherdata,
|
|
|
|
|
code_review: teacherdata.code_review,
|
|
|
|
|
view_report: teacherdata.view_report,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
const query =this.props.location.search;
|
|
|
|
|
const query = this.props.location.search;
|
|
|
|
|
const type = query.split('?tab=');
|
|
|
|
|
// let sum = []
|
|
|
|
|
// sum.push(type[1])
|
|
|
|
|
// console.log("componentDidMountcomponentDidMount");
|
|
|
|
|
console.log(type);
|
|
|
|
|
this.setState({
|
|
|
|
|
tab:type[1],
|
|
|
|
|
tab: type[1],
|
|
|
|
|
})
|
|
|
|
|
let querys = this.props.location.pathname;
|
|
|
|
|
const types = querys.split('/');
|
|
|
|
@ -57,11 +73,11 @@ class ShixunHomeworkPage extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {tab,jobsettingsdata,teacherdata}=this.state;
|
|
|
|
|
const isAdmin =this.props.isAdmin();
|
|
|
|
|
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="newMain clearfix ">
|
|
|
|
|
<div className={"educontent mb20"} style={{width: "1200px"}}>
|
|
|
|
|
|
|
|
|
|
<div className="educontent mb20">
|
|
|
|
|
<p className="clearfix mb20 mt10">
|
|
|
|
@ -70,20 +86,20 @@ class ShixunHomeworkPage extends Component {
|
|
|
|
|
<span className="color-grey-9 fl ml3 mr3">></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>
|
|
|
|
|
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">></span>
|
|
|
|
|
<WordsBtn className="fl">作业详情</WordsBtn>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<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}
|
|
|
|
|
</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>
|
|
|
|
|
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>
|
|
|
|
@ -91,21 +107,126 @@ class ShixunHomeworkPage extends Component {
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="edu-back-white ">
|
|
|
|
|
<div className="stud-class-set bor-bottom-greyE ">
|
|
|
|
|
<div className=" clearfix edu-back-white poll_list">
|
|
|
|
|
<a className={parseInt(tab) === 0 ? "active" : ""} onClick={(e) => this.ChangeTab(0)}>作品列表</a>
|
|
|
|
|
<a className={parseInt(tab) === 1 ? "active" : ""} onClick={(e) => this.ChangeTab(1)}>作业问答</a>
|
|
|
|
|
{this.props.isAdmin() ?
|
|
|
|
|
this.state.code_review === true || jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0] === "未发布" ? "" :
|
|
|
|
|
<a
|
|
|
|
|
className={parseInt(tab) === 2 ? "active" : ""}
|
|
|
|
|
onClick={(e) => this.ChangeTab(2)}>
|
|
|
|
|
代码查重</a> : ""}
|
|
|
|
|
{parseInt(tab) === 3?
|
|
|
|
|
<style>{
|
|
|
|
|
`
|
|
|
|
|
.poll_list a.active:after {
|
|
|
|
|
content: '';
|
|
|
|
|
width: 57px;
|
|
|
|
|
left: 10px;
|
|
|
|
|
bottom: 0px;
|
|
|
|
|
height: 2px;
|
|
|
|
|
background-color: #4CACFF;
|
|
|
|
|
position: absolute;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}</style>
|
|
|
|
|
:""}
|
|
|
|
|
<a className={parseInt(tab) === 3 ? "active" : ""}
|
|
|
|
|
onClick={(e) => this.ChangeTab(3)}
|
|
|
|
|
>设置</a>
|
|
|
|
|
{/*{this.props.isAdmin() ? <a*/}
|
|
|
|
|
{/* className="fr color-blue font-16"*/}
|
|
|
|
|
{/* href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}*/}
|
|
|
|
|
{/*>导出</a> : ""}*/}
|
|
|
|
|
<style>{`
|
|
|
|
|
.drop_down_menu li a {
|
|
|
|
|
padding: 0px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
.drop_down_menu {
|
|
|
|
|
width: 93px;
|
|
|
|
|
}
|
|
|
|
|
.drop_down_menu li {
|
|
|
|
|
overflow: visible;
|
|
|
|
|
width: 93px;
|
|
|
|
|
}
|
|
|
|
|
.drop_down_menu, .drop_down_normal {
|
|
|
|
|
padding-top: 10px;
|
|
|
|
|
padding-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
a:hover {
|
|
|
|
|
color:#1A0B00 !important;
|
|
|
|
|
}
|
|
|
|
|
`}</style>
|
|
|
|
|
{this.props.isAdmin() ?
|
|
|
|
|
<li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}>
|
|
|
|
|
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
|
|
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
|
|
|
|
|
<li><a
|
|
|
|
|
onClick={() => this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>实训报告</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a
|
|
|
|
|
onClick={() => this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>学生成绩</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 教师列表
|
|
|
|
|
parseInt(tab)===0 ? (isAdmin===true ?
|
|
|
|
|
<Listofworks {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Listofworks>
|
|
|
|
|
</ul>
|
|
|
|
|
</li> : ""}
|
|
|
|
|
{this.props.isAdmin() ?
|
|
|
|
|
teacherdata && teacherdata.end_immediately === true ?
|
|
|
|
|
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
|
|
|
|
|
: ""
|
|
|
|
|
: ""}
|
|
|
|
|
{this.props.isAdmin() ?
|
|
|
|
|
teacherdata && teacherdata.publish_immediately === true ?
|
|
|
|
|
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>
|
|
|
|
|
: ""
|
|
|
|
|
: ""}
|
|
|
|
|
{this.props.isAdmin() ?
|
|
|
|
|
teacherdata && teacherdata.code_review === true ?
|
|
|
|
|
<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
|
|
|
|
|
: "" : ""}
|
|
|
|
|
{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`}>
|
|
|
|
|
查看实训报告
|
|
|
|
|
</Link> : ""}
|
|
|
|
|
{
|
|
|
|
|
teacherdata === undefined ? ""
|
|
|
|
|
: teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" :
|
|
|
|
|
<a className="fr color-blue font-16"
|
|
|
|
|
href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{teacherdata.commit_des}</a>
|
|
|
|
|
}
|
|
|
|
|
{teacherdata === undefined ? "" : <Startshixuntask
|
|
|
|
|
{...this.props}
|
|
|
|
|
data={teacherdata}
|
|
|
|
|
/>}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</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>)
|
|
|
|
|
<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) === 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>
|
|
|
|
|
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>
|
|
|
|
|
<Trainingjobsetting {...this.props} {...this.state} ChangeTab={(e) => this.ChangeTab(e)}
|
|
|
|
|
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
@ -135,9 +256,9 @@ export default ShixunHomeworkPage;
|
|
|
|
|
//
|
|
|
|
|
// </div>
|
|
|
|
|
// </div>
|
|
|
|
|
{/* </div>*/}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* </div>*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*</div>*/}
|
|
|
|
|
{/*</div>*/
|
|
|
|
|
}
|