毕设任务作品列表添加参数

dev_course
cxt 6 years ago
parent 93724af8ce
commit fa5685a877

@ -15,7 +15,6 @@ module GraduationWorksHelper
end end
end end
# work_score 最终成绩; late_penalty 迟交扣分; final_score 最终评分 # work_score 最终成绩; late_penalty 迟交扣分; final_score 最终评分
{username: work.user.full_name, login: work.user.login, work_score: work_score, final_score: work.final_score, {username: work.user.full_name, login: work.user.login, work_score: work_score, final_score: work.final_score}
late_penalty:work.late_penalty }
end end
end end

@ -100,8 +100,7 @@ class GraduationWork < ApplicationRecord
"未批阅" "未批阅"
else else
if self.check_score_power?(current_user, course_identity) if self.check_score_power?(current_user, course_identity)
"#{format("%.1f", self.cross_score.round(1))}(#{self.graduation_work_scores "#{format("%.1f", self.cross_score.round(1))}"
.where(reviewer_role: 2).group_by(&:user_id).count})"
else else
"**" "**"
end end
@ -109,6 +108,10 @@ class GraduationWork < ApplicationRecord
end end
end end
def cross_comment_num
graduation_work_scores.where(reviewer_role: 2).group_by(&:user_id).count
end
def scored? def scored?
graduation_work_scores.where.not(reviewer_role: 3).exists? graduation_work_scores.where.not(reviewer_role: 3).exists?
end end

@ -42,6 +42,7 @@ if @task.published? || @user_course_identity < Course::STUDENT
json.name work.user.real_name json.name work.user.real_name
json.student_id work.user.student_id json.student_id work.user.student_id
json.class_grouping_name work.class_grouping_name json.class_grouping_name work.class_grouping_name
json.ultimate_score work.ultimate_score
if @task.have_grouping? if @task.have_grouping?
json.grouping_name work.grouping_name json.grouping_name work.grouping_name
if @task.base_on_project if @task.base_on_project
@ -51,7 +52,11 @@ if @task.published? || @user_course_identity < Course::STUDENT
json.status work.work_status json.status work.work_status
json.update_time format_time work.update_time json.update_time format_time work.update_time
json.teacher_comment_score work.teacher_comment_score(@current_user, @user_course_identity) json.teacher_comment_score work.teacher_comment_score(@current_user, @user_course_identity)
json.cross_comment_score work.cross_comment_score(@current_user, @user_course_identity) if @task.cross_comment
json.cross_comment_score work.cross_comment_score(@current_user, @user_course_identity)
json.cross_comment_num work.cross_comment_num
end
json.late_penalty work.late_penalty if @task.allow_late
json.final_score work_final_score work, @current_user, @user_course_identity json.final_score work_final_score work, @current_user, @user_course_identity
json.assign work.assign_power?(@user_course_identity) json.assign work.assign_power?(@user_course_identity)
end end

Loading…
Cancel
Save