From bd099f2e1b4cce1edc309d107cc72b974e267c3e Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 10 Jul 2019 14:18:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A=E5=92=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9F=A5=E9=87=8D=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=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 +- app/views/homework_commons/code_review_detail.json.jbuilder | 2 ++ app/views/student_works/adjust_review_score.json.jbuilder | 3 ++- app/views/student_works/shixun_work_report.json.jbuilder | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 62d96c424..1c98db56c 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -631,7 +631,7 @@ class StudentWorksController < ApplicationController # 查重作品调分 def adjust_review_score - tip_exception("缺少type参数") if params[:type].blank? || ["review", "report"].include?(params[:type]) + tip_exception("缺少type参数") if params[:type].blank? || !["review", "report"].include?(params[:type]) if params[:type] == "review" && (params[:score].nil? || params[:challenge_id].nil? || params[:code_rate].nil? || params[:copy_user_id].nil?) tip_exception("参数错误,score和challenge_id和code_rate和copy_user_id不能为空") elsif params[:type] == "report" && (params[:score].nil? || params[:challenge_id].nil?) diff --git a/app/views/homework_commons/code_review_detail.json.jbuilder b/app/views/homework_commons/code_review_detail.json.jbuilder index 90d2c4a54..c33a906ec 100644 --- a/app/views/homework_commons/code_review_detail.json.jbuilder +++ b/app/views/homework_commons/code_review_detail.json.jbuilder @@ -2,6 +2,7 @@ json.course_id @course.id json.course_name @course.name json.homework_common_id @homework.id json.homework_common_name @homework.name +json.work_id @student_work.id json.work_name @student_work.name json.username @user.full_name json.user_id @user.id @@ -32,6 +33,7 @@ json.challenge_list do json.final_score challenge[:final_score] json.username challenge[:username] json.all_score challenge[:all_score] + json.copy_user_id challenge[:copy_user_id] json.copy_username challenge[:copy_username] json.copy_end_time challenge[:copy_end_time] json.code_rate challenge[:code_rate] diff --git a/app/views/student_works/adjust_review_score.json.jbuilder b/app/views/student_works/adjust_review_score.json.jbuilder index 399b52c13..928806bd6 100644 --- a/app/views/student_works/adjust_review_score.json.jbuilder +++ b/app/views/student_works/adjust_review_score.json.jbuilder @@ -1,3 +1,4 @@ json.status 0 json.message "调分成功" -json.work_score @work.work_score \ No newline at end of file +json.work_score number_with_precision @work.work_score, 1 +json.challenge_score number_with_precision @work.final_score, 1 \ No newline at end of file diff --git a/app/views/student_works/shixun_work_report.json.jbuilder b/app/views/student_works/shixun_work_report.json.jbuilder index 05387125d..e24092f05 100644 --- a/app/views/student_works/shixun_work_report.json.jbuilder +++ b/app/views/student_works/shixun_work_report.json.jbuilder @@ -1,6 +1,7 @@ json.homework_common_id @homework.id json.category @homework.category_info json.course_name @course.name +json.work_id @work.id if @shixun json.shixun_name @shixun.name # 总体评价