From 0d2942112394c970e597ee740d687eaae6137605 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 5 Sep 2019 18:15:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E9=A2=98=E5=BA=93?= =?UTF-8?q?=E7=9A=84=E5=88=86=E6=95=B0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_banks_controller.rb | 26 +++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/app/controllers/exercise_banks_controller.rb b/app/controllers/exercise_banks_controller.rb index b52fe2c86..ce6259c19 100644 --- a/app/controllers/exercise_banks_controller.rb +++ b/app/controllers/exercise_banks_controller.rb @@ -85,45 +85,47 @@ class ExerciseBanksController < ApplicationController end def get_exercise_question_count - @exercise_ques_count = @exercise_questions.size # 全部的题目数 - @exercise_ques_scores = @exercise_questions.pluck(:question_score).sum + exercise_questions = @bank.exercise_bank_questions + @exercise_ques_count = exercise_questions.size # 全部的题目数 + @exercise_ques_scores = exercise_questions.pluck(:question_score).sum #单选题的数量及分数 - exercise_single_ques = @exercise_questions.find_by_custom("question_type", Exercise::SINGLE) + exercise_single_ques = exercise_questions.find_by_custom("question_type", Exercise::SINGLE) @exercise_single_ques_count = exercise_single_ques.size @exercise_single_ques_scores = exercise_single_ques.pluck(:question_score).sum #多选题的数量及分数 - exercise_double_ques = @exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE) + exercise_double_ques = exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE) @exercise_double_ques_count = exercise_double_ques.size @exercise_double_ques_scores = exercise_double_ques.pluck(:question_score).sum # 判断题数量及分数 - exercise_ques_judge = @exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT) + exercise_ques_judge = exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT) @exercise_ques_judge_count = exercise_ques_judge.size @exercise_ques_judge_scores = exercise_ques_judge.pluck(:question_score).sum #填空题数量及分数 - exercise_ques_null = @exercise_questions.find_by_custom("question_type", Exercise::COMPLETION) + exercise_ques_null = exercise_questions.find_by_custom("question_type", Exercise::COMPLETION) @exercise_ques_null_count = exercise_ques_null.size @exercise_ques_null_scores = exercise_ques_null.pluck(:question_score).sum #简答题数量及分数 - exercise_ques_main = @exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE) + exercise_ques_main = exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE) @exercise_ques_main_count = exercise_ques_main.size @exercise_ques_main_scores = exercise_ques_main.pluck(:question_score).sum #实训题数量及分数 - exercise_ques_shixun = @exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL) + exercise_ques_shixun = exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL) @exercise_ques_shixun_count = exercise_ques_shixun.size @exercise_ques_shixun_scores = exercise_ques_shixun.pluck(:question_score).sum end def get_poll_question_count - @poll_questions_count = @exercise_questions&.size # 全部的题目数 - @poll_question_singles = @exercise_questions.find_by_custom("question_type", 1).size # 单选题 - @poll_question_doubles = @exercise_questions.find_by_custom("question_type", 2).size # 多选题 - @poll_question_mains = @exercise_questions.find_by_custom("question_type", 3).size #主观题 + exercise_questions = @bank.exercise_bank_questions + @poll_questions_count = exercise_questions&.size # 全部的题目数 + @poll_question_singles = exercise_questions.find_by_custom("question_type", 1).size # 单选题 + @poll_question_doubles = exercise_questions.find_by_custom("question_type", 2).size # 多选题 + @poll_question_mains = exercise_questions.find_by_custom("question_type", 3).size #主观题 end end From dceed4fc5b74ede251374321beebef52e4d98956 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 5 Sep 2019 18:30:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 7eef670fc..526535157 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -475,7 +475,7 @@ class StudentWorksController < ApplicationController # 实训作品的评阅 def shixun_work_comment tip_exception("评阅不能为空") if params[:comment].blank? - tip_exception("缺少is_hidden参数") if params[:is_hidden].blank? || ![true, false].include?(params[:is_hidden]) + tip_exception("缺少is_hidden参数") if params[:is_hidden].blank? || ![1, 0].include?(params[:is_hidden]) comment = @work.student_works_scores.shixun_comment.first || StudentWorksScore.new(student_work_id: @work.id, user_id: current_user.id) comment.comment = params[:comment] comment.is_hidden = params[:is_hidden] From 0f162b7e88e03bd8ceed31e3a060967f54fa3d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 5 Sep 2019 18:40:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 140 +++++++++--------- 1 file changed, 73 insertions(+), 67 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 64e2e6a99..cf04431df 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2598,29 +2598,31 @@ class Listofworksstudentone extends Component { color:rgba(255,104,0,1); } - .computeTime{ - width: 73px; - height: 24px; - display: inline-block; - padding: 5px; - text-align: center; - line-height: 13px; - color: #4CACFF; - border: 1px solid #4CACFF; - cursor: pointer; - } + .computeTime { + width: 122px; + height: 31px; + display: inline-block; + padding: 5px; + text-align: center; + line-height: 20px; + color: #FE6B21; + border: 1px solid #FE6B21; + cursor: pointer; + border-radius: 4px; + } - .computeTimes{ - width: 73px; - height: 24px; - display: inline-block; - padding: 5px; - text-align: center; - line-height: 13px; - color: #C5C5C5; - border: 1px solid #EDEDED; - background:#EDEDED; - cursor: pointer; + .computeTimes{ + width: 122px; + height: 31px; + display: inline-block; + padding: 5px; + text-align: center; + line-height: 20px; + color: #C5C5C5; + border: 1px solid #EDEDED; + background:#EDEDED; + cursor: pointer; + border-radius: 4px; } .shixunSpin{ color:#FF6801; @@ -2641,12 +2643,12 @@ class Listofworksstudentone extends Component { 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} {teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true? - (this.props.isNotMember()===false?
- 计算成绩 + (this.props.isNotMember()===false?
+ 查看最新成绩
:""): teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": - (this.props.isNotMember()===false?
- 计算成绩 + (this.props.isNotMember()===false?
+ 查看最新成绩
:"") } @@ -2840,30 +2842,32 @@ class Listofworksstudentone extends Component { font-weight:400; color:rgba(255,104,0,1); } - .computeTime{ - width: 73px; - height: 24px; - display: inline-block; - padding: 5px; - text-align: center; - line-height: 13px; - color: #4CACFF; - border: 1px solid #4CACFF; - cursor: pointer; - } + .computeTime { + width: 122px; + height: 31px; + display: inline-block; + padding: 5px; + text-align: center; + line-height: 20px; + color: #FE6B21; + border: 1px solid #FE6B21; + cursor: pointer; + border-radius: 4px; + } - .computeTimes{ - width: 73px; - height: 24px; - display: inline-block; - padding: 5px; - text-align: center; - line-height: 13px; - color: #C5C5C5; - border: 1px solid #EDEDED; - background:#EDEDED; - cursor: pointer; - } + .computeTimes{ + width: 122px; + height: 31px; + display: inline-block; + padding: 5px; + text-align: center; + line-height: 20px; + color: #C5C5C5; + border: 1px solid #EDEDED; + background:#EDEDED; + cursor: pointer; + border-radius: 4px; + } `} {visibles === true ? @@ -2947,15 +2951,15 @@ class Listofworksstudentone extends Component { {teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"": {computeTimetype===true? (this.props.isNotMember()===false? -
- 计算成绩 +
+ 查看最新成绩
:"") : (teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": this.props.isNotMember()===false? -
- 计算成绩 +
+ 查看最新成绩
:"") } @@ -3125,29 +3129,31 @@ class Listofworksstudentone extends Component { font-weight:400; color:rgba(255,104,0,1); } - .computeTime{ - width: 73px; - height: 24px; + .computeTime { + width: 122px; + height: 31px; display: inline-block; padding: 5px; text-align: center; - line-height: 13px; - color: #4CACFF; - border: 1px solid #4CACFF; + line-height: 20px; + color: #FE6B21; + border: 1px solid #FE6B21; cursor: pointer; - } + border-radius: 4px; + } .computeTimes{ - width: 73px; - height: 24px; + width: 122px; + height: 31px; display: inline-block; padding: 5px; text-align: center; - line-height: 13px; + line-height: 20px; color: #C5C5C5; border: 1px solid #EDEDED; background:#EDEDED; cursor: pointer; + border-radius: 4px; } `} @@ -3156,12 +3162,12 @@ class Listofworksstudentone extends Component { 计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')} {teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"": {computeTimetype===true? - (this.props.isNotMember()===false?
- 计算成绩 + (this.props.isNotMember()===false?
+ 查看最新成绩
:""): teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": - (this.props.isNotMember()===false?
- 计算成绩 + (this.props.isNotMember()===false?
+ 查看最新成绩
:"") } }