|
|
@ -1819,16 +1819,29 @@ class PollNew extends Component {
|
|
|
|
// console.log(max_choicess);
|
|
|
|
// console.log(max_choicess);
|
|
|
|
// console.log(min_choicess);
|
|
|
|
// console.log(min_choicess);
|
|
|
|
// console.log(length);
|
|
|
|
// console.log(length);
|
|
|
|
axios.post(urlly, {
|
|
|
|
var datay={};
|
|
|
|
|
|
|
|
datay={
|
|
|
|
question_title: object.question.question_title,
|
|
|
|
question_title: object.question.question_title,
|
|
|
|
question_type: number,
|
|
|
|
question_type: number,
|
|
|
|
is_necessary: object.question.is_necessary,
|
|
|
|
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_answers: option,
|
|
|
|
question_other_answer: null,
|
|
|
|
question_other_answer: null,
|
|
|
|
insert_id: insert_id
|
|
|
|
insert_id: insert_id
|
|
|
|
}).then((result) => {
|
|
|
|
}
|
|
|
|
|
|
|
|
if(number&&number===2){
|
|
|
|
|
|
|
|
datay={
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
axios.post(urlly, datay).then((result) => {
|
|
|
|
// try {
|
|
|
|
// try {
|
|
|
|
if (result !== undefined) {
|
|
|
|
if (result !== undefined) {
|
|
|
|
if (result.data.status === 0) {
|
|
|
|
if (result.data.status === 0) {
|
|
|
@ -1874,20 +1887,32 @@ class PollNew extends Component {
|
|
|
|
min_choicess = null;
|
|
|
|
min_choicess = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log("createquestionsandanswers");
|
|
|
|
// console.log("createquestionsandanswers");
|
|
|
|
console.log(max_choicess);
|
|
|
|
// console.log(max_choicess);
|
|
|
|
console.log(min_choicess);
|
|
|
|
// console.log(min_choicess);
|
|
|
|
console.log(length);
|
|
|
|
// console.log(length);
|
|
|
|
axios.put(url, {
|
|
|
|
var datay={};
|
|
|
|
|
|
|
|
datay={
|
|
|
|
// debug: true,
|
|
|
|
// debug: true,
|
|
|
|
question_title: object.question.question_title,
|
|
|
|
question_title: object.question.question_title,
|
|
|
|
question_type: number,
|
|
|
|
question_type: number,
|
|
|
|
is_necessary: object.question.is_necessary,
|
|
|
|
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_answers: option,
|
|
|
|
question_other_answer: null,
|
|
|
|
question_other_answer: null,
|
|
|
|
}).then((result) => {
|
|
|
|
};
|
|
|
|
|
|
|
|
if(number&&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,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
axios.put(url,datay ).then((result) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (result.data.status === 0) {
|
|
|
|
if (result.data.status === 0) {
|
|
|
|
this.props.showNotification(`编辑题目成功`);
|
|
|
|
this.props.showNotification(`编辑题目成功`);
|
|
|
|