|
|
@ -11,14 +11,14 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
before_action :find_homework, only: [:edit, :show, :update, :group_list, :homework_code_repeat, :code_review_results,
|
|
|
|
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,
|
|
|
|
:code_review_detail, :show_comment, :settings, :works_list, :update_settings,
|
|
|
|
:reference_answer, :publish_groups, :end_groups, :alter_name, :update_explanation,
|
|
|
|
:reference_answer, :publish_groups, :end_groups, :alter_name, :update_explanation,
|
|
|
|
:update_score, :update_student_score, :get_challenge_detail]
|
|
|
|
:update_score, :update_student_score]
|
|
|
|
before_action :user_course_identity
|
|
|
|
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 :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,
|
|
|
|
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,
|
|
|
|
:publish_homework, :end_homework, :set_public, :choose_category, :move_to_category,
|
|
|
|
:choose_category, :create_subject_homework, :multi_destroy, :group_list, :homework_code_repeat,
|
|
|
|
:choose_category, :create_subject_homework, :multi_destroy, :group_list, :homework_code_repeat,
|
|
|
|
:code_review_results, :code_review_detail, :update_explanation, :update_settings,
|
|
|
|
:code_review_results, :code_review_detail, :update_explanation, :update_settings,
|
|
|
|
:add_to_homework_bank, :publish_groups, :end_groups, :get_challenge_detail]
|
|
|
|
:add_to_homework_bank, :publish_groups, :end_groups]
|
|
|
|
before_action :require_id_params, only: [:set_public, :multi_destroy, :publish_homework, :end_homework, :move_to_category,
|
|
|
|
before_action :require_id_params, only: [:set_public, :multi_destroy, :publish_homework, :end_homework, :move_to_category,
|
|
|
|
:add_to_homework_bank]
|
|
|
|
:add_to_homework_bank]
|
|
|
|
before_action :course_manager, only: [:alter_name]
|
|
|
|
before_action :course_manager, only: [:alter_name]
|
|
|
@ -1346,13 +1346,6 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
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
|
|
|
|
def code_review_detail
|
|
|
|
@student_work = @homework.student_works.find_by(user_id: params[:user_id])
|
|
|
|
@student_work = @homework.student_works.find_by(user_id: params[:user_id])
|
|
|
|