Merge branch 'dev_item_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_jupyter

dev_jupyter
杨树林 5 years ago
commit e894edbf45

@ -8,7 +8,7 @@ class ItemBanks::SaveItemForm
validates :item_type, presence: true, inclusion: {in: %W(SINGLE MULTIPLE JUDGMENT COMPLETION SUBJECTIVE PRACTICAL PROGRAM)}
validates :difficulty, presence: true, inclusion: {in: 1..3}, numericality: { only_integer: true }
validates :name, presence: true, length: { maximum: 1000 }
validates :analysis, length: { maximum: 1000 }
validates :analysis, length: { maximum: 5000 }
def validate!
super
@ -27,7 +27,7 @@ class ItemBanks::SaveItemForm
attr_accessor :choice_text, :is_answer
validates :choice_text, presence: true, length: { maximum: 300 }
validates :choice_text, presence: true, length: { maximum: 500 }
validates :is_answer, presence: true, inclusion: {in: 0..1}, numericality: { only_integer: true }
end
end

@ -1,3 +1,3 @@
class ItemAnalysis < ApplicationRecord
belongs_to :item_bank
belongs_to :item_bank, touch: true
end

@ -1,3 +1,3 @@
class ItemChoice < ApplicationRecord
belongs_to :item_bank
belongs_to :item_bank, touch: true
end

@ -1,5 +1,5 @@
class TagDisciplineContainer < ApplicationRecord
belongs_to :tag_discipline
belongs_to :container, polymorphic: true, optional: true
belongs_to :container, polymorphic: true, optional: true, touch: true
end

@ -98,7 +98,7 @@ Rails.application.routes.draw do
resources :examination_intelligent_settings do
collection do
get :optinal_items
post :optinal_items
end
member do

