diff --git a/public/react/src/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js index cce7be87d..4307c5ba2 100644 --- a/public/react/src/modules/question/NewMyShixunModel.js +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -729,7 +729,35 @@ class NewMyShixunModel extends Component { } - //选用 + + // 不选用 Question.js页面也有个 + NOgetitem_baskets=(data)=>{ + let url="/examination_banks/cancel_items.json"; + + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keyword: this.state.keywords, + page: this.state.page, + per_page:10, + exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdatasy(data); + this.getbasket_listdata(); + } + }).catch((error) => { + ////console.log(error); + }) + } + + //选用 Question.js页面也有个 getitem_baskets=(data)=>{ //选用题型可以上传单个 或者多个题型 let url=""; @@ -743,7 +771,6 @@ class NewMyShixunModel extends Component { axios.post(url, data) .then((result) => { if (result.data.status == 0) { - // this.props.showNotification(`选用成功`); var data = { discipline_id:this.state.discipline_id, sub_discipline_id:this.state.sub_discipline_id, @@ -758,9 +785,6 @@ class NewMyShixunModel extends Component { }; this.getdatasy(data); this.getbasket_listdata(); - // this.setState({ - // visible:true - // }) } }).catch((error) => { ////console.log(error); @@ -845,7 +869,7 @@ class NewMyShixunModel extends Component { } //全选试题库 - selectallquestionsonthispage=()=>{ + selectallquestionsonthispage=(bool)=>{ var item_idsdata=[]; var arr= this.state.Contentdata.items; @@ -853,6 +877,10 @@ class NewMyShixunModel extends Component { if(data.item_type==="PROGRAM"){ //编程题 if(data.choosed===true){ + if(data.program_attr.status===1){ + //已发布 + item_idsdata.push(data.id); + } }else{ //未选用 @@ -866,7 +894,7 @@ class NewMyShixunModel extends Component { }else{ //不是编程题 if(data.choosed===true){ - + item_idsdata.push(data.id); }else{ //未选用 item_idsdata.push(data.id); @@ -878,10 +906,21 @@ class NewMyShixunModel extends Component { item_ids:item_idsdata, exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), } - this.getitem_baskets(data); - this.setState({ - selectallquestionsonthispages:true, - }) + + + if(bool===false){ + this.getitem_baskets(data); + this.setState({ + selectallquestionsonthispages:true, + }) + }else{ + this.NOgetitem_baskets(data); + this.setState({ + selectallquestionsonthispages:false, + }) + } + + } //全选的状态 @@ -1040,7 +1079,7 @@ class NewMyShixunModel extends Component { chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexibool={(e)=>this.chakanjiexibool(e)} getitem_basketss={(id)=>this.getitem_basketss(id)} - selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} + selectallquestionsonthispage={(bool)=>this.selectallquestionsonthispage(bool)} getitem_baskets={(e)=>this.getitem_baskets(e)} setdatafuns={(e) => this.setdatafuns(e)} setdatafunsval={(e) => this.setdatafunsval(e)} diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index b48affa33..f4d859ed7 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -659,9 +659,37 @@ class Question extends Component { }) } + // 不选用 NewMyShixunModel.js 页面也有个 + NOgetitem_baskets=(data)=>{ + let url="/examination_banks/cancel_items.json"; + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + // this.props.showNotification(`选用成功`); + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keyword: this.state.keywords, + page: this.state.page, + per_page:10, + }; + this.getdatasy(data); + this.getbasket_listdata(); + // this.setState({ + // visible:true + // }) + } + }).catch((error) => { + ////console.log(error); + }) + } - //选用 + //选用 NewMyShixunModel.js 页面也有个 getitem_baskets=(data)=>{ //选用题型可以上传单个 或者多个题型 let url="/item_baskets.json"; @@ -738,7 +766,7 @@ class Question extends Component { } //全选试题库 - selectallquestionsonthispage=()=>{ + selectallquestionsonthispage=(bool)=>{ var item_idsdata=[]; var arr= this.state.Contentdata.items; @@ -746,7 +774,10 @@ class Question extends Component { if(data.item_type==="PROGRAM"){ //编程题 if(data.choosed===true){ - + if(data.program_attr.status===1){ + //已发布 + item_idsdata.push(data.id); + } }else{ //未选用 if(data.program_attr.status===1){ @@ -759,7 +790,7 @@ class Question extends Component { }else{ //不是编程题 if(data.choosed===true){ - + item_idsdata.push(data.id); }else{ //未选用 item_idsdata.push(data.id); @@ -770,10 +801,18 @@ class Question extends Component { const data={ item_ids:item_idsdata } - this.getitem_baskets(data); - this.setState({ - selectallquestionsonthispages:true, - }) + if(bool===false){ + this.getitem_baskets(data); + this.setState({ + selectallquestionsonthispages:true, + }) + }else{ + this.NOgetitem_baskets(data); + this.setState({ + selectallquestionsonthispages:false, + }) + } + } //全选的状态 @@ -1016,7 +1055,7 @@ class Question extends Component { chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexibool={(e)=>this.chakanjiexibool(e)} getitem_basketss={(id)=>this.getitem_basketss(id)} - selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} + selectallquestionsonthispage={(bool)=>this.selectallquestionsonthispage(bool)} getitem_baskets={(e)=>this.getitem_baskets(e)} setdatafuns={(e) => this.setdatafuns(e)} setdatafunsval={(e) => this.setdatafunsval(e)} diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 955a9d9b8..516e6be1f 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -440,12 +440,12 @@ class Contentpart extends Component {
选用本页全部试题