diff --git a/app/models/course.rb b/app/models/course.rb index abe17b3cd..77634e13b 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -392,7 +392,7 @@ class Course < ApplicationRecord # 课堂实训作业的评测次数 def evaluate_count course_user_ids = students.pluck(:user_id) - shixun_ids = homework_commons.joins(:homework_commons_shixun).where(homework_type: 4).pluck(:shixun_id) + shixun_ids = homework_commons.joins(:homework_commons_shixun).where(homework_type: "practice").pluck(:shixun_id) return 0 if shixun_ids.blank? Game.joins(:challenge).where(challenges: {shixun_id: shixun_ids}, games: {user_id: course_user_ids}).sum(:evaluate_count) end diff --git a/app/views/admins/courses/shared/_td.html.erb b/app/views/admins/courses/shared/_td.html.erb index 87e6f305d..7b72179da 100644 --- a/app/views/admins/courses/shared/_td.html.erb +++ b/app/views/admins/courses/shared/_td.html.erb @@ -5,9 +5,9 @@