parent
857110d537
commit
469f1c3663
|
@ -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
|
|
@ -12,18 +12,22 @@
|
|||
<%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
|
||||
</li>
|
||||
<li class=" hwork_time_c">
|
||||
06-01
|
||||
<% if Time.parse(@homework.end_time.to_s) < Time.parse(student_work.created_at.to_s) %>
|
||||
<span class="c_red">迟交</span>
|
||||
<% else%>
|
||||
<%= student_work.created_at.strftime("%m-%d").to_s%>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class=" hwork_score c_red">
|
||||
<li class=" hwork_score <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</li>
|
||||
<li class=" hwork_score c_red">
|
||||
<li class=" hwork_score <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</li>
|
||||
<li class=" hwork_code02 <%= student_work.student_score.nil? ? 'c_grey' : 'c_red'%> student_score_info" >
|
||||
<li class=" hwork_code02 <%= score_color student_work.student_score%> student_score_info" >
|
||||
<%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%>
|
||||
<% unless student_work.student_score.nil?%>
|
||||
<span class="c_blue">
|
||||
<span class="">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>)
|
||||
</span>
|
||||
<div class="info_ni">
|
||||
|
@ -34,7 +38,7 @@
|
|||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class=" hwork_score <%= student_work.final_score.nil? ? 'c_grey' : 'c_red'%>">
|
||||
<li class=" hwork_score <%= score_color student_work.final_score%>">
|
||||
<%= student_work.final_score.nil? ? "--" : format("%.1f",student_work.final_score)%>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
|
|
Loading…
Reference in New Issue