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