|
|
|
@ -187,8 +187,10 @@ class PollInfo extends Component{
|
|
|
|
|
}else{
|
|
|
|
|
flag = answers==a_id?true:false;
|
|
|
|
|
}
|
|
|
|
|
if(answers && (answers.length>0 || answers !="")){
|
|
|
|
|
this.postAnswer(q_id,answers,flag ? inputs.text : "",key);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//提交主观题
|
|
|
|
|
commitText=(key,q_id)=>{
|
|
|
|
@ -379,13 +381,21 @@ class PollInfo extends Component{
|
|
|
|
|
<div className="previewList" id={'Anchor_'+`${key}`}>
|
|
|
|
|
<div className="pl30 pr30 mt30 mb10 clearfix">
|
|
|
|
|
<span className="color-blue fl font-16">{item.question.question_number}、{map[item.question.question_type]}</span>
|
|
|
|
|
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mt5">必答</span>:"" }
|
|
|
|
|
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10 mt5">必答</span>:<span className="mustAnswer fl ml10 mr10 mt5">选答</span> }
|
|
|
|
|
{ item.question.question_type == 2 ?
|
|
|
|
|
<span className="color-grey-9 font-14 fl mt2">
|
|
|
|
|
{
|
|
|
|
|
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :
|
|
|
|
|
"可选"+item.question.min_choices+"-"+item.question.max_choices+"项"
|
|
|
|
|
}
|
|
|
|
|
</span>:""
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
<li className="pl30 pr30 mb10 lineh-20">{item.question.question_title}</li>
|
|
|
|
|
{
|
|
|
|
|
//单选
|
|
|
|
|
item.question.question_type==1 &&
|
|
|
|
|
<Radio.Group disabled={isAdmin?true:false} className="answerList" defaultValue={item.question.poll_answer_ids[0]} name={[item.question.id,key]} onChange={this.ChangeOptionSingle}>
|
|
|
|
|
<Radio.Group disabled={isAdmin || (isStudent && poll && poll.user_poll_status == 1)?true:false} className="answerList" defaultValue={item.question.poll_answer_ids[0]} name={[item.question.id,key]} onChange={this.ChangeOptionSingle}>
|
|
|
|
|
{
|
|
|
|
|
item.question.answers && item.question.answers.map((i,k)=>{
|
|
|
|
|
return(
|
|
|
|
@ -422,7 +432,12 @@ class PollInfo extends Component{
|
|
|
|
|
{
|
|
|
|
|
//多选
|
|
|
|
|
item.question.question_type==2 &&
|
|
|
|
|
<Checkbox.Group onChange={(value)=>this.ChangeOptionMuntil(value,item.question.id,key)} disabled={isAdmin?true:false} defaultValue={item.question.poll_answer_ids} className="answerList" name={key}>
|
|
|
|
|
<Checkbox.Group
|
|
|
|
|
onChange={(value)=>this.ChangeOptionMuntil(value,item.question.id,key)}
|
|
|
|
|
disabled={isAdmin || (isStudent && poll && poll.user_poll_status == 1)?true:false}
|
|
|
|
|
defaultValue={item.question.poll_answer_ids}
|
|
|
|
|
className="answerList"
|
|
|
|
|
name={key}>
|
|
|
|
|
{
|
|
|
|
|
item.question.answers && item.question.answers.map((i,k)=>{
|
|
|
|
|
return(
|
|
|
|
@ -466,14 +481,13 @@ class PollInfo extends Component{
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{
|
|
|
|
|
j.id == item.question.id ?
|
|
|
|
|
<textarea placeholder="在此填入答案" disabled={isAdmin?true:false} value={j.text && j.text} className="winput-100-130" name={key} onInput={this.blurTxt} onBlur={()=>this.commitText(key,item.question.id)}></textarea>
|
|
|
|
|
<textarea placeholder="在此填入答案" disabled={isAdmin || (isStudent && poll && poll.user_poll_status == 1) ? true:false} value={j.text && j.text} className="winput-100-130" name={key} onInput={this.blurTxt} onBlur={()=>this.commitText(key,item.question.id)}></textarea>
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|