|
|
|
@ -18,18 +18,20 @@ import Workquestionandanswer from './Workquestionandanswer';
|
|
|
|
|
import CoursesListType from '../coursesPublic/CoursesListType';
|
|
|
|
|
import ShixunStudentWork from "./ShixunStudentWork";
|
|
|
|
|
import Startshixuntask from "../coursesPublic/Startshixuntask";
|
|
|
|
|
import HomeworkModal from "../coursesPublic/HomeworkModal";
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
|
|
|
|
|
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
|
|
|
|
|
class ShixunHomeworkPage extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
// this.answerMdRef = React.createRef();
|
|
|
|
|
this.state = {
|
|
|
|
|
tab: ["0"],
|
|
|
|
|
jobsettingsdata: undefined,
|
|
|
|
|
teacherdata: undefined,
|
|
|
|
|
code_review: false,
|
|
|
|
|
view_report: false,
|
|
|
|
|
visible: false,
|
|
|
|
|
showmodel:false,
|
|
|
|
|
child:undefined,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -76,190 +78,33 @@ class ShixunHomeworkPage extends Component {
|
|
|
|
|
shixuntypes: types[3]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//立即发布
|
|
|
|
|
homeworkstart = () => {
|
|
|
|
|
debugger
|
|
|
|
|
let homeworkid = this.props.match.params.homeworkid;
|
|
|
|
|
let url = "/homework_commons/" + homeworkid + "/publish_groups.json";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
let starttime = this.props.getNowFormatDates(1);
|
|
|
|
|
let endtime = this.props.getNowFormatDates(2);
|
|
|
|
|
this.setState({
|
|
|
|
|
modalname: "立即发布",
|
|
|
|
|
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
|
|
|
|
|
svisible: true,
|
|
|
|
|
Topval:"学生将立即收到作业",
|
|
|
|
|
// Botvalleft:"暂不发布",
|
|
|
|
|
Botval:`本操作只对"未发布"的分班有效`,
|
|
|
|
|
starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
|
|
|
|
|
endtime: "截止时间:" + endtime,
|
|
|
|
|
starttimes:starttime,
|
|
|
|
|
typs:"start",
|
|
|
|
|
Cancelname: "暂不发布",
|
|
|
|
|
Savesname: "立即发布",
|
|
|
|
|
Cancel: this.homeworkhide,
|
|
|
|
|
Saves: this.homeworkstartend,
|
|
|
|
|
course_groups: response.data.course_groups,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
confirmysl(child,url) {
|
|
|
|
|
child.confirmysl(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getcourse_groupslist = (id) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
course_groupslist: id
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
homeworkendss(child){
|
|
|
|
|
child.homeworkends();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isupdatas = () => {
|
|
|
|
|
// var homeworkid = this.props.match.params.homeworkid;
|
|
|
|
|
// // this.Gettitleinformation(homeworkid);
|
|
|
|
|
// this.Getalistofworks(homeworkid);
|
|
|
|
|
}
|
|
|
|
|
homeworkstarts(child){
|
|
|
|
|
child.homeworkstart();
|
|
|
|
|
|
|
|
|
|
homeworkhide = () => {
|
|
|
|
|
this.isupdatas()
|
|
|
|
|
this.setState({
|
|
|
|
|
modalname: undefined,
|
|
|
|
|
modaltype: undefined,
|
|
|
|
|
svisible: false,
|
|
|
|
|
Topval: undefined,
|
|
|
|
|
Topvalright: undefined,
|
|
|
|
|
Botvalleft: undefined,
|
|
|
|
|
Botval: undefined,
|
|
|
|
|
starttime: undefined,
|
|
|
|
|
endtime: undefined,
|
|
|
|
|
Cancelname: undefined,
|
|
|
|
|
Savesname: undefined,
|
|
|
|
|
Cancel: undefined,
|
|
|
|
|
Saves: undefined,
|
|
|
|
|
StudentList_value: undefined,
|
|
|
|
|
addname: undefined,
|
|
|
|
|
addnametype: false,
|
|
|
|
|
addnametab: undefined,
|
|
|
|
|
course_groupyslstwo: undefined,
|
|
|
|
|
typs:undefined,
|
|
|
|
|
starttimes:undefined,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 立即发布
|
|
|
|
|
homeworkstartend = (ds,endtime) => {
|
|
|
|
|
var homeworkid = this.props.match.params.homeworkid;
|
|
|
|
|
let {course_groupslist} = this.state;
|
|
|
|
|
|
|
|
|
|
let coursesId = this.props.match.params.coursesId;
|
|
|
|
|
let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json";
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
homework_ids: [homeworkid],
|
|
|
|
|
group_ids: course_groupslist,
|
|
|
|
|
end_time:endtime,
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
if (result.status === 200) {
|
|
|
|
|
if (result.data.status === 0) {
|
|
|
|
|
notification.open({
|
|
|
|
|
message: "提示",
|
|
|
|
|
description: result.data.message
|
|
|
|
|
});
|
|
|
|
|
this.homeworkhide()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//立即截止
|
|
|
|
|
homeworkends = () => {
|
|
|
|
|
let homeworkid = this.props.match.params.homeworkid;
|
|
|
|
|
let url = "/homework_commons/" + homeworkid + "/end_groups.json";
|
|
|
|
|
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
this.setState({})
|
|
|
|
|
this.setState({
|
|
|
|
|
modalname: "立即截止",
|
|
|
|
|
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
|
|
|
|
|
svisible: true,
|
|
|
|
|
Topval:"学生将不能再提交作业",
|
|
|
|
|
// Botvalleft:"暂不截止",
|
|
|
|
|
Botval:`本操作只对"提交中"的分班有效`,
|
|
|
|
|
Cancelname: "暂不截止",
|
|
|
|
|
Savesname: "立即截止",
|
|
|
|
|
Cancel: this.homeworkhide,
|
|
|
|
|
Saves: this.coursetaskend,
|
|
|
|
|
starttime: undefined,
|
|
|
|
|
endtime: undefined,
|
|
|
|
|
course_groups: response.data.course_groups,
|
|
|
|
|
typs:"end",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
workshowmodels(child){
|
|
|
|
|
child.workshowmodel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//立即截止确定按钮
|
|
|
|
|
coursetaskend = () => {
|
|
|
|
|
var homeworkid = this.props.match.params.homeworkid;
|
|
|
|
|
let {course_groupslist} = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const cid = this.props.match.params.coursesId;
|
|
|
|
|
let url = "/courses/" + cid + "/homework_commons/end_homework.json";
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
group_ids: course_groupslist,
|
|
|
|
|
homework_ids: [homeworkid],
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
notification.open({
|
|
|
|
|
message: "提示",
|
|
|
|
|
description: response.data.message
|
|
|
|
|
});
|
|
|
|
|
this.homeworkhide()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
bindRef = ref => { this.child = ref }
|
|
|
|
|
///////////////教师截止
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {tab, jobsettingsdata, teacherdata} = this.state;
|
|
|
|
|
let {tab, teacherdata, jobsettingsdata} = this.state;
|
|
|
|
|
|
|
|
|
|
const isAdmin = this.props.isAdmin();
|
|
|
|
|
return (
|
|
|
|
|
<div className="newMain clearfix ">
|
|
|
|
|
{/*立即发布*/}
|
|
|
|
|
<HomeworkModal
|
|
|
|
|
modaltype={this.state.modaltype}
|
|
|
|
|
modalname={this.state.modalname}
|
|
|
|
|
visible={this.state.svisible}
|
|
|
|
|
Topval={this.state.Topval}
|
|
|
|
|
Topvalright={this.state.Topvalright}
|
|
|
|
|
Botvalleft={this.state.Botvalleft}
|
|
|
|
|
Botval={this.state.Botval}
|
|
|
|
|
starttime={this.state.starttime}
|
|
|
|
|
endtime={this.state.endtime}
|
|
|
|
|
Cancelname={this.state.Cancelname}
|
|
|
|
|
Savesname={this.state.Savesname}
|
|
|
|
|
Cancel={this.state.Cancel}
|
|
|
|
|
Saves={this.state.Saves}
|
|
|
|
|
course_groups={this.state.course_groups}
|
|
|
|
|
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
|
|
|
|
|
starttimes={this.state.starttimes}
|
|
|
|
|
typs={this.state.typs}
|
|
|
|
|
/>
|
|
|
|
|
<div className={"educontent mb20"} style={{width: "1200px"}}>
|
|
|
|
|
|
|
|
|
|
<div className="educontent mb20">
|
|
|
|
@ -348,27 +193,27 @@ class ShixunHomeworkPage extends Component {
|
|
|
|
|
导出<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>
|
|
|
|
|
onClick={(child) => this.confirmysl(this.child,`/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>
|
|
|
|
|
onClick={(child) => this.confirmysl(this.child,`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>学生成绩</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
</li> : ""}
|
|
|
|
|
{this.props.isAdmin() ?
|
|
|
|
|
teacherdata && teacherdata.end_immediately === true ?
|
|
|
|
|
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
|
|
|
|
|
<a className="fr color-blue font-16" onClick={(child)=>this.homeworkendss(this.child)}>立即截止</a>
|
|
|
|
|
: ""
|
|
|
|
|
: ""}
|
|
|
|
|
{this.props.isAdmin() ?
|
|
|
|
|
teacherdata && teacherdata.publish_immediately === true ?
|
|
|
|
|
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>
|
|
|
|
|
<a className="fr color-blue font-16" onClick={(child)=>this.homeworkstarts(this.child)}>立即发布</a>
|
|
|
|
|
: ""
|
|
|
|
|
: ""}
|
|
|
|
|
{this.props.isAdmin() ?
|
|
|
|
|
teacherdata && teacherdata.code_review === true ?
|
|
|
|
|
<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</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"}
|
|
|
|
|
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/shixun_work_report`}>
|
|
|
|
@ -392,21 +237,21 @@ class ShixunHomeworkPage extends Component {
|
|
|
|
|
{
|
|
|
|
|
// 教师列表
|
|
|
|
|
parseInt(tab) === 0 ? (isAdmin === true ?
|
|
|
|
|
<Listofworks {...this.props} {...this.state}
|
|
|
|
|
<Listofworks triggerRef={this.bindRef} {...this.props} {...this.state}
|
|
|
|
|
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworks>
|
|
|
|
|
:
|
|
|
|
|
<Listofworksstudentone {...this.props} {...this.state}
|
|
|
|
|
<Listofworksstudentone triggerRef={this.bindRef} {...this.props} {...this.state}
|
|
|
|
|
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>)
|
|
|
|
|
:
|
|
|
|
|
parseInt(tab) === 1 ?
|
|
|
|
|
<Workquestionandanswer {...this.props} {...this.state}
|
|
|
|
|
<Workquestionandanswer triggerRef={this.bindRef} {...this.props} {...this.state}
|
|
|
|
|
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Workquestionandanswer>
|
|
|
|
|
:
|
|
|
|
|
parseInt(tab) === 2 ?
|
|
|
|
|
<ShixunStudentWork {...this.props} {...this.state}
|
|
|
|
|
<ShixunStudentWork triggerRef={this.bindRef} {...this.props} {...this.state}
|
|
|
|
|
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>
|
|
|
|
|
:
|
|
|
|
|
<Trainingjobsetting {...this.props} {...this.state}
|
|
|
|
|
<Trainingjobsetting triggerRef={this.bindRef} {...this.props} {...this.state}
|
|
|
|
|
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|