diff --git a/app/views/exercise/_student_exercise.html.erb b/app/views/exercise/_student_exercise.html.erb index 4e27d57cb..3983fb0c4 100644 --- a/app/views/exercise/_student_exercise.html.erb +++ b/app/views/exercise/_student_exercise.html.erb @@ -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) %>'; + } -
  • +
  • <% if exercise.created_at%> <%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>  <% end %>