From 893e637b99f3efdfe851b7ed648441dacafdaf38 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:22:56 +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 | 171 +++++++++++------- 1 file changed, 102 insertions(+), 69 deletions(-) diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 64559596b..0b1f012f5 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); @@ -32,10 +37,10 @@ class Listjihe extends Component { //选用 Selectingpracticaltraining=(id)=>{ - let data={ - item_ids:[id] - } - this.props.getitem_baskets(data); + let data={ + item_ids:[id] + } + this.props.getitem_baskets(data); } //撤销 Selectingpracticaltrainings=(id)=>{ @@ -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; + } + } + } + } + + } } } @@ -94,38 +117,38 @@ class Listjihe extends Component { {/*内容*/}
- { - items === undefined ||items === null? "" : items.choices.map((object, index) => { - return ( -
-
+ { + items === undefined ||items === null? "" : items.choices.map((object, index) => { + return ( +
+
-
-
++
+ + + : ++ { + items === undefined ||items === null? "" : items.choices.map((object, index) => { + return ( +
+ {tagArray[index]} +
+ ) + }) + } - : -- { - items === undefined ||items === null? "" : items.choices.map((object, index) => { - return ( -
- {tagArray[index]} -
- - ) - }) - } - }更新时间:{items.update_time}
+更新时间:{items.update_time}
{ this.props.defaultActiveKey==="0"||this.props.defaultActiveKey===0? "" :创建者:{items.author.name}
} - { - items.item_type==="PROGRAM"? -编程语言:{items.program_attr.language}
- :"" - } + { + items.item_type==="PROGRAM"? +编程语言:{items.program_attr.language}
+ :"" + } { items.item_type==="PROGRAM"? items.program_attr.status===0? @@ -164,22 +187,22 @@ class Listjihe extends Component { 撤销 : - items.item_type==="PROGRAM"? - items.program_attr.status===0? -- - 选用 -
- : -this.Selectingpracticaltraining(items.id)}> + items.item_type==="PROGRAM"? + items.program_attr.status===0? +
选用
: -this.Selectingpracticaltraining(items.id)}> - - 选用 -
+this.Selectingpracticaltraining(items.id)}> + + 选用 +
+ : +this.Selectingpracticaltraining(items.id)}> + + 选用 +
} { defaultActiveKey===0||defaultActiveKey==="0"? @@ -210,17 +233,17 @@ class Listjihe extends Component { items.program_attr.status===0? "" : +this.props.showmodels(items.id)}> + + 公开 +
+ :this.props.showmodels(items.id)}> 公开
- : -this.props.showmodels(items.id)}> - - 公开 -
: - "" + "" }this.props.chakanjiexibool(keindex)}> @@ -245,10 +268,20 @@ class Listjihe extends Component {
-
+ + { + items.item_type==="SINGLE" || items.item_type==="MULTIPLE"? ++
+ : ++
+ } +