diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index 75869c666..50a1a3c89 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -192,7 +192,6 @@ class Paperreview extends Component { } preservation = () => { //保存试卷 - debugger if(this.state.Cohetepaperbool===true){ if (this.contentMdRef.Getdatas().length === 0) { this.scrollToAnchor("Itembankstopid"); diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js index 712566946..0b80e8bf8 100644 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ b/public/react/src/modules/testpaper/Paperlibraryeditid.js @@ -141,7 +141,33 @@ class Paperlibraryeditid extends Component { } preservation = () => { //保存试卷 - + if (this.Judquestio.Getdatas().length === 0) { + this.scrollToAnchor("Itembankstopid"); + return; + } + var myrbkc=[]; + var Getdatasdatas=this.Judquestio.Getdatas()[2].rbzsd; + for(let myda of Getdatasdatas) { + myrbkc.push(myda.id); + } + const url = `/examination_banks/${this.props.match.params.id}.json`; + var data={ + difficulty:this.Judquestio.Getdatas()[0].rbnd, + name:this.Judquestio.Getdatas()[4].classroom, + duration:this.Judquestio.Getdatas()[5].kssc, + discipline_id: this.Judquestio.Getdatas()[3].rbkc[0], + sub_discipline_id: this.Judquestio.Getdatas()[3].rbkc[1], + tag_discipline_id: myrbkc, + } + axios.put(url, data) + .then((result) => { + if (result.data.status === 0) { + this.props.showNotification(`试卷更新成功`); + this.props.history.replace('./paperlibrary'); + } + }).catch((error) => { + console.log(error); + }) }