代码查重详情

dev_course
daiao 5 years ago
parent 5666a3564e
commit df246f245c

@ -11,14 +11,14 @@ class HomeworkCommonsController < ApplicationController
before_action :find_homework, only: [:edit, :show, :update, :group_list, :homework_code_repeat, :code_review_results,
:code_review_detail, :show_comment, :settings, :works_list, :update_settings,
:reference_answer, :publish_groups, :end_groups, :alter_name, :update_explanation,
:update_score, :update_student_score]
:update_score, :update_student_score, :get_challenge_detail]
before_action :user_course_identity
before_action :homework_publish, only: [:show, :works_list, :code_review_results, :show_comment, :settings, :reference_answer, :update_student_score]
before_action :teacher_allowed, only: [:new, :edit, :create, :update, :shixuns, :subjects, :create_shixun_homework,
:publish_homework, :end_homework, :set_public, :choose_category, :move_to_category,
:choose_category, :create_subject_homework, :multi_destroy, :group_list, :homework_code_repeat,
:code_review_results, :code_review_detail, :update_explanation, :update_settings,
:add_to_homework_bank, :publish_groups, :end_groups]
:add_to_homework_bank, :publish_groups, :end_groups, :get_challenge_detail]
before_action :require_id_params, only: [:set_public, :multi_destroy, :publish_homework, :end_homework, :move_to_category,
:add_to_homework_bank]
before_action :course_manager, only: [:alter_name]
@ -1342,7 +1342,14 @@ class HomeworkCommonsController < ApplicationController
end
# 代码查重详情
# 代码查重关卡详情
def get_challenge_detail
@student_work = @homework.student_works.find_by(user_id: params[:user_id])
@user = @student_work.user
tip_exception("当前用户无作品可以显示") if @student_work.nil?
end
# 代码查重代码的详情
def code_review_detail
@student_work = @homework.student_works.find_by(user_id: params[:user_id])
@user = @student_work.user

@ -1,21 +1,3 @@
json.course_id @course.id
json.course_name @course.name
json.homework_common_id @homework.id
json.homework_common_name @homework.name
json.work_name @student_work.name
json.username @user.full_name
json.user_id @user.id
json.user_login @user.login
json.work_score @student_work.work_score
if @student_work.ultimate_score
json.adjust_score @student_work.work_score < 0 ? 0 : number_with_precision(@student_work.work_score, precision: 1)
else
json.final_score @student_work.final_score
json.late_penalty @student_work.late_penalty
json.score @student_work.work_score < 0 ? 0 : number_with_precision(@student_work.work_score, precision: 1)
end
json.challenge_list do
json.array! @challenges do |challenge|
json.id challenge[:id]

@ -0,0 +1,17 @@
json.course_id @course.id
json.course_name @course.name
json.homework_common_id @homework.id
json.homework_common_name @homework.name
json.work_name @student_work.name
json.username @user.full_name
json.user_id @user.id
json.user_login @user.login
json.work_score @student_work.work_score
if @student_work.ultimate_score
json.adjust_score @student_work.work_score < 0 ? 0 : number_with_precision(@student_work.work_score, precision: 1)
else
json.final_score @student_work.final_score
json.late_penalty @student_work.late_penalty
json.score @student_work.work_score < 0 ? 0 : number_with_precision(@student_work.work_score, precision: 1)
end

@ -337,6 +337,7 @@ Rails.application.routes.draw do
post :homework_code_repeat
get :code_review_results
get :code_review_detail
get :get_challenge_detail
post :update_explanation
get :show_comment
get :settings

Loading…
Cancel
Save