|
|
import React, {Component} from "react";
|
|
|
import {Link, NavLink} from 'react-router-dom';
|
|
|
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} 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
|
|
|
})
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
render() {
|
|
|
let {page,name,nd,chakanjiexibool}=this.state;
|
|
|
let {defaultActiveKey,items}=this.props;
|
|
|
|
|
|
//console.log("Listjihe");
|
|
|
//console.log(this.props);
|
|
|
return (
|
|
|
<div className={chakanjiexibool===true?"w100s borderwds283 pd20 mb20":"w100s borderwds pd20 mb20"}>
|
|
|
{/*顶部*/}
|
|
|
<div className="w100s sortinxdirection">
|
|
|
<div className="w70s listjihetixingstit">
|
|
|
{
|
|
|
items&&items.name
|
|
|
}
|
|
|
</div>
|
|
|
<div className="w30s xaxisreverseorder">
|
|
|
<p className="listjihetixing">难度:<span className="listjihetixings">{items.difficulty===1?"简单":items.difficulty===2?"适中":items.difficulty===3?"困难":""}</span></p>
|
|
|
<p className="mr30 listjihetixing">题型:<span className="listjihetixings">{items.item_type==="SINGLE"?"单选题":items.item_type==="MULTIPLE"?"多选题":items.item_type==="JUDGMENT"?"判断题":items.item_type==="PROGRAM"?"编程题":""}</span></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
{/*内容*/}
|
|
|
<div className="w100s sortinxdirection">
|
|
|
<p className="w100s listjihetixingstits sortinxdirection">
|
|
|
{
|
|
|
items.item_type==="JUDGMENT"?
|
|
|
items === undefined ||items === null? "" : items.choices.map((object, index) => {
|
|
|
return (
|
|
|
<p className="sortinxdirection ml10">
|
|
|
<Radio checked={object.is_answer}>{
|
|
|
object.choice_text
|
|
|
}</Radio>
|
|
|
</p>
|
|
|
)
|
|
|
})
|
|
|
:
|
|
|
items === undefined ||items === null? "" : items.choices.map((object, index) => {
|
|
|
return (
|
|
|
<p className="sortinxdirection ml10">
|
|
|
{tagArray[index]}
|
|
|
{
|
|
|
object.choice_text
|
|
|
}
|
|
|
</p>
|
|
|
)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
</p>
|
|
|
</div>
|
|
|
|
|
|
{/*更新时间*/}
|
|
|
<div className="w100s sortinxdirection mt22">
|
|
|
<div className="w50s listjihetixingstit sortinxdirection">
|
|
|
<p className="updatetimes lh30">更新时间:{items.update_time}</p>
|
|
|
<p className="updatetimes lh30 ml45">创建者:{items.author.name}</p>
|
|
|
</div>
|
|
|
<div className="w50s xaxisreverseorder">
|
|
|
<p className="selection xiaoshou">
|
|
|
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr10"></i>
|
|
|
<span>选用</span></p>
|
|
|
{
|
|
|
defaultActiveKey===0||defaultActiveKey==="0"?
|
|
|
<div className="xaxisreverseorder">
|
|
|
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodelysl(items.id)}>
|
|
|
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
|
|
|
<span>删除</span>
|
|
|
</p>
|
|
|
<p className="viewparsings xiaoshou mr25">
|
|
|
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
|
|
|
<span>编辑</span>
|
|
|
</p>
|
|
|
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodels(items.id)}>
|
|
|
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
|
|
|
<span>公开</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
:""
|
|
|
}
|
|
|
<p className="viewparsings xiaoshou mr25" onClick={()=>this.chakanjiexibool()}>
|
|
|
<i className="iconfont icon-jiexi font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
|
|
|
查看解析</p>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
{
|
|
|
chakanjiexibool===true?<div>
|
|
|
<div className="w100s questiontypeheng mt23">
|
|
|
|
|
|
</div>
|
|
|
<p className="analysis mt22">解析:</p>
|
|
|
|
|
|
<p className="mt15 testfondex">
|
|
|
|
|
|
{
|
|
|
items.analysis
|
|
|
}
|
|
|
</p>
|
|
|
|
|
|
</div>:""
|
|
|
}
|
|
|
|
|
|
|
|
|
</div>
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
export default Listjihe;
|