From fee5c58785e50dc91ccf56109cfe7fdfa7c2dab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 8 Nov 2019 14:47:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coursesPublic/ModulationModal_exercise.js | 129 +++++++++--------- .../exercise/Studentshavecompletedthelist.js | 34 +++-- 2 files changed, 86 insertions(+), 77 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js b/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js index ff5fea43d..538b32773 100644 --- a/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js +++ b/public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js @@ -8,43 +8,24 @@ class ModulationModal_exercise extends Component { constructor(props) { super(props); this.state = { - group_ids: [], - fileList: [], - textareaval: undefined, - Inputsval: undefined + score: 0, + subjective_questions: 0, + objective_questions: 0, + + } + //因为主观题加客观题的和是总分 } + componentDidMount = () => { - Saves = () => { - let {textareaval, Inputsval} = this.state; - // if(textareaval===""||textareaval===undefined){ - // this.setState({ - // textareavaltype:true - // }) - // return - // } - this.setState({ - textareavaltype: false - }) - if (Inputsval === undefined || Inputsval === "") { - this.setState({ - Inputsval: "", - Inputsvaltype: true, - Inputsvaltest: "请输入分数", - }) - return - } + } - if (this.state.Inputsvaltype === true) { - return; - } - this.setState({ - Inputsvaltype: false, - Inputsvaltest: "", - }) - this.props.Saves(textareaval, Inputsval) + Saves = () => { + let {textareaval, subjective_questions, objective_questions, score} = this.state; + + // this.props.Saves(textareaval, Inputsval) } @@ -55,41 +36,18 @@ class ModulationModal_exercise extends Component { } setInputs = (e) => { - debugger - var value = parseInt(e.target.value) - - if (isNaN(value)) { - value = 0; - this.setState({ - Inputsval: value, - Inputsvaltype: true, - Inputsvaltest: "请输入分数", - }) - } else { - if (value < 0 || value > 100) { - value = 0; - this.setState({ - Inputsval: value, - Inputsvaltype: true, - Inputsvaltest: "请输入0-100的分数", - }) - - } - } - this.setState({ - Inputsval: value, - Inputsvaltype: false, - }) + + } render() { - let {textareaval, Inputsval, textareavaltype, Inputsvaltype, Inputsvaltest} = this.state; + let {Inputsvaltype, subjective_questions, objective_questions, score} = this.state; return (
+
+

主观题成绩:

+ this.setInputs(e)} + value={subjective_questions === undefined || subjective_questions === null ? "" : subjective_questions}/> +

分 ,

+

总分:45.0

+
+ +
+ +

客观题成绩:

+ this.setInputs(e)} + value={objective_questions === undefined || objective_questions === null ? "" : objective_questions}/> +

分 ,

+

总分:45.0

+ +
+ +
+

最终成绩:

+ this.setInputs(e)} + value={score === undefined || score === null ? "" : score}/> +

分 ,

+

总分:45.0

+ +
+ -
+
{this.props.Cancelname || '取消'} ( {record.finalscore==="--"? - - -- - + this.Adjustment(record.user_id)}>评阅 : ( {record.finalscore==="--"? - - -- - + this.Adjustment(record.user_id)}>评阅 : { if (response.data.status == '0') { @@ -2661,11 +2662,18 @@ class Studentshavecompletedthelist extends Component {
:
- {testpapergradingboll === true ? this.Adjustments()} - Saves={(value, num) => this.Testpapergrading(value, num)} - /> : ""} + {/*{testpapergradingboll === true ? this.Adjustments()}*/} + {/* Saves={(value, num) => this.Testpapergrading(value, num)}*/} + {/*/> : ""}*/} + { + testpapergradingboll === true ? this.Adjustments()} + Saves={(value, num) => this.Testpapergrading(value, num)} + /> : "" + }