|
|
@ -366,16 +366,35 @@ class HomeworkAttachController < ApplicationController
|
|
|
|
#是否开启互评功能
|
|
|
|
#是否开启互评功能
|
|
|
|
@is_evaluation = @homework.bid.is_evaluation == 1 || @homework.bid.is_evaluation == nil
|
|
|
|
@is_evaluation = @homework.bid.is_evaluation == 1 || @homework.bid.is_evaluation == nil
|
|
|
|
@limit = 10
|
|
|
|
@limit = 10
|
|
|
|
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation is null").order("created_on DESC")
|
|
|
|
#@jours留言 is null条件用以兼容历史数据
|
|
|
|
|
|
|
|
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
|
|
|
|
@feedback_count = @jours.count
|
|
|
|
@feedback_count = @jours.count
|
|
|
|
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
|
|
|
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
|
|
|
@offset ||= @feedback_pages.offset
|
|
|
|
@offset ||= @feedback_pages.offset
|
|
|
|
@jour = @jours[@offset, @limit]
|
|
|
|
@jour = @jours[@offset, @limit]
|
|
|
|
@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation is not null").order("created_on DESC")
|
|
|
|
#@comprehensive_evaluation教师评论
|
|
|
|
|
|
|
|
@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1").order("created_on DESC")
|
|
|
|
|
|
|
|
#@anonymous_comments 匿评
|
|
|
|
|
|
|
|
@anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2").order("created_on DESC")
|
|
|
|
|
|
|
|
|
|
|
|
@totle_score = score_for_homework @homework
|
|
|
|
@totle_score = score_for_homework @homework
|
|
|
|
@teaher_score = teacher_score_for_homework @homework
|
|
|
|
@teaher_score = teacher_score_for_homework @homework
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
is_student = is_cur_course_student @homework.bid.courses.first
|
|
|
|
|
|
|
|
is_teacher = is_course_teacher User.current,@homework.bid.courses.first
|
|
|
|
|
|
|
|
is_anonymous_comments = true #是否开启了匿评
|
|
|
|
|
|
|
|
if !User.current.member_of_course?(@homework.bid.courses.first)
|
|
|
|
|
|
|
|
@is_comprehensive_evaluation = 3 #留言
|
|
|
|
|
|
|
|
elsif is_student && is_anonymous_comments #是学生且开启了匿评
|
|
|
|
|
|
|
|
@is_comprehensive_evaluation = 2 #匿评
|
|
|
|
|
|
|
|
elsif is_student && !is_anonymous_comments #是学生未开启匿评
|
|
|
|
|
|
|
|
@is_comprehensive_evaluation = 3 #留言
|
|
|
|
|
|
|
|
elsif is_teacher
|
|
|
|
|
|
|
|
@is_comprehensive_evaluation = 1 #教师评论
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
@is_comprehensive_evaluation = 3
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
|
|
|
format.html
|
|
|
|
format.js
|
|
|
|
format.js
|
|
|
|