|
|
|
@ -46,8 +46,8 @@ class ExercisesController < ApplicationController
|
|
|
|
|
@exercises = member_show_exercises.exists? ? member_show_exercises.unified_setting : []
|
|
|
|
|
else #已分班级的成员,可以查看统一设置和单独设置(试卷是发布在该班级)试卷
|
|
|
|
|
# 已发布 当前用户班级分组的 试卷id
|
|
|
|
|
not_exercise_ids = @course.exercise_group_settings.exercise_group_not_published.where("course_group_id = #{@member_group_id}").pluck(:exercise_id)
|
|
|
|
|
@exercises = member_show_exercises.where.not(id: not_exercise_ids)
|
|
|
|
|
publish_exercise_ids = @course.exercise_group_settings.exercise_group_published.where("course_group_id = #{@member_group_id}").pluck(:exercise_id)
|
|
|
|
|
@exercises = member_show_exercises.unified_setting.or(id: publish_exercise_ids)
|
|
|
|
|
end
|
|
|
|
|
else #用户未登陆或不是该课堂成员,仅显示统一设置的(已发布的/已截止的),如有公开,则不显示锁,不公开,则显示锁
|
|
|
|
|
@is_teacher_or = 0
|
|
|
|
|