@ -334,7 +334,11 @@ const Paperreview= Loadable({
loading: Loading
})
//智能组卷
const Integeneration= Loadable({
loader: () => import('./modules/testpaper/Intecomponents'),
loading: Loading
})
// 学院统计
const College = Loadable({
@ -754,6 +758,7 @@ class App extends Component {
}
}
/>
<Route path="/myproblems/record_detail/:id"
render={
(props) => (<RecordDetail {...this.props} {...props} {...this.state} />)
@ -764,7 +769,14 @@ class App extends Component {
render={
(props) => (<NewOrEditTask {...this.props} {...props} {...this.state} />)
} />
<Route path="/IntegenerationSee/:type/:id"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperreview/:type"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperlibrary/edit/:id"
render={
(props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)
@ -774,6 +786,7 @@ class App extends Component {
render={
(props) => (<Paperlibraryseeid {...this.props} {...props} {...this.state} />)
}/>
<Route path="/myproblems/:id/:tab?"
render={
(props) => (<StudentStudy {...this.props} {...props} {...this.state} />)
@ -795,9 +808,10 @@ class App extends Component {
render={
(props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperreview"
<Route path="/Integeneration"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
(props) => (<Integeneration {...this.props} {...props} {...this.state} />)
}/>
<Route path="/problems"

@ -82,8 +82,8 @@ export function initAxiosInterceptors(props) {
// proxy = "https://testeduplus2.educoder.net"
//proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net"
//proxy="https://test-jupyterweb.educoder.net"
// proxy="https://test-newweb.educoder.net"
proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求

@ -27,7 +27,7 @@ class NewMyShixunModel extends Component {
super(props);
this.state = {
count: 50,
defaultActiveKey:"0",
defaultActiveKey:"1",
Headertop: "",
Footerdown: "",
visible: false,
@ -148,18 +148,17 @@ class NewMyShixunModel extends Component {
//初始化
componentDidMount() {
let {defaultActiveKey} = this.state;
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
public: defaultActiveKey,
page:1,
per_page:10,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
};
this.getdata(data);
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
defaultActiveKeys="1"
}
this.callback(defaultActiveKeys);
let url = `/users/get_navigation_info.json`;
axios.get(url, {}).then((response) => {
// ////console.log("开始请求/get_navigation_info.json");
@ -190,6 +189,24 @@ class NewMyShixunModel extends Component {
}
});
}
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
debugger
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
defaultActiveKeys="1"
}
this.callback(defaultActiveKeys);
}
}
//公共和我的
callback = (key) => {
this.setState({

@ -51,6 +51,7 @@ class Paperreview extends Component {
name:null,
duration:null,
newmyshixunmodelbool:false,
artificialtype:"artificial",
}
// single_questions:null, 单选题
@ -64,10 +65,27 @@ class Paperreview extends Component {
//初始化
componentDidMount() {
console.log("Paperreview.js");
console.log(this.props.match.params.type);
this.setState({
artificialtype:this.props.match.params.type
})
if(this.props.match.params.type==="artificial"){
//人工组卷
var data = {}
this.getdata(data);
}else{
//智能组卷
//
var data = {
exam_setting_id:this.props.match.params.id
}
this.getdata(data);
}
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
@ -193,6 +211,7 @@ class Paperreview extends Component {
}
preservation = () => {
//保存试卷
if(this.state.artificialtype==="artificial"){
if(this.state.Cohetepaperbool===true){
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
@ -227,6 +246,13 @@ class Paperreview extends Component {
}
}else{
//智能组卷
}
@ -265,7 +291,7 @@ class Paperreview extends Component {
this.getdata(data);
}
render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type,Cohetepaperbool,newmyshixunmodelbool} = this.state;
let {page, limit, count, Headertop, visible, placement, modalsType, item_type,artificialtype,Cohetepaperbool,newmyshixunmodelbool} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
return (
@ -285,7 +311,7 @@ class Paperreview extends Component {
{
newmyshixunmodelbool===true?
<div className="fangdatwo">
<NewMyShixunModel exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
<NewMyShixunModel {...this.props} {...this.state} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
</div>
:
""
@ -305,12 +331,19 @@ class Paperreview extends Component {
<div className="w100s mt30">
{
Cohetepaperbool===false?
artificialtype==="artificial"?
<Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshou"}>人工组卷</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item>
</Breadcrumb>
:
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"/Integeneration"}>智能组卷</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item>
</Breadcrumb>
:
<Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshou"}>新增试卷</Breadcrumb.Item>

@ -26,7 +26,7 @@ class Question extends Component {
super(props);
this.state = {
count: 50,
defaultActiveKey:"0",
defaultActiveKey:"1",
Headertop: "",
Footerdown: "",
visible: false,
@ -72,7 +72,6 @@ class Question extends Component {
}
chakanjiexibool=(index)=>{
debugger
if(this.state.chakanjiexiboolindex===index){
this.setState({
chakanjiexiboolindex:"无",
@ -163,21 +162,8 @@ class Question extends Component {
//初始化
componentDidMount() {
let {defaultActiveKey} = this.state;
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
public: defaultActiveKey,
page:1,
per_page:10,
};
this.getdata(data);
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({
@ -187,9 +173,7 @@ class Question extends Component {
}
}
});
this.getbasket_listdata();
//获取题库筛选资料
let urls = `/disciplines.json`;
axios.get(urls, {params: {
@ -775,7 +759,7 @@ class Question extends Component {
//跳转
gotopaperreview=()=>{
this.props.history.replace("/paperreview");
this.props.history.replace("/paperreview/artificial");
}
@ -816,7 +800,9 @@ class Question extends Component {
+ program_questions_count
+ single_questions_count
+ subjective_questions_count;
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
return (
@ -878,6 +864,19 @@ class Question extends Component {
`
}
</style>
{
isysladmins===true?
<SiderBars
Datacount={Datacount}
myvisible={visible}
{...this.props}
{...this.state}
showDrawer={() => this.showDrawer()}
Headertop={Headertop}
/>
:
is_teacher===true&&professional_certification===true?
<SiderBars
Datacount={Datacount}
myvisible={visible}
@ -887,6 +886,11 @@ class Question extends Component {
Headertop={Headertop}
/>
:
""
}
{/*顶部*/}

@ -36,7 +36,22 @@ class Contentpart extends Component {
chakanjiexibool=(index)=>{
this.props.chakanjiexibool(index);
}
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
debugger
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
defaultActiveKeys="1"
}
this.props.callback(defaultActiveKeys);
}
}
xinzenw=(e)=>{
var urls="?";
if(this.props.discipline_id){
@ -82,6 +97,11 @@ class Contentpart extends Component {
render() {
let {page}=this.state;
let {defaultActiveKey,item_type,booljupyterurls}=this.props;
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
const content = (
<div className="questiontypes" style={{
width:'93px',
@ -114,9 +134,10 @@ class Contentpart extends Component {
</div>
);
const buttonWidth = 70;
//console.log("Contentpart");
//console.log(this.props);
console.log("Contentpart.js");
console.log(this.props.defaultActiveKey);
return (
<div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s">
@ -141,12 +162,23 @@ class Contentpart extends Component {
`
}
</style>
<Tabs defaultActiveKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
{
isysladmins===true||(is_teacher===true&&professional_certification===true)?
<Tabs activeKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
<TabPane tab="我的" key="0">
</TabPane>
</Tabs>
:
<Tabs activeKey={1} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
</Tabs>
}
<div className=" mt19" style={{
position:"absolute",
@ -181,12 +213,14 @@ class Contentpart extends Component {
<div className="xaxisreverseorder">
{
defaultActiveKey===0||defaultActiveKey==="0"?
isysladmins===true||(is_teacher===true&&professional_certification===true)?
<a onClick={(e)=>this.xinzenw(e)}>
<div className="newbutoon">
<p className="newbutoontes" >新增</p>
</div>
</a>
:""
:""
}
{item_type==="PROGRAM"?
@ -208,7 +242,7 @@ class Contentpart extends Component {
{
defaultActiveKey===0||defaultActiveKey==="0"?
<Search
style={{ marginRight:"30px"}}
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"30px"}:{marginRight:"0px"}}
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton

@ -367,15 +367,15 @@ class Itembankstop extends Component {
});
}
handleFormLayoutChange = (value) => {
handleFormLayoutChange = (e) => {
//难度塞选
////console.log("难度塞选");
////console.log(value);
this.props.form.setFieldsValue({
rbnd: value + "",
rbnd: e.target.value + "",
});
this.setState({
rbnd: value + "",
rbnd: e.target.value + "",
})
}
@ -403,8 +403,8 @@ class Itembankstop extends Component {
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
console.log("guonue");
console.log(item);
// console.log("guonue");
// console.log(item);
_result.push(item);
}
});
@ -628,9 +628,9 @@ class Itembankstop extends Component {
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
const {getFieldDecorator} = this.props.form;
console.log("this.state.rbkc");
console.log(this.state.rbkc);
console.log(options);
// console.log("this.state.rbkc");
// console.log(this.state.rbkc);
// console.log(options);
return (
@ -718,13 +718,13 @@ class Itembankstop extends Component {
</div>
)}
</Form.Item>
{
this.state.Knowpoints===undefined||this.state.Knowpoints===null?"":
this.state.Knowpoints.length>0?
<div className="sortinxdirection huanhan w100s mt15" style={{
minHeight: "33px",
lineHeight: "28px",
}}>
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return (
<div key={index} className={index===0?"mytags mb20":"mytags"} style={{
@ -737,11 +737,11 @@ class Itembankstop extends Component {
</div>
)
})}
</div>
:
""
}
<Form.Item
label="题型"

@ -349,17 +349,22 @@ class Listjihe extends Component {
items.program_attr.status === 0 ?
""
:
items.apply===false?
<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>
:
""
:items.apply===false?
<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>

@ -331,15 +331,15 @@ class Comthetestpaperst extends Component {
});
}
handleFormLayoutChange = (value) => {
handleFormLayoutChange = (e) => {
//难度塞选
////console.log("难度塞选");
////console.log(value);
this.props.form.setFieldsValue({
rbnd: value + "",
rbnd: e.target.value + "",
});
this.setState({
rbnd: value + "",
rbnd: e.target.value + "",
})
}
@ -494,6 +494,10 @@ class Comthetestpaperst extends Component {
}
NewknTypedeldel=(bool)=>{
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
return;
}
this.setState({
NewknTypedel:bool
})
@ -524,11 +528,7 @@ class Comthetestpaperst extends Component {
return
}
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
this.setboolred(true);
return;
}
var data={
name:value,
sub_discipline_id:this.state.rbkc[1]
@ -699,29 +699,29 @@ class Comthetestpaperst extends Component {
)}
</Form.Item>
</div>
{
this.state.Knowpoints===undefined||this.state.Knowpoints===null?"":
this.state.Knowpoints.length>0?
<div className="sortinxdirection huanhan w100s mt15" style={{
height: "33px",
minHeight: "33px",
lineHeight: "28px",
}}>
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return (
<div key={index} className="mytags" style={{
<div key={index} className={index===0?"mytags mb20":"mytags"} style={{
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("/images/educoder/bzucha.png")}/>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("images/educoder/bzucha.png")}/>
</div>
)
})}
</div>
:
""
}
<style>
{
`

@ -0,0 +1,794 @@
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,
Form,
Input,
Select,
Cascader,
Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag,Icon
} from "antd";
import './../questioncss/questioncom.css';
import Newknledpots from '../component/Newknledpots';
import Ldanxuan from './lntlligentpone';
const InputGroup = Input.Group;
const {Option} = Select;
//Itembankstop Comthetestpaperst 题库的
class Intelligentcomponents extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef()
this.state = {
page: 1,
Knowpoints: [],
rbtx: undefined,
rbkc: undefined,
knowledgepoints: [],
knowledgepoints2:[],
options: [],
NewknTypedel:false,
boolred:false,
rbly:"1"
}
}
setboolred=(bool)=>{
this.setState({
boolred:bool
})
}
//初始化
componentDidMount() {
try {
this.props.getJudquestio(this);
} catch (e) {
}
this.setState({
options: this.props.disciplmy,
})
}
componentDidUpdate(prevProps) {
//编辑的时候
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
})
this.props.form.setFieldsValue({
rbkc: [name.id,title.id],
});
}
handleSearch=(value)=>{
if(value!=""){
this.props.form.setFieldsValue({
classroom:value,
// course:value
});
// this.Searchvalue(value)
}
};
handleChange=(e)=>{
console.log(e);
if(e.target.value){
if(e.target.value.length>60){
this.setState({
bordebool:true,
})
}else if(e.target.value.length===0){
this.setState({
bordebool:true,
})
}else{
this.setState({
bordebool:false,
})
}
}else{
this.setState({
bordebool:true
})
}
};
handletag_disciplinesChange = (data) => {
//是否选中的知识点
try {
var sju=data[data.length-1].name;
this.setState({
Knowpoints:data,
})
this.props.form.setFieldsValue({
rbzsd: sju,
});
}catch (e) {
}
}
onChange = (e) => {
}
Getdatas = () => {
return this.handleSubmits();
}
handleSubmits = () => {
var dxt=0;
var dxtx=0;
var pdt=0;
var bct=0;
try {
dxt=this.$dxt.mygetinputnumber();
}catch (e) {
dxt=0;
}
try {
dxtx=this.$ddxt.mygetinputnumber();
}catch (e) {
dxtx=0;
}
try {
pdt=this.$pdt.mygetinputnumber();
}catch (e) {
pdt=0;
}
try {
bct=this.$bct.mygetinputnumber();
}catch (e) {
bct=0;
}
var data = [];
this.props.form.validateFields((err, values) => {
data = [];
if (!err) {
data.push({
rbnd: parseInt(values.rbnd)
})
data.push({
rbzsd: this.state.Knowpoints
})
data.push({
rbkc: values.rbkc
})
data.push({
rbdxt: dxt
})
data.push({
rbdxtx: dxtx
})
data.push({
rbpdt: pdt
})
data.push({
rbbct: bct
})
data.push({
rbly: parseInt(values.rbly)
})
}
});
return data;
}
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
////console.log("获取的form 数据");
////console.log(values);
}
});
}
handleFormLayoutChanges = (e) => {
// console.log("handleFormLayoutChanges");
// console.log(value);
// debugger
//来源
this.props.form.setFieldsValue({
rbly: e.target.value + "",
});
this.setState({
rbly: e.target.value + "",
})
}
handleFormLayoutChange = (e) => {
// console.log("handleFormLayoutChange");
// console.log(value);
// debugger
//难度塞选
this.props.form.setFieldsValue({
rbnd: e.target.value + "",
});
this.setState({
rbnd: e.target.value + "",
});
try {
this.props.getdatass(parseInt(e.target.value));
}catch (e) {
}
}
handleFormkechen = (value) => {
//课程
if(this.state.Knowpoints.length>4){
this.props.showNotification(`知识点最多选择5个`);
return
}
var valuename = undefined;
this.props.form.setFieldsValue({
rbzsd: value,
});
var arr = this.state.knowledgepoints;
for (let data of arr) {
if (data.id === value) {
this.state.Knowpoints.push(data);
valuename = data.name;
}
}
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
rbzsd: valuename,
Knowpoints: this.state.Knowpoints,
knowledgepoints2: _result,
})
}
handleFormzhishidian = (value) => {
console.log("handleFormzhishidian 课程");
console.log(value);
//课程
this.props.form.setFieldsValue({
rbkc: value,
});
this.setState({
rbkc:value,
})
// console.log("handleFormzhishidian");
// console.log(this.props.disciplinesdata);
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (value[0] === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (value[1] === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
this.setState({
Knowpoints: [],
knowledgepoints: knowledgepointsdata,
knowledgepoints2:knowledgepointsdata,
})
this.props.form.setFieldsValue({
rbzsd: undefined,
});
this.setState({
rbzsd: undefined,
})
}
handleFormtixing = (value) => {
//题型
//console.log("题型");
//console.log(value);
this.setState({
rbtx: value + "",
})
this.props.form.setFieldsValue({
rbtx: value + "",
});
this.props.setitem_type(value);
}
preventDefault = (e) => {
e.preventDefault();
////console.log('Clicked! But prevent default.');
}
deletesobject = (item, index) => {
debugger
var tmp = this.state.Knowpoints;
for (var i = 0; i < tmp.length; i++) {
if (i ===index) {
tmp.splice(i,1);
}
}
this.props.form.setFieldsValue({
rbzsd: this.state.Knowpoints,
});
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints2:_result,
})
if (this.state.Knowpoints.length === 0) {
this.setState({
rbzsd: undefined,
})
} else if (this.state.Knowpoints.length > 0) {
try {
const myknowda = this.state.Knowpoints;
this.setState({
rbzsd: myknowda[this.state.Knowpoints.length - 1].name,
})
} catch (e) {
}
}
}
NewknTypedeldel=(bool)=>{
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
return;
}
this.setState({
NewknTypedel:bool
})
}
NewknTypedeltyoedel=(value)=>{
var knowledgepointmys= this.state.knowledgepoints;
for(let myda of knowledgepointmys) {
if(myda.name===value){
this.props.showNotification(`重复的知识点`);
this.setboolred(true);
break;
}
}
if(value===null||value===""){
this.props.showNotification(`请输入知识点`);
this.setboolred(true);
return
}
if(value.length===0){
this.props.showNotification(`请输入知识点`);
this.setboolred(true);
return
}
var data={
name:value,
sub_discipline_id:this.state.rbkc[1]
}
const url="/tag_disciplines.json";
axios.post(url,data)
.then((result) => {
if (result.data.status === 0) {
// this.props.showNotification(`新增知识点成功!`);
var leydata={
id: result.data.tag_discipline_id,
name:value,
}
if(this.state.Knowpoints.length>=5){
this.state.knowledgepoints.push(leydata);
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
})
}else{
this.state.Knowpoints.push(leydata);
this.state.knowledgepoints.push(leydata);
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
})
}
}
}).catch((error) => {
//console.log(error);
})
this.setState({
NewknTypedel:false
})
}
render() {
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
const {getFieldDecorator} = this.props.form;
const optionss = this.state.searchlist && this.state.searchlist.map(d => <Option key={d.name} value={d.name}>{d.name}</Option>);
return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
<style>
{
`
.ant-form-item{
margin-bottom: 0px !important;
}
.ant-form-explain{
padding-left:0px !important;
margin-top: 3px !important;
}
.ant-select-selection{
height: 33px !important;
}
.kechen .ant-input-group{
width:258px !important;
}
.zsdd .ant-input-group{
width:258px !important;
}
.sjmc .ant-input-group{
width:258px !important;
}
.kssc .ant-input-group{
width:258px !important;
}
.rbndclass .ant-input-group{
width:258px !important;
}
.ant-input {
height: 33px !important;
}
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
outline: 0px solid rgba(24, 144, 255, 0.06) !important;
}
`
}
</style>
<div className="h12"></div>
{
NewknTypedel?
<Newknledpots {...this.state} {...this.props}
boolred={this.state.boolred}
setboolred={(bool)=>this.setboolred(bool)}
NewknTypedeldel={(bool)=>this.NewknTypedeldel(bool)}
NewknTypedeltyoedel={(value)=>this.NewknTypedeltyoedel(value)}
></Newknledpots>
:""
}
<Form onSubmit={this.handleSubmit}>
<div className="kechen">
<div className="sortinxdirection">
<Form.Item
label="课程"
>
{getFieldDecorator("rbkc"
,
{initialValue: this.state.rbkc,
rules: [{required: true, message: '请选择课程'}],
}
)(
<Cascader style={{width: '258px'}} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/>
)}
</Form.Item>
</div>
</div>
<div className="zsdd">
<Form.Item
label="知识点"
>
{getFieldDecorator("rbzsd"
)(
<div className="sortinxdirection">
<InputGroup compact>
<Select style={{width: '258px'}} value={undefined} onChange={this.handleFormkechen}
placeholder="请选择...">
{knowledgepoints2 && knowledgepoints2.map((object, index) => {
return (
<Option key={object.id} value={object.id}>{object.name}</Option>
)
})}
</Select>
</InputGroup>
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/>
</div>
)}
</Form.Item>
</div>
{
this.state.Knowpoints===undefined||this.state.Knowpoints===null?"":
this.state.Knowpoints.length>0?
<div className="sortinxdirection huanhan w100s mt15" style={{
minHeight: "33px",
lineHeight: "28px",
}}>
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return (
<div key={index} className={index===0?"mytagss mb20":"mytagss"} style={{
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("images/educoder/bzucha.png")}/>
</div>
)
})}
</div>
:
""
}
<style>
{
`
.rbndclasss .ant-radio-button-wrapper{
width:106px !important;
height:33px !important;
background:#EEEEEE;
border-radius:2px;
color:#333333;
text-align: center !important;
border:0px !important;
margin-right: 27px !important;
margin-top: 6px !important;
}
.rbndclasss .ant-radio-button-wrapper-checked {
width: 106px !important;
height: 33px !important;
background: #4CACFF !important;
border-radius:2px;
text-align: center !important;
border:0px !important;
color: #ffffff !important;
margin-right: 27px !important;
margin-top: 6px!important;
}
.rbndclasss .ant-radio-button-wrapper:not(:first-child)::before{
border:0px !important;
width:0px !important;
}
.rbndclasss .ant-radio-button-wrapper{
border:0px !important;
}
.rbndclasss .ant-radio-group{
border:0px !important;
}
.rbndclasss .ant-radio-group label{
border:0px !important;
}
.rbndclasss .ant-radio-group span{
border:0px !important;
}
ant-radio-button-wrapper:focus-within {
outline: 0px solid #ffffff;
}
`
}
</style>
<div className="rbndclasss">
<Form.Item label="来源">
{getFieldDecorator('rbly'
,
{initialValue: this.state.rbly,
}
)(
<Radio.Group onChange={this.handleFormLayoutChanges}>
<Radio.Button value="1">公共</Radio.Button>
<Radio.Button value="0">我的</Radio.Button>
</Radio.Group>,
)}
</Form.Item>
</div>
<p className="conditionsetting mt40">条件设置</p>
<div className="hengxians mt13"></div>
<style>
{
`
.rbndclass .ant-radio-button-wrapper{
width:106px !important;
height:33px !important;
background:#EEEEEE;
border-radius:17px !important;
color:#333333;
text-align: center !important;
border:0px !important;
margin-right: 27px !important;
margin-top: 6px !important;
}
.rbndclass .ant-radio-button-wrapper-checked {
width: 106px !important;
height: 33px !important;
background: #4CACFF !important;
border-radius: 17px !important;
text-align: center !important;
border:0px !important;
color: #ffffff !important;
margin-right: 27px !important;
margin-top: 6px!important;
}
.rbndclass .ant-radio-button-wrapper:not(:first-child)::before{
border:0px !important;
width:0px !important;
}
.rbndclass .ant-radio-button-wrapper{
border:0px !important;
}
.rbndclass .ant-radio-group{
border:0px !important;
}
.rbndclass .ant-radio-group label{
border:0px !important;
}
.rbndclass .ant-radio-group span{
border:0px !important;
}
ant-radio-button-wrapper:focus-within {
outline: 0px solid #ffffff;
}
`
}
</style>
<div className="rbndclass">
<Form.Item label="试卷难度">
{getFieldDecorator('rbnd'
,
{initialValue: this.state.rbnd,
rules: [{required: true, message: '请选择难度'}],
}
)(
<Radio.Group onChange={this.handleFormLayoutChange}>
<Radio.Button value="1">简单</Radio.Button>
<Radio.Button value="2">适中</Radio.Button>
<Radio.Button value="3">困难</Radio.Button>
</Radio.Group>,
)}
</Form.Item>
</div>
</Form>
<p className={"conditionsettings mt40"}>题型及数量</p>
<div className={"hengxians mt13"}></div>
<Ldanxuan {...this.state} {...this.props} dxtx={"单选题:"} mycount={this.props.single_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$dxt = dom;
}}></Ldanxuan>
<Ldanxuan {...this.state} {...this.props} dxtx={"多选题:"} mycount={this.props.multiple_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$ddxt = dom;
}}></Ldanxuan>
<Ldanxuan {...this.state} {...this.props} dxtx={"判断题:"} mycount={this.props.judgement_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$pdt = dom;
}}></Ldanxuan>
<Ldanxuan {...this.state} {...this.props} dxtx={"编程题:"} mycount={this.props.program_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$bct = dom;
}}></Ldanxuan>
<div className="h20"></div>
</div>
)
}
}
const Intelligentcomponentss = Form.create({name: 'Intelligentcomponents'})(Intelligentcomponents);
export default Intelligentcomponentss;

@ -0,0 +1,169 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl, markdownToHTML} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb,
Icon,
InputNumber,
Tooltip
} from "antd";
import '../questioncss/questioncom.css';
//判断题
class lntlligentpone extends Component {
constructor(props) {
super(props);
this.state = {
count: 0,
countbool: false,
}
}
//初始化
componentDidMount() {
}
increase = () => {
const datasbool=this.props.getdatas();
// if(datasbool===undefined || datasbool===null){
// if(this.props.mycount===0){
// this.props.showNotification(`题数为0无法增加题目`);
// return
// }
//
// }
const count = this.state.count + 1;
if(count<=this.props.mycount){
this.setState({count: count, countbool: false});
}
};
decline = () => {
const datasbool=this.props.getdatas();
// if(datasbool===undefined || datasbool===null){
// if(this.props.mycount===0){
// this.props.showNotification(`题数为0无法减少题目`);
// return
// }
// }
let count = this.state.count - 1;
if (count < 0) {
count = 0;
}
this.setState({count: count, countbool: false});
};
inputsnumber = (value) => {
const datasbool=this.props.getdatas();
// if(datasbool===undefined || datasbool===null){
// if(this.props.mycount===0){
// this.setState({count: 0, countbool: false});
// this.props.showNotification(`题数为0无法输入`);
// return
// }
// }
if(this.props.mycount===0){
this.setState({count: 0, countbool: false});
}else {
this.setState({count: value, countbool: false});
}
}
//返回数据
mygetinputnumber=()=>{
return this.state.count;
}
isNumber=(val)=>{
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
if(regPos.test(val) && regNeg.test(val)){
return true;
}else{
return false;
}
}
render() {
let {questions, totalscore, total, items} = this.state;
return (
<div>
<p className="dxuantitie mt19">{this.props.dxtx}</p>
{
this.props.mycount===0?
<div className="sortinxdirection mt10 inpustredssdiv">
<Tooltip placement="top" title={"题数为0无法减少"}>
<Button disabled={this.props.mycount===0?true:false} onClick={this.decline}>
<Icon type="minus"/>
</Button>
</Tooltip>
<div className={this.state.countbool === true ? "inpustredss ml12 mr12" : "ml12 mr12"}>
<Tooltip placement="top" title={"题数为0无法输入"}>
<InputNumber
disabled={this.props.mycount===0?true:false}
min={0}
value={this.state.count}
onChange={this.inputsnumber}
></InputNumber>
</Tooltip>
</div>
<Tooltip placement="top" title={"题数为0无法增加"}>
<Button disabled={this.props.mycount===0?true:false} onClick={this.increase}>
<Icon type="plus"/>
</Button>
</Tooltip>
<p className={"ml23 lh32"}>{this.props.mycount}</p>
</div>
:
<div className="sortinxdirection mt10 inpustredssdiv">
<Button onClick={this.decline}>
<Icon type="minus"/>
</Button>
<div className={this.state.countbool === true ? "inpustredss ml12 mr12" : "ml12 mr12"}>
<InputNumber
min={0}
value={this.state.count}
onChange={this.inputsnumber}
></InputNumber>
</div>
<Button onClick={this.increase}>
<Icon type="plus"/>
</Button>
<p className={"ml23 lh32"}>{this.props.mycount}</p>
</div>
}
</div>
)
}
}
export default lntlligentpone

@ -524,7 +524,14 @@
margin-top: 19px;
}
.mytags{
min-width:106px;
min-width:106px !important;
height:32px;
border-radius:2px;
border:1px solid #DDDDDD;
margin-right: 20px;
}
.mytagss{
min-width:106px !important;
height:32px;
border-radius:2px;
border:1px solid #DDDDDD;
@ -970,3 +977,48 @@
.mt15{
margin-top: 15px;
}
.conditionsetting{
width:64px;
height:21px;
font-size:16px;
color:#333333;
line-height:21px;
}
.hengxians{
width:1021px;
height:1px;
background: #EEEEEE;
}
.mt13{
margin-top: 13px;
}
.inpustredss .ant-input-number{
border: 1px solid #f30707;
border-radius: 5px;
}
.inpustredssdiv button {
border-radius: 50%;
width: 38px;
height: 38px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.inpustredssdiv .ant-input-number-input{
text-align: center;
}
.lh32{
line-height: 32px;
}
.ml23{
margin-left: 23px;
}
.ml12{
margin-left: 12px;
}
.mr12{
margin-right: 12px;
}

@ -0,0 +1,347 @@
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,
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import './testioncss/testioncss.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Intelligentcomponents from "../question/comthetestpaper/Intelligentcomponents";
//试卷编辑
class Intecomponents extends Component {
constructor(props) {
super(props);
this.Judquestio = React.createRef();
this.state = {
paperlibrartdata: [],
disciplinesdata: [],
knowledgepoints: [],
disciplmy: [],
item_banksedit: [],
newmyshixunmodelbool:false,
single_question_count:0,
multiple_question_count:0,
judgement_question_count:0,
program_question_count:0,
}
}
getJudquestio = (Ref) => {
console.log("子组件对象");
console.log(Ref);
this.Judquestio = Ref;
}
//初始化
componentDidMount() {
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
source: "question"
}
}).then((response) => {
if (response) {
this.setState({
disciplinesdata: response.data.disciplines,
})
if (response.data) {
if (response.data.disciplines) {
const didata = response.data.disciplines;
for (var i = 0; i < didata.length; i++) {
const childern = [];
//方向
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
const zsddata = fxdidata[j].tag_disciplines;
childern.push(
{
value: fxdidata[j].id,
label: fxdidata[j].name,
}
)
for (var k = 0; k < zsddata.length; k++) {
//知识点
this.state.knowledgepoints.push(zsddata[k]);
}
}
const datakec = {
value: didata[i].id,
label: didata[i].name,
children: childern,
}
this.state.disciplmy.push(datakec);
}
this.setState({
knowledgepoints: this.state.knowledgepoints,
disciplmy: this.state.disciplmy,
})
}
}
}
});
}
getdatas=()=>{
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return false;
}
console.log(this.Judquestio.Getdatas());
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url="/examination_intelligent_settings/optinal_items.json";
var data={
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:this.Judquestio.Getdatas()[0].rbnd,
}
axios.get(url, {params: {
data
}}).then((response) => {
if (response) {
console.log("智能组卷");
console.log(response);
if(response.data){
this.setState({
single_question_count:response.data.single_question_count,
multiple_question_count:response.data.multiple_question_count,
judgement_question_count:response.data.judgement_question_count,
program_question_count:response.data.program_question_count,
})
}
}
});
}
getdatass=(nandu)=>{
debugger
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return false;
}
console.log(this.Judquestio.Getdatas());
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url="/examination_intelligent_settings/optinal_items.json";
var data={
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:nandu,
}
axios.get(url, {params: {
data
}}).then((response) => {
if (response) {
console.log("智能组卷");
console.log(response);
if(response.data){
this.setState({
single_question_count:response.data.single_question_count,
multiple_question_count:response.data.multiple_question_count,
judgement_question_count:response.data.judgement_question_count,
program_question_count:response.data.program_question_count,
})
}
}
});
}
componentDidUpdate(prevProps) {
}
//跳转道描点的地方
scrollToAnchor = (anchorName) => {
try {
if (anchorName) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
// 如果对应id的锚点存在就跳转到锚点
if (anchorElement) {
anchorElement.scrollIntoView();
}
}
} catch (e) {
}
}
preservation = () => {
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
// console.log(myrbkc);
// console.log("preservation");
// console.log(this.Judquestio.Getdatas());
var question_settings =[
{
"item_type": "SINGLE",
"count": this.Judquestio.Getdatas()[3].rbdxt
},
{
"item_type": "MULTIPLE",
"count": this.Judquestio.Getdatas()[4].rbdxtx
},
{
"item_type": "JUDGMENT",
"count": this.Judquestio.Getdatas()[5].rbpdt
},
{
"item_type": "PROGRAM",
"count": this.Judquestio.Getdatas()[6].rbbct
}
]
const url="/examination_intelligent_settings.json"
var data = {
discipline_id: this.Judquestio.Getdatas()[2].rbkc[0],
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:this.Judquestio.Getdatas()[0].rbnd,
question_settings:question_settings,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
console.log("组卷成功");
this.props.history.push(`/IntegenerationSee/Intelligence/${result.data.exam_setting_id}`);
}
}).catch((error) => {
console.log(error);
})
}
setitem_type = (item_type) => {
}
setCohetepaperbool = (bool) => {
}
getcontentMdRef = (Ref) => {
this.contentMdRef = Ref;
}
setnewmyshixunmodelbool=()=>{
}
render() {
let {paperlibrartdata,newmyshixunmodelbool,single_question_count,multiple_question_count,judgement_question_count,program_question_count} = this.state;
const params = this.props && this.props.match && this.props.match.params;
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
<style>
{
`
.newFooter{
display: none;
}
`
}
</style>
<div className="w1200ms">
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>智能组卷</Breadcrumb.Item>
</Breadcrumb>
</div>
<Intelligentcomponents {...this.state} {...this.props}
single_question_count={this.state.single_question_count}
multiple_question_count={this.state.multiple_question_count}
judgement_question_count={this.state.judgement_question_count}
program_question_count={this.state.program_question_count}
getdatas={()=>this.getdatas()}
getdatass={(nd)=>this.getdatass(nd)}
getJudquestio={(ref) => this.getJudquestio(ref)}
></Intelligentcomponents>
</div>
</div>
{
newmyshixunmodelbool === true ? "" :
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
}
</div>
)
}
}
export default SnackbarHOC()(TPMIndexHOC(Intecomponents));

@ -227,7 +227,7 @@ class Paperlibraryeditid extends Component {
{
newmyshixunmodelbool===true?
<div className="fangdatwo">
<NewMyShixunModel exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
<NewMyShixunModel {...this.state} {...this.props} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
</div>
:
""

@ -36,7 +36,7 @@ class Testpaperlibrary extends Component {
booljupyterurls:false,
Contentdata:[],
items_count:0,
defaultActiveKey:"0",
defaultActiveKey:"1",
modalsTypes:false,
modalsType:false,
timuid:0,
@ -64,7 +64,6 @@ class Testpaperlibrary extends Component {
}
}
});
//获取题库筛选资料
let urls = `/disciplines.json`;
axios.get(urls, {params: {
@ -76,18 +75,6 @@ class Testpaperlibrary extends Component {
})
}
});
var data={
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
keywords: this.state.keywords,
page: 1,
per_page:10,
}
this.getdata(data);
}
paginationonChange=(pages)=>{
@ -417,6 +404,12 @@ class Testpaperlibrary extends Component {
render() {
let{Headertop,items_count,page,per_page,modalsTypes,modalsType}=this.state;
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
return (
<div className="newMain clearfix" ref={this.saveContainer}>
{

@ -38,9 +38,31 @@ class Contentpart extends Component {
}
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
defaultActiveKeys="1"
}
this.props.callback(defaultActiveKeys);
}
}
render() {
let {page}=this.state;
let {defaultActiveKey}=this.props;
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
const contents = (
<div className="questiontypes" style={{
width:'93px',
@ -56,6 +78,8 @@ class Contentpart extends Component {
<p className="questiontypeheng"></p>
</div>
);
return (
<div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s">
@ -82,12 +106,20 @@ class Contentpart extends Component {
}
</style>
<Tabs defaultActiveKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
{
isysladmins===true||(is_teacher===true&&professional_certification===true)?
<Tabs activeKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
<TabPane tab="我的" key="0">
</TabPane>
</Tabs>
:
<Tabs activeKey={1} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
</Tabs>
}
<div className=" mt19" style={{
position:"absolute",
top: "0px",
@ -112,7 +144,7 @@ class Contentpart extends Component {
`
}
</style>
<div className="sortinxdirection">
<div className={isysladmins===true||(is_teacher===true&&professional_certification===true)?"sortinxdirection":"xaxisreverseorder"}>
<Search
style={{ width: "347px",marginRight:"60px",}}
placeholder="请输入题目名称、内容"
@ -123,12 +155,13 @@ class Contentpart extends Component {
value={this.props.keywords}
/>
{
isysladmins===true||(is_teacher===true&&professional_certification===true)?
<div className="xaxisreverseorder" style={{
width:"50%"
}}>
<a href={'/question/newitem'}>
<a href={'/Integeneration'}>
<div className="newbutoonss">
<p className="newbutoontess" >智能组卷</p>
</div>
@ -140,9 +173,8 @@ class Contentpart extends Component {
</div>
</a>
</div>
:""
}
</div>

@ -895,3 +895,35 @@
.tites{
color: #888888 !important;
}
.conditionsetting{
width:64px;
height:21px;
font-size:16px;
color:#333333;
line-height:21px;
}
.conditionsettings{
width:80px;
height:21px;
font-size:16px;
font-family:MicrosoftYaHei;
color:rgba(51,51,51,1);
line-height:21px;
}
.hengxians{
width:1021px;
height:1px;
background: #EEEEEE;
}
.mt13{
margin-top: 13px;
}
.dxuantitie{
width:57px;
height:19px;
font-size:14px;
font-family:MicrosoftYaHei;
color:rgba(51,51,51,1);
line-height:19px;
}

Loading…
Cancel
Save