issues25489
杨树明 5 years ago
parent 8e77fa4813
commit d29ce33ca5

@ -4,8 +4,7 @@ import {WordsBtn, ActionBtn} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Tabs
Spin
} from "antd";
import '../css/members.css';
import "../common/formCommon.css";
@ -23,9 +22,6 @@ import Startshixuntask from "../coursesPublic/Startshixuntask";
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
import DownloadMessageysl from "../../modals/DownloadMessageysl";
import Modals from "../../modals/Modals";
const { TabPane } = Tabs;
class ShixunHomeworkPage extends Component {
constructor(props) {
super(props);
@ -121,12 +117,12 @@ class ShixunHomeworkPage extends Component {
/// 重做的确认
ModalSaves=()=>{
this.setState({
ModalsType:false,
Modalstopval:""
});
this.setState({
ModalsType:false,
Modalstopval:""
});
if(this.state.teacherdatapage){
this.resetshixunCombat(this.state.teacherdatapage.myshixun_identifier);
this.resetshixunCombat(this.state.teacherdatapage.myshixun_identifier);
}
try {
console.log("this.child");
@ -153,29 +149,29 @@ class ShixunHomeworkPage extends Component {
}
//重置按钮
resetshixunCombat=(id)=>{
this.setState({
mylistisSpin:true,
this.setState({
mylistisSpin:true,
})
let zrl=`/myshixuns/${id}/reset_my_game.json`;
axios.get(zrl).then((response) => {
// window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges";
this.setState({
mylistisSpin:false,
})
this.child.Isupdatass();
this.props.showNotification("已清空本实训的学习记录\n" +
"\n" +
"请点击“开启挑战”重做实训作业");
}).catch((error) => {
this.setState({
mylistisSpin:false,
})
let zrl=`/myshixuns/${id}/reset_my_game.json`;
axios.get(zrl).then((response) => {
// window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges";
this.setState({
mylistisSpin:false,
})
this.child.Isupdatass();
this.props.showNotification("已清空本实训的学习记录\n" +
"\n" +
"请点击“开启挑战”重做实训作业");
}).catch((error) => {
this.setState({
mylistisSpin:false,
})
console.log(error)
});
console.log(error)
});
}
bindRef = ref => { this.child = ref }
///////////////教师截止
//编辑作业
//编辑作业
Showupdateinstructionsboolfalse (bool) {
this.setState({
Showupdateinstructions:bool
@ -187,105 +183,19 @@ class ShixunHomeworkPage extends Component {
Showupdateinstructions:true
})
}
gotohome=()=>{
gotohome=()=>{
// console.log(this.props)
let {jobsettingsdatapage}=this.state
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`);
}
callback=(key)=>{
this.setState({
tab: key,
})
}
render() {
let {tab, teacherdatapage, jobsettingsdatapage} = this.state;
const isAdmin = this.props.isAdmin();
// console.log(119)
// console.log(jobsettingsdatapage);
// console.log(jobsettingsdatapage);
document.title=jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name;
const operations = <div>
{/*<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;*/}
{/*}*/}
{/*`}</style>*/}
{this.props.isAdmin() ?
<li className="li_line drop_down fr color-blue font-16 ml50">
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
{/*<li><a*/}
{/* onClick={(child,i) => this.confirmysl(this.child,1)}>实训报告</a>*/}
{/*</li>*/}
<li><a
onClick={(child,i) => this.confirmysl(this.child,2)}>学生成绩</a>
</li>
</ul>
</li> : ""}
{this.props.isAdmin() ?
teacherdatapage && teacherdatapage.end_immediately === true ?
<a className="fr color-blue font-16 ml50" onClick={(child)=>this.homeworkendss(this.child)}>立即截止</a>
: ""
: ""}
{this.props.isAdmin() ?
teacherdatapage && teacherdatapage.publish_immediately === true ?
<a className="fr color-blue font-16 ml50" onClick={(child)=>this.homeworkstarts(this.child)}>立即发布</a>
: ""
: ""}
{this.props.isAdmin() ?
teacherdatapage && teacherdatapage.code_review === true ?
<a className="fr color-blue font-16 ml50" onClick={(child)=>this.workshowmodels(this.child)}>代码查重</a>
: "" : ""}
{
parseInt(tab)===1?
this.props.isAdmin() ?
<a className="fr color-blue font-16 ml50" onClick={()=>this.edenwork()}>编辑作业</a>
:""
:""
}
{this.state.view_report === true ? <Link className="fr color-blue font-16 ml50" target={"_blank"}
to={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}>
查看实训报告
</Link> : ""}
{
teacherdatapage === undefined ? ""
: teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" :
<a className="fr color-blue font-16 ml50"
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
}
{teacherdatapage === undefined ? "" : <Startshixuntask
{...this.props}
data={teacherdatapage}
/>}
{this.props.isStudent() ?
(
teacherdatapage&&teacherdatapage.redo_work===true?
<a className="fr color-blue font-16 ml50" onClick={()=>this.Modalcancelss()}>重做</a>
:""
)
: "" }
</div>;
return (
<div className="newMain clearfix ">
<Modals
@ -314,112 +224,138 @@ class ShixunHomeworkPage extends Component {
</div>
}
<div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth: "33px"}}>
{teacherdatapage === undefined ? "" : teacherdatapage.homework_name}
</p>
<CoursesListType
typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20" onClick={()=>this.gotohome()}>返回</a>
<a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a>
</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 || jobsettingsdatapage === undefined ? [""] : jobsettingsdatapage.data.homework_status[0] === "未发布" ? "" :*!/*/}
{/*/!*<a*!/*/}
{/*/!*className={parseInt(tab) === 2 ? "active" : ""}*!/*/}
{/*/!*onClick={(e) => this.ChangeTab(2)}>*!/*/}
{/*/!*代码查重</a> : ""}*!/*/}
{/*/!*{parseInt(tab) === 3?*!/*/}
{/*/!*<style>{this.props.isAdmin()?*!/*/}
{/*/!*`*!/*/}
{/*/!*.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)}*!/*/}
{/*>{this.props.isAdmin()?"设置":"得分规则"}</a>*/}
{/*/!*{this.props.isAdmin() ? <a*!/*/}
{/*/!* className="fr color-blue font-16"*!/*/}
{/*/!* href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}*!/*/}
{/*/!*>导出</a> : ""}*!/*/}
{/**/}
{/**/}
{/**/}
{/*</div>*/}
{/*</div>*/}
{/*</div>*/}
<style>
{
`
.ant-tabs-bar{
margin:0px;
}
.ant-tabs-nav .ant-tabs-tab{
display: inline-block;
padding: 20px;
font-size: 18px;
text-align: center;
position: relative;
color: #05101a;
}
.ant-tabs-nav-wrap{
background-color: #FFF;
}
.ant-tabs-nav-container{
border-bottom: 1px solid #ebedf0;
}
.ant-tabs-nav-container{
background-color: #FFF;
}
.ant-tabs-extra-content{
margin-top: 10px;
margin-right: 20px;
}
.ant-tabs-top-bar{
background-color: #FFF;
}
`
}
</style>
<Tabs defaultActiveKey="1" animated={false} onChange={this.ChangeTab} tabBarExtraContent={operations}>
<TabPane tab="作品列表" key="1">
<Listofworksstudentone triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>
</TabPane>
<TabPane tab="作业描述" key="2">
<Workquestionandanswer triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)} Showupdateinstructionsboolfalse={(i)=>this.Showupdateinstructionsboolfalse(i)}></Workquestionandanswer>
</TabPane>
<TabPane tab="代码查重" key="3">
<ShixunStudentWork triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>
</TabPane>
<TabPane tab={this.props.isAdmin()?"设置":"得分规则"} key="4">
<Trainingjobsetting triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>
</TabPane>
</Tabs>
</Spin>
<div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth: "33px"}}>
{teacherdatapage === undefined ? "" : teacherdatapage.homework_name}
</p>
<CoursesListType
typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20" onClick={()=>this.gotohome()}>返回</a>
<a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a>
</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 || jobsettingsdatapage === undefined ? [""] : jobsettingsdatapage.data.homework_status[0] === "未发布" ? "" :
<a
className={parseInt(tab) === 2 ? "active" : ""}
onClick={(e) => this.ChangeTab(2)}>
代码查重</a> : ""}
{parseInt(tab) === 3?
<style>{this.props.isAdmin()?
`
.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)}
>{this.props.isAdmin()?"设置":"得分规则"}</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;
}
`}</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={(child,i) => this.confirmysl(this.child,1)}>实训报告</a>*/}
{/*</li>*/}
<li><a
onClick={(child,i) => this.confirmysl(this.child,2)}>学生成绩</a>
</li>
</ul>
</li> : ""}
{this.props.isAdmin() ?
teacherdatapage && teacherdatapage.end_immediately === true ?
<a className="fr color-blue font-16" onClick={(child)=>this.homeworkendss(this.child)}>立即截止</a>
: ""
: ""}
{this.props.isAdmin() ?
teacherdatapage && teacherdatapage.publish_immediately === true ?
<a className="fr color-blue font-16" onClick={(child)=>this.homeworkstarts(this.child)}>立即发布</a>
: ""
: ""}
{this.props.isAdmin() ?
teacherdatapage && teacherdatapage.code_review === true ?
<a className="fr color-blue font-16" onClick={(child)=>this.workshowmodels(this.child)}>代码查重</a>
: "" : ""}
{
parseInt(tab)===1?
this.props.isAdmin() ?
<a className="fr color-blue font-16" onClick={()=>this.edenwork()}>编辑作业</a>
:""
:""
}
{this.state.view_report === true ? <Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}>
查看实训报告
</Link> : ""}
{
teacherdatapage === undefined ? ""
: teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" :
<a className="fr color-blue font-16"
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
}
{teacherdatapage === undefined ? "" : <Startshixuntask
{...this.props}
data={teacherdatapage}
/>}
{this.props.isStudent() ?
(
teacherdatapage&&teacherdatapage.redo_work===true?
<a className="fr color-blue font-16" onClick={()=>this.Modalcancelss()}>重做</a>
:""
)
: "" }
</div>
</div>
</div>
{parseInt(tab) === 0 ?<Listofworksstudentone triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>:""}
{parseInt(tab) === 1 ?<Workquestionandanswer triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)} Showupdateinstructionsboolfalse={(i)=>this.Showupdateinstructionsboolfalse(i)}></Workquestionandanswer>:""}
{parseInt(tab) === 2 ?<ShixunStudentWork triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>:""}
{parseInt(tab) === 3 ?<Trainingjobsetting triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>:""}
</Spin>
</div>
</div>
)

Loading…
Cancel
Save