dev_aliyun2
杨树林 5 years ago committed by harry
parent e59ed11fb9
commit a767595a6f

@ -720,8 +720,36 @@ class NewMyShixunModel extends Component {
} }
//选用
getitem_baskets = (data) => { // 不选用 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 = ""; let url = "";
if (this.props.exam_id === undefined) { if (this.props.exam_id === undefined) {
@ -734,7 +762,6 @@ class NewMyShixunModel extends Component {
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`选用成功`);
var data = { var data = {
discipline_id: this.state.discipline_id, discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id, sub_discipline_id: this.state.sub_discipline_id,
@ -749,9 +776,6 @@ class NewMyShixunModel extends Component {
}; };
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
// this.setState({
// visible:true
// })
} }
}).catch((error) => { }).catch((error) => {
////console.log(error); ////console.log(error);
@ -836,14 +860,18 @@ class NewMyShixunModel extends Component {
} }
//全选试题库 //全选试题库
selectallquestionsonthispage = () => { selectallquestionsonthispage=(bool)=>{
var item_idsdata = []; var item_idsdata=[];
var arr = this.state.Contentdata.items; var arr = this.state.Contentdata.items;
for (let data of arr) { for (let data of arr) {
if (data.item_type === "PROGRAM") { if (data.item_type === "PROGRAM") {
//编程题 //编程题
if (data.choosed === true) { if(data.choosed===true){
if(data.program_attr.status===1){
//已发布
item_idsdata.push(data.id);
}
} else { } else {
//未选用 //未选用
@ -856,9 +884,9 @@ class NewMyShixunModel extends Component {
} else { } else {
//不是编程题 //不是编程题
if (data.choosed === true) { if(data.choosed===true){
item_idsdata.push(data.id);
} else { }else{
//未选用 //未选用
item_idsdata.push(data.id); item_idsdata.push(data.id);
} }
@ -869,10 +897,21 @@ class NewMyShixunModel extends Component {
item_ids: item_idsdata, item_ids: item_idsdata,
item_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id), item_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,
})
}
} }
//全选的状态 //全选的状态
@ -1048,7 +1087,7 @@ class NewMyShixunModel extends Component {
chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)} chakanjiexibool={(e)=>this.chakanjiexibool(e)}
getitem_basketss={(id)=>this.getitem_basketss(id)} getitem_basketss={(id)=>this.getitem_basketss(id)}
selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} selectallquestionsonthispage={(bool)=>this.selectallquestionsonthispage(bool)}
getitem_baskets={(e)=>this.getitem_baskets(e)} getitem_baskets={(e)=>this.getitem_baskets(e)}
setdatafuns={(e) => this.setdatafuns(e)} setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)} setdatafunsval={(e) => this.setdatafunsval(e)}

@ -232,14 +232,7 @@ class Question extends Component {
this.setState({ this.setState({
booljupyterurls: false, booljupyterurls: false,
}) })
<<<<<<< HEAD
<<<<<<< HEAD
}, 1000);
=======
},500); },500);
>>>>>>> 3c090ce... 调整
=======
>>>>>>> f83c4bc... 调整
if (response === null || response === undefined) { if (response === null || response === undefined) {
return return
@ -660,10 +653,38 @@ 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) => { getitem_baskets=(data)=>{
//选用题型可以上传单个 或者多个题型 //选用题型可以上传单个 或者多个题型
let url = "/item_baskets.json"; let url = "/item_baskets.json";
@ -739,16 +760,19 @@ class Question extends Component {
} }
//全选试题库 //全选试题库
selectallquestionsonthispage = () => { selectallquestionsonthispage=(bool)=>{
var item_idsdata = []; var item_idsdata=[];
var arr = this.state.Contentdata.items; var arr = this.state.Contentdata.items;
for (let data of arr) { for (let data of arr) {
if (data.item_type === "PROGRAM") { if (data.item_type === "PROGRAM") {
//编程题 //编程题
if (data.choosed === true) { if(data.choosed===true){
if(data.program_attr.status===1){
} else { //已发布
item_idsdata.push(data.id);
}
}else{
//未选用 //未选用
if (data.program_attr.status === 1) { if (data.program_attr.status === 1) {
//已发布 //已发布
@ -759,9 +783,9 @@ class Question extends Component {
} else { } else {
//不是编程题 //不是编程题
if (data.choosed === true) { if(data.choosed===true){
item_idsdata.push(data.id);
} else { }else{
//未选用 //未选用
item_idsdata.push(data.id); item_idsdata.push(data.id);
} }
@ -771,10 +795,18 @@ class Question extends Component {
const data = { const data = {
item_ids: item_idsdata item_ids: item_idsdata
} }
this.getitem_baskets(data); if(bool===false){
this.setState({ this.getitem_baskets(data);
selectallquestionsonthispages: true, this.setState({
}) selectallquestionsonthispages:true,
})
}else{
this.NOgetitem_baskets(data);
this.setState({
selectallquestionsonthispages:false,
})
}
} }
//全选的状态 //全选的状态
@ -952,21 +984,12 @@ class Question extends Component {
: "" : ""
} }
{ {
<<<<<<< HEAD
visible === true ?
<div
style={{
marginTop: "60px"
}}></div>
: ""}
=======
visible===true? visible===true?
<div <div
style={{ style={{
marginTop: "81px" marginTop: "81px"
}}></div> }}></div>
:""} :""}
>>>>>>> e686e4c... 调整
{ {
modalsTypes === true ? modalsTypes === true ?
<QuestionModals {...this.props}{...this.state} modalsTypes={modalsTypes} modalCancels={() => this.modalCancels()} <QuestionModals {...this.props}{...this.state} modalsTypes={modalsTypes} modalCancels={() => this.modalCancels()}
@ -1027,7 +1050,7 @@ class Question extends Component {
chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)} chakanjiexibool={(e)=>this.chakanjiexibool(e)}
getitem_basketss={(id)=>this.getitem_basketss(id)} getitem_basketss={(id)=>this.getitem_basketss(id)}
selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} selectallquestionsonthispage={(bool)=>this.selectallquestionsonthispage(bool)}
getitem_baskets={(e)=>this.getitem_baskets(e)} getitem_baskets={(e)=>this.getitem_baskets(e)}
setdatafuns={(e) => this.setdatafuns(e)} setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)} setdatafunsval={(e) => this.setdatafunsval(e)}

@ -439,14 +439,14 @@ class Contentpart extends Component {
: :
<div className=" w100s mb10"> <div className=" w100s mb10">
{ {
defaultActiveKey === 1 || defaultActiveKey === "1" ? defaultActiveKey===1||defaultActiveKey==="1"?
<Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={() => this.props.selectallquestionsonthispage()} ></Contentquestionbank> <Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={(bool)=>this.props.selectallquestionsonthispage(bool)} ></Contentquestionbank>
: "" :""
} }
{ {
defaultActiveKey === 0 || defaultActiveKey === "0" ? defaultActiveKey===0||defaultActiveKey==="0"?
<Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={() => this.props.selectallquestionsonthispage()}></Contentquestionbank> <Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={(bool)=>this.props.selectallquestionsonthispage(bool)}></Contentquestionbank>
: "" :""
} }
</div> </div>
} }

@ -50,9 +50,9 @@ class Contentquestionbank extends Component {
<div className="sortinxdirection w50s"> <div className="sortinxdirection w50s">
{ {
selectionbools===true? selectionbools===true?
<Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage()} disabled></Checkbox> <Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage(this.props.selectallquestionsonthispages)} ></Checkbox>
: :
<Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage()}></Checkbox> <Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage(this.props.selectallquestionsonthispages)}></Checkbox>
} }
<p className="setequesbank ml20">选用本页全部试题</p> <p className="setequesbank ml20">选用本页全部试题</p>

Loading…
Cancel
Save