|
|
|
@ -539,6 +539,14 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
}
|
|
|
|
|
answers.push(answerstwo);
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
questiontwo = {
|
|
|
|
|
"id": object.question.id,
|
|
|
|
|
"is_necessary": object.question.is_necessary,
|
|
|
|
@ -2116,14 +2124,14 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
if(result.data){
|
|
|
|
|
if (result.data.status === 0) {
|
|
|
|
|
this.props.showNotification(`上移成功`);
|
|
|
|
|
let arr = this.state.poll_questions;
|
|
|
|
|
let newarr = [...arr];
|
|
|
|
|
let temp = newarr[index - 1];
|
|
|
|
|
newarr[index - 1] = newarr[index];
|
|
|
|
|
newarr[index] = temp;
|
|
|
|
|
this.setState({
|
|
|
|
|
poll_questions: newarr,
|
|
|
|
|
});
|
|
|
|
|
// let arr = this.state.poll_questions;
|
|
|
|
|
// let newarr = [...arr];
|
|
|
|
|
// let temp = newarr[index - 1];
|
|
|
|
|
// newarr[index - 1] = newarr[index];
|
|
|
|
|
// newarr[index] = temp;
|
|
|
|
|
// this.setState({
|
|
|
|
|
// poll_questions: newarr,
|
|
|
|
|
// });
|
|
|
|
|
thiss.thisinitializationdatanew();
|
|
|
|
|
}else{
|
|
|
|
|
this.props.showNotification(`上移失败`);
|
|
|
|
@ -2150,14 +2158,14 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
if (result.data.status === 0) {
|
|
|
|
|
// message.success("下移题目成功", 1)
|
|
|
|
|
this.props.showNotification(`下移成功`);
|
|
|
|
|
let arr = this.state.poll_questions;
|
|
|
|
|
let newarr = [...arr];
|
|
|
|
|
let temp = newarr[index + 1];
|
|
|
|
|
newarr[index + 1] = newarr[index];
|
|
|
|
|
newarr[index] = temp;
|
|
|
|
|
this.setState({
|
|
|
|
|
poll_questions: newarr,
|
|
|
|
|
});
|
|
|
|
|
// let arr = this.state.poll_questions;
|
|
|
|
|
// let newarr = [...arr];
|
|
|
|
|
// let temp = newarr[index + 1];
|
|
|
|
|
// newarr[index + 1] = newarr[index];
|
|
|
|
|
// newarr[index] = temp;
|
|
|
|
|
// this.setState({
|
|
|
|
|
// poll_questions: newarr,
|
|
|
|
|
// });
|
|
|
|
|
thiss.thisinitializationdatanew();
|
|
|
|
|
}else {
|
|
|
|
|
this.props.showNotification(`下移失败`);
|
|
|
|
@ -3188,7 +3196,17 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
}}
|
|
|
|
|
onInput={(e) => this.HandleInputChanges(e, indexo, indext)}></TextArea>
|
|
|
|
|
{this.state.polls_status === undefined || this.state.polls_status === 1 ?
|
|
|
|
|
indext > 1 ?
|
|
|
|
|
(itemo.question.question_type === 2 && itemo.question.answers.length === 3 ?
|
|
|
|
|
(indext ===1?
|
|
|
|
|
<a className="lineh-40" id="bianjibianji1"
|
|
|
|
|
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
|
|
|
|
|
title="新增" placement={"bottom"}><i
|
|
|
|
|
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
|
|
|
|
|
:
|
|
|
|
|
""
|
|
|
|
|
)
|
|
|
|
|
:
|
|
|
|
|
itemo.question.answers.length > 2 &&indext>1?
|
|
|
|
|
<span>
|
|
|
|
|
<a className="lineh-40 mr10"
|
|
|
|
|
onClick={() => this.Deleteentrys(arrid, indext, false)}><Tooltip
|
|
|
|
@ -3210,11 +3228,14 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
></a>
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
: indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ?
|
|
|
|
|
<a className="lineh-40"
|
|
|
|
|
:itemo.question.answers.length === 2?
|
|
|
|
|
(indext ===1?
|
|
|
|
|
<a className="lineh-40" id="bianjibianji1"
|
|
|
|
|
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
|
|
|
|
|
title="新增" placement={"bottom"}><i
|
|
|
|
|
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> : ""
|
|
|
|
|
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
|
|
|
|
|
:"")
|
|
|
|
|
: "")
|
|
|
|
|
: ""}
|
|
|
|
|
</p>)}
|
|
|
|
|
</div>
|
|
|
|
@ -3441,6 +3462,10 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
|
|
|
|
|
console.log("chishiyong1");
|
|
|
|
|
console.log(itemo.question.answers[itemo.question.answers.length - 1]);
|
|
|
|
|
// var bools=true;
|
|
|
|
|
// if(){
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{itemt.answer_text === undefined ? (
|
|
|
|
@ -3497,7 +3522,15 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
}}
|
|
|
|
|
onInput={(e) => this.HandleInputChanges(e, indexo, indext)}></TextArea>
|
|
|
|
|
{this.state.polls_status === undefined || this.state.polls_status === 1 ?
|
|
|
|
|
indext > 1 ?
|
|
|
|
|
( itemo.question.question_type === 2 && itemo.question.answers.length === 3 ?
|
|
|
|
|
(indext ===1?
|
|
|
|
|
<a className="lineh-40 " id="bianjibianji2"
|
|
|
|
|
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
|
|
|
|
|
title="新增" placement={"bottom"}><i
|
|
|
|
|
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
|
|
|
|
|
:"")
|
|
|
|
|
:
|
|
|
|
|
itemo.question.answers.length > 2 && indext>1 ?
|
|
|
|
|
<span>
|
|
|
|
|
<a className="lineh-40 mr10"
|
|
|
|
|
onClick={() => this.Deleteentrys(arrid, indext, false)}><Tooltip
|
|
|
|
@ -3519,11 +3552,14 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
></a>
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
: indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ?
|
|
|
|
|
<a className="lineh-40 "
|
|
|
|
|
:itemo.question.answers.length === 2 && indext ===1 ?
|
|
|
|
|
(indext ===1?
|
|
|
|
|
<a className="lineh-40 " id="bianjibianji2"
|
|
|
|
|
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
|
|
|
|
|
title="新增" placement={"bottom"}><i
|
|
|
|
|
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> : ""
|
|
|
|
|
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
|
|
|
|
|
:"")
|
|
|
|
|
: "")
|
|
|
|
|
: ""}
|
|
|
|
|
</p>)}
|
|
|
|
|
</div>
|
|
|
|
@ -3810,7 +3846,16 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
}}
|
|
|
|
|
onInput={(e) => this.HandleInputChanges(e, indexo, indext)}></TextArea>
|
|
|
|
|
{polls_status === undefined || polls_status === 1 ?
|
|
|
|
|
(indext > 1 ?
|
|
|
|
|
(itemo.question.question_type === 2&& itemo.question.answers.length === 3 ?
|
|
|
|
|
(indext ===1?
|
|
|
|
|
<a className="lineh-40" id="bianjibianji3"
|
|
|
|
|
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
|
|
|
|
|
title="新增"
|
|
|
|
|
placement={"bottom"}><i
|
|
|
|
|
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
|
|
|
|
|
:"")
|
|
|
|
|
:
|
|
|
|
|
itemo.question.answers.length > 2 && indext>1 ?
|
|
|
|
|
<span>
|
|
|
|
|
<a className="lineh-40 mr10"
|
|
|
|
|
onClick={() => this.Deleteentrys(arrid, indext, false)}><Tooltip
|
|
|
|
@ -3836,12 +3881,16 @@ class PollNewQuestbank extends Component {
|
|
|
|
|
></a>
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
: indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ?
|
|
|
|
|
<a className="lineh-40"
|
|
|
|
|
: itemo.question.answers.length === 2?
|
|
|
|
|
(indext ===1?
|
|
|
|
|
<a className="lineh-40" id="bianjibianji3"
|
|
|
|
|
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
|
|
|
|
|
title="新增"
|
|
|
|
|
placement={"bottom"}><i
|
|
|
|
|
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> : "")
|
|
|
|
|
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
|
|
|
|
|
:"")
|
|
|
|
|
|
|
|
|
|
: "")
|
|
|
|
|
: ""}
|
|
|
|
|
</p>)}
|
|
|
|
|
</div>
|
|
|
|
|