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:"简单", chakanjiexibool:false, } } //初始化 componentDidMount(){ } chakanjiexibool=()=>{ if(this.state.chakanjiexibool===true){ this.setState({ chakanjiexibool:false }) }else{ this.setState({ chakanjiexibool:true }) } } //选用 Selectingpracticaltraining=(id)=>{ let data={ item_ids:[id] } this.props.getitem_baskets(data); } //撤销 Selectingpracticaltrainings=(id)=>{ this.props.getitem_basketss(id); } render() { let {page,name,nd,chakanjiexibool}=this.state; let {defaultActiveKey,items,listjihe}=this.props; ////console.log("Listjihe"); ////console.log(this.props); return (
{/*顶部*/}
{ this.props.listjihe+1 }
.
{/*内容*/}
{items.item_type==="JUDGMENT"?

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

{object.choice_text}

) }) }

: items.item_type==="PROGRAM"?

:

{ 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.choosed===true?

this.Selectingpracticaltrainings(items.id)}> 撤销

:

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

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

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

编辑

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

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

this.chakanjiexibool()}> 查看解析

}
{ chakanjiexibool===true?

:"" }
) } } export default Listjihe;