diff --git a/app/views/users/_homework_base_info.html.erb b/app/views/users/_homework_base_info.html.erb index bbc84011c..a3d216ef2 100644 --- a/app/views/users/_homework_base_info.html.erb +++ b/app/views/users/_homework_base_info.html.erb @@ -29,7 +29,7 @@ <% end %>
-<% 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 %> <% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %> -

分数:<%=format("%.1f",score<0 ? 0 : score) %>分

+

分数:<%=format("%.1f",score.to_f < 0 ? 0 : score.to_f) %>分

<% if i == 4 %> <% break %>