学生匿评份初始值显示修正

This commit is contained in:
z9hang 2014-11-08 15:20:43 +08:00
parent 63d233ee42
commit b45e23d837
2 changed files with 3 additions and 1 deletions

View File

@ -392,6 +392,8 @@ class HomeworkAttachController < ApplicationController
# percent_m.to_s + "%"
#end
#是否已经进行过评价
temp = HomeworkAttach.find_by_sql("SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{@homework.id} AND rater_id = #{User.current.id}").first
@m_score = temp.nil? ? 0:temp.stars
@has_evaluation = stars_reates.where("rater_id = ?",User.current).count > 0
#是否开启互评功能
#@is_evaluation = @homework.bid.is_evaluation == 1 || @homework.bid.is_evaluation == nil

View File

@ -4,7 +4,7 @@
<% elsif is_comprehensive_evaluation == 2 %>
<% if has_evaluation %>
<%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %>
<%= rating_for homework, dimension: :quality,start_score: @m_score, class: 'rateable div_inline' %>
<% else %>
<%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %>