diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index 7c85dc5c4..f88b1ff21 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -70,4 +70,14 @@ module StudentWorkHelper def has_evaluation_count user,homework StudentWorksScore.joins(:student_work).where("student_works_scores.user_id = #{user.id} AND student_works.homework_common_id = #{homework.id}").count end + + #传入分数,获取对应颜色 + def score_color score + if score + color = score >= 90 ? "c_red" : "c_green" + else + color = "c_grey" + end + color + end end \ No newline at end of file diff --git a/app/views/student_work/_student_work.html.erb b/app/views/student_work/_student_work.html.erb index 22df921ec..abbd134b0 100644 --- a/app/views/student_work/_student_work.html.erb +++ b/app/views/student_work/_student_work.html.erb @@ -12,18 +12,22 @@ <%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
  • - 06-01 + <% if Time.parse(@homework.end_time.to_s) < Time.parse(student_work.created_at.to_s) %> + 迟交 + <% else%> + <%= student_work.created_at.strftime("%m-%d").to_s%> + <% end %>
  • -
  • +
  • <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
  • -
  • +
  • <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
  • -
  • +
  • <%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%> <% unless student_work.student_score.nil?%> - + (<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>)
    @@ -34,7 +38,7 @@
    <% end%>
  • -
  • +
  • <%= student_work.final_score.nil? ? "--" : format("%.1f",student_work.final_score)%>