import React, {Component} from "react"; import {Link, NavLink} from 'react-router-dom'; import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl,markdownToHTML} from 'educoder'; import axios from 'axios'; import { notification, Spin, Table, Pagination, Radio } from "antd"; import './../questioncss/questioncom.css'; 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.' ] 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 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; } } } } } } } 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.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"?编辑
:编辑
} { 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)}> 查看解析
}