|
|
|
@ -87,7 +87,10 @@ class SingleEditor extends Component{
|
|
|
|
|
// TODO check
|
|
|
|
|
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
|
|
|
|
|
if(!question_title) {
|
|
|
|
|
this.refs['titleEditor'].showError()
|
|
|
|
|
this.props.showNotification('题目不能为空'); return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const intScore = parseFloat(question_score)
|
|
|
|
|
if(!question_score || intScore == NaN) {
|
|
|
|
@ -101,11 +104,15 @@ class SingleEditor extends Component{
|
|
|
|
|
this.props.showNotification('请先点击选择本选择题的正确选项'); return;
|
|
|
|
|
}
|
|
|
|
|
if(!question_title) {
|
|
|
|
|
this.refs['titleEditor'].showError()
|
|
|
|
|
this.props.showNotification('题目不能为空'); return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(let i = 0; i < question_choices.length; i++) {
|
|
|
|
|
if (!question_choices[i]) {
|
|
|
|
|
this.refs[`optionEditor${i}`].showError()
|
|
|
|
|
this.props.showNotification(`请先输入 ${tagArray[i]} 选项的内容`); return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -237,6 +244,8 @@ class SingleEditor extends Component{
|
|
|
|
|
|
|
|
|
|
<TPMMDEditor mdID={qNumber} placeholder="请您输入题目" height={155} watch={false} className="mb20"
|
|
|
|
|
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
|
|
|
|
|
ref="titleEditor"
|
|
|
|
|
|
|
|
|
|
></TPMMDEditor>
|
|
|
|
|
|
|
|
|
|
{question_choices.map( (item, index) => {
|
|
|
|
@ -254,6 +263,7 @@ class SingleEditor extends Component{
|
|
|
|
|
{/* </Tooltip> */}
|
|
|
|
|
<div style={{ flex: '0 0 1038px'}}>
|
|
|
|
|
<DMDEditor
|
|
|
|
|
ref={`optionEditor${index}`}
|
|
|
|
|
toMDMode={this.toMDMode} toShowMode={this.toShowMode}
|
|
|
|
|
height={166} className={'optionMdEditor'} watch={false} noStorage={true}
|
|
|
|
|
mdID={qNumber + index} placeholder="" onChange={(value) => this.onOptionContentChange(value, index)}
|
|
|
|
|