dev_jupyter
杨树林 5 years ago
parent 0b45789cd5
commit 3ac3698caa

@ -220,7 +220,6 @@ class Questionitem_banks extends Component {
// "编辑" // "编辑"
} }
if(this.state.item_type !== "PROGRAM"){
if (this.contentMdRef.Getdatas().length === 0) { if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid"); this.scrollToAnchor("Itembankstopid");
return; return;
@ -230,7 +229,6 @@ class Questionitem_banks extends Component {
if (this.state.item_type === null) { if (this.state.item_type === null) {
return return
} }
}
if (this.state.item_type === "SINGLE") { if (this.state.item_type === "SINGLE") {
@ -451,8 +449,18 @@ class Questionitem_banks extends Component {
} }
if (this.state.item_type === "PROGRAM") { if (this.state.item_type === "PROGRAM") {
//编程题 跳转到 oj 中创建 //编程题 跳转到 oj 中创建
this.props.history.replace('/problems/new'); var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
this.props.setOjInitialValue({
difficult: Getdatasdata[0].rbnd,
sub_discipline_id: Getdatasdata[3].rbkc[1],
tag_discipline_id: myrbkc,
});
this.props.history.replace('/problems/new');
} }

@ -238,6 +238,11 @@ class Itembankstop extends Component {
//课程 //课程
////console.log("课程"); ////console.log("课程");
////console.log(value); ////console.log(value);
// console.log("handleFormkechen");
if(this.state.Knowpoints.length>4){
this.props.showNotification(`知识点最多选择5个`);
return
}
var valuename = undefined; var valuename = undefined;
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
rbzsd: value, rbzsd: value,
@ -384,9 +389,11 @@ class Itembankstop extends Component {
NewknTypedel:bool NewknTypedel:bool
}) })
} }
NewknTypedeltyoedel=(value)=>{ NewknTypedeltyoedel=(value)=>{
if(value===null||value===""){ if(value===null||value===""){
this.props.showNotification(`请输入知识点`); this.props.showNotification(`请输入知识点`);
return return
@ -396,15 +403,28 @@ class Itembankstop extends Component {
this.props.showNotification(`请输入知识点`); this.props.showNotification(`请输入知识点`);
return return
} }
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
return;
}
var data={ var data={
name:"", name:value,
sub_discipline_id:"" sub_discipline_id:this.state.rbkc[1]
} }
const url="/tag_disciplines.json"; const url="/tag_disciplines.json";
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(`新增知识点成功!`); this.props.showNotification(`新增知识点成功!`);
var leydata={
id: result.data.tag_discipline_id,
name:value,
}
this.state.knowledgepoints.push(leydata);
this.setState({
knowledgepoints:this.state.knowledgepoints
})
} }
}).catch((error) => { }).catch((error) => {
//console.log(error); //console.log(error);

Loading…
Cancel
Save