diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 38a8028f1..e26e67a93 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -214,7 +214,7 @@ class HomeworkCommonsController < ApplicationController limit = params[:limit] || 20 @student_works = @student_works.page(page).per(limit) if @homework.homework_type == "practice" - @student_works = @student_works.includes(:student_works_scores, user: :user_extension, myshixun: :games) + @student_works = @student_works.includes(:student_works_scores, :shixun_work_comments, user: :user_extension, myshixun: :games) else @student_works = @student_works.includes(:student_works_scores, :project, user: :user_extension) end diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index 41518d66a..b8fa73b66 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -108,6 +108,7 @@ if @homework.homework_type == "practice" json.student_id work.user.try(:student_id) json.group_name @students.select{|student| student.user_id == work.user_id}.first.try(:course_group_name) json.work_status work.compelete_status + json.has_comment work.shixun_work_comments.size > 0 end elsif @homework.homework_type == "group" || @homework.homework_type == "normal" json.anonymous_comment @homework.anonymous_comment