学生匿评份初始值显示修正
This commit is contained in:
parent
63d233ee42
commit
b45e23d837
|
@ -392,6 +392,8 @@ class HomeworkAttachController < ApplicationController
|
||||||
# percent_m.to_s + "%"
|
# percent_m.to_s + "%"
|
||||||
#end
|
#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
|
@has_evaluation = stars_reates.where("rater_id = ?",User.current).count > 0
|
||||||
#是否开启互评功能
|
#是否开启互评功能
|
||||||
#@is_evaluation = @homework.bid.is_evaluation == 1 || @homework.bid.is_evaluation == nil
|
#@is_evaluation = @homework.bid.is_evaluation == 1 || @homework.bid.is_evaluation == nil
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<% elsif is_comprehensive_evaluation == 2 %>
|
<% elsif is_comprehensive_evaluation == 2 %>
|
||||||
<% if has_evaluation %>
|
<% if has_evaluation %>
|
||||||
<%= l(:label_work_rating) %>:
|
<%= 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 %>
|
<% else %>
|
||||||
<%= l(:label_work_rating) %>:
|
<%= l(:label_work_rating) %>:
|
||||||
<%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %>
|
<%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %>
|
||||||
|
|
Loading…
Reference in New Issue