|
|
|
@ -53,8 +53,8 @@ class Questionitem_banks extends Component {
|
|
|
|
|
// axios.get(url, {
|
|
|
|
|
//
|
|
|
|
|
// }).then((response) => {
|
|
|
|
|
// // ////console.log("开始请求/get_navigation_info.json");
|
|
|
|
|
// // ////console.log(response);
|
|
|
|
|
// // //////console.log("开始请求/get_navigation_info.json");
|
|
|
|
|
// // //////console.log(response);
|
|
|
|
|
// if(response!=undefined){
|
|
|
|
|
// if(response.status===200){
|
|
|
|
|
// this.setState({
|
|
|
|
@ -81,15 +81,15 @@ class Questionitem_banks extends Component {
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
////console.log("item_banks");
|
|
|
|
|
console.log("Questionitem_banks");
|
|
|
|
|
console.log(response.data);
|
|
|
|
|
//////console.log("item_banks");
|
|
|
|
|
//console.log("Questionitem_banks");
|
|
|
|
|
//console.log(response.data);
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
item_banksedit:response.data,
|
|
|
|
|
})
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
////console.log(error)
|
|
|
|
|
//////console.log(error)
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -113,10 +113,10 @@ class Questionitem_banks extends Component {
|
|
|
|
|
// }else{
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// ////console.log("item_banks");
|
|
|
|
|
// ////console.log(response);
|
|
|
|
|
// //////console.log("item_banks");
|
|
|
|
|
// //////console.log(response);
|
|
|
|
|
// }).catch((error) => {
|
|
|
|
|
// ////console.log(error)
|
|
|
|
|
// //////console.log(error)
|
|
|
|
|
//
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
@ -135,14 +135,30 @@ class Questionitem_banks extends Component {
|
|
|
|
|
getChoquesEditor=(Ref)=>{
|
|
|
|
|
this.Choques=Ref;
|
|
|
|
|
}
|
|
|
|
|
//跳转道描点的地方
|
|
|
|
|
scrollToAnchor = (anchorName) => {
|
|
|
|
|
try {
|
|
|
|
|
if (anchorName) {
|
|
|
|
|
// 找到锚点
|
|
|
|
|
let anchorElement = document.getElementById(anchorName);
|
|
|
|
|
// 如果对应id的锚点存在,就跳转到锚点
|
|
|
|
|
if (anchorElement) {
|
|
|
|
|
anchorElement.scrollIntoView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
preservation=()=>{
|
|
|
|
|
////console.log("preservation");
|
|
|
|
|
// ////console.log(this.contentMdRef);
|
|
|
|
|
// ////console.log(this.answerMdRef);
|
|
|
|
|
////console.log("preservation222");
|
|
|
|
|
////console.log(this.contentMdRef.Getdatas());
|
|
|
|
|
////console.log("preservation3333");
|
|
|
|
|
////console.log(this.answerMdRef.onSave());
|
|
|
|
|
//////console.log("preservation");
|
|
|
|
|
// //////console.log(this.contentMdRef);
|
|
|
|
|
// //////console.log(this.answerMdRef);
|
|
|
|
|
//////console.log("preservation222");
|
|
|
|
|
//////console.log(this.contentMdRef.Getdatas());
|
|
|
|
|
//////console.log("preservation3333");
|
|
|
|
|
//////console.log(this.answerMdRef.onSave());
|
|
|
|
|
const params= this.props&&this.props.match&&this.props.match.params;
|
|
|
|
|
var url="";
|
|
|
|
|
var boolnew=true;
|
|
|
|
@ -156,12 +172,8 @@ class Questionitem_banks extends Component {
|
|
|
|
|
// "编辑"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.contentMdRef !=null){
|
|
|
|
|
console.log(this.contentMdRef.Getdatas());
|
|
|
|
|
}
|
|
|
|
|
if(this.contentMdRef.Getdatas().length===0){
|
|
|
|
|
|
|
|
|
|
this.scrollToAnchor("Itembankstopid");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(this.state.item_type===null){
|
|
|
|
@ -172,7 +184,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
if(this.state.item_type==="SINGLE"){
|
|
|
|
|
if( this.answerMdRef!=null){
|
|
|
|
|
//单选题
|
|
|
|
|
// console.log(this.answerMdRef.onSave());
|
|
|
|
|
// //console.log(this.answerMdRef.onSave());
|
|
|
|
|
|
|
|
|
|
if(this.answerMdRef.onSave().length===0){
|
|
|
|
|
return;
|
|
|
|
@ -191,11 +203,13 @@ class Questionitem_banks extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// repertoire_id:1,
|
|
|
|
|
// sub_repertoire_id:1,
|
|
|
|
|
// tag_repertoire_id:[1,3],
|
|
|
|
|
var data={
|
|
|
|
|
repertoire_id:1,
|
|
|
|
|
sub_repertoire_id:1,
|
|
|
|
|
tag_repertoire_id:[1,3],
|
|
|
|
|
discipline_id:1,
|
|
|
|
|
sub_discipline_id:1,
|
|
|
|
|
tag_discipline_id:[1,3],
|
|
|
|
|
name:anserdata[0],
|
|
|
|
|
item_type:"SINGLE",
|
|
|
|
|
difficulty:2,
|
|
|
|
@ -214,7 +228,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
//console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
axios.put(url, data)
|
|
|
|
@ -226,7 +240,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
//console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -238,7 +252,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
if(this.state.item_type==="MULTIPLE"){
|
|
|
|
|
if(this.Choques!=null){
|
|
|
|
|
//多选题
|
|
|
|
|
// console.log(this.Choques.onSave());
|
|
|
|
|
// //console.log(this.Choques.onSave());
|
|
|
|
|
if(this.Choques.onSave().length===0){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -246,8 +260,8 @@ class Questionitem_banks extends Component {
|
|
|
|
|
const choices=[];
|
|
|
|
|
// 1: [3]
|
|
|
|
|
// 2: (4) ["1", "2", "3", "4"]
|
|
|
|
|
console.log("MULTIPLE");
|
|
|
|
|
console.log(anserdata);
|
|
|
|
|
//console.log("MULTIPLE");
|
|
|
|
|
//console.log(anserdata);
|
|
|
|
|
for(var k=0;k<anserdata[2].length;k++){
|
|
|
|
|
|
|
|
|
|
var bool =false
|
|
|
|
@ -265,9 +279,9 @@ class Questionitem_banks extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var data={
|
|
|
|
|
repertoire_id:1,
|
|
|
|
|
sub_repertoire_id:1,
|
|
|
|
|
tag_repertoire_id:[1,3],
|
|
|
|
|
discipline_id:1,
|
|
|
|
|
sub_discipline_id:1,
|
|
|
|
|
tag_discipline_id:[1,3],
|
|
|
|
|
name:anserdata[0],
|
|
|
|
|
item_type:"MULTIPLE",
|
|
|
|
|
difficulty:2,
|
|
|
|
@ -284,7 +298,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
//console.log(error);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
@ -297,7 +311,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
//console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -313,7 +327,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
if(this.state.item_type==="JUDGMENT"){
|
|
|
|
|
if( this.Judquestio !=null){
|
|
|
|
|
//判断题
|
|
|
|
|
// console.log(this.Judquestio.onSave());
|
|
|
|
|
// //console.log(this.Judquestio.onSave());
|
|
|
|
|
if(this.Judquestio.onSave().length===0){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -331,9 +345,9 @@ class Questionitem_banks extends Component {
|
|
|
|
|
}
|
|
|
|
|
choices.push(choicesdatas);
|
|
|
|
|
var data={
|
|
|
|
|
repertoire_id:1,
|
|
|
|
|
sub_repertoire_id:1,
|
|
|
|
|
tag_repertoire_id:[1,3],
|
|
|
|
|
discipline_id:1,
|
|
|
|
|
sub_discipline_id:1,
|
|
|
|
|
tag_discipline_id:[1,3],
|
|
|
|
|
name:anserdata[0],
|
|
|
|
|
item_type:"JUDGMENT",
|
|
|
|
|
difficulty:2,
|
|
|
|
@ -350,7 +364,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
//console.log(error);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
@ -362,7 +376,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
//console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -406,13 +420,13 @@ class Questionitem_banks extends Component {
|
|
|
|
|
{/*<Option value="JUDGMENT">判断题</Option>*/}
|
|
|
|
|
{/*<Option value="PROGRAM">编程题</Option>*/}
|
|
|
|
|
|
|
|
|
|
////console.log("塞选的数据");
|
|
|
|
|
////console.log(item_type);
|
|
|
|
|
//////console.log("塞选的数据");
|
|
|
|
|
//////console.log(item_type);
|
|
|
|
|
const params= this.props&&this.props.match&&this.props.match.params;
|
|
|
|
|
// console.log(params);
|
|
|
|
|
// //console.log(params);
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<div className="newMain clearfix intermediatecenter "
|
|
|
|
|
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
|
|
|
|
|
style={{
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
@ -437,6 +451,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Itembankstop
|
|
|
|
|
|
|
|
|
|
{...this.state}
|
|
|
|
|
{...this.props}
|
|
|
|
|
getcontentMdRef={(ref)=>this.getcontentMdRef(ref)}
|
|
|
|
@ -502,7 +517,7 @@ class Questionitem_banks extends Component {
|
|
|
|
|
item_type===null?
|
|
|
|
|
""
|
|
|
|
|
:
|
|
|
|
|
<Bottomsubmit bottomvalue={item_type==="PROGRAM"?"创建":"保存"} onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit>
|
|
|
|
|
<Bottomsubmit {...this.props} {...this.state} bottomvalue={item_type==="PROGRAM"?"创建":"保存"} onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|