diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 17efa6f89..0eeffa588 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -27,7 +27,7 @@ class ExerciseController < ApplicationController if @is_teacher || User.current.admin? exercises = @course.exercises.order("created_at asc") else - exercises = @course.exercises.where("exercise_status <> 1 ").order("created_at asc") + exercises = @course.exercises.where("exercise_status <> 1").order("created_at asc") end @exercises = paginateHelper exercises,20 #分页 respond_to do |format| diff --git a/app/views/exercise/_exercise.html.erb b/app/views/exercise/_exercise.html.erb index 30f986d92..19bc520d4 100644 --- a/app/views/exercise/_exercise.html.erb +++ b/app/views/exercise/_exercise.html.erb @@ -56,7 +56,10 @@ <%#else%> - <%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%> + <%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%> + <% if exercise.end_time <= Time.now && has_commit_exercise?(exercise.id, User.current.id) %> +
  • 已答
  • + <% end %> <%#end%> <% end%>
  • 截止时间:<%= format_time(exercise.end_time.to_s)%>