diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index aeefba540..de80537a1 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -363,7 +363,7 @@ class StudentWorkController < ApplicationController @homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now).order("created_at desc") @all_homework_commons = @course.homework_commons.order("created_at desc") @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? - @is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 3 && !@is_teacher #是不是匿评 + @is_evaluation = @homework.homework_detail_manual && (@homework.homework_detail_manual.comment_status == 3 || @homework.homework_detail_manual.comment_status == 4) && !@is_teacher #是不是匿评 @show_all = false # 0表示没有分组的学生,-1表示所有分组的学生 @@ -713,7 +713,7 @@ class StudentWorkController < ApplicationController @score = student_work_score @work,User.current @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? - if @homework.homework_detail_manual.comment_status == 3 && !@is_teacher && @work.user != User.current + if (@homework.homework_detail_manual.comment_status == 3 || @homework.homework_detail_manual.comment_status == 4) && !@is_teacher && @work.user != User.current @student_work_scores = @work.student_works_scores.where("user_id = #{User.current.id} and reviewer_role = 3").order("updated_at desc") else @student_work_scores = student_work_score_record(@work) diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 9ea2d97e3..2948f05a2 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -26,7 +26,7 @@ <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%> - <%= link_to '评阅', student_work_path(student_work), :class => 'link-color-blue' %> + <%= link_to @homework.homework_detail_manual.comment_status == 3 ? '评阅' : '查看', student_work_path(student_work), :class => 'link-color-blue' %> <% end%> diff --git a/lib/tasks/homework_evaluation.rake b/lib/tasks/homework_evaluation.rake index cb817c61d..15e8cd6d6 100644 --- a/lib/tasks/homework_evaluation.rake +++ b/lib/tasks/homework_evaluation.rake @@ -14,7 +14,11 @@ namespace :homework_evaluation do homework_detail_manuals.each do |homework_detail_manual| homework_common = homework_detail_manual.homework_common if homework_common.anonymous_comment == 0 #新建状态才可开启匿评 - student_works = homework_common.student_works.has_committed + if homework_common.homework_type == 3 + student_works = homework_common.student_works.where(:id => homework_common.student_work_projects.where(:is_leader => 1).map(&:student_work_id)) + else + student_works = homework_common.student_works.has_committed + end if student_works && student_works.size >= 2 if homework_common.homework_type == 3 student_work_projects = homework_common.student_work_projects.where("student_work_id is not null")