From 4b9949f186986ded538b4668d85852750f21fa4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 30 Aug 2019 19:03:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/poll/PollNew.js | 57 ++++++++++++++----- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index bc96ef951..a7e648ab0 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -981,12 +981,17 @@ class PollNew extends Component { } else if (object.question.question_type === 2) { //插入多选题 - if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选的最大限制不能小于最小限制`); + if(object.question.max_choices){ + if(object.question.max_choices>0){ + if (object.question.max_choices < object.question.min_choices) { + this.props.showNotification(`可选的最大限制不能小于最小限制`); - return; + return; + } + } } + var questiontwo = {}; var other = []; var option = []; @@ -1179,12 +1184,20 @@ class PollNew extends Component { // console.log(newarrpoll) } else if (object.question.question_type === 2) { //插入多选题 + if(object.question.max_choices){ + if(object.question.max_choices>0){ + if (object.question.max_choices < object.question.min_choices) { + this.props.showNotification(`可选的最大限制不能小于最小限制`); - if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification('可选的最大限制不能小于最小限制!'); - - return; + return; + } + } } + // if (object.question.max_choices < object.question.min_choices) { + // this.props.showNotification('可选的最大限制不能小于最小限制!'); + // + // return; + // } var questiontwo = {}; var other = []; var option = []; @@ -1461,11 +1474,20 @@ class PollNew extends Component { newarrpoll.splice(thiss.state.Insertposition, 0, question); } else if (object.question.question_type === 2) { //插入多选题 - if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选的最大限制不能小于最小限制`); + if(object.question.max_choices){ + if(object.question.max_choices>0){ + if (object.question.max_choices < object.question.min_choices) { + this.props.showNotification(`可选的最大限制不能小于最小限制`); - return; + return; + } + } } + // if (object.question.max_choices < object.question.min_choices) { + // this.props.showNotification(`可选的最大限制不能小于最小限制`); + // + // return; + // } var questiontwo = {}; var other = []; @@ -1630,11 +1652,20 @@ class PollNew extends Component { // console.log(newarrpoll) } else if (object.question.question_type === 2) { //插入多选题 - if (object.question.max_choices < object.question.min_choices) { - this.props.showNotification(`可选的最大限制不能小于最小限制`); + if(object.question.max_choices){ + if(object.question.max_choices>0){ + if (object.question.max_choices < object.question.min_choices) { + this.props.showNotification(`可选的最大限制不能小于最小限制`); - return; + return; + } + } } + // if (object.question.max_choices < object.question.min_choices) { + // this.props.showNotification(`可选的最大限制不能小于最小限制`); + // + // return; + // } var questiontwo = {}; var other = []; var option = [];