From 5993130fdc1895654ac50c598734260cb7a96cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Mar 2020 22:18:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=99=BA=E8=83=BD=E7=BB=84?= =?UTF-8?q?=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/question/Paperreview.js | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index 1435de301..f48ec22d9 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -192,33 +192,34 @@ class Paperreview extends Component { } preservation = () => { //保存试卷 - if (this.state.artificialtype === "artificial") { - if (this.state.Cohetepaperbool === true) { - if (this.contentMdRef.Getdatas().length === 0) { - this.scrollToAnchor("Itembankstopid"); - return; - } - var myrbkc = []; - var Getdatasdatas = this.contentMdRef.Getdatas()[2].rbzsd; - for (let myda of Getdatasdatas) { - myrbkc.push(myda.id); - } - const url = `/examination_banks.json`; - var data = { - difficulty: this.contentMdRef.Getdatas()[0].rbnd, - name: this.contentMdRef.Getdatas()[4].classroom, - duration: this.contentMdRef.Getdatas()[5].kssc, - discipline_id: this.contentMdRef.Getdatas()[3].rbkc[0], - sub_discipline_id: this.contentMdRef.Getdatas()[3].rbkc[1], - tag_discipline_id: myrbkc, - } - axios.post(url, data) - .then((result) => { - if (result.data.status === 0) { - // this.props.showNotification(`组卷成功`); - this.props.history.replace('/paperlibrary'); - } - }).catch((error) => { + if(this.state.artificialtype==="artificial"){ + if(this.state.Cohetepaperbool===true){ + if (this.contentMdRef.Getdatas().length === 0) { + this.scrollToAnchor("Itembankstopid"); + return; + } + var myrbkc=[]; + var Getdatasdatas=this.contentMdRef.Getdatas()[2].rbzsd; + for(let myda of Getdatasdatas) { + myrbkc.push(myda.id); + } + const url = `/examination_banks.json`; + var data={ + difficulty:this.contentMdRef.Getdatas()[0].rbnd, + name:this.contentMdRef.Getdatas()[4].classroom, + duration:this.contentMdRef.Getdatas()[5].kssc, + discipline_id: this.contentMdRef.Getdatas()[3].rbkc[0], + sub_discipline_id: this.contentMdRef.Getdatas()[3].rbkc[1], + tag_discipline_id: myrbkc, + } + axios.post(url, data) + .then((result) => { + if (result.data.status === 0) { + // this.props.showNotification(`组卷成功`); + // console.log(result.data.exam_id); + this.props.history.replace('/paperlibrary/see/'+result.data.exam_id); + } + }).catch((error) => { //console.log(error); })