From 651677f9197a69b6666260ec51f2d2a8f8566ce4 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 10:10:19 +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 --- public/react/src/modules/courses/poll/PollNew.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 33a85bf0e..171a27c5e 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -2146,8 +2146,19 @@ class PollNew extends Component { } else { for (var i = 0; i < arr.length; i++) { if (index === i) { - arr[i].question.min_choices = parseInt(value); - arr[i].question.max_choices = length; + try { + if(parseInt(value)===0){ + arr[i].question.min_choices = 2; + arr[i].question.max_choices = length; + }else{ + arr[i].question.min_choices = parseInt(value); + arr[i].question.max_choices = length; + } + }catch (e) { + arr[i].question.min_choices = 2; + arr[i].question.max_choices = length; + } + break; } } this.setState({