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,
	Checkbox
} from "antd";
import './../questioncss/questioncom.css';
class Contentquestionbank extends Component {
	constructor(props) {
		super(props);
		this.state = {
			page:1,
		}
	}
	//初始化
	componentDidMount(){
		//////console.log("componentDidMount");
		//////console.log(this.state);
		//////console.log(this.props);
		// let homeworkid = this.props.match.params.homeworkid;
		// let url = "/homework_commons/" + homeworkid + "/end_groups.json";
		// axios.get(url).then((response) => {
		// 	if (response.status === 200) {
		// 		this.setState({})
		// 	}
		// }).catch((error) => {
		// 	//////console.log(error)
		// });

	}
	onChange=(e)=> {
		//////console.log(`checked = ${e.target.checked}`);
	}

	render() {
		let {page}=this.state;
		let {selectionbools}=this.props;
		let Periofters = false;
		if (this.props) {
			if (this.props.current_user) {
				if (this.props.current_user.admin) {
					Periofters = true;
				}
				else if (this.props.current_user.business) {
					Periofters = true;
				}
				else if (this.props.current_user.is_shixun_marker) {
					Periofters = true;
				}
				else if (this.props.current_user.is_teacher) {
					Periofters = true;
				} else if (this.props.current_user.user_identity !== "学生") {
					Periofters = true;
				}
			}
		}

		return (

			<div className=" clearfix mt10 Contentquestionbankstyle">
				<div className="educontent   w100s">
					<div className="sortinxdirection w100s" >
						{
							Periofters===false?
								<div className="sortinxdirection w50s pl5">

								</div>
								:
								<div className="sortinxdirection w50s pl5">
									{
										selectionbools===true?
											<Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage(this.props.selectallquestionsonthispages)} ></Checkbox>
											:
											<Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage(this.props.selectallquestionsonthispages)}></Checkbox>

									}
									<p className="setequesbank ml20">选用本页全部试题</p>
								</div>

						}
						<div className="xaxisreverseorder testpaper w50s pr5">
							共{this.props.items_count?this.props.items_count:0}个试题
						</div>
					</div>




				</div>
			</div>
		)

	}



}
export default Contentquestionbank ;
