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 = "";
if (this.props.exam_id === undefined) {
@ -734,7 +762,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,
@ -749,9 +776,6 @@ class NewMyShixunModel extends Component {
};
this.getdatasy(data);
this.getbasket_listdata();
// this.setState({
// visible:true
// })
}
}).catch((error) => {
////console.log(error);
@ -836,14 +860,18 @@ class NewMyShixunModel extends Component {
}
//全选试题库
selectallquestionsonthispage = () => {
var item_idsdata = [];
selectallquestionsonthispage=(bool)=>{
var item_idsdata=[];
var arr = this.state.Contentdata.items;
for (let data of arr) {
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 {
//未选用
@ -856,9 +884,9 @@ class NewMyShixunModel extends Component {
} else {
//不是编程题
if (data.choosed === true) {
} else {
if(data.choosed===true){
item_idsdata.push(data.id);
}else{
//未选用
item_idsdata.push(data.id);
}
@ -869,10 +897,21 @@ class NewMyShixunModel extends Component {
item_ids: item_idsdata,
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}
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)}

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

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

@ -50,9 +50,9 @@ class Contentquestionbank extends Component {
<div className="sortinxdirection w50s">
{
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>

Loading…
Cancel
Save