diff --git a/public/react/src/modules/modals/Bottomsubmit.js b/public/react/src/modules/modals/Bottomsubmit.js index d5637e0ff..229219bfa 100644 --- a/public/react/src/modules/modals/Bottomsubmit.js +++ b/public/react/src/modules/modals/Bottomsubmit.js @@ -12,7 +12,12 @@ class Bottomsubmit extends Component { cannelfun = () => { // window.location.href= - this.props.history.replace(this.props.url); + if(this.props.Cohetepaperbool===true){ + this.setCohetepaperbool(false); + }else { + this.props.history.replace(this.props.url); + } + } diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index 8194fb016..36a48dea8 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -23,15 +23,12 @@ import ChoquesEditor from "./component/ChoquesEditor" import JudquestionEditor from "./component/JudquestionEditor"; import Paperreview_item from "./Paperreview_item" import Bottomsubmit from "../../modules/modals/Bottomsubmit"; - +import Comthetestpapers from "./comthetestpaper/Comthetestpapers"; //人工组卷预览 class Paperreview extends Component { constructor(props) { super(props); this.contentMdRef = React.createRef(); - this.answerMdRef = React.createRef(); - this.Choques = React.createRef(); - this.Judquestio = React.createRef(); this.state = { item_type: null, item_banksedit: [], @@ -45,6 +42,15 @@ class Paperreview extends Component { program_questions:null, all_score:0, all_questions_count:0, + Cohetepaperbool:false, + discipline_id:null, + sub_discipline_id:null, + tag_discipline_id:null, + difficulty:null, + name:null, + duration:null, + + } // single_questions:null, 单选题 // multiple_questions:null, 多选题 @@ -61,7 +67,64 @@ class Paperreview extends Component { var data = {} this.getdata(data); + 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, + }) + + } + + } + + } + }); } @@ -107,20 +170,7 @@ class Paperreview extends Component { }); } - getcontentMdRef = (Ref) => { - this.contentMdRef = Ref; - } - getanswerMdRef = (Ref) => { - this.answerMdRef = Ref; - } - - getJudquestio = (Ref) => { - this.Judquestio = Ref; - } - getChoquesEditor = (Ref) => { - this.Choques = Ref; - } //跳转道描点的地方 scrollToAnchor = (anchorName) => { try { @@ -139,6 +189,32 @@ class Paperreview extends Component { } preservation = () => { //保存试卷 + if(this.props.Cohetepaperbool===true){ + + if (this.contentMdRef.Getdatas().length === 0) { + this.scrollToAnchor("Itembankstopid"); + return; + } + + const url = `/examination_banks.json`; + var data={ + } + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + this.props.showNotification(`组卷成功`); + this.props.history.replace('./paperlibrary'); + } + }).catch((error) => { + console.log(error); + }) + + }else{ + this.setCohetepaperbool(true); + + } + + } @@ -149,8 +225,16 @@ class Paperreview extends Component { } + setCohetepaperbool =(bool)=>{ + this.setState({ + Cohetepaperbool:bool + }) + } + getcontentMdRef = (Ref) => { + this.contentMdRef = Ref; + } render() { - let {page, limit, count, Headertop, visible, placement, modalsType, item_type} = this.state; + let {page, limit, count, Headertop, visible, placement, modalsType, item_type,Cohetepaperbool} = this.state; const params = this.props && this.props.match && this.props.match.params; // //console.log(params); return ( @@ -177,9 +261,21 @@ class Paperreview extends Component { - this.getdata(data)}> + { + Cohetepaperbool===false? + this.getdata(data)}> + + + : + this.getcontentMdRef(ref)} + setitem_type={(item) => this.setitem_type(item)} + + > + } + + - @@ -187,7 +283,8 @@ class Paperreview extends Component { - this.setCohetepaperbool(bool)} onSubmits={() => this.preservation()} url={'/question'}> ) diff --git a/public/react/src/modules/question/component/Itembankstop.js b/public/react/src/modules/question/component/Itembankstop.js index 6480ec82b..306ca89a0 100644 --- a/public/react/src/modules/question/component/Itembankstop.js +++ b/public/react/src/modules/question/component/Itembankstop.js @@ -418,6 +418,7 @@ class Itembankstop extends Component { }
+
)} - diff --git a/public/react/src/modules/question/comthetestpaper/comthetestpapers.js b/public/react/src/modules/question/comthetestpaper/Comthetestpapers.js similarity index 91% rename from public/react/src/modules/question/comthetestpaper/comthetestpapers.js rename to public/react/src/modules/question/comthetestpaper/Comthetestpapers.js index b5d682a35..a0e384a47 100644 --- a/public/react/src/modules/question/comthetestpaper/comthetestpapers.js +++ b/public/react/src/modules/question/comthetestpaper/Comthetestpapers.js @@ -14,7 +14,7 @@ import { Select, Cascader, AutoComplete, - Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag + Col, Row, InputNumber, DatePicker, Button, Tag } from "antd"; import './../questioncss/questioncom.css'; @@ -43,7 +43,7 @@ const options = [ }, ]; -class Itembankstop extends Component { +class Comthetestpapers extends Component { constructor(props) { super(props); this.contentMdRef = React.createRef() @@ -185,10 +185,8 @@ class Itembankstop extends Component { handleSubmits = () => { var data = []; this.props.form.validateFields((err, values) => { - data = [] + data = []; if (!err) { - // ////console.log("获取的form 数据"); - // ////console.log(values); data.push({ rbnd: parseInt(values.rbnd) }) @@ -201,6 +199,12 @@ class Itembankstop extends Component { data.push({ rbkc: values.rbkc }) + data.push({ + classroom:values.classroom + }) + data.push({ + kssc:values.kssc + }) } }); @@ -461,9 +465,10 @@ class Itembankstop extends Component { }
- + +
{getFieldDecorator("rbkc", { @@ -475,32 +480,14 @@ class Itembankstop extends Component { - - - {/*
*/} - - {/* {this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {*/} - {/* return (*/} - {/*
*/} - {/*

{object}

*/} - {/* this.deletesobject(object,index)}>*/} - {/*
*/} - {/* )*/} - {/* })}*/} - - {/*
*/}
)}
- + + +
{getFieldDecorator("rbzsd" )( @@ -537,7 +524,7 @@ class Itembankstop extends Component {
)} - + -
+
- - +
+ {getFieldDecorator('classroom', { rules: [{required: true, message: "不能为空"}], })( @@ -583,12 +570,32 @@ class Itembankstop extends Component { )}
- +
- + +
+ + + {getFieldDecorator('kssc')()} + 分钟 + +
+
{getFieldDecorator("rbtx", { @@ -606,7 +613,7 @@ class Itembankstop extends Component { )} - +
- + {getFieldDecorator('rbnd', { rules: [{required: true, message: '请选择难度'}], @@ -676,11 +683,6 @@ class Itembankstop extends Component { )}
- {/**/} - {/* */} - {/**/}
@@ -692,5 +694,5 @@ class Itembankstop extends Component { } -const Itembankstops = Form.create({name: 'Itembankstops'})(Itembankstop); -export default Itembankstops; +const Comthetestpaperss = Form.create({name: 'Itembankstops'})(Comthetestpapers); +export default Comthetestpaperss;