|
|
|
@ -15,6 +15,7 @@ class Multiple extends Component{
|
|
|
|
|
saveId=(value)=>{
|
|
|
|
|
let question_id=this.props.questionType.question_id;
|
|
|
|
|
let url=`/exercise_questions/${question_id}/exercise_answers.json`;
|
|
|
|
|
let {index}=this.props;
|
|
|
|
|
axios.post((url),{
|
|
|
|
|
exercise_choice_id:value
|
|
|
|
|
}).then((result)=>{
|
|
|
|
@ -25,6 +26,7 @@ class Multiple extends Component{
|
|
|
|
|
}else{
|
|
|
|
|
k=0;
|
|
|
|
|
}
|
|
|
|
|
this.props.changeOption && this.props.changeOption(index,value);
|
|
|
|
|
this.props.changeQuestionStatus && this.props.changeQuestionStatus(parseInt(this.props.questionType.q_position)-1,k);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
@ -42,14 +44,14 @@ class Multiple extends Component{
|
|
|
|
|
console.log(questionType);
|
|
|
|
|
return(
|
|
|
|
|
<div className="pl30 pr30 singleDisplay">
|
|
|
|
|
<Checkbox.Group disabled={ user_exercise_status == 1 ? true : false } onChange={this.saveId} defaultValue={questionType.user_answer}>
|
|
|
|
|
<Checkbox.Group disabled={ user_exercise_status == 1 ? true : false } onChange={this.saveId} value={questionType.user_answer}>
|
|
|
|
|
{
|
|
|
|
|
questionType.question_choices && questionType.question_choices.map((item,key)=>{
|
|
|
|
|
let prefix = `${tagArray[key]}.`
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<p className="clearfix mb15 df">
|
|
|
|
|
<Checkbox className="fl lineh-20 " value={item.choice_id}>{prefix}</Checkbox>
|
|
|
|
|
<Checkbox className="fl lineh-15 df mr8 mt2" value={item.choice_id}>{prefix}</Checkbox>
|
|
|
|
|
{/* <span class="fl lineh-20 mt1"></span> */}
|
|
|
|
|
{/* <span style={{display:"inline-block"}} className="markdown-body " dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}></span> */}
|
|
|
|
|
<MarkdownToHtml content={item.choice_text} selector={'multiple_' + (this.props.index + 1) + (key + 1)}
|
|
|
|
|