|
|
@ -16,8 +16,8 @@ const $ = window.$
|
|
|
|
const { Option } = Select;
|
|
|
|
const { Option } = Select;
|
|
|
|
|
|
|
|
|
|
|
|
const tagArray = [
|
|
|
|
const tagArray = [
|
|
|
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
|
|
|
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
|
|
|
|
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
|
|
|
|
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
|
|
|
|
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
|
|
|
|
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
|
|
|
|
]
|
|
|
|
]
|
|
|
|
class SingleEditor extends Component{
|
|
|
|
class SingleEditor extends Component{
|
|
|
@ -186,7 +186,7 @@ class SingleEditor extends Component{
|
|
|
|
// TODO 新建,然后删除CD选项,再输入题干,会调用到这里,且index是3
|
|
|
|
// TODO 新建,然后删除CD选项,再输入题干,会调用到这里,且index是3
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let question_choices = this.state.question_choices.slice(0);
|
|
|
|
let question_choices = this.state.question_choices.slice(0);
|
|
|
|
question_choices[index] = value;
|
|
|
|
question_choices[index] = value;
|
|
|
|
this.setState({ question_choices })
|
|
|
|
this.setState({ question_choices })
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -208,8 +208,8 @@ class SingleEditor extends Component{
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let { question_title, question_score, question_type, question_choices, standard_answers } = this.state;
|
|
|
|
let { question_title, question_score, question_type, question_choices, standard_answers } = this.state;
|
|
|
|
let { question_id, index, exerciseIsPublish,
|
|
|
|
let { question_id, index, exerciseIsPublish,
|
|
|
|
// question_title,
|
|
|
|
// question_title,
|
|
|
|
// question_type,
|
|
|
|
// question_type,
|
|
|
|
// question_score,
|
|
|
|
// question_score,
|
|
|
|
isNew } = this.props;
|
|
|
|
isNew } = this.props;
|
|
|
|
|
|
|
|
|
|
|
@ -254,7 +254,7 @@ class SingleEditor extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
></TPMMDEditor>
|
|
|
|
></TPMMDEditor>
|
|
|
|
|
|
|
|
|
|
|
|
{question_choices.map( (item, index) => {
|
|
|
|
{question_choices.map( (item, index) => {
|
|
|
|
const bg = standard_answers[index] ? 'check-option-bg' : ''
|
|
|
|
const bg = standard_answers[index] ? 'check-option-bg' : ''
|
|
|
|
return <div className="df optionRow " >
|
|
|
|
return <div className="df optionRow " >
|
|
|
|
{/* 点击设置答案 */}
|
|
|
|
{/* 点击设置答案 */}
|
|
|
@ -268,7 +268,7 @@ class SingleEditor extends Component{
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
{/* </Tooltip> */}
|
|
|
|
{/* </Tooltip> */}
|
|
|
|
<div style={{ flex: '0 0 1038px'}}>
|
|
|
|
<div style={{ flex: '0 0 1038px'}}>
|
|
|
|
<DMDEditor
|
|
|
|
<DMDEditor
|
|
|
|
ref={`optionEditor${index}`}
|
|
|
|
ref={`optionEditor${index}`}
|
|
|
|
toMDMode={this.toMDMode} toShowMode={this.toShowMode}
|
|
|
|
toMDMode={this.toMDMode} toShowMode={this.toShowMode}
|
|
|
|
height={166} className={'optionMdEditor'} noStorage={true}
|
|
|
|
height={166} className={'optionMdEditor'} noStorage={true}
|
|
|
@ -294,14 +294,15 @@ class SingleEditor extends Component{
|
|
|
|
<div className="mb20">
|
|
|
|
<div className="mb20">
|
|
|
|
{/* {!exerciseIsPublish && <ActionBtn style="grey" className="middle mr20" onClick={this.addOption}>新增选项</ActionBtn>} */}
|
|
|
|
{/* {!exerciseIsPublish && <ActionBtn style="grey" className="middle mr20" onClick={this.addOption}>新增选项</ActionBtn>} */}
|
|
|
|
|
|
|
|
|
|
|
|
<span style={{color: '#FF6800'}}>{!exerciseIsPublish ? '温馨提示:点击选项标题,可以直接设置答案;选择多个答案即为多选题' : ' '}</span>
|
|
|
|
<span
|
|
|
|
|
|
|
|
style={{color: '#FF6800'}}>{!exerciseIsPublish ? '温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题' : ' '}</span>
|
|
|
|
{ answerTagArray && !!answerTagArray.length ?
|
|
|
|
{ answerTagArray && !!answerTagArray.length ?
|
|
|
|
<React.Fragment>
|
|
|
|
<React.Fragment>
|
|
|
|
<span className="fr color-orange">{answerTagArray.join(' ')}</span>
|
|
|
|
<span className="fr color-orange">{answerTagArray.join(' ')}</span>
|
|
|
|
<span className="fr">标准答案:</span>
|
|
|
|
<span className="fr">标准答案:</span>
|
|
|
|
</React.Fragment>
|
|
|
|
</React.Fragment>
|
|
|
|
:
|
|
|
|
:
|
|
|
|
<span className="fr color-orange">请点击正确选项</span>
|
|
|
|
<span className="fl color-orange">温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题</span>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|