diff --git a/app/views/exercise/_student_exercise.html.erb b/app/views/exercise/_student_exercise.html.erb index 6555cfc61..bbbe9026d 100644 --- a/app/views/exercise/_student_exercise.html.erb +++ b/app/views/exercise/_student_exercise.html.erb @@ -35,7 +35,9 @@ }); $(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',show_result); + $("#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","截止日期未到,暂不能查看学生答题结果"); @@ -43,9 +45,9 @@ $("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); <% end %> }); - function show_result() { - window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>'; - } + /*function show_result(id) { + window.location.href = '<%#=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>'; + }*/