@ -959,34 +959,33 @@ class CoursesController < ApplicationController
def export_member_scores_excel
def export_member_scores_excel
ActiveRecord :: Base . transaction do
ActiveRecord :: Base . transaction do
begin
begin
name = params [ :name ] ? " #{ params [ :name ] . strip } " : " " #用户名或学生学号id搜索
search = params [ :search ] ? " #{ params [ :search ] . strip } " : " " #用户名或学生学号id搜索
group_id = params [ :group_id ] #分班的班级id
group_id = params [ :group_id ] #分班的班级id
if group_id && group_id != " 0 " && group_id != " -1 "
# if group_id && group_id != "0" && group_id != "-1"
@all_members = @course . students . course_find_by_ids ( " course_group_id " , group_id )
# @all_members = @course.students.course_find_by_ids("course_group_id",group_id)
elsif group_id && group_id == " 0 " # 未分班
# elsif group_id && group_id == "0" # 未分班
@all_members = @course . course_members . ungroup_students
# @all_members = @course.course_members.ungroup_students
else
# else
@all_members = @course . students
# @all_members = @course.students
end
# end
if name . present?
# if name.present?
nick_name_search = @all_members . joins ( :user ) . where ( " nickname like ? " , " % #{ name } % " )
# @all_members = @all_members.joins(user: [:user_extension]).where('concat(users.lastname, users.firstname) like ? or user_extensions.student_id like ?',"%#{name}%","%#{name}%")
if nick_name_search . present?
# end
@all_members = nick_name_search
else
@all_members = student_act_score group_id , search
@all_members = @all_members . joins ( user : [ :user_extension ] ) . where ( 'user_extensions.student_id like ? OR user_extensions.student_realname like ?' , " % #{ name } % " , " % #{ name } % " )
end
@c_homeworks = @course . homework_commons . homework_published . order ( " homework_commons.publish_time asc, homework_commons.created_at asc " )
end
@c_exercises = @course . exercises . is_exercise_published . order ( " exercises.publish_time asc, exercises.created_at asc " )
# @c_polls = @course.polls.publish_or_not.order("polls.publish_time asc, polls.created_at asc")
@c_homeworks = @course . homework_commons . homework_published . order ( " publish_time asc, created_at asc " )
@c_tasks = @course . graduation_tasks . task_published . order ( " graduation_tasks.publish_time asc, graduation_tasks.created_at asc " )
@c_exercises = @course . exercises . is_exercise_published . order ( " publish_time asc, created_at asc " )
@c_polls = @course . polls . publish_or_not . order ( " publish_time asc, created_at asc " )
@c_tasks = @course . graduation_tasks . task_published . order ( " publish_time asc, created_at asc " )
if @user_course_identity > Course :: ASSISTANT_PROFESSOR
if @user_course_identity > Course :: ASSISTANT_PROFESSOR
tip_exception ( 403 , " 无权限操作 " )
tip_exception ( 403 , " 无权限操作 " )
elsif @all_members . size == 0
normal_status ( - 1 , " 课堂暂时没有学生 " )
else
else
member_to_xlsx ( @course , @all_members , @c_homeworks , @c_exercises , @c_tasks , @c_polls )
member_to_xlsx ( @course , @all_members , @c_homeworks , @c_exercises , @c_task s)
filename = current_user . real_name + " _ " + @course . name + " _全部成绩 " + Time . now . strftime ( '%Y%m%d_%H%M%S' )
filename = current_user . real_name + " _ " + @course . name + " _全部成绩 " + Time . now . strftime ( '%Y%m%d_%H%M%S' )
render xlsx : " #{ f ilename. strip . first ( 30 ) } " , template : " courses/export_member_scores_excel.xlsx.axlsx " ,
render xlsx : " #{ f ormat_sheet_name f ilename. strip . first ( 30 ) } " , template : " courses/export_member_scores_excel.xlsx.axlsx " ,
locals : { course_info : @course_info , activity_level : @user_activity_level ,
locals : { course_info : @course_info , activity_level : @user_activity_level ,
course_scores : @course_user_scores , shixun_works : @shixun_work_arrays ,
course_scores : @course_user_scores , shixun_works : @shixun_work_arrays ,
common_works : @common_work_arrays , group_works : @group_work_arrays , task_works : @task_work_arrays ,
common_works : @common_work_arrays , group_works : @group_work_arrays , task_works : @task_work_arrays ,
@ -994,7 +993,7 @@ class CoursesController < ApplicationController
end
end
rescue Exception = > e
rescue Exception = > e
uid_logger_error ( e . message )
uid_logger_error ( e . message )
tip_exception ( " 没有权限 " )
tip_exception ( e . message )
raise ActiveRecord :: Rollback
raise ActiveRecord :: Rollback
end
end
end
end
@ -1056,16 +1055,72 @@ class CoursesController < ApplicationController
end
end
end
end
def member_to_xlsx ( course , all_members , homeworks , exercises , tasks , polls )
def student_act_score group_id , search
sql_select = %Q{ SELECT cm.*,(
SELECT SUM ( student_works . work_score )
FROM student_works , homework_commons
WHERE student_works . homework_common_id = homework_commons . id
AND homework_commons . course_id = #{@course.id}
AND student_works . user_id = cm . user_id
) AS score ,
( SELECT max ( student_id ) FROM user_extensions WHERE user_extensions . user_id = cm . user_id ) AS student_id ,
( SELECT count ( messages . id ) FROM messages join boards on messages . board_id = boards . id WHERE boards . course_id = #{@course.id}
AND messages . author_id = cm . user_id and messages . parent_id is null ) AS message_num ,
( SELECT count ( messages . id ) FROM messages join boards on messages . board_id = boards . id WHERE boards . course_id = #{@course.id}
AND messages . author_id = cm . user_id and messages . parent_id is not null ) AS message_reply_num ,
( SELECT count ( attachments . id ) FROM attachments WHERE container_id = #{@course.id} and container_type = "Course"
AND attachments . author_id = cm . user_id ) AS resource_num ,
( SELECT count ( jfm . id ) FROM journals_for_messages AS jfm , homework_commons hs WHERE jfm . jour_id = hs . id AND
jfm . user_id = cm . user_id and jfm . jour_type = " HomeworkCommon " and hs . course_id = #{@course.id}) AS homework_journal_num,
( SELECT COUNT ( gw . id ) FROM graduation_works AS gw , graduation_tasks AS gt WHERE gw . graduation_task_id = gt . id AND
gt . course_id = #{@course.id} AND gw.work_status != 0 AND gw.user_id = cm.user_id) AS graduation_num,
( SELECT COUNT ( ss . id ) FROM student_works AS ss , homework_commons AS hc WHERE ss . homework_common_id = hc . id AND
hc . course_id = #{@course.id} AND ss.work_status != 0 AND ss.user_id = cm.user_id) AS homework_num,
( SELECT COUNT ( eu . id ) FROM exercise_users AS eu , exercises WHERE eu . exercise_id = exercises . id AND exercises . course_id = #{@course.id}
AND eu . commit_status = 1 AND eu . user_id = cm . user_id ) AS exercise_num ,
( SELECT COUNT ( pu . id ) FROM poll_users AS pu , polls WHERE pu . poll_id = polls . id AND polls . course_id = #{@course.id}
AND pu . commit_status = 1 AND pu . user_id = cm . user_id ) AS poll_num
FROM course_members cm }
if search . present? && group_id . present?
sql_select += %Q{ join users on cm.user_id = users.id
joins user_extensions ue on ue . user_id = users . id
WHERE cm . role = 4 and cm . course_id = #{@course.id} and cm.course_group_id = #{group_id} and
( concat ( users . lastname , users . firstname ) like '%#{search}%' or ue . student_id like '%#{search}%' ) ORDER BY score desc }
elsif search . present?
sql_select += %Q{ join users on cm.user_id = users.id
joins user_extensions ue on ue . user_id = users . id
WHERE cm . role = 4 and
( concat ( users . lastname , users . firstname ) like '%#{search}%' or ue . student_id like '%#{search}%' ) ORDER BY score desc }
elsif group_id . present?
sql_select += %Q{ WHERE cm.role = 4 and cm.course_id = #{ @course . id } and cm.course_group_id = #{ group_id } ORDER BY score desc }
else
sql_select += %Q{ WHERE cm.role = 4 and cm.course_id = #{ @course . id } ORDER BY score desc }
end
act_scores = CourseMember . find_by_sql ( sql_select )
act_scores
end
def member_to_xlsx ( course , all_members , homeworks , exercises , tasks )
#课堂的作业信息
#课堂的作业信息
shixun_homeworks = homeworks . search_homework_type ( 4 ) #全部实训作业
shixun_homeworks = homeworks . search_homework_type ( 4 ) #全部实训作业
shixun_titles = shixun_homeworks . pluck ( :name ) + [ " 总得分 " ]
shixun_titles = shixun_homeworks . pluck ( :name ) + [ " 总得分 " ]
common_homeworks = homeworks . search_homework_type ( 1 ) #全部普通作业
shixun_homeworks = shixun_homeworks . includes ( :score_student_works )
common_homeworks = homeworks . search_homework_type ( 1 ) #全部普通作业
common_titles = common_homeworks . pluck ( :name ) + [ " 总得分 " ]
common_titles = common_homeworks . pluck ( :name ) + [ " 总得分 " ]
common_homeworks = common_homeworks . includes ( :score_student_works )
group_homeworks = homeworks . search_homework_type ( 3 ) #全部分组作业
group_homeworks = homeworks . search_homework_type ( 3 ) #全部分组作业
group_titles = group_homeworks . pluck ( :name ) + [ " 总得分 " ]
group_titles = group_homeworks . pluck ( :name ) + [ " 总得分 " ]
task_titles = tasks . pluck ( :name ) + [ " 总得分 " ]
group_homeworks = group_homeworks . includes ( :score_student_works )
exercise_titles = exercises . pluck ( :exercise_name ) + [ " 总得分 " ]
task_titles = tasks . pluck ( :name ) + [ " 总得分 " ]
tasks = tasks . includes ( :score_graduation_works )
exercise_titles = exercises . pluck ( :exercise_name ) + [ " 总得分 " ]
exercises = exercises . includes ( :score_exercise_users )
total_user_score_array = [ ] #学生总成绩集合
total_user_score_array = [ ] #学生总成绩集合
#课堂信息
#课堂信息
@ -1080,7 +1135,7 @@ class CoursesController < ApplicationController
course_teacher_member = course . course_members . course_user_role ( % i [ CREATOR ] )
course_teacher_member = course . course_members . course_user_role ( % i [ CREATOR ] )
course_teacher = course_teacher_member . present? ? course_teacher_member . first . user . real_name : " -- "
course_teacher = course_teacher_member . present? ? course_teacher_member . first . user . real_name : " -- "
course_class_counts = course . course_groups_count
course_class_counts = course . course_groups_count
course_students_count = course . students . count
course_students_count = course . students . size
course_1 = [ " 课堂编号 " , course_id ]
course_1 = [ " 课堂编号 " , course_id ]
course_2 = [ " 课程名称 " , course_list_name ]
course_2 = [ " 课程名称 " , course_list_name ]
course_3 = [ " 课堂名称 " , course_name ]
course_3 = [ " 课堂名称 " , course_name ]
@ -1105,11 +1160,6 @@ class CoursesController < ApplicationController
@course_info += [ course_info_title , course_main_info , course_group_info ]
@course_info += [ course_info_title , course_main_info , course_group_info ]
#课堂活跃度
#课堂活跃度
course_homework_ids = homeworks . pluck ( :id ) #该课堂的全部作业id
course_graduate_task_ids = tasks . pluck ( :id ) #该课堂的全部毕业任务id
course_exercise_ids = exercises . pluck ( :id ) #课堂的全部试卷数
course_poll_ids = polls . pluck ( :id ) #课堂的全部问卷数
course_board_ids = course . boards . pluck ( :id ) #课堂的全部讨论区
@user_activity_level = [ ]
@user_activity_level = [ ]
course_user_level = [ ]
course_user_level = [ ]
course_activity_title = " 课堂活跃度统计 "
course_activity_title = " 课堂活跃度统计 "
@ -1120,27 +1170,26 @@ class CoursesController < ApplicationController
user_login = user . login
user_login = user . login
user_name = user . real_name
user_name = user . real_name
user_mail = user . mail
user_mail = user . mail
user_stu_id = u ser . student_id . present? ? ( u ser . student_id . to_s + " \t " ) : " -- "
user_stu_id = u . student_id . present? ? ( u . student_id . to_s + " \t " ) : " -- "
user_course_group = u . course_group_name
user_course_group = u . course_group_name
user_info_array = [ user_login , user_name , user_mail , user_stu_id , user_course_group ] #用户的信息集合
user_info_array = [ user_login , user_name , user_mail , user_stu_id , user_course_group ] #用户的信息集合
user_work_scores = [ ]
user_work_scores = [ ]
#课堂活跃度统计
#课堂活跃度统计
user_homeworks_num = user . student_works . find_by_homework ( course_homework_ids ) . has_committed . count #完成的作业数
user_homeworks_num = u . homework_num . to_i #完成的作业数
user_graduate_num = user . graduation_works . find_by_task ( course_graduate_task_ids ) . has_committed . count #毕业任务完成数
user_graduate_num = u . graduation_num . to_i #毕业任务完成数
user_exercise_num = user . exercise_users . search_by_exercise ( course_exercise_ids ) . commit_exercise_by_status ( 1 ) . count #根据试卷的id来查找
user_exercise_num = u . exercise_num . to_i #根据试卷的id来查找
user_poll_num = user . poll_users . search_by_poll ( course_poll_ids ) . commit_by_status ( 1 ) . count #已完成问卷
user_poll_num = u . poll_num . to_i #已完成问卷
user_file_num = user . attachments . search_by_container ( course . id ) . count
user_file_num = u . resource_num . to_i
user_messages = user . messages
user_messages_num = u . message_num . to_i #帖子发布数
user_messages_num = user_messages . root_nodes . find_by_boards ( course_board_ids ) . count #帖子发布数
user_reply_num = u . message_reply_num . to_i #帖子回复数
user_reply_num = user_messages . reply_nodes . find_by_boards ( course_board_ids ) . count #帖子回复数
user_work_reply_num = u . homework_journal_num . to_i #作业回复数的数量
user_work_reply_num = user . journals_for_messages . search_by_jour_type ( " HomeworkCommon " , course_homework_ids ) . count #作业回复数的数量
c_works_num = ( user_homeworks_num + user_graduate_num ) * 10
c_works_num = ( user_homeworks_num + user_graduate_num ) * 10
c_exercise_num = user_exercise_num * 10
c_exercise_num = user_exercise_num * 10
c_poll_num = user_poll_num * 7
c_poll_num = user_poll_num * 7
c_file_num = user_file_num * 5
c_file_num = user_file_num * 5
c_message_num = user_messages_num * 2
c_message_num = user_messages_num * 2
c_reply_num = user_reply_num * 2
c_reply_num = user_reply_num
user_activity_levels = c_works_num + c_exercise_num + c_poll_num + c_file_num + c_message_num + c_reply_num + user_work_reply_num
user_activity_levels = c_works_num + c_exercise_num + c_poll_num + c_file_num + c_message_num + c_reply_num + user_work_reply_num
user_ac_level = {
user_ac_level = {
u_1 : user_name ,
u_1 : user_name ,
@ -1172,14 +1221,13 @@ class CoursesController < ApplicationController
exercise_score_array = [ ]
exercise_score_array = [ ]
#实训作业
#实训作业
if shixun_homeworks . count > 0
if shixun_homeworks . size > 0
shixun_homeworks . each do | s |
shixun_homeworks . each do | s |
user_student_work = s . s tudent_works. homework_by_user ( user . id ) #当前用户的对该作业的回答
user_student_work = s . s core_student_works. select { | work | work . user_id == user . id } . first #当前用户的对该作业的回答
if user_student_work . blank ?
if user_student_work . nil ?
h_score = 0 . 0 #该作业的得分为0
h_score = 0 . 0 #该作业的得分为0
else
else
user_stu_work = user_student_work . first
h_score = user_student_work . work_score . nil? ? 0 . 0 : user_student_work . work_score #用户对该作业的分数
h_score = user_stu_work . work_score . nil? ? 0 . 0 : user_stu_work . work_score #用户对该作业的分数
end
end
shixun_score_array . push ( h_score )
shixun_score_array . push ( h_score )
end
end
@ -1189,14 +1237,13 @@ class CoursesController < ApplicationController
user_work_scores += user_info_array + shixun_score_array #单个用户的实训作业得分信息
user_work_scores += user_info_array + shixun_score_array #单个用户的实训作业得分信息
#普通作业
#普通作业
if common_homeworks . count > 0
if common_homeworks . size > 0
common_homeworks . each do | c |
common_homeworks . each do | c |
user_student_work_1 = c . s tudent_works. homework_by_user ( user . id ) #当前用户的对该作业的回答
user_student_work_1 = c . s core_student_works. select { | work | work . user_id == user . id } . first #当前用户的对该作业的回答
if user_student_work_1 . blank ?
if user_student_work_1 . nil ?
h_score_1 = 0 . 0 #该作业的得分为0
h_score_1 = 0 . 0 #该作业的得分为0
else
else
user_stu_work_1 = user_student_work_1 . first
h_score_1 = user_student_work_1 . work_score . nil? ? 0 . 0 : user_student_work_1 . work_score #用户对该作业的分数
h_score_1 = user_stu_work_1 . work_score . nil? ? 0 . 0 : user_stu_work_1 . work_score #用户对该作业的分数
end
end
common_score_array . push ( h_score_1 )
common_score_array . push ( h_score_1 )
end
end
@ -1206,14 +1253,13 @@ class CoursesController < ApplicationController
user_work_scores += common_score_array #单个用户的普通作业得分信息
user_work_scores += common_score_array #单个用户的普通作业得分信息
#分组作业
#分组作业
if group_homeworks . count > 0
if group_homeworks . size > 0
group_homeworks . each do | g |
group_homeworks . each do | g |
user_student_work_3 = g . s tudent_works. homework_by_user ( user . id ) #当前用户的对该作业的回答
user_student_work_3 = g . s core_student_works. select { | work | work . user_id == user . id } . first #当前用户的对该作业的回答
if user_student_work_3 . blank ?
if user_student_work_3 . nil ?
h_score_3 = 0 . 0 #该作业的得分为0
h_score_3 = 0 . 0 #该作业的得分为0
else
else
user_stu_work_3 = user_student_work_3 . first
h_score_3 = user_student_work_3 . work_score . nil? ? 0 . 0 : user_student_work_3 . work_score #用户对该作业的分数
h_score_3 = user_stu_work_3 . work_score . nil? ? 0 . 0 : user_stu_work_3 . work_score #用户对该作业的分数
end
end
group_score_array . push ( h_score_3 )
group_score_array . push ( h_score_3 )
end
end
@ -1223,13 +1269,13 @@ class CoursesController < ApplicationController
user_work_scores += group_score_array #单个用户的分组作业得分信息
user_work_scores += group_score_array #单个用户的分组作业得分信息
#毕设作业
#毕设作业
if tasks . count > 0
if tasks . size > 0
tasks . each do | task |
tasks . each do | task |
graduation_work s = task . graduation_works . find_by_task_user ( user . id )
graduation_work = task . score_graduation_works . select { | work | work . user_id == user . id } . first
if graduation_work s. empty ?
if graduation_work . nil ?
t_score = 0 . 0
t_score = 0 . 0
else
else
t_score = graduation_work s. first . work_score . nil? ? 0 . 0 : graduation_work s. first . work_score
t_score = graduation_work . work_score . nil? ? 0 . 0 : graduation_work . work_score
end
end
task_score_array . push ( t_score )
task_score_array . push ( t_score )
end
end
@ -1239,13 +1285,13 @@ class CoursesController < ApplicationController
user_work_scores += task_score_array #单个用户的分组作业得分信息
user_work_scores += task_score_array #单个用户的分组作业得分信息
#试卷
#试卷
if exercises . count > 0
if exercises . size > 0
exercises . each do | ex |
exercises . each do | ex |
exercise_work s = ex . exercise_users . exercise_commit_users ( user . id )
exercise_work = ex . score_exercise_users . select { | work | work . user_id == user . id } . first
if exercise_work s. empty ?
if exercise_work . nil ?
e_score = 0 . 0
e_score = 0 . 0
else
else
e_score = exercise_work s. first . score . nil? ? 0 . 0 : exercise_work s. first . score
e_score = exercise_work . score . nil? ? 0 . 0 : exercise_work . score
end
end
exercise_score_array . push ( e_score )
exercise_score_array . push ( e_score )
end
end
@ -1277,73 +1323,63 @@ class CoursesController < ApplicationController
@common_work_arrays = [ ]
@common_work_arrays = [ ]
@task_work_arrays = [ ]
@task_work_arrays = [ ]
@exercise_work_arrays = [ ]
@exercise_work_arrays = [ ]
count_1 = shixun_homeworks . count
count_1 = shixun_homeworks . size
count_2 = common_homeworks . count
count_2 = common_homeworks . size
count_3 = group_homeworks . count
count_3 = group_homeworks . size
count_4 = tasks . count
count_4 = tasks . size
count_5 = exercises . count
count_5 = exercises . size
#实训作业
#实训作业
if count_1 > 0
shixun_homeworks . each_with_index do | s , index |
shixun_homeworks . each_with_index do | s , index |
all_student_works = s . score_student_works #该实训题的全部用户回答
all_student_works = s . student_works . has_committed . order ( " work_score desc " ) #该实训题的全部用户回答
title_no = index . to_i + 1
title_no = index . to_i + 1
student_work_to_xlsx ( all_student_works , s )
student_work_to_xlsx ( all_student_works , s )
shixun_work_display_name = format_sheet_name ( title_no . to_s + " . " + s . name ) . strip . first ( 30 )
shixun_work_display_name = ( title_no . to_s + " . " + s . name ) . strip . first ( 30 )
shixun_work_content = [ shixun_work_display_name , @work_head_cells , @work_cells_column ]
shixun_work_content = [ shixun_work_display_name , @work_head_cells , @work_cells_column ]
@shixun_work_arrays . push ( shixun_work_content )
@shixun_work_arrays . push ( shixun_work_content )
end
end
end
#普通作业
#普通作业
if count_2 > 0
common_homeworks . each_with_index do | c , index |
common_homeworks . each_with_index do | c , index |
all_student_works = c . score_student_works #当前用户的对该作业的回答
all_student_works = c . student_works . has_committed . order ( " work_score desc " ) #当前用户的对该作业的回答
title_no = count_1 + index . to_i + 1
title_no = count_1 + index . to_i + 1
student_work_to_xlsx ( all_student_works , c )
student_work_to_xlsx ( all_student_works , c )
work_name = format_sheet_name ( title_no . to_s + " . " + c . name ) . strip . first ( 30 )
work_name = ( title_no . to_s + " . " + c . name ) . strip . first ( 30 )
work_content = [ work_name , @work_head_cells , @work_cells_column ]
work_content = [ work_name , @work_head_cells , @work_cells_column ]
@common_work_arrays . push ( work_content )
@common_work_arrays . push ( work_content )
title_no
title_no
end
end
end
#分组作业
#分组作业
if count_3 > 0
group_homeworks . each_with_index do | c , index |
group_homeworks . each_with_index do | c , index |
all_student_works = c . score_student_works #当前用户的对该作业的回答
all_student_works = c . student_works . has_committed . order ( " work_score desc " ) #当前用户的对该作业的回答
title_no = count_1 + count_2 + index . to_i + 1
title_no = count_1 + count_2 + index . to_i + 1
student_work_to_xlsx ( all_student_works , c )
student_work_to_xlsx ( all_student_works , c )
work_name = format_sheet_name ( title_no . to_s + " . " + c . name ) . strip . first ( 30 )
work_name = ( title_no . to_s + " . " + c . name ) . strip . first ( 30 )
work_content = [ work_name , @work_head_cells , @work_cells_column ]
work_content = [ work_name , @work_head_cells , @work_cells_column ]
@group_work_arrays . push ( work_content )
@group_work_arrays . push ( work_content )
end
end
end
#毕设任务
#毕设任务
if count_4 > 0
tasks . each_with_index do | c , index |
tasks . each_with_index do | c , index |
all_student_works = c . score_graduation_works #当前用户的对该作业的回答
all_student_works = c . graduation_works . has_committed . order ( " work_score desc " ) #当前用户的对该作业的回答
title_no = count_1 + count_2 + count_3 + index . to_i + 1
title_no = count_1 + count_2 + count_3 + index . to_i + 1
graduation_work_to_xlsx ( all_student_works , c , current_user )
graduation_work_to_xlsx ( all_student_works , c , current_user )
work_name = format_sheet_name ( title_no . to_s + " . " + c . name ) . strip . first ( 30 )
work_name = ( title_no . to_s + " . " + c . name ) . strip . first ( 30 )
# work_content = [work_name,@work_head_cells,@work_cells_column]
# work_content = [work_name,@work_head_cells,@work_cells_column]
work_content = [ work_name , @head_cells_column , @task_cells_column ]
work_content = [ work_name , @head_cells_column , @task_cells_column ]
@task_work_arrays . push ( work_content )
@task_work_arrays . push ( work_content )
end
end
end
#试卷的导出
#试卷的导出
if count_5 > 0
exercises . each_with_index do | c , index |
exercises . each_with_index do | c , index |
all_student_works = c . score_exercise_users #当前用户的对该作业的回答
all_student_works = c . exercise_users . exercise_user_committed #当前用户的对该作业的回答
title_no = count_1 + count_2 + count_3 + count_4 + index . to_i + 1
title_no = count_1 + count_2 + count_3 + count_4 + index . to_i + 1
get_export_users ( c , course , all_student_works )
get_export_users ( c , course , all_student_works )
work_name = format_sheet_name ( title_no . to_s + " . " + c . exercise_name ) . strip . first ( 30 )
work_name = ( title_no . to_s + " . " + c . exercise_name ) . strip . first ( 30 )
# work_content = [work_name,@work_head_cells,@work_cells_column]
# work_content = [work_name,@work_head_cells,@work_cells_column]
work_content = [ work_name , @table_columns , @user_columns ]
work_content = [ work_name , @table_columns , @user_columns ]
@exercise_work_arrays . push ( work_content )
@exercise_work_arrays . push ( work_content )
end
end
end
end
end
end
end