首页报500

This commit is contained in:
cxt 2016-11-04 16:37:50 +08:00
parent 78ca68b5e3
commit 23edad0687
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@
</div>
<% end %>
<div class="cl"></div>
<% if activity.student_works.count != 0 %>
<% if activity.student_works.has_committed.count != 0 %>
<% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %>
<%# student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id} and score is not null").reorder("created_at desc") %>
@ -64,7 +64,7 @@
<% end %>
</a>
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score.to_f < 0 ? 0 : score.to_f) %>分</span></p>
</div>
<% if i == 4 %>
<% break %>