2016-04-14 11:29:22 +08:00
|
|
|
<h3>
|
|
|
|
<%=l(:label_code_work_tests)%>
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="autoscroll">
|
|
|
|
<table class="list" style="width: 100%;table-layout: fixed">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th style="width: 50px;">
|
2016-04-20 09:51:51 +08:00
|
|
|
<span style="float:left; margin-left:20px;">作业id</span>
|
2016-04-14 11:29:22 +08:00
|
|
|
</th>
|
|
|
|
<th style="width: 50px;">
|
2016-04-20 09:51:51 +08:00
|
|
|
<span style="float:left; margin-left:20px;">作品id</span>
|
2016-04-14 11:29:22 +08:00
|
|
|
</th>
|
2016-04-20 09:51:51 +08:00
|
|
|
<th style="width: 60px;">
|
|
|
|
用户等待时间
|
2016-04-14 11:29:22 +08:00
|
|
|
</th>
|
|
|
|
<th style="width: 50px;">
|
2016-04-20 09:51:51 +08:00
|
|
|
<span style="float:left; margin-left:20px;">语言</span>
|
2016-04-14 11:29:22 +08:00
|
|
|
</th>
|
2016-04-20 09:51:51 +08:00
|
|
|
<th style="width: 100px;">
|
|
|
|
测试完成时间
|
2016-04-14 11:29:22 +08:00
|
|
|
</th>
|
2016-04-20 09:51:51 +08:00
|
|
|
<th style="width: 60px;">
|
|
|
|
<span style="float:left; margin-left:20px;">答题状态</span>
|
2016-04-14 11:29:22 +08:00
|
|
|
</th>
|
|
|
|
<th style="width: 50px;">
|
2016-04-20 09:51:51 +08:00
|
|
|
<span style="float:left; margin-left:20px;">耗时</span>
|
2016-04-14 11:29:22 +08:00
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<% @code_work_tests.each do |test| %>
|
2016-04-20 09:51:51 +08:00
|
|
|
<% if test['homework_id'] != nil %>
|
2016-04-15 12:39:22 +08:00
|
|
|
<tr class="<%= cycle("odd", "even") %>">
|
2016-04-20 09:51:51 +08:00
|
|
|
<td style="text-align: center; " title='<%=test['homework_id']%>'>
|
2016-04-21 11:16:32 +08:00
|
|
|
<% if test['link_hwork'] %>
|
|
|
|
<%=link_to(test['homework_id'], student_work_index_path(:homework => test['homework_id']))%>
|
|
|
|
<% else %>
|
|
|
|
<%= test['homework_id'] %>
|
|
|
|
<% end %>
|
2016-04-20 09:51:51 +08:00
|
|
|
</td>
|
|
|
|
<td style="text-align: center; " title='<%=test['student_work_id']%>'>
|
2016-04-21 11:16:32 +08:00
|
|
|
<% if test['link_swork'] && test['link_hwork'] %>
|
|
|
|
<% if !test['is_test'] %>
|
|
|
|
<%=link_to(test['student_work_id'], student_work_index_path(:homework => test['homework_id'],:student_work_id=>test['student_work_id']))%>
|
|
|
|
<% else %>
|
|
|
|
<%=link_to(test['student_work_id'], new_user_commit_homework_users_path(homework_id: test['homework_id'], is_test: true))%>
|
|
|
|
<% end %>
|
2016-04-20 09:51:51 +08:00
|
|
|
<% else %>
|
2016-04-21 11:16:32 +08:00
|
|
|
<%= test['student_work_id'] %>
|
2016-04-20 09:51:51 +08:00
|
|
|
<% end %>
|
2016-04-15 12:39:22 +08:00
|
|
|
</td>
|
|
|
|
<td style="text-align: center;">
|
2016-04-20 09:51:51 +08:00
|
|
|
<% if test.wait_time != 0 %>
|
|
|
|
<%=test.wait_time.to_s+"毫秒" %>
|
2016-04-15 12:39:22 +08:00
|
|
|
<% else %>
|
|
|
|
<%="未记录"%>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
<td align="center">
|
2016-04-20 09:51:51 +08:00
|
|
|
<%=%W(C C++ Python Java).at(test['language'].to_i - 1)%>
|
2016-04-15 12:39:22 +08:00
|
|
|
</td>
|
|
|
|
<td align="center">
|
|
|
|
<%=Time.parse(test.created_at.to_s).strftime("%Y-%m-%d %H:%M:%S")%>
|
|
|
|
</td>
|
|
|
|
<td align="center">
|
|
|
|
<% if test.status == 0 %>
|
|
|
|
<%= "答题正确" %>
|
|
|
|
<% elsif test.status == -2 %>
|
|
|
|
<%= "编译错误" %>
|
2016-04-20 09:51:51 +08:00
|
|
|
<% elsif test.status == 2 %>
|
|
|
|
<%= "代码超时" %>
|
|
|
|
<% elsif test.status == -3 %>
|
|
|
|
<%= "请求超时" %>
|
2016-04-14 11:29:22 +08:00
|
|
|
<% else %>
|
2016-04-15 12:39:22 +08:00
|
|
|
<%= "答题错误" %>
|
2016-04-14 11:29:22 +08:00
|
|
|
<% end %>
|
2016-04-15 12:39:22 +08:00
|
|
|
</td>
|
|
|
|
<td class="center">
|
2016-04-20 09:51:51 +08:00
|
|
|
<% if test.time_used > 0 %>
|
|
|
|
<%=test.time_used.to_s+"毫秒"%>
|
2016-04-15 12:39:22 +08:00
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
2016-04-14 11:29:22 +08:00
|
|
|
<% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="pagination">
|
|
|
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% html_title(l(:label_code_work_tests)) -%>
|