From 58bf03e694d827e3c39db93f3708acdc4663bbe6 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sat, 22 Jun 2019 09:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=8E=E6=97=A5=E7=AD=BE=E5=88=B0=E7=9A=84?= =?UTF-8?q?=E9=87=91=E5=B8=81=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/ExerciseReviewAndAnswer.js | 18 +++++++++++------- .../courses/exercise/question/shixunAnswer.js | 4 ++-- .../react/src/modules/user/usersInfo/Infos.js | 14 ++++++++++---- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index 58569554f..06291a8d6 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -73,8 +73,9 @@ class ExerciseReviewAndAnswer extends Component{ setScoreReason:undefined, setTip:"", - Id:undefined - + Id:undefined, + // 试卷总分 + exerciseTotalScore:undefined } } componentDidUpdate (prevProps) { @@ -185,7 +186,8 @@ class ExerciseReviewAndAnswer extends Component{ exercise_answer_user:result.data.exercise_answer_user, exercise_questions:result.data.exercise_questions, user_exercise_status:1, - Id:result.data.exercise_answer_user.user_id + Id:result.data.exercise_answer_user.user_id, + exerciseTotalScore:result.data.exercise_answer_user.score }) } }).catch((error)=>{ @@ -207,7 +209,8 @@ class ExerciseReviewAndAnswer extends Component{ exercise_scores:result.data.exercise_scores, exercise_questions:result.data.exercise_questions, user_exercise_status:result.data.exercise.user_exercise_status, - time:result.data.exercise.left_time + time:result.data.exercise.left_time, + exerciseTotalScore:result.data.user_score }) if(result.data.exercise.left_time != null){ this.remainTime(); @@ -490,7 +493,8 @@ class ExerciseReviewAndAnswer extends Component{ modalsBottomval, ModalCancel, ModalSave, - Loadtype + Loadtype, + exerciseTotalScore }=this.state let isAdmin = this.props.isAdmin(); let isStudent =this.props.isStudent(); @@ -579,8 +583,8 @@ class ExerciseReviewAndAnswer extends Component{ exercise_start_at && 开始答题时间:{ exercise_start_at && moment(exercise_start_at).format(format) } } { - exercise_answer_user && !!exercise_answer_user.score && - 总分: { exercise_answer_user.score } + (isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore && + 总分: { exerciseTotalScore } } { diff --git a/public/react/src/modules/courses/exercise/question/shixunAnswer.js b/public/react/src/modules/courses/exercise/question/shixunAnswer.js index 40dc11ed6..0ce4b3084 100644 --- a/public/react/src/modules/courses/exercise/question/shixunAnswer.js +++ b/public/react/src/modules/courses/exercise/question/shixunAnswer.js @@ -269,7 +269,7 @@ class shixunAnswer extends Component{ } { item.operation ? - this.scrollToAnchor(`${index+1}`)}>查看 + this.scrollToAnchor(`${questionType.question_id}${index+1}`)}>查看 : -- } @@ -292,7 +292,7 @@ class shixunAnswer extends Component{ { challenge.map((item,key)=>{ return( -
+

diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 201d5b43a..026ebc06b 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -46,7 +46,8 @@ class Infos extends Component{ type:0, login:undefined, isRenders:false, - moduleName:"courses" + moduleName:"courses", + next_gold:undefined } } componentDidMount =()=>{ @@ -75,7 +76,8 @@ class Infos extends Component{ data:result.data, followed:result.data.followed, sign:result.data.brief_introduction, - id:result.data.id + id:result.data.id, + next_gold:result.data.tomorrow_attendance_gold }) } }).catch((error)=>{ @@ -133,6 +135,9 @@ class Infos extends Component{ data : update(prevState.data, {attendance_signed: {$set: true} }) }) ) + this.setState({ + next_gold:result.data.next_gold + }) } }).catch((error)=>{ console.log(error); @@ -195,7 +200,8 @@ class Infos extends Component{ id, login, isRenders, - moduleName + moduleName, + next_gold }=this.state; let {username}= this.props.match.params; @@ -291,7 +297,7 @@ class Infos extends Component{ data.attendance_signed ? 已签到 - 明日签到 +{data && data.tomorrow_attendance_gold} 金币 + 明日签到 +{next_gold} 金币 : 签到