From fb6fcee96971886f144be425f9345831793422b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Wed, 16 Oct 2019 09:41:11 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=20issues/24746=20?=
=?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A=E4=BD=9C=E4=B8=9A=E6=8F=8F?=
=?UTF-8?q?=E8=BF=B0=E6=A8=A1=E5=9D=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../shixunHomework/ShixunHomeworkPage.js | 24 ++-
.../shixunHomework/Workquestionandanswer.js | 137 ++++++++----------
2 files changed, 87 insertions(+), 74 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
index 0983e0fa6..e34b6356a 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
@@ -40,6 +40,7 @@ class ShixunHomeworkPage extends Component {
ModalsBottomval:"是否确认重做?",
ModalsType:false,
mylistisSpin:false,
+ Showupdateinstructions:false,
}
}
@@ -170,6 +171,18 @@ class ShixunHomeworkPage extends Component {
}
bindRef = ref => { this.child = ref }
///////////////教师截止
+ //编辑作业
+ Showupdateinstructionsboolfalse (bool) {
+ this.setState({
+ Showupdateinstructions:bool
+ })
+ }
+ //开始编辑作业
+ edenwork = ()=>{
+ this.setState({
+ Showupdateinstructions:true
+ })
+ }
gotohome=()=>{
// console.log(this.props)
let {jobsettingsdatapage}=this.state
@@ -304,6 +317,15 @@ class ShixunHomeworkPage extends Component {
teacherdatapage && teacherdatapage.code_review === true ?
this.workshowmodels(this.child)}>代码查重
: "" : ""}
+ {
+ parseInt(tab)===1?
+ this.props.isAdmin() ?
+ this.edenwork()}>编辑作业
+ :""
+ :""
+ }
+
+
{this.state.view_report === true ?
查看实训报告
@@ -335,7 +357,7 @@ class ShixunHomeworkPage extends Component {
{/*modalsType={this.state.DownloadType}*/}
{/*/>*/}
{parseInt(tab) === 0 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""}
- {parseInt(tab) === 1 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""}
+ {parseInt(tab) === 1 ? this.Getdataback(jobsettingsdata, teacherdata)} Showupdateinstructionsboolfalse={(i)=>this.Showupdateinstructionsboolfalse(i)}>:""}
{parseInt(tab) === 2 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""}
{parseInt(tab) === 3 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""}
diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
index 34c484b83..c495222f6 100644
--- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
+++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
@@ -67,7 +67,7 @@ class Workquestionandanswer extends Component {
ealuation: false,
latededuction: undefined,
latedeductiontwo: undefined,
- Showupdateinstructions: false,
+ // Showupdateinstructions: false,
database: false,
datasheet: false,
databasetwo: undefined,
@@ -135,11 +135,11 @@ class Workquestionandanswer extends Component {
console.log(error)
})
}
- jobdescriptiondisplaybj = () => {
- this.setState({
- Showupdateinstructions: true,
- })
- }
+ // jobdescriptiondisplaybj = () => {
+ // this.setState({
+ // Showupdateinstructions: true,
+ // })
+ // }
//统一设置
onChange = (e) => {
@@ -275,13 +275,23 @@ class Workquestionandanswer extends Component {
})
.then((result) => {
if (result) {
- this.props.showNotification(`${result.data.message}`);
- this.setState({
- Showupdateinstructions: false
- })
- var homeworkid = this.props.match.params.homeworkid;
- // console.log(homeworkid)
- this.Gettitleinformation(homeworkid)
+ try {
+ this.props.showNotification(`${result.data.message}`);
+ }catch (e) {
+
+ }
+ try {
+ var homeworkid = this.props.match.params.homeworkid;
+
+ this.Gettitleinformation(homeworkid);
+ }catch (e) {
+
+ }
+ try {
+ this.props.Showupdateinstructionsboolfalse(false);
+ }catch (e) {
+
+ }
}
}).catch((error) => {
console.log(error);
@@ -289,9 +299,7 @@ class Workquestionandanswer extends Component {
}
NOReleaseNotes = () => {
- this.setState({
- Showupdateinstructions: false,
- })
+ this.props.Showupdateinstructionsboolfalse(false);
}
workshowmodel = () => {
this.setState({
@@ -390,7 +398,7 @@ class Workquestionandanswer extends Component {
render() {
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
let {
- starttimetype, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, score_open, Showupdateinstructions
+ starttimetype, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, score_open
, homework_id
} = this.state;
const radioStyle = {
@@ -451,69 +459,52 @@ class Workquestionandanswer extends Component {
- {jobsettingsdata === undefined || jobsettingsdata.data.description === null ?
无
:
-
-
-
-
- {/* /!*{jobsettingsdata.data.description}*!/*/}
- {/* */}
-
- {/*
*/}
- {/*
*/}
- {/* /!*{ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?""*!/*/}
- {/* */}
- {/* /!*}*!/*/}
- {/*
*/}
-
- {/*
*/}
-
-
}
-
-
-
作业说明:
- {
- this.props.isAdmin() && this.props.isAdmin() === true ?
-
- (Showupdateinstructions && Showupdateinstructions === true ? "" :
-
this.jobdescriptiondisplaybj()}>
- ) : ""
- }
-
-
+ {/*{jobsettingsdata === undefined || jobsettingsdata.data.description === null ? 无
:*/}
+ {/* */}
+ {/*
*/}
+ {/* */}
+ {/* */}
+ {/* */}
+ {/*
}*/}
+
+ {/**/}
+ {/*
作业说明:
*/}
+ {/*{*/}
+ {/* this.props.isAdmin() && this.props.isAdmin() === true ?*/}
+
+ {/* (Showupdateinstructions && Showupdateinstructions === true ? "" :*/}
+ {/*
this.jobdescriptiondisplaybj()}>*/}
+ {/* ) : ""*/}
+ {/*}*/}
+
+ {/*
*/}
- {Showupdateinstructions && Showupdateinstructions === true ?
+ {this.props.Showupdateinstructions && this.props.Showupdateinstructions === true ?
- this.ReleaseNotes(explanations)}
+ NOReleaseNotes={()=>this.NOReleaseNotes()}
description={jobsettingsdata === undefined ? "" : jobsettingsdata === null ? "" : jobsettingsdata === "null" ? "" : jobsettingsdata.data.explanation === undefined ? "" : jobsettingsdata.data.explanation === null ? "" : jobsettingsdata.data.explanation}>
:
-
- {jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" :
- jobsettingsdata.data.explanation === undefined ? "无" : jobsettingsdata.data.explanation === null ? "无" :
+
+ {jobsettingsdata === undefined ?
暂无~ : jobsettingsdata === null ?
暂无~ : jobsettingsdata === "null" ?
暂无~ :
+ jobsettingsdata.data.explanation === undefined ?
暂无~ : jobsettingsdata.data.explanation === null ?
暂无~ :
}