增加教师功能用户打包下载所有作业的功能
This commit is contained in:
parent
58c3e98a21
commit
d9b9b2152f
|
@ -75,7 +75,9 @@ class ZipdownController < ApplicationController
|
|||
# 得到每一个人所有文件打包的zip文件
|
||||
# 并将每一个人的zip打包为一个并返回路径
|
||||
user_zip_paths = homeattaches.map do |homeattach|
|
||||
zip_homework_by_user homeattach
|
||||
if homeattach.attachments.count > 0
|
||||
zip_homework_by_user homeattach
|
||||
end
|
||||
end
|
||||
zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<table width="100%" valign="center">
|
||||
<tr>
|
||||
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%>(<%= @homework_list.count%>)</span>
|
||||
<%#= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(is_teacher) %>
|
||||
<%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(is_teacher && @bid.homeworks.count > 0) %>
|
||||
</td>
|
||||
<td align="right">
|
||||
<div class="project-search">
|
||||
|
|
Loading…
Reference in New Issue