|
|
|
@ -32,13 +32,13 @@ class ExercisesController < ApplicationController
|
|
|
|
|
@exercises_all = @course.exercises
|
|
|
|
|
member_show_exercises = @exercises_all.is_exercise_published #已发布的或已截止的试卷
|
|
|
|
|
@current_user_ = current_user
|
|
|
|
|
@exercises_count = @exercises_all.count # 全部页面,需返回
|
|
|
|
|
@exercises_unpublish_counts = @exercises_all.exercise_by_status(1).count #未发布的试卷数
|
|
|
|
|
@exercises_published_counts = @exercises_all.exercise_by_status([2,3]).count # 已发布的试卷数,包含已截止的
|
|
|
|
|
@exercises_ended_counts = @exercises_all.exercise_by_status(3).count #已截止的试卷数
|
|
|
|
|
@exercises_count = @exercises_all.size # 全部页面,需返回
|
|
|
|
|
@exercises_unpublish_counts = @exercises_all.exercise_by_status(1).size #未发布的试卷数
|
|
|
|
|
@exercises_published_counts = @exercises_all.exercise_by_status([2,3]).size # 已发布的试卷数,包含已截止的
|
|
|
|
|
@exercises_ended_counts = @exercises_all.exercise_by_status(3).size #已截止的试卷数
|
|
|
|
|
# 课堂的学生人数
|
|
|
|
|
@course_all_members = @course.students #当前课堂的全部学生
|
|
|
|
|
@course_all_members_count = @course_all_members.count #当前课堂的学生数
|
|
|
|
|
@course_all_members_count = @course_all_members.size #当前课堂的学生数
|
|
|
|
|
@current_student = @course_all_members.course_find_by_ids("user_id",current_user.id) #当前用户是否为课堂的学生
|
|
|
|
|
|
|
|
|
|
# exercises的不同用户群体的显示
|
|
|
|
@ -64,7 +64,7 @@ class ExercisesController < ApplicationController
|
|
|
|
|
@is_teacher_or = 0
|
|
|
|
|
@exercises = member_show_exercises.present? ? member_show_exercises.unified_setting : []
|
|
|
|
|
end
|
|
|
|
|
if @exercises.count > 0
|
|
|
|
|
if @exercises.size > 0
|
|
|
|
|
if params[:type].present?
|
|
|
|
|
choose_type = params[:type].to_i
|
|
|
|
|
member_group_id = @current_student.first.try(:course_group_id).to_i
|
|
|
|
|