socialforge/app/views/exercise/_student_table.html.erb

71 lines
3.9 KiB
Plaintext
Raw Normal View History

2016-05-20 15:15:42 +08:00
<table class="hwork-table-wrap">
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
<th class="hworkList340 width530" colspan="6">
<span class="c_dark f14 fb fl mr5">序号</span>
<span class="c_dark f14 fb fl mr55">&nbsp;&nbsp;</span>
<span class="c_dark f14 fb fl mr60">姓名</span>
<span class="c_dark f14 fb fl mr60">学号</span>
<span class="c_dark f14 fb fl">班级</span>
</th>
<th class="hworkList130">
<%= link_to "时间",'',:class => "c_dark f14 fb fl ml50" ,:remote => true%>
</th>
<th class="hworkList50">
<%= link_to "成绩",'',:class => "c_dark f14 fb fl ml10",:remote => true%>
</th>
</tr>
2015-11-17 15:18:07 +08:00
2016-05-20 15:15:42 +08:00
<% @exercise_users_list.each do |exercise|%>
<script type="text/javascript">
$(".student_work_<%= exercise.id%>").mouseenter(function(){
$("#work_click_<%= exercise.id%>").show();
}).mouseleave(function(){
$("#work_click_<%= exercise.id%>").hide();
});
$(function(){
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
$("#show_student_result_div_<%= exercise.id%>").on('click',function() {
window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user_id) %>';
});
<% else %>
$("#show_student_result_div_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
$("#student_name_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
$("#student_id_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
$("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
<% end %>
});
/*function show_result(id) {
window.location.href = '<%#=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>';
}*/
</script>
2015-11-17 15:18:07 +08:00
2016-05-20 15:15:42 +08:00
<tr class="hworkListRow" id="student_work_<%= exercise.id%>">
<td class="pl5 pr5" style="width:28px; text-align:center;">1</td>
<td class="hworkPortrait pr10 float-none">
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;", :class => "mt15"),user_activities_path(exercise.user)) %>
</td>
<td class="hworkStName" title="姓名" id="student_name_<%= exercise.id%>" style="cursor:pointer;">
<%=exercise.user.show_name %>
</td>
<td class="hworkStID pl15 pr10 float-none" title="学号" id="student_id_<%= exercise.id%>" style="cursor:pointer;">
2016-05-20 21:47:31 +08:00
<span class="hidden fl" style="width:80px;"><%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%></span>
2016-05-20 15:15:42 +08:00
</td>
<td class="hworkStID float-none" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
--
</td>
<td width="200">&nbsp;</td>
<td class="hworkList130 c_grey student_work_<%= exercise.id%>">
<% if exercise.created_at%>
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if @exercise.end_time <= exercise.created_at %>
<span class="c_red">[未答]</span>
<% end %>
<% end %>
</td>
<td class="hworkList50 <%= score_color exercise.score%> student_final_scor_info">
<%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
</td>
2016-05-20 20:44:13 +08:00
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= exercise.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
2016-05-20 15:15:42 +08:00
</tr>
<% end%>
</table>