|
|
|
@ -479,10 +479,14 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
//编辑方法
|
|
|
|
|
adddomedit = (object,indexysl) => {
|
|
|
|
|
if (this.state.q_countst > 0) {
|
|
|
|
|
if(this.state.boolneweied===true){
|
|
|
|
|
this.scrollToAnchor("publishtimeids");
|
|
|
|
|
if(this.state.boolneweied !== undefined){
|
|
|
|
|
if(this.state.boolneweied===true){
|
|
|
|
|
this.scrollToAnchor("publishtimeids");
|
|
|
|
|
}else{
|
|
|
|
|
this.scrollToAnchor("publishtimeid"+this.state.publishtimeid_int);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
this.scrollToAnchor("publishtimeid"+this.state.publishtimeid_int);
|
|
|
|
|
this.scrollToAnchor("publishtimeids");
|
|
|
|
|
}
|
|
|
|
|
this.props.showNotification(`不能同时编辑两题`);
|
|
|
|
|
return;
|
|
|
|
@ -566,18 +570,18 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
}
|
|
|
|
|
answers.push(answerstwo);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
if(anserbool===false){
|
|
|
|
|
let answersysltwo = {
|
|
|
|
|
"answer_id": parseInt(object.question.answers[object.question.answers.length-1].answer_id)+1,
|
|
|
|
|
"answer_position": parseInt(object.question.answers[object.question.answers.length-1].answer_position)+1,
|
|
|
|
|
"answer_text": "其他"
|
|
|
|
|
}
|
|
|
|
|
answers.push(answersysltwo);
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// try {
|
|
|
|
|
// if(anserbool===false){
|
|
|
|
|
// let answersysltwo = {
|
|
|
|
|
// "answer_id": parseInt(object.question.answers[object.question.answers.length-1].answer_id)+1,
|
|
|
|
|
// "answer_position": parseInt(object.question.answers[object.question.answers.length-1].answer_position)+1,
|
|
|
|
|
// "answer_text": "其他"
|
|
|
|
|
// }
|
|
|
|
|
// answers.push(answersysltwo);
|
|
|
|
|
// }
|
|
|
|
|
// }catch (e) {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
questiontwo = {
|
|
|
|
|
"id": object.question.id,
|
|
|
|
@ -659,12 +663,15 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
|
|
|
|
|
if (this.state.q_countst > 0) {
|
|
|
|
|
if(Whether===true){
|
|
|
|
|
if(this.state.boolneweied===true){
|
|
|
|
|
this.scrollToAnchor("publishtimeids");
|
|
|
|
|
if(this.state.boolneweied !== undefined){
|
|
|
|
|
if(this.state.boolneweied===true){
|
|
|
|
|
this.scrollToAnchor("publishtimeids");
|
|
|
|
|
}else{
|
|
|
|
|
this.scrollToAnchor("publishtimeid"+this.state.publishtimeid_int);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
this.scrollToAnchor("publishtimeid"+this.state.publishtimeid_int);
|
|
|
|
|
this.scrollToAnchor("publishtimeids");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.props.showNotification(`不能同时编辑两题`);
|
|
|
|
|
return;
|
|
|
|
|