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

@ -176,22 +176,43 @@ class Paperreview_item extends Component {
}
setDownloady = (fenshu) => {
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" : '',
if(this.props.match.params.type==="Intelligence") {
//智能选题
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" : '',
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)=>{
@ -239,24 +260,49 @@ class Paperreview_item extends Component {
modalsTypedel: bool,
titilesms: names
})
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);
});
if(this.props.match.params.type==="Intelligence") {
//智能组卷
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: names,
exam_setting_id:this.props.match.params.id,
}
})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('大题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
})
}
})
.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 {
//确定
const url = `/item_baskets/${this.state.item_bank_id}.json`;
axios.delete(url, { data: {
exam_setting_id: this.props.match.params.id,
}})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('试题删除成功');
this.props.getdata({});
}
})
.catch(function (error) {
if(this.props.match.params.type==="Intelligence"){
//智能组卷
const url = `/item_baskets/${this.state.item_bank_id}.json`;
axios.delete(url, { data: {
exam_setting_id: this.props.match.params.id,
}})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('试题删除成功');
this.props.getdata({});
}
})
.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({
modalsTypedels: bool,

Loading…
Cancel
Save