parent
c9cbae157d
commit
a6bd369fae
@ -0,0 +1,239 @@
|
|||||||
|
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,
|
||||||
|
Drawer,
|
||||||
|
Input
|
||||||
|
} from "antd";
|
||||||
|
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
|
||||||
|
import NoneData from './component/NoneData';
|
||||||
|
import './testioncss/testioncss.css';
|
||||||
|
import Contentpart from "./component/Contentpart";
|
||||||
|
import SiderBar from "../tpm/SiderBar";
|
||||||
|
import Headplugselection from "../question/component/Headplugselection";
|
||||||
|
|
||||||
|
class Testpaperlibrary extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
Headertop: "",
|
||||||
|
disciplinesdata:null,
|
||||||
|
discipline_id:null,
|
||||||
|
sub_discipline_id:null,
|
||||||
|
tag_discipline_id:null,
|
||||||
|
public:null,
|
||||||
|
difficulty:null,
|
||||||
|
item_type:null,
|
||||||
|
keywords:null,
|
||||||
|
page:1,
|
||||||
|
per_page:10,
|
||||||
|
booljupyterurls:false,
|
||||||
|
Contentdata:[],
|
||||||
|
items_count:0,
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getContainer = () => {
|
||||||
|
return this.container;
|
||||||
|
};
|
||||||
|
saveContainer = container => {
|
||||||
|
this.container = container;
|
||||||
|
};
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
componentDidMount() {
|
||||||
|
let url = `/users/get_navigation_info.json`;
|
||||||
|
axios.get(url, {}).then((response) => {
|
||||||
|
// ////console.log("开始请求/get_navigation_info.json");
|
||||||
|
// ////console.log(response);
|
||||||
|
if (response != undefined) {
|
||||||
|
if (response.status === 200) {
|
||||||
|
this.setState({
|
||||||
|
Headertop: response.data.top,
|
||||||
|
Footerdown: response.data.down
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//获取题库筛选资料
|
||||||
|
let urls = `/disciplines.json`;
|
||||||
|
axios.get(urls, {params: {
|
||||||
|
source:"question"
|
||||||
|
}}).then((response) => {
|
||||||
|
if (response) {
|
||||||
|
this.setState({
|
||||||
|
disciplinesdata: response.data.disciplines,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
paginationonChange=()=>{
|
||||||
|
var data={
|
||||||
|
|
||||||
|
}
|
||||||
|
this.getdata(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择难度
|
||||||
|
setdifficulty=()=>{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
callback=()=>{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//搜索框的内容
|
||||||
|
setdatafunsval=()=>{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//搜索按钮
|
||||||
|
setdatafuns=()=>{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取数据
|
||||||
|
getdata=(data)=>{
|
||||||
|
const url = `/item_banks.json`;
|
||||||
|
this.setState({
|
||||||
|
booljupyterurls:true,
|
||||||
|
})
|
||||||
|
axios.get((url), {params: data}).then((response) => {
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.setState({
|
||||||
|
booljupyterurls:false,
|
||||||
|
})
|
||||||
|
},1000);
|
||||||
|
if (response === null || response === undefined) {
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
////console.log("item_banks");
|
||||||
|
////console.log(response);
|
||||||
|
this.setState({
|
||||||
|
Contentdata: response.data,
|
||||||
|
items_count: response.data.items_count,
|
||||||
|
})
|
||||||
|
}).catch((error) => {
|
||||||
|
////console.log(error)
|
||||||
|
this.setState({
|
||||||
|
booljupyterurls:false,
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
setdiscipline_id=(discipline_id)=>{
|
||||||
|
this.setState({
|
||||||
|
discipline_id:discipline_id,
|
||||||
|
sub_discipline_id:null,
|
||||||
|
tag_discipline_id:null
|
||||||
|
})
|
||||||
|
var data = {
|
||||||
|
discipline_id:discipline_id,
|
||||||
|
sub_discipline_id:null,
|
||||||
|
tag_discipline_id:null,
|
||||||
|
public: this.state.defaultActiveKey,
|
||||||
|
difficulty: this.state.difficulty,
|
||||||
|
item_type: this.state.item_type,
|
||||||
|
keywords: this.state.keywords,
|
||||||
|
page: this.state.page,
|
||||||
|
per_page:10,
|
||||||
|
};
|
||||||
|
this.getdata(data);
|
||||||
|
|
||||||
|
}
|
||||||
|
setsub_discipline_id=(sub_discipline_id)=>{
|
||||||
|
this.setState({
|
||||||
|
sub_discipline_id:sub_discipline_id,
|
||||||
|
tag_discipline_id:null
|
||||||
|
})
|
||||||
|
var data = {
|
||||||
|
discipline_id:this.state.discipline_id,
|
||||||
|
sub_discipline_id:sub_discipline_id,
|
||||||
|
tag_discipline_id:null,
|
||||||
|
public: this.state.defaultActiveKey,
|
||||||
|
difficulty: this.state.difficulty,
|
||||||
|
item_type: this.state.item_type,
|
||||||
|
keywords: this.state.keywords,
|
||||||
|
page: this.state.page,
|
||||||
|
per_page:10,
|
||||||
|
};
|
||||||
|
this.getdata(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
settag_discipline_id=(tag_discipline_id)=>{
|
||||||
|
this.setState({
|
||||||
|
tag_discipline_id:tag_discipline_id
|
||||||
|
})
|
||||||
|
var data = {
|
||||||
|
discipline_id:this.state.discipline_id,
|
||||||
|
sub_discipline_id:this.state.sub_discipline_id,
|
||||||
|
tag_discipline_id:tag_discipline_id,
|
||||||
|
public: this.state.defaultActiveKey,
|
||||||
|
difficulty: this.state.difficulty,
|
||||||
|
item_type: this.state.item_type,
|
||||||
|
keywords: this.state.keywords,
|
||||||
|
page: this.state.page,
|
||||||
|
per_page:10,
|
||||||
|
};
|
||||||
|
this.getdata(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let{Headertop,items_count,page,per_page}=this.state;
|
||||||
|
return (
|
||||||
|
<div className="newMain clearfix" ref={this.saveContainer}>
|
||||||
|
{/*试卷库*/}
|
||||||
|
<SiderBar
|
||||||
|
{...this.props}
|
||||||
|
{...this.state}
|
||||||
|
showDrawer={() => this.showDrawer()}
|
||||||
|
Headertop={Headertop}/>
|
||||||
|
{/*顶部*/}
|
||||||
|
<Headplugselection {...this.props} {...this.state}
|
||||||
|
setdiscipline_id={(e)=>this.setdiscipline_id(e)}
|
||||||
|
setsub_discipline_id={(e)=>this.setsub_discipline_id(e)}
|
||||||
|
settag_discipline_id={(e)=>this.settag_discipline_id(e)}
|
||||||
|
></Headplugselection>
|
||||||
|
{/*头部*/}
|
||||||
|
<Contentpart>
|
||||||
|
|
||||||
|
</Contentpart>
|
||||||
|
{
|
||||||
|
items_count&&items_count>10?
|
||||||
|
<div className="mb30 clearfix educontent mt40 intermediatecenter">
|
||||||
|
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
|
||||||
|
pageSize={per_page}
|
||||||
|
total={items_count}></Pagination>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<div className="h30 clearfix educontent mt40 intermediatecenter">
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SnackbarHOC()(TPMIndexHOC(Testpaperlibrary));
|
@ -0,0 +1,176 @@
|
|||||||
|
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,
|
||||||
|
Tabs,
|
||||||
|
Input,
|
||||||
|
Popover
|
||||||
|
} from "antd";
|
||||||
|
import './../questioncss/questioncom.css';
|
||||||
|
import NoneDatas from '../component/NoneDatas';
|
||||||
|
import LoadingSpin from '../../../common/LoadingSpin';
|
||||||
|
import Contentquestionbank from "./Contentquestionbank";
|
||||||
|
import Listjihe from "./Listjihe";
|
||||||
|
const { TabPane } = Tabs;
|
||||||
|
const Search = Input.Search;
|
||||||
|
class Contentpart extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
page:1,
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//初始化
|
||||||
|
componentDidMount(){
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let {page}=this.state;
|
||||||
|
let {defaultActiveKey}=this.props;
|
||||||
|
const content = (
|
||||||
|
<div className="questiontypes" style={{
|
||||||
|
width:'93px',
|
||||||
|
height:'161px',
|
||||||
|
}}>
|
||||||
|
<p className="questiontype " onClick={()=>this.props.setitem_types("SINGLE")}>单选题</p>
|
||||||
|
<p className="questiontypeheng" ></p>
|
||||||
|
<p className="questiontype " onClick={()=>this.props.setitem_types("MULTIPLE")}>多选题</p>
|
||||||
|
<p className="questiontypeheng"></p>
|
||||||
|
<p className="questiontype " onClick={()=>this.props.setitem_types("JUDGMENT")}>判断题</p>
|
||||||
|
<p className="questiontypeheng"></p>
|
||||||
|
<p className="questiontype " onClick={()=>this.props.setitem_types("PROGRAM")}>编程题</p>
|
||||||
|
<p className="questiontypeheng"></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
const contents = (
|
||||||
|
<div className="questiontypes" style={{
|
||||||
|
width:'93px',
|
||||||
|
height:'120px',
|
||||||
|
}}>
|
||||||
|
<p className="questiontype " onClick={()=>this.props.setdifficulty(1)}>简单</p>
|
||||||
|
<p className="questiontypeheng"></p>
|
||||||
|
<p className="questiontype " onClick={()=>this.props.setdifficulty(2)}>适中</p>
|
||||||
|
<p className="questiontypeheng"></p>
|
||||||
|
<p className="questiontype " onClick={()=>this.props.setdifficulty(3)}>困难</p>
|
||||||
|
<p className="questiontypeheng"></p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<div className=" clearfix mt40">
|
||||||
|
<div className="educontent mt10 pb20 w1200s">
|
||||||
|
<div className="w1200ms contentparttit" style={{
|
||||||
|
position: "relative",
|
||||||
|
}}>
|
||||||
|
<style>
|
||||||
|
{
|
||||||
|
`
|
||||||
|
.contentparttit .ant-tabs-nav .ant-tabs-tab{
|
||||||
|
margin: 10px 10px 10px 0 !important;
|
||||||
|
}
|
||||||
|
.contentparttit .ant-tabs-nav .ant-tabs-ink-bar{
|
||||||
|
width: 31px !important;
|
||||||
|
left: 14px;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<Tabs defaultActiveKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
|
||||||
|
<TabPane tab="公共" key="1">
|
||||||
|
</TabPane>
|
||||||
|
<TabPane tab="我的" key="0">
|
||||||
|
</TabPane>
|
||||||
|
</Tabs>
|
||||||
|
<div className=" mt19" style={{
|
||||||
|
position:"absolute",
|
||||||
|
top: "0px",
|
||||||
|
right:" 0px",
|
||||||
|
paddingRight: "20px",
|
||||||
|
}}>
|
||||||
|
<style>
|
||||||
|
{
|
||||||
|
`
|
||||||
|
.xaxisreverseorder .ant-input-group-addon{
|
||||||
|
width: 60px !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.xaxisreverseorder .ant-input-lg {
|
||||||
|
height: 41px;}
|
||||||
|
|
||||||
|
.xaxisreverseorder .ant-popover{
|
||||||
|
top: 348px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.ant-popover-inner-content {
|
||||||
|
padding:0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
`
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div className="xaxisreverseorder">
|
||||||
|
{
|
||||||
|
defaultActiveKey===0||defaultActiveKey==="0"?
|
||||||
|
<a href={'/question/newitem'}>
|
||||||
|
<div className="newbutoon">
|
||||||
|
<p className="newbutoontes" >新增</p>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
:""
|
||||||
|
}
|
||||||
|
<Popover placement="bottom" content={contents} trigger="click" visible={this.props.visiblemys} onVisibleChange={()=>this.props.handleVisibleChange(true)}>
|
||||||
|
<div className=" sortinxdirection mr10">
|
||||||
|
|
||||||
|
<div className="subjecttit">
|
||||||
|
难度
|
||||||
|
</div>
|
||||||
|
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
|
||||||
|
</div>
|
||||||
|
</Popover>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<Popover placement="bottom" content={content} trigger="click" visible={this.props.visiblemyss} onVisibleChange={()=>this.props.handleVisibleChanges(true)}>
|
||||||
|
<div className="sortinxdirection mr40">
|
||||||
|
<div className="subjecttit">
|
||||||
|
题型
|
||||||
|
</div>
|
||||||
|
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
|
||||||
|
</div>
|
||||||
|
</Popover>
|
||||||
|
<Search
|
||||||
|
style={{ width: "347px",marginRight:"60px",}}
|
||||||
|
placeholder="请输入题目名称、内容"
|
||||||
|
enterButton
|
||||||
|
size="large"
|
||||||
|
onInput={(e)=>this.props.setdatafunsval(e)}
|
||||||
|
onSearch={ (value)=>this.props.setdatafuns(value)} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
export default Contentpart
|
@ -0,0 +1,68 @@
|
|||||||
|
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() {
|
||||||
|
|
||||||
|
return (
|
||||||
|
|
||||||
|
<div className=" clearfix mt5 Contentquestionbankstyle">
|
||||||
|
<div className="educontent mt10 w100s">
|
||||||
|
<div className="sortinxdirection w100s" >
|
||||||
|
<div className="sortinxdirection w50s">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div className="xaxisreverseorder testpaper w50s">
|
||||||
|
共{this.props.items_count?this.props.items_count:0}个试题
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
export default Contentquestionbank ;
|
@ -0,0 +1,37 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import { getImageUrl , getUrl } from 'educoder';
|
||||||
|
|
||||||
|
class NoneData extends Component{
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
}
|
||||||
|
render(){
|
||||||
|
const { style } = this.props;
|
||||||
|
return(
|
||||||
|
<div className="edu-tab-con-box clearfix edu-txt-center intermediatecenter" style={ style || { width:"100%",height:"100%"}}>
|
||||||
|
<style>
|
||||||
|
{`
|
||||||
|
.edu-tab-con-box{
|
||||||
|
padding:100px 0px;
|
||||||
|
}
|
||||||
|
.ant-modal-body .edu-tab-con-box{
|
||||||
|
padding:0px!important;
|
||||||
|
}
|
||||||
|
img.edu-nodata-img{
|
||||||
|
margin: 40px auto 20px;
|
||||||
|
}
|
||||||
|
.zenwuxgsj{
|
||||||
|
font-size:17px;
|
||||||
|
font-family:MicrosoftYaHei;
|
||||||
|
color:rgba(136,136,136,1);
|
||||||
|
}
|
||||||
|
`}
|
||||||
|
</style>
|
||||||
|
<img className="edu-nodata-img mb20" src={getUrl("/images/educoder/nodata.png")}/>
|
||||||
|
<p className="edu-nodata-p mb10 zenwuxgsj">暂无相关数据</p>
|
||||||
|
<p className="edu-nodata-p mb20 mt4 zenwuxgsj">请选择试题进行组卷</p>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export default NoneData;
|
@ -0,0 +1,36 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import { getImageUrl , getUrl } from 'educoder';
|
||||||
|
|
||||||
|
class NoneDatas extends Component{
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
}
|
||||||
|
render(){
|
||||||
|
const { style } = this.props;
|
||||||
|
return(
|
||||||
|
<div className="edu-tab-con-box clearfix edu-txt-center intermediatecenter" style={ style || { width:"100%",height:"100%"}}>
|
||||||
|
<style>
|
||||||
|
{`
|
||||||
|
.edu-tab-con-box{
|
||||||
|
padding:100px 0px;
|
||||||
|
}
|
||||||
|
.ant-modal-body .edu-tab-con-box{
|
||||||
|
padding:0px!important;
|
||||||
|
}
|
||||||
|
img.edu-nodata-img{
|
||||||
|
margin: 40px auto 20px;
|
||||||
|
}
|
||||||
|
.zenwuxgsj{
|
||||||
|
font-size:17px;
|
||||||
|
font-family:MicrosoftYaHei;
|
||||||
|
color:rgba(136,136,136,1);
|
||||||
|
}
|
||||||
|
`}
|
||||||
|
</style>
|
||||||
|
<img className="edu-nodata-img mb20" src={getUrl("/images/educoder/nodata.png")}/>
|
||||||
|
<p className="edu-nodata-p mb10 zenwuxgsj">暂无相关数据</p>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export default NoneDatas;
|
Loading…
Reference in new issue