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' ] class Listjihe extends Component { constructor(props) { super(props); this.state = { page: 1, name: "单选题", nd: "简单", } } //初始化 componentDidMount() { } //选用 Selectingpracticaltraining = (id) => { let data = { item_ids: [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; } return (
{ items === undefined || items === null ? "" : items.choices.map((object, index) => { return (
:
{ items === undefined || items === null ? "" : items.choices.map((object, index) => { return (
{tagArray[index]}
) }) } }难度:{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.language}
: "" } { items.item_type === "PROGRAM" ? items.program_attr.status === 0 ?未发布
: "" : "" }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 ? "" :this.props.showmodels(items.id)}> 公开
:this.props.showmodels(items.id)}> 公开
: "" }this.props.chakanjiexibool(keindex)}> 查看解析
}:
}
{items ?
items.analysis === undefined || items.analysis === null || items.analysis === "" ?
""
:
items.analysis.length > 0 ?