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

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

@ -113,10 +113,21 @@ class ShixunHomeworkPage extends Component {
}
/// 重做的确认
ModalSaves=()=>{
this.setState({
ModalsType:false,
Modalstopval:""
})
});
if(this.state.teacherdatapage){
this.resetshixunCombat(this.state.teacherdatapage.myshixun_identifier);
}
try {
console.log("this.child");
console.log(this.child);
}catch (e) {
}
};
//取消重做
ModalCancels=()=>{
@ -133,6 +144,18 @@ class ShixunHomeworkPage extends Component {
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 }
///////////////教师截止
gotohome=()=>{
@ -151,15 +174,15 @@ class ShixunHomeworkPage extends Component {
return (
<div className="newMain clearfix ">
{/*<Modals*/}
{/* modalsType={this.state.ModalsType}*/}
{/* modalsTopval={this.state.Modalstopval}*/}
{/* modalsBottomval={this.state.ModalsBottomval}*/}
{/* modalSave={this.ModalSaves}*/}
{/* modalCancel={this.ModalCancels}*/}
{/* loadtype={false}*/}
{/*>*/}
{/*</Modals>*/}
<Modals
modalsType={this.state.ModalsType}
modalsTopval={this.state.Modalstopval}
modalsBottomval={this.state.ModalsBottomval}
modalSave={this.ModalSaves}
modalCancel={this.ModalCancels}
loadtype={false}
>
</Modals>
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}>
@ -278,13 +301,18 @@ class ShixunHomeworkPage extends Component {
<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>
}
{this.props.isStudent() ?
(
teacherdatapage&&teacherdatapage.redo_work===true?
<a className="fr color-blue font-16" onClick={()=>this.Modalcancelss()}>重做</a>
:""
)
: "" }
{teacherdatapage === undefined ? "" : <Startshixuntask
{...this.props}
data={teacherdatapage}
/>}
{/*{this.props.isStudent() ?*/}
{/* <a className="fr color-blue font-16" onClick={()=>this.Modalcancelss()}>重做</a>*/}
{/* : "" }*/}
</div>
</div>
</div>

Loading…
Cancel
Save