|
|
|
@ -54,7 +54,7 @@ class SingleDisplay extends Component{
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
let { question_title, question_score, question_type, question_choices, standard_answer,
|
|
|
|
|
question_id, question_number, index, displayCount
|
|
|
|
|
question_id, question_number, index, displayCount, showActionButton
|
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
// const { getFieldDecorator } = this.props.form;
|
|
|
|
@ -70,6 +70,9 @@ class SingleDisplay extends Component{
|
|
|
|
|
// const answerTagArray = standard_answer.map((item, index) => { return item == true ? tagArray[index] : -1 }).filter(item => item != -1);
|
|
|
|
|
let length = 5;
|
|
|
|
|
const qName = qNameArray[question_type]
|
|
|
|
|
|
|
|
|
|
const isPreviewPage = showActionButton == false
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<div className="bor-bottom-greyE padding20-30 singleDisplay" id={qNumber} _id={question_id}>
|
|
|
|
|
<style>{`
|
|
|
|
@ -89,20 +92,24 @@ class SingleDisplay extends Component{
|
|
|
|
|
{/* 单选 or 多选 */}
|
|
|
|
|
<div className="options">
|
|
|
|
|
{ question_choices.map((item, optionIndex) => {
|
|
|
|
|
let prefix = ''
|
|
|
|
|
if (!isPreviewPage) {
|
|
|
|
|
prefix = `${tagArray[optionIndex]}.`
|
|
|
|
|
}
|
|
|
|
|
if (question_type == 0) { // 单选
|
|
|
|
|
return (
|
|
|
|
|
<div className="mb10 clearfix" key={optionIndex}>
|
|
|
|
|
<Radio disabled className="fl lineh-20" checked={item.standard_boolean}></Radio>
|
|
|
|
|
<Radio disabled className="fl lineh-20" checked={item.standard_boolean}>{prefix}</Radio>
|
|
|
|
|
<span style={{ display: 'inline-block'}} className="markdown-body fl"
|
|
|
|
|
dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
|
|
|
|
|
dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
|
|
|
|
|
</div>)
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="mb10 clearfix" key={optionIndex}>
|
|
|
|
|
<Checkbox disabled className="fl lineh-20" checked={item.standard_boolean}></Checkbox>
|
|
|
|
|
<Checkbox disabled className="fl lineh-20" checked={item.standard_boolean}>{prefix}</Checkbox>
|
|
|
|
|
<span style={{ display: 'inline-block'}} className="markdown-body fl"
|
|
|
|
|
dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
|
|
|
|
|
dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
|
|
|
|
|
</div>)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|