点击学号、班级也要弹出答题详情页面
This commit is contained in:
parent
d4bde8e73c
commit
ac77f0d40a
|
@ -33,6 +33,19 @@
|
|||
}).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").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>
|
||||
<ul class="hworkListRow" id="student_work_<%= exercise.id%>">
|
||||
<li class="hworkList340 width530">
|
||||
|
@ -40,22 +53,24 @@
|
|||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40"),user_activities_path(exercise.user)) %>
|
||||
</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>
|
||||
<ul class="mt10 fl">
|
||||
<li class="hworkStName mr15 mt16" title="姓名">
|
||||
<% 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") %>
|
||||
<%= link_to name,show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>
|
||||
<% else %>
|
||||
<span title="截止日期未到,暂不能查看学生答题结果。"><%=name%></span>
|
||||
<li class="hworkStName mr15 mt16" title="姓名" id="student_name_id">
|
||||
<%=exercise.user.show_name %>
|
||||
<%# 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") %>
|
||||
<%#= link_to name,show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>
|
||||
<%# else %>
|
||||
<!--<span title="截止日期未到,暂不能查看学生答题结果。"><%#=name%></span>-->
|
||||
<%#= link_to name,'',:title=>"截止日期未到,暂不能查看学生答题结果。" %>
|
||||
<% end %>
|
||||
<%# end %>
|
||||
</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%>
|
||||
</li>
|
||||
<li class="hworkStID mt16" title="班级">
|
||||
<li class="hworkStID mt16" title="班级" id="student_class_id">
|
||||
--
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -63,7 +78,7 @@
|
|||
</div>
|
||||
</ul>
|
||||
</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%>
|
||||
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue