点击学号、班级也要弹出答题详情页面

This commit is contained in:
cxt 2015-12-11 16:35:43 +08:00
parent d4bde8e73c
commit ac77f0d40a
1 changed files with 26 additions and 11 deletions

View File

@ -33,6 +33,19 @@
}).mouseleave(function(){ }).mouseleave(function(){
$("#work_click_<%= exercise.id%>").hide(); $("#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").on('click',show_result);
<% else %>
$("#show_student_result_div").attr("title","截止日期未到,暂不能查看学生答题结果");
$("#student_name_id").attr("title","截止日期未到,暂不能查看学生答题结果");
$("#student_id_id").attr("title","截止日期未到,暂不能查看学生答题结果");
$("#student_class_id").attr("title","截止日期未到,暂不能查看学生答题结果");
<% end %>
});
function show_result() {
window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>';
}
</script> </script>
<ul class="hworkListRow" id="student_work_<%= exercise.id%>"> <ul class="hworkListRow" id="student_work_<%= exercise.id%>">
<li class="hworkList340 width530"> <li class="hworkList340 width530">
@ -40,22 +53,24 @@
<li class="hworkPortrait mt15 mr10"> <li class="hworkPortrait mt15 mr10">
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40"),user_activities_path(exercise.user)) %> <%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40"),user_activities_path(exercise.user)) %>
</li> </li>
<div onclick="" style="cursor: pointer;" class="student_work_<%= exercise.id%>"> <%# end_time = Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
<div id="show_student_result_div" style="cursor: pointer;" class="student_work_<%= exercise.id%>">
<li> <li>
<ul class="mt10 fl"> <ul class="mt10 fl">
<li class="hworkStName mr15 mt16" title="姓名"> <li class="hworkStName mr15 mt16" title="姓名" id="student_name_id">
<% name = exercise.user.show_name %> <%=exercise.user.show_name %>
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %> <%# name = exercise.user.show_name %>
<%= link_to name,show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %> <%# if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
<% else %> <%#= link_to name,show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>
<span title="截止日期未到,暂不能查看学生答题结果。"><%=name%></span> <%# else %>
<!--<span title="截止日期未到,暂不能查看学生答题结果。"><%#=name%></span>-->
<%#= link_to name,'',:title=>"截止日期未到,暂不能查看学生答题结果。" %> <%#= link_to name,'',:title=>"截止日期未到,暂不能查看学生答题结果。" %>
<% end %> <%# end %>
</li> </li>
<li class="hworkStID mr10 mt16" title="学号"> <li class="hworkStID mr10 mt16" title="学号" id="student_id_id">
<%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%> <%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
</li> </li>
<li class="hworkStID mt16" title="班级"> <li class="hworkStID mt16" title="班级" id="student_class_id">
-- --
</li> </li>
</ul> </ul>
@ -63,7 +78,7 @@
</div> </div>
</ul> </ul>
</li> </li>
<li class="hworkList130 c_grey student_work_<%= exercise.id%>" onclick="" style="cursor: pointer;"> <li class="hworkList130 c_grey student_work_<%= exercise.id%>">
<% if exercise.created_at%> <% if exercise.created_at%>
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>&nbsp; <%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% end %> <% end %>