From 4568e0c0c0cb5191c4f23f08db655e808053346f Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 24 Jul 2019 14:50:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/ExerciseReviewAndAnswer.js | 2 +- .../exercise/Exercisestatisticalresult.js | 1 + .../courses/exercise/Exercisetablesmubu.js | 41 ++++++++++++++----- .../courses/exercise/new/SingleDisplay.js | 4 +- .../modules/courses/exercise/new/common.css | 4 ++ .../courses/exercise/question/multiple.js | 15 ++++--- .../courses/exercise/question/single.js | 14 ++++--- 7 files changed, 56 insertions(+), 25 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index b9f0f67f9..eb8143c03 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -20,7 +20,7 @@ import ShixunAnswer from './question/shixunAnswer' import update from 'immutability-helper' import axios from 'axios'; - +import './new/common.css' const Textarea =Input.TextArea const tagArray = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index f6389613b..6e7b52715 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -222,6 +222,7 @@ class Exercisestatisticalresult extends Component { ) }): { datas.push({ - commit_percent:{num:item.choice_position,value:type===4||type===5?choicetype[item.choice_text-1]:item.choice_text,type:item.choice_right_boolean}, + commit_percent:{ + num:item.choice_position, + value:type===4||type===5?choicetype[item.choice_text-1]:item.choice_text, + type:item.choice_right_boolean, + _type: type + }, min_score:{value:item.choice_users_count,type:item.choice_right_boolean}, max_score:item.choice_percent, }) @@ -40,13 +51,23 @@ class Exercisetablesmubus extends Component { title: '选项', dataIndex: 'commit_percent', key: 'commit_percent', - render: (text, record) => ( - - {text.value!="有效填写量"&&text.value!="wrong"?text.value:false} - {text.value==="wrong"?"填写了错误答案":false} - {text.value==="有效填写量"?"有效填写量":false} - - ), + render: (text, record, index) => { + const _content = + {text.value!="有效填写量"&&text.value!="wrong" && + + } + {text.value==="wrong" && "填写了错误答案" } + {text.value==="有效填写量" && "有效填写量" } + + return ( + + (text._type === 0 || text._type === 1) ?
+ {{tagArray[index]}.} + {_content} +
: {_content} + ) + + }, }, { title: '小计', dataIndex: 'min_score', diff --git a/public/react/src/modules/courses/exercise/new/SingleDisplay.js b/public/react/src/modules/courses/exercise/new/SingleDisplay.js index b7a1905fc..13d1e838c 100644 --- a/public/react/src/modules/courses/exercise/new/SingleDisplay.js +++ b/public/react/src/modules/courses/exercise/new/SingleDisplay.js @@ -93,9 +93,9 @@ class SingleDisplay extends Component{
{ question_choices.map((item, optionIndex) => { let prefix = undefined - if (!isPreviewPage) { + // if (!isPreviewPage) { prefix = `${tagArray[optionIndex]}.` - } + // } if (question_type == 0) { // 单选 return (
diff --git a/public/react/src/modules/courses/exercise/new/common.css b/public/react/src/modules/courses/exercise/new/common.css index 0fef369e3..7e1e2530f 100644 --- a/public/react/src/modules/courses/exercise/new/common.css +++ b/public/react/src/modules/courses/exercise/new/common.css @@ -33,4 +33,8 @@ .singleDisplay .options .markdown-body { max-width: 1116px; +} +.singleDisplay .ant-radio-wrapper span:last-child + , .singleDisplay .ant-checkbox-wrapper span:last-child { + padding-right: 0px; } \ No newline at end of file diff --git a/public/react/src/modules/courses/exercise/question/multiple.js b/public/react/src/modules/courses/exercise/question/multiple.js index 60dbc9ac9..3ef3d960f 100644 --- a/public/react/src/modules/courses/exercise/question/multiple.js +++ b/public/react/src/modules/courses/exercise/question/multiple.js @@ -4,9 +4,9 @@ import {markdownToHTML} from 'educoder' import axios from 'axios' const tagArray = [ - // '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' + '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 Multiple extends Component{ constructor(props){ @@ -41,14 +41,17 @@ class Multiple extends Component{ let isStudent =this.props.isStudent(); console.log(questionType); return( -
+
{ questionType.question_choices && questionType.question_choices.map((item,key)=>{ + let prefix = `${tagArray[key]}.` + return(

- - + {prefix} + {/* */} +

) }) diff --git a/public/react/src/modules/courses/exercise/question/single.js b/public/react/src/modules/courses/exercise/question/single.js index 5f514581a..aa23aa3d9 100644 --- a/public/react/src/modules/courses/exercise/question/single.js +++ b/public/react/src/modules/courses/exercise/question/single.js @@ -4,9 +4,9 @@ import {Checkbox,Radio, Input} from "antd"; import {markdownToHTML} from 'educoder' import axios from 'axios' const tagArray = [ - // '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' + '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 single extends Component{ constructor(props){ @@ -36,14 +36,16 @@ class single extends Component{ let isStudent =this.props.isStudent(); return( -
+
{ questionType.question_choices && questionType.question_choices.map((item,key)=>{ + let prefix = `${tagArray[key]}.` return(

- - + {prefix} + {/* */} +

) })