若测验已截止且学生已提交则在测验列表后面显示“已答”
This commit is contained in:
parent
0deffdba33
commit
0215e5e38c
|
@ -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|
|
||||
|
|
|
@ -56,7 +56,10 @@
|
|||
<!--li><%#= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue" %></li>
|
||||
<li class="pollsbtn_tip fl ml5">已答</li-->
|
||||
<%#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) %>
|
||||
<li class="pollsbtn_tip fl ml5">已答</li>
|
||||
<% end %>
|
||||
<%#end%>
|
||||
<% end%>
|
||||
<li class="polls_date fr mr10">截止时间:<%= format_time(exercise.end_time.to_s)%></li>
|
||||
|
|
Loading…
Reference in New Issue