From d0ddf9150d0f99deca00bbf474321516bd87157d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 7 Jan 2020 14:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/question/component/Listjihe.js | 59 +++++++++++++++---- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 64559596b..34506150b 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -15,6 +15,11 @@ const tagArray = [ 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.' ] +const tagArrays = [ + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', + 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', + 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' +] class Listjihe extends Component { constructor(props) { super(props); @@ -57,18 +62,36 @@ class Listjihe extends Component { if(items){ if(items.item_type){ if(items.item_type==="PROGRAM"){ + }else{ - if(items.choices){ - if(items.choices.length>0){ - - var arr= items.choices; - for(let data of arr) { - if(data.is_answer===true){ - rightkey=data.choice_text; - break; + if(items.item_type==="JUDGMENT") { + + + if(items.choices){ + if(items.choices.length>0){ + var arr= items.choices; + for(let data of arr) { + if(data.is_answer===true){ + rightkey=data.choice_text; + break; + } } } } + }else { + if (items.choices) { + if (items.choices.length > 0) { + var arr = items.choices; + for (var i = 0; i < arr.length; i++) { + if (arr[i].is_answer === true) { + rightkey = i; + break; + } + } + } + } + + } } } @@ -99,7 +122,7 @@ class Listjihe extends Component { items === undefined ||items === null? "" : items.choices.map((object, index) => { return (
-
-
+ + { + items.item_type==="SINGLE" || items.item_type==="MULTIPLE"? ++
+ : ++
+ } +