From 6c5ede176438466b2f5adc15a8c070afe9e1860f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 5 Sep 2019 13:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/poll/PollNewQuestbank.js | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index c2d67dde8..919cfa5e7 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -389,7 +389,12 @@ class PollNewQuestbank extends Component { } //添加单选题目 addmysingles = () => { + if (this.state.q_countst > 0) { + this.scrollToAnchor("publishtimeid"); + this.props.showNotification(`不能同时编辑两题`); + return; + } if (this.state.newoption === true) { this.setState({ newoption: false @@ -407,12 +412,17 @@ class PollNewQuestbank extends Component { } this.addMytopic(1, this.state.pollid, Insertposition, false, 0); - this.scrollToAnchor("publishtimeid"); + this.scrollToAnchor("publishtimeids"); } //添加多选题目 addmydoubles = () => { - // console.log("addmymainsint 70") + if (this.state.q_countst > 0) { + this.scrollToAnchor("publishtimeid"); + this.props.showNotification(`不能同时编辑两题`); + + return; + } if (this.state.newoption === true) { this.setState({ newoption: false @@ -431,13 +441,18 @@ class PollNewQuestbank extends Component { } this.addMytopic(2, this.state.pollid, Insertposition, false, 0); - this.scrollToAnchor("publishtimeid"); + this.scrollToAnchor("publishtimeids"); // } } //添加主观题目 addmymainsint = () => { + if (this.state.q_countst > 0) { + this.scrollToAnchor("publishtimeid"); + this.props.showNotification(`不能同时编辑两题`); + return; + } this.setState({ Newdisplay: true, }) @@ -452,15 +467,14 @@ class PollNewQuestbank extends Component { } this.addMytopic(3, this.state.pollid, Insertposition, false, 0); - this.scrollToAnchor("publishtimeid"); + this.scrollToAnchor("publishtimeids"); } //编辑方法 adddomedit = (object) => { - // console.log("adddomedit 76"); if (this.state.q_countst > 0) { this.props.showNotification(`不能同时编辑两题`); - + this.scrollToAnchor("publishtimeids"); return; } var anserbool = false; @@ -630,8 +644,10 @@ class PollNewQuestbank extends Component { console.log("addMytopic"); console.log(id); if (this.state.q_countst > 0) { + if(Whether===true){ + this.scrollToAnchor("publishtimeids"); + } this.props.showNotification(`不能同时编辑两题`); - return; } this.state.Insertposition = Insertposition; @@ -3098,13 +3114,13 @@ class PollNewQuestbank extends Component { { this.state.bindingid && this.state.bindingid === item.question.id ? (this.state.Newdisplay === false ? -