Merge branch 'dev_local' of https://bdgit.educoder.net/Hjqreturn/pgfqe6ch8 into dev_local

dev_local
daiao 6 years ago
commit c63633c877

@ -54,10 +54,10 @@ class ZipdownController < ApplicationController
else
student_in_group = '(' + group_students.map{ |member| member.user_id }.join(',') + ')'
end
exercise_users_list = exercise.exercise_users.where("user_id in #{student_in_group}").order("#{order} #{b_sort}")
exercise_users_list = exercise.exercise_users.where("user_id in #{student_in_group} and commit_status = 1").order("#{order} #{b_sort}")
else
exercise_users_list = exercise.exercise_users.where("user_id in #{student_id}").order("#{order} #{b_sort}")
exercise_users_list = exercise.exercise_users.where("user_id in #{student_id} and commit_status = 1").order("#{order} #{b_sort}")
end
unless comment.blank?
@ -77,7 +77,7 @@ class ZipdownController < ApplicationController
exercise_users_list = exercise_users_list.select{ |exercise| exercise.user.user_extensions[:student_id].to_s.downcase.include?(name) || (exercise.user[:lastname].to_s.downcase + exercise.user[:firstname].to_s.downcase).include?(name)}
end
zipfile = zip_user_exercise exercise, exercise_users_list.select{|exercise| exercise.commit_status = 1}
zipfile = zip_user_exercise exercise, exercise_users_list
file = decode64(zipfile[0][:base64file])
send_file "#{OUTPUT_FOLDER}/#{file}", :filename => filename_for_content_disposition(file), :type => detect_content_type(file)

@ -1,2 +1,9 @@
$("#exercise_student_work_list").html("<%= escape_javascript(render :partial => 'exercise/student_exercise') %>");
$("#export_exercise_work").replaceWith("<%= escape_javascript(link_to "导出成绩", student_exercise_list_exercise_path(@exercise, :course_id => @course.id, :order => @order, :sort => @b_sort, :name => @name, :ex_group => @group, :ex_comment => @comment, :ex_status => @status, :format => 'xls'), :class => "fr white-btn orange-btn mt10 ml15", :id => "export_exercise_work") %>");
$("#export_exercise_work").replaceWith("<%= escape_javascript(link_to "导出成绩", student_exercise_list_exercise_path(@exercise,
:course_id => @course.id, :order => @order, :sort => @b_sort, :name => @name, :ex_group => @group, :ex_comment => @comment,
:ex_status => @status, :format => 'xls'), :class => "fr white-btn orange-btn mt10 ml15", :id => "export_exercise_work") %>");
$("#export_exercise_user").replaceWith("<%= escape_javascript(link_to "PDF存档", zipdown_assort_path(:obj_class => @exercise.class,
:obj_id => @exercise.id,:order => @order, :sort => @b_sort, :name => @name, :ex_group => @group, :ex_comment => @comment,
:ex_status => @status), :class => "fl white-btn orange-btn mt10 export_exercise_user_zip", :id => "export_exercise_user") %>");

Loading…
Cancel
Save