From f9ee0733cf7515357f16a0e6bf423210bafcd9d9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 17 Sep 2019 16:14:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=EF=BC=8C=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E5=88=A0=E9=99=A4CD=E9=80=89=E9=A1=B9=EF=BC=8C=E5=86=8D?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E9=A2=98=E5=B9=B2=EF=BC=8C=E4=BC=9A=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E5=88=B0=E8=BF=99=E9=87=8C=EF=BC=8C=E4=B8=94index?= =?UTF-8?q?=E6=98=AF3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/exercise/new/SingleEditor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/react/src/modules/courses/exercise/new/SingleEditor.js b/public/react/src/modules/courses/exercise/new/SingleEditor.js index b3c2842f5..1e2005360 100644 --- a/public/react/src/modules/courses/exercise/new/SingleEditor.js +++ b/public/react/src/modules/courses/exercise/new/SingleEditor.js @@ -182,6 +182,10 @@ class SingleEditor extends Component{ this.setState({ standard_answers }) } onOptionContentChange = (value, index) => { + if (index >= this.state.question_choices.length) { + // TODO 新建,然后删除CD选项,再输入题干,会调用到这里,且index是3 + return; + } let question_choices = this.state.question_choices.slice(0); question_choices[index] = value; this.setState({ question_choices })