import React, { Component } from "react"; import { markdownToHTML } from 'educoder'; import { Radio, Tooltip } from "antd"; import './../questioncss/questioncom.css'; import QuillForEditor from "../../../common/quillForEditor"; const tagArray = [ '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.' ] 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' ] //Paperreview_single.js Paperlibraryseeid_items.js class Listjihe extends Component { constructor(props) { super(props); this.state = { page: 1, name: "单选题", nd: "简单", } } //初始化 componentDidMount() { } //选用 Selectingpracticaltraining = (id) => { let data = {} if (this.props.exam_id === undefined) { data = { item_ids: [id] } } else { data = { item_ids: [id], exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id), } } this.props.getitem_baskets(data); } //撤销 Selectingpracticaltrainings = (id) => { this.props.getitem_basketss(id); } render() { let { page, name, nd } = this.state; let { defaultActiveKey, items, listjihe, chakanjiexiboolindex, keindex } = this.props; // 编程答案 var rightkey = null var MULTIPLEkey = null; if (items) { if (items.item_type) { if (items.item_type === "PROGRAM") { } else { 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.item_type === "MULTIPLE") { 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) { if (MULTIPLEkey === null) { MULTIPLEkey = tagArrays[i]; } else { MULTIPLEkey = MULTIPLEkey + tagArrays[i]; } // 编程答案 var rightkey = null if (items) { if (items.item_type) { if (items.item_type === "PROGRAM") { } else { 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; } } } } } } } } var itemssname=""; try { itemssname= JSON.parse(items.name); }catch (e) { } if(itemssname===undefined){ itemssname=items.name+"" } var itemsnamesy = ""; try { itemsnamesy = JSON.parse(items && items.program_attr && items.program_attr.description); }catch (e) { itemsnamesy=items&&items.program_attr&&items.program_attr.description+""; } var analysisnames = ""; try { analysisnames = JSON.parse(items && items.analysis); }catch (e) { analysisnames=items&&items.analysis+""; } // console.log(items.name); // console.log(itemsnamesy); // // console.log(analysisnames); const options = [ 'bold', // 加粗 ] try { if(itemsnamesy.constructor === Object){ // console.log("是对象"); // console.log(itemsnamesy); }else { // console.log("不是对象"); // console.log(itemsnamesy); itemsnamesy=itemsnamesy+""; } }catch (e) { } return (
{/*顶部*/}
{ this.props.listjihe }.
{ items.item_type==="PROGRAM"?
:
{ items===undefined||items===null||items===""?"": items.name === undefined || items.name === null || items.name === "" ? "" : items.name.length>0? itemssname===null|| itemssname===undefined?"": :"" }
}
{/*内容*/}
{items.item_type === "JUDGMENT" ?

{ items === undefined || items === null ? "" : items.choices.map((object, index) => { return (

{object.choice_text}

) }) }

: items.item_type === "PROGRAM" ?

{ items&&items.program_attr&&items.program_attr.description?

{ itemsnamesy===null || itemsnamesy===undefined? "" : }

:"" }

:

{ items === undefined || items === null ? "" : items.choices.map((object, index) => { var string="" try { string=JSON.parse(object.choice_text); }catch (e) { string=object.choice_text; } return (

{tagArray[index]}

{object ? object.choice_text === undefined || object.choice_text=== null || object.choice_text === "" ? "" : object.choice_text.length>0? :"" : "" }

) }) }

}

难度:{items.difficulty === 1 ? "简单" : items.difficulty === 2 ? "适中" : items.difficulty === 3 ? "困难" : ""}

题型:{items.item_type === "SINGLE" ? "单选题" : items.item_type === "MULTIPLE" ? "多选题" : items.item_type === "JUDGMENT" ? "判断题" : items.item_type === "PROGRAM" ? "编程题" : ""}

{/*更新时间*/}

更新时间:{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.status === 0 ?

未发布

: "" : "" }
{ items.choosed === true ?

this.Selectingpracticaltrainings(items.id)}> {/**/} 撤销

: items.item_type === "PROGRAM" ? items.program_attr.status === 0 ?

选用

:

this.Selectingpracticaltraining(items.id)}> 选用

:

this.Selectingpracticaltraining(items.id)}> 选用

} { defaultActiveKey === 0 || defaultActiveKey === "0" ?

this.props.showmodelysl(items.id)}> 删除

{ items.item_type === "PROGRAM" ? this.props.Isitapopup&&this.props.Isitapopup==="true"? "" :

编辑

: this.props.Isitapopup&&this.props.Isitapopup==="true"? "" :

编辑

} { items.public === false ? items.item_type === "PROGRAM" ? ( items.program_attr.status === 0 ? "" : items.apply===false?

this.props.showmodels(items.id)}> 公开

: ( items.public==true? "" :

this.props.showmodelsInaudit(e)}> 公开审核中

) ) :items.apply===false?

this.props.showmodels(items.id)}> 公开

: ( items.public==true? "" :

this.props.showmodelsInaudit(e)}> 公开审核中

) : "" }
: "" } { items.item_type === "PROGRAM" ? "" :

this.props.chakanjiexibool(keindex)}> 查看解析

}
{ chakanjiexiboolindex === keindex ?
{ items.item_type === "SINGLE" ?

: items.item_type === "MULTIPLE"?

:

}

解析:

{items ? items.analysis=== undefined || items.analysis=== null || items.analysis === "" ? "暂无解析" : items.analysis.length>0? analysisnames===null || analysisnames===undefined?"": : "暂无解析" : "" }

: "" }
) } } export default Listjihe;