dev_cs
杨树林 5 years ago
parent 6dd9345313
commit bc8fef1a6c

@ -1489,6 +1489,11 @@ class Listofworksstudentone extends Component {
// this.Gettitleinformation(homeworkid); // this.Gettitleinformation(homeworkid);
this.Getalistofworks(homeworkid); this.Getalistofworks(homeworkid);
} }
Isupdatass = () => {
var homeworkid = this.props.match.params.homeworkid;
// this.Gettitleinformation(homeworkid);
this.Getalistofworks(homeworkid);
}
/////////老师操作 /////////老师操作
// tearchar=()=>{ // tearchar=()=>{
// var homeworkid = this.props.match.params.homeworkid; // var homeworkid = this.props.match.params.homeworkid;

@ -113,10 +113,21 @@ class ShixunHomeworkPage extends Component {
} }
/// 重做的确认 /// 重做的确认
ModalSaves=()=>{ ModalSaves=()=>{
this.setState({ this.setState({
ModalsType:false, ModalsType:false,
Modalstopval:"" Modalstopval:""
}) });
if(this.state.teacherdatapage){
this.resetshixunCombat(this.state.teacherdatapage.myshixun_identifier);
}
try {
console.log("this.child");
console.log(this.child);
}catch (e) {
}
}; };
//取消重做 //取消重做
ModalCancels=()=>{ ModalCancels=()=>{
@ -133,6 +144,18 @@ class ShixunHomeworkPage extends Component {
ModalsType:true, ModalsType:true,
}) })
} }
//重置按钮
resetshixunCombat=(id)=>{
console.log(id);
let zrl=`/myshixuns/${id}/reset_my_game.json`;
axios.get(zrl).then((response) => {
// window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges";
this.child.Isupdatass();
this.props.showNotification("重置成功");
}).catch((error) => {
console.log(error)
});
}
bindRef = ref => { this.child = ref } bindRef = ref => { this.child = ref }
///////////////教师截止 ///////////////教师截止
gotohome=()=>{ gotohome=()=>{
@ -151,15 +174,15 @@ class ShixunHomeworkPage extends Component {
return ( return (
<div className="newMain clearfix "> <div className="newMain clearfix ">
{/*<Modals*/} <Modals
{/* modalsType={this.state.ModalsType}*/} modalsType={this.state.ModalsType}
{/* modalsTopval={this.state.Modalstopval}*/} modalsTopval={this.state.Modalstopval}
{/* modalsBottomval={this.state.ModalsBottomval}*/} modalsBottomval={this.state.ModalsBottomval}
{/* modalSave={this.ModalSaves}*/} modalSave={this.ModalSaves}
{/* modalCancel={this.ModalCancels}*/} modalCancel={this.ModalCancels}
{/* loadtype={false}*/} loadtype={false}
{/*>*/} >
{/*</Modals>*/} </Modals>
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}> <div className={"educontent mt10 mb20"} style={{width: "1200px"}}>
@ -278,13 +301,18 @@ class ShixunHomeworkPage extends Component {
<a className="fr color-blue font-16" <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> 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>
} }
{this.props.isStudent() ?
(
teacherdatapage&&teacherdatapage.redo_work===true?
<a className="fr color-blue font-16" onClick={()=>this.Modalcancelss()}>重做</a>
:""
)
: "" }
{teacherdatapage === undefined ? "" : <Startshixuntask {teacherdatapage === undefined ? "" : <Startshixuntask
{...this.props} {...this.props}
data={teacherdatapage} data={teacherdatapage}
/>} />}
{/*{this.props.isStudent() ?*/}
{/* <a className="fr color-blue font-16" onClick={()=>this.Modalcancelss()}>重做</a>*/}
{/* : "" }*/}
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save