实训报告和代码查重详情页的接口调整

dev_forum
cxt 5 years ago
parent a1d11910fe
commit bd099f2e1b

@ -631,7 +631,7 @@ class StudentWorksController < ApplicationController
# 查重作品调分 # 查重作品调分
def adjust_review_score 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?) 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不能为空") tip_exception("参数错误score和challenge_id和code_rate和copy_user_id不能为空")
elsif params[:type] == "report" && (params[:score].nil? || params[:challenge_id].nil?) elsif params[:type] == "report" && (params[:score].nil? || params[:challenge_id].nil?)

@ -2,6 +2,7 @@ json.course_id @course.id
json.course_name @course.name json.course_name @course.name
json.homework_common_id @homework.id json.homework_common_id @homework.id
json.homework_common_name @homework.name json.homework_common_name @homework.name
json.work_id @student_work.id
json.work_name @student_work.name json.work_name @student_work.name
json.username @user.full_name json.username @user.full_name
json.user_id @user.id json.user_id @user.id
@ -32,6 +33,7 @@ json.challenge_list do
json.final_score challenge[:final_score] json.final_score challenge[:final_score]
json.username challenge[:username] json.username challenge[:username]
json.all_score challenge[:all_score] json.all_score challenge[:all_score]
json.copy_user_id challenge[:copy_user_id]
json.copy_username challenge[:copy_username] json.copy_username challenge[:copy_username]
json.copy_end_time challenge[:copy_end_time] json.copy_end_time challenge[:copy_end_time]
json.code_rate challenge[:code_rate] json.code_rate challenge[:code_rate]

@ -1,3 +1,4 @@
json.status 0 json.status 0
json.message "调分成功" json.message "调分成功"
json.work_score @work.work_score json.work_score number_with_precision @work.work_score, 1
json.challenge_score number_with_precision @work.final_score, 1

@ -1,6 +1,7 @@
json.homework_common_id @homework.id json.homework_common_id @homework.id
json.category @homework.category_info json.category @homework.category_info
json.course_name @course.name json.course_name @course.name
json.work_id @work.id
if @shixun if @shixun
json.shixun_name @shixun.name json.shixun_name @shixun.name
# 总体评价 # 总体评价

Loading…
Cancel
Save