|
|
|
@ -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);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|