|
|
|
@ -1176,19 +1176,19 @@ class CoursesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
def export_course_member_excel
|
|
|
|
|
q = params[:name] ? "#{params[:name].strip}" : ""
|
|
|
|
|
filename="#{@course.teacher.show_real_name.to_s }_#{@course.name}_#{l(:excel_member_list)}";
|
|
|
|
|
if params[:group_id] && params[:group_id] != "0" && params[:group_id] != "-1"
|
|
|
|
|
group = CourseGroup.find params[:group_id]
|
|
|
|
|
unless group.nil?
|
|
|
|
|
@all_members = searchmember_by_name(student_homework_score(group.id,0,0,"desc"), q)
|
|
|
|
|
filename="#{@course.teacher.show_real_name.to_s }_#{@course.name}_#{group.name}_#{l(:excel_member_list)}"
|
|
|
|
|
end
|
|
|
|
|
elsif params[:group_id] && params[:group_id] == "0"
|
|
|
|
|
@all_members = searchmember_by_name(student_homework_score(-1, 0, 10,"desc"), q)
|
|
|
|
|
filename="#{@course.teacher.show_real_name.to_s }_#{@course.name}_未分班_#{l(:excel_member_list)}"
|
|
|
|
|
else
|
|
|
|
|
@all_members = searchmember_by_name(student_homework_score(0, 0, 10,"desc"), q)
|
|
|
|
|
end
|
|
|
|
|
filename="#{@course.teacher.show_real_name.to_s }_#{@course.name}_#{l(:excel_member_list)}"
|
|
|
|
|
# if params[:group_id] && params[:group_id] != "0" && params[:group_id] != "-1"
|
|
|
|
|
# group = CourseGroup.find params[:group_id]
|
|
|
|
|
# unless group.nil?
|
|
|
|
|
# @all_members = searchmember_by_name(student_homework_score(group.id,0,0,"desc"), q)
|
|
|
|
|
# filename="#{@course.teacher.show_real_name.to_s }_#{@course.name}_#{group.name}_#{l(:excel_member_list)}"
|
|
|
|
|
# end
|
|
|
|
|
# elsif params[:group_id] && params[:group_id] == "0"
|
|
|
|
|
# @all_members = searchmember_by_name(student_homework_score(-1, 0, 10,"desc"), q)
|
|
|
|
|
# filename="#{@course.teacher.show_real_name.to_s }_#{@course.name}_未分班_#{l(:excel_member_list)}"
|
|
|
|
|
# else
|
|
|
|
|
# @all_members = searchmember_by_name(student_homework_score(0, 0, 10,"desc"), q)
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
@homeworks = @course.homework_commons.where("publish_time <= '#{Time.now}'").order("publish_time asc, created_at asc")
|
|
|
|
|
@exercises = @course.exercises.where("publish_time <= '#{Time.now}'").order("publish_time asc, created_at asc")
|
|
|
|
|