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