|
|
|
@ -12,7 +12,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
:code_review_detail, :show_comment, :settings, :works_list, :update_settings,
|
|
|
|
|
:reference_answer, :publish_groups, :end_groups, :alter_name, :update_explanation]
|
|
|
|
|
before_action :user_course_identity
|
|
|
|
|
before_action :homework_publish, only: [:show, :works_list, :code_review_results, :show_comment, :settings, :reference_answer]
|
|
|
|
|
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,
|
|
|
|
@ -237,6 +237,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update_score
|
|
|
|
|
tip_exception("作业还未发布,暂不能计算成绩") if @homework.publish_time.nil? || @homework.publish_time > Time.now
|
|
|
|
|
begin
|
|
|
|
|
if @homework.unified_setting
|
|
|
|
|
student_works = @homework.student_works
|
|
|
|
|