mast_item_banktwo
杨树林 5 years ago
parent 5c611fb61b
commit af26a97137

@ -176,22 +176,43 @@ class Paperreview_item extends Component {
} }
setDownloady = (fenshu) => { setDownloady = (fenshu) => {
const url = "/item_baskets/batch_set_score.json"; if(this.props.match.params.type==="Intelligence") {
var data = { //智能选题
score: fenshu, const url = "/item_baskets/batch_set_score.json";
item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '', var data = {
score: fenshu,
item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '',
exam_setting_id:this.props.match.params.id,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
}).catch((error) => {
//console.log(error);
})
}else{
const url = "/item_baskets/batch_set_score.json";
var data = {
score: fenshu,
item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '',
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
}).catch((error) => {
//console.log(error);
})
} }
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
}).catch((error) => {
//console.log(error);
})
} }
setDownloadys=(value)=>{ setDownloadys=(value)=>{
@ -239,24 +260,49 @@ class Paperreview_item extends Component {
modalsTypedel: bool, modalsTypedel: bool,
titilesms: names titilesms: names
}) })
const url = `/item_baskets/delete_item_type.json`; if(this.props.match.params.type==="Intelligence") {
axios.delete((url), { //智能组卷
data: { const url = `/item_baskets/delete_item_type.json`;
item_type: names axios.delete((url), {
} data: {
}) item_type: names,
.then((response) => { exam_setting_id:this.props.match.params.id,
if (response.data.status == 0) { }
// this.props.showNotification('大题删除成功'); })
this.props.getdata({}); .then((response) => {
this.setState({ if (response.data.status == 0) {
titilesms: "" // this.props.showNotification('大题删除成功');
}) this.props.getdata({});
} this.setState({
}) titilesms: ""
.catch(function (error) { })
////console.log(error); }
}); })
.catch(function (error) {
////console.log(error);
});
}else{
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: names
}
})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('大题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
})
}
})
.catch(function (error) {
////console.log(error);
});
}
@ -271,19 +317,35 @@ class Paperreview_item extends Component {
}) })
}else { }else {
//确定 //确定
const url = `/item_baskets/${this.state.item_bank_id}.json`; if(this.props.match.params.type==="Intelligence"){
axios.delete(url, { data: { //智能组卷
exam_setting_id: this.props.match.params.id, const url = `/item_baskets/${this.state.item_bank_id}.json`;
}}) axios.delete(url, { data: {
.then((response) => { exam_setting_id: this.props.match.params.id,
if (response.data.status == 0) { }})
// this.props.showNotification('试题删除成功'); .then((response) => {
this.props.getdata({}); if (response.data.status == 0) {
} // this.props.showNotification('试题删除成功');
}) this.props.getdata({});
.catch(function (error) { }
})
.catch(function (error) {
});
}else{
const url = `/item_baskets/${this.state.item_bank_id}.json`;
axios.delete(url)
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('试题删除成功');
this.props.getdata({});
}
})
.catch(function (error) {
});
}
});
this.setState({ this.setState({
modalsTypedels: bool, modalsTypedels: bool,

Loading…
Cancel
Save