|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
<!-- fq -->
|
|
|
|
|
<% is_teacher = is_course_teacher User.current,@bid.courses.first.project %>
|
|
|
|
|
<%= form_tag(:controller => 'bids', :action => "show_project", :method => :get) do %>
|
|
|
|
|
<div class="project-search-block">
|
|
|
|
|
<table width="100%" valign="center">
|
|
|
|
@ -6,8 +7,10 @@
|
|
|
|
|
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%>(<%= @homework_list.count%>)</span></td>
|
|
|
|
|
<td align="right">
|
|
|
|
|
<div class="project-search">
|
|
|
|
|
<%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
|
|
|
|
|
<%= submit_tag l(:label_search_by_student_id), :class => "small", :name => nil %>
|
|
|
|
|
<% if is_teacher %>
|
|
|
|
|
<%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
|
|
|
|
|
<%= submit_tag l(:label_search_by_student_id), :class => "small", :name => nil %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div></td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
@ -25,16 +28,25 @@
|
|
|
|
|
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(homework.user), :class => "avatar")%></td>
|
|
|
|
|
<td>
|
|
|
|
|
<table width="580px" border="0">
|
|
|
|
|
<tr> <strong>作业 :</strong>
|
|
|
|
|
<% filename = "" %>
|
|
|
|
|
<% homework.attachments.map do |attachment| %>
|
|
|
|
|
<% filename = attachment.filename %>
|
|
|
|
|
<% if homework.attachments.count > 1%>
|
|
|
|
|
<% filename += "等#{homework.attachments.count}个文件" %>
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 300px">
|
|
|
|
|
<strong>作业 :</strong>
|
|
|
|
|
<% attachments = homework.attachments.map %>
|
|
|
|
|
<% for attachment in attachments %>
|
|
|
|
|
<% if attachments.count > 1 && attachment != attachments.first %>
|
|
|
|
|
<br/>
|
|
|
|
|
<% for item in 1..7 %>
|
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<%= link_to_attachment attachment , :download => true -%>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% break %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<%= link_to filename , homework_attach_path(homework)%>
|
|
|
|
|
</td>
|
|
|
|
|
<td style="vertical-align: top">
|
|
|
|
|
<% if display_id %>
|
|
|
|
|
<%= link_to "互评>>" , homework_attach_path(homework)%>
|
|
|
|
|
<% end %>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="1" valign="top" style="width: 300px">
|
|
|
|
@ -48,7 +60,7 @@
|
|
|
|
|
<% sum = sum + star_reates.stars %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% stars_reates_count = stars_reates.count == 0 ? 1 : stars_reates.count %>
|
|
|
|
|
<%= sum * 1.0 / stars_reates_count %>
|
|
|
|
|
<%= format("%.2f", sum * 1.0 / stars_reates_count) %>
|
|
|
|
|
</td>
|
|
|
|
|
<td valign="top" align="right">
|
|
|
|
|
<% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.attachments[0].created_on.to_s) %>
|
|
|
|
@ -58,20 +70,20 @@
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2" valign="top">
|
|
|
|
|
<% if display_id %>
|
|
|
|
|
<strong><%= l(:label_bidding_user_studentcode) %> : <%= homework.user.user_extensions.student_id%></strong>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if display_id %>
|
|
|
|
|
<strong><%= l(:label_bidding_user_studentcode) %> : <%= homework.user.user_extensions.student_id%></strong>
|
|
|
|
|
<% end %>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2" width="580px" >
|
|
|
|
|
<% if (User.current == homework.user) || (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',3,7, 9)).size >0) %>
|
|
|
|
|
<p class="font_description">
|
|
|
|
|
<% options = {:author => true, :deletable => attach_delete(homework)} %>
|
|
|
|
|
<%= render :partial => 'attachments/links',
|
|
|
|
|
:locals => {:attachments => homework.attachments, :options => options} %>
|
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if (User.current == homework.user) || (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',3,7, 9)).size >0) %>
|
|
|
|
|
<p class="font_description">
|
|
|
|
|
<% options = {:author => true, :deletable => attach_delete(homework)} %>
|
|
|
|
|
<%= render :partial => 'attachments/links',
|
|
|
|
|
:locals => {:attachments => homework.attachments, :options => options} %>
|
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|