diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index bde5895e1..8d3726e1a 100755 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -43,7 +43,7 @@ class CompetitionCommon extends Component{ // }) // } // }).catch((error) => { - // console.log(error) + // //console.log(error) // }) } } @@ -51,8 +51,8 @@ class CompetitionCommon extends Component{ componentDidUpdate = (prevProps) => { if (prevProps.user != this.props.user) { - console.log("componentDidUpdatess"); - console.log(this.props.user); + //console.log("componentDidUpdatess"); + //console.log(this.props.user); if (this.props.user && this.props.user.login != "") { const zul = `/competitions/${this.props.match.params.identifier}/competition_staff.json`; axios.get((zul)).then((result) => { @@ -64,7 +64,7 @@ class CompetitionCommon extends Component{ } } }).catch((error) => { - //console.log(error); + ////console.log(error); }) } } @@ -103,7 +103,7 @@ class CompetitionCommon extends Component{ } } }).catch((error) => { - console.log(error) + //console.log(error) }) //this.props.user 有可能为空 @@ -119,7 +119,7 @@ class CompetitionCommon extends Component{ } } }).catch((error) => { - //console.log(error); + ////console.log(error); }) } @@ -161,7 +161,7 @@ class CompetitionCommon extends Component{ } }).catch((error) => { - console.log(error) + //console.log(error) }) } } @@ -192,7 +192,7 @@ class CompetitionCommon extends Component{ } }).catch((error) => { - console.log(error) + //console.log(error) }) }else{ if (module_url.substring(0, 7) == 'http://' || module_url.substring(0, 8) == 'https://') { @@ -309,7 +309,7 @@ class CompetitionCommon extends Component{ }) } }).catch((error) => { - console.log(error) + //console.log(error) }) } diff --git a/public/react/src/modules/courses/exercise/new/SingleEditor.js b/public/react/src/modules/courses/exercise/new/SingleEditor.js index 1e2005360..f3c917c75 100644 --- a/public/react/src/modules/courses/exercise/new/SingleEditor.js +++ b/public/react/src/modules/courses/exercise/new/SingleEditor.js @@ -16,8 +16,8 @@ const $ = window.$ const { Option } = Select; const tagArray = [ - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', - 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', + 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ] class SingleEditor extends Component{ @@ -92,13 +92,13 @@ class SingleEditor extends Component{ } - + const intScore = parseFloat(question_score) if (intScore == 0) { this.props.showNotification('分值:必须大于0'); return; } else if(!question_score || intScore == NaN) { this.props.showNotification('分值:不能为空'); return; - } + } if(!answerArray || answerArray.length == 0) { this.props.showNotification('请先点击选择本选择题的正确选项'); return; } @@ -119,9 +119,9 @@ class SingleEditor extends Component{ "question_type":1, "question_score":5, "question_choices":["a答案","b答案","c答案","d答案"], - "standard_answers":[1] + "standard_answers":[1] }*/ - const Id = this.props.match.params.Id + const Id = this.props.match.params.Id if (question_id) { const editUrl = this.props.getEditQuestionUrl(question_id); axios.put(editUrl, { @@ -144,7 +144,7 @@ class SingleEditor extends Component{ }); } else { const url = this.props.getAddQuestionUrl(); - + axios.post(url, { exercise_bank_id: Id, question_title, @@ -162,16 +162,16 @@ class SingleEditor extends Component{ .catch(function (error) { console.log(error); }); - } + } } onCancel = () => { this.props.onEditorCancel() } - + componentDidMount = () => { - + } onOptionClick = (index) => { // if (this.props.exerciseIsPublish) { @@ -186,7 +186,7 @@ class SingleEditor extends Component{ // TODO 新建,然后删除CD选项,再输入题干,会调用到这里,且index是3 return; } - let question_choices = this.state.question_choices.slice(0); + let question_choices = this.state.question_choices.slice(0); question_choices[index] = value; this.setState({ question_choices }) } @@ -200,19 +200,19 @@ class SingleEditor extends Component{ mdReactObject.toShowMode() } this.mdReactObject = that; - + } toShowMode = () => { - + } render() { let { question_title, question_score, question_type, question_choices, standard_answers } = this.state; let { question_id, index, exerciseIsPublish, - // question_title, - // question_type, + // question_title, + // question_type, // question_score, isNew } = this.props; - + // const { getFieldDecorator } = this.props.form; const isAdmin = this.props.isAdmin() @@ -221,8 +221,8 @@ class SingleEditor extends Component{ const qNumber = `question_${index}`; // TODO show模式 isNew为false isEdit为false - // [true, false, true] -> [0, 2] - + // [true, false, true] -> [0, 2] + const answerTagArray = standard_answers.map((item, index) => { return item == true ? tagArray[index] : -1 }).filter(item => item != -1); return(
@@ -253,8 +253,8 @@ class SingleEditor extends Component{ ref="titleEditor" > - - {question_choices.map( (item, index) => { + + {question_choices.map( (item, index) => { const bg = standard_answers[index] ? 'check-option-bg' : '' return
{/* 点击设置答案 */} @@ -268,7 +268,7 @@ class SingleEditor extends Component{ {/* */}
- {/* {!exerciseIsPublish && 新增选项} */} - - {!exerciseIsPublish ? '温馨提示:点击选项标题,可以直接设置答案;选择多个答案即为多选题' : ' '} + + {!exerciseIsPublish ? '温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题' : ' '} { answerTagArray && !!answerTagArray.length ? {answerTagArray.join(' ')} 标准答案: - : - 请点击正确选项 + : + 温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题 }
@@ -310,18 +311,18 @@ class SingleEditor extends Component{  分 - + 取消 保存 - +
- +
) } } // RouteHOC() -export default (SingleEditor); \ No newline at end of file +export default (SingleEditor);