Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 5 years ago
commit cdbfaef473

@ -24,7 +24,7 @@ class ShixunHomeworkPage extends Component {
super(props);
// this.answerMdRef = React.createRef();
this.state = {
tab: 0,
tab: ["0"],
jobsettingsdata: undefined,
teacherdata: undefined,
code_review: false,
@ -141,9 +141,8 @@ class ShixunHomeworkPage extends Component {
render() {
let {tab, teacherdata, jobsettingsdata} = this.state;
const isAdmin = this.props.isAdmin();
console.log(tab);
console.log("147147147147147147147");
return (
<div className="newMain clearfix ">
<div className={"educontent mb20"} style={{width: "1200px"}}>
@ -188,8 +187,8 @@ class ShixunHomeworkPage extends Component {
onClick={(e) => this.ChangeTab(2)}>
代码查重</a> : ""}
{parseInt(tab) === 3?
<style>{
`
<style>{
`
.poll_list a.active:after {
content: '';
width: 57px;
@ -200,7 +199,7 @@ class ShixunHomeworkPage extends Component {
position: absolute;
}
`
}</style>
}</style>
:""}
<a className={parseInt(tab) === 3 ? "active" : ""}
onClick={(e) => this.ChangeTab(3)}
@ -280,13 +279,10 @@ class ShixunHomeworkPage extends Component {
/>
{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)}></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>:""}
{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)}></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>:""}
</div>
</div>

@ -76,9 +76,12 @@ class ShixunStudentWork extends Component {
console.log("ShixunStudentWork");
console.log("componentDidMount");
this.props.triggerRef(this);
this.getupdata();
this.getTrainingjobsetting();
this.getTrainingjobsettings();
}
getTrainingjobsettings=()=>{
this.getupdata();
this.getTrainingjobsetting();
}
// 获取数据地方
getTrainingjobsetting = () => {

@ -675,7 +675,7 @@ class MainContentContainer extends Component {
const timeOut = time_limit;
// http://localhost:3000/myshixuns/so5w6iap97/stages/zl6kx8f7vfpo/game_build?first=1&resubmit=GDBEX741_1993
// const game_build_url = `${locationPath}/game_build?first=${first}&resubmit=${resubmit}&content_modified=${content_modified}`
const game_build_url = `/tasks/${game.identifier}/game_build.json?first=${first}&resubmit=${resubmit}&content_modified=${content_modified}&sec_key=${sec_key}`
const game_build_url = `/tasks/${game.identifier}/game_build.json?first=${first}&resubmit=${resubmit}&content_modified=${!!content_modified ? 1 : 0}&sec_key=${sec_key}`
// var timeOut = parseInt(<%= @myshixun.main_mirror.try(:time_limit) %>); // 超时参数

@ -349,6 +349,7 @@ class TPMBanner extends Component {
// });
// }
// reset_my_game
hidestartshixunsreplace=(url)=>{
this.setState({
isSpin:true,
@ -358,7 +359,7 @@ class TPMBanner extends Component {
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
// this.props.history.push(path);
message.success('重置成功,正在进入实训!');
this.startshixunCombat(response.data.shixun_identifier);
this.startshixunCombat(response.data.shixun_identifier, 1);
this.setState({
shixunsreplace:false,
isSpin:false,
@ -379,7 +380,7 @@ class TPMBanner extends Component {
//开始实战按钮
startshixunCombat=(id)=>{
startshixunCombat=(id, reset)=>{
let {shixunsDetails} = this.props
if( shixunsDetails.shixun_status>1){
this.setState({
@ -393,7 +394,10 @@ class TPMBanner extends Component {
}
let url="/shixuns/"+id+"/shixun_exec.json";
let url="/shixuns/"+id+"/shixun_exec.json" ;
if (reset) {
url += '?reset=' + reset
}
axios.get(url).then((response) => {
if(response.status===200){
if(response.data.status===-2){

@ -213,10 +213,7 @@ class LoginRegisterComponent extends Component {
})
return
}
if (this.state.password !== this.state.passwords==="") {
this.openNotification(`两次输入的密码不一致`);
return
}
else if (this.state.password !==undefined&&this.state.password.length>0&&this.state.password.length<8){
this.setState({
Phonenumberisnotcosmmm:"密码不能少于8位",
@ -239,6 +236,13 @@ class LoginRegisterComponent extends Component {
})
return
}
if (this.state.password !== this.state.passwords) {
this.setState({
Phonenumberisnotcosmmm:"两次输入的密码不一致",
Phonenumberisnotcosymmmm:"两次输入的密码不一致",
})
return
}
if (this.state.codes === undefined|| this.state.codes.length ===0 || this.state.codes === "") {
this.setState({
Phonenumberisnotcosyzm:"验证码不能为空"

Loading…
Cancel
Save