|
|
|
@ -1814,17 +1814,35 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
max_choicess = max_choices;
|
|
|
|
|
min_choicess = min_choices;
|
|
|
|
|
}
|
|
|
|
|
axios.post(urlly, {
|
|
|
|
|
var datay={};
|
|
|
|
|
datay={
|
|
|
|
|
exercise_bank_id: poll_id,
|
|
|
|
|
question_title: object.question.question_title,
|
|
|
|
|
question_type: number,
|
|
|
|
|
is_necessary: object.question.is_necessary,
|
|
|
|
|
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess,
|
|
|
|
|
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
|
|
|
|
|
question_answers: option,
|
|
|
|
|
question_other_answer: null,
|
|
|
|
|
insert_id: insert_id
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
if(number===2){
|
|
|
|
|
datay={
|
|
|
|
|
exercise_bank_id: poll_id,
|
|
|
|
|
question_title: object.question.question_title,
|
|
|
|
|
question_type: number,
|
|
|
|
|
is_necessary: object.question.is_necessary,
|
|
|
|
|
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess,
|
|
|
|
|
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
|
|
|
|
|
question_answers: option,
|
|
|
|
|
question_other_answer: null,
|
|
|
|
|
insert_id: insert_id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.post(urlly,datay).then((result) => {
|
|
|
|
|
// try {
|
|
|
|
|
if (result !== undefined) {
|
|
|
|
|
if (result.data.status === 0) {
|
|
|
|
@ -1855,16 +1873,34 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
// console.log("调用了edittotheserver")
|
|
|
|
|
var url = `/poll_bank_questions/${object.question.id}.json`
|
|
|
|
|
var thiss = this;
|
|
|
|
|
axios.put(url, {
|
|
|
|
|
|
|
|
|
|
var datay={};
|
|
|
|
|
datay={
|
|
|
|
|
// debug: true,
|
|
|
|
|
question_title: object.question.question_title,
|
|
|
|
|
question_type: number,
|
|
|
|
|
is_necessary: object.question.is_necessary,
|
|
|
|
|
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess,
|
|
|
|
|
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
|
|
|
|
|
question_answers: option,
|
|
|
|
|
question_other_answer: null,
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
};
|
|
|
|
|
try {
|
|
|
|
|
if(number===2){
|
|
|
|
|
datay={
|
|
|
|
|
// debug: true,
|
|
|
|
|
question_title: object.question.question_title,
|
|
|
|
|
question_type: number,
|
|
|
|
|
is_necessary: object.question.is_necessary,
|
|
|
|
|
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess,
|
|
|
|
|
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
|
|
|
|
|
question_answers: option,
|
|
|
|
|
question_other_answer: null,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.put(url,datay).then((result) => {
|
|
|
|
|
try {
|
|
|
|
|
if (result.data.status === 0) {
|
|
|
|
|
this.props.showNotification(`编辑题目成功`);
|
|
|
|
|