|
|
|
@ -381,14 +381,24 @@ class StudentWorkController < ApplicationController
|
|
|
|
|
@is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
|
|
|
|
|
@show_all = false
|
|
|
|
|
|
|
|
|
|
course_group = CourseGroup.find_by_id(@group) if @group
|
|
|
|
|
if course_group
|
|
|
|
|
group_students = course_group.users
|
|
|
|
|
if group_students.empty?
|
|
|
|
|
student_in_group = '(0)'
|
|
|
|
|
if @group
|
|
|
|
|
if @group == "0"
|
|
|
|
|
none_group_students = @course.members.select{ |member| member.course_group_id == 0 }
|
|
|
|
|
if none_group_students.empty?
|
|
|
|
|
student_in_group = '(0)'
|
|
|
|
|
else
|
|
|
|
|
student_in_group = '(' + none_group_students.map{ |member| member.user_id }.join(',') + ')'
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
|
|
|
|
|
course_group = CourseGroup.find_by_id(@group)
|
|
|
|
|
group_students = course_group.users
|
|
|
|
|
if group_students.empty?
|
|
|
|
|
student_in_group = '(0)'
|
|
|
|
|
else
|
|
|
|
|
student_in_group = '(' + group_students.map{ |user| user.id }.join(',') + ')'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
|
|
|
|
|
if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?)
|
|
|
|
|
if @order == 'lastname'
|
|
|
|
|