diff --git a/app/helpers/graduation_tasks_helper.rb b/app/helpers/graduation_tasks_helper.rb index 5253b0d56..a5f05d623 100644 --- a/app/helpers/graduation_tasks_helper.rb +++ b/app/helpers/graduation_tasks_helper.rb @@ -14,7 +14,7 @@ module GraduationTasksHelper # 交叉评阅 def cross_comment task, user_id - if task.cross_comment + if task.cross_comment && task.status >= 3 [{id: 1, name: "只看我的交叉评阅", count: task.graduation_work_comment_assignations.myself(user_id).count}] else [] diff --git a/app/views/graduation_tasks/tasks_list.json.jbuilder b/app/views/graduation_tasks/tasks_list.json.jbuilder index cda1eb6d4..fe7ffddc4 100644 --- a/app/views/graduation_tasks/tasks_list.json.jbuilder +++ b/app/views/graduation_tasks/tasks_list.json.jbuilder @@ -9,7 +9,7 @@ if @task.published? || @user_course_identity < Course::STUDENT json.teacher_comment teacher_comment @task, @current_user.id json.task_status task_status @task, @current_user.id json.course_group_info course_group_info @course, @current_user.id - json.cross_comment cross_comment @task, @current_user if @task.status >= 3 + json.cross_comment cross_comment @task, @current_user end # 课堂下所有老师 TODO: 考虑以后在点击分配时,再获取老师列表 json.teacher_list do