From ac77f0d40ad86f56eb397802cab06b282d271e23 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 11 Dec 2015 16:35:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=AD=A6=E5=8F=B7=E3=80=81?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=B9=9F=E8=A6=81=E5=BC=B9=E5=87=BA=E7=AD=94?= =?UTF-8?q?=E9=A2=98=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_student_exercise.html.erb | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) 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 %>