diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index 0fb865884..ee28a14dc 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -35,7 +35,7 @@
  • <%= is_student_batch_homework ? l(:label_my_score) : l(:label_student_score)%>: - <%= homework.s_score.nil? ? l(:label_without_score) : format("%.2f",(is_student_batch_homework ? homework.m_score : homework.s_score)) %> + <%= homework.s_score.nil? ? l(:label_without_score) : format("%.2f",((is_student_batch_homework ? homework.m_score : homework.s_score).nil? ? 0:(is_student_batch_homework ? homework.m_score : homework.s_score))) %>
  • <% if is_teacher %> diff --git a/app/views/homework_attach/_show_score.html.erb b/app/views/homework_attach/_show_score.html.erb index 9e7586c38..2c9f60d92 100644 --- a/app/views/homework_attach/_show_score.html.erb +++ b/app/views/homework_attach/_show_score.html.erb @@ -1,6 +1,6 @@
    + style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;"> <% if stars != nil %>
    <% else %> diff --git a/app/views/homework_attach/_show_star.html.erb b/app/views/homework_attach/_show_star.html.erb index 08923a874..b10455f1a 100644 --- a/app/views/homework_attach/_show_star.html.erb +++ b/app/views/homework_attach/_show_star.html.erb @@ -1,15 +1,15 @@ -<% if is_comprehensive_evaluation == 3 || User.current == homework.user%> - -<% elsif is_comprehensive_evaluation == 2 %> - <% if has_evaluation %> - - <% else %> - <%= l(:label_work_rating) %>: - <%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %> - <% end %> - -<% elsif @is_comprehensive_evaluation == 1%> - <%= l(:label_work_rating) %>: - <%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %> +<% if is_comprehensive_evaluation == 3 || User.current == homework.user%> + +<% elsif is_comprehensive_evaluation == 2 %> + <% if has_evaluation %> + + <% else %> + <%= l(:label_work_rating) %>: + <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %> + <% end %> + +<% elsif @is_comprehensive_evaluation == 1%> + <%= l(:label_work_rating) %>: + <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %> <% end %> \ No newline at end of file diff --git a/lib/seems_rateable/lib/seems_rateable/helpers.rb b/lib/seems_rateable/lib/seems_rateable/helpers.rb index 3d79adf79..a0da7d0c9 100644 --- a/lib/seems_rateable/lib/seems_rateable/helpers.rb +++ b/lib/seems_rateable/lib/seems_rateable/helpers.rb @@ -7,10 +7,11 @@ module SeemsRateable :dimension => nil, :static => false, :class => 'rateable', - :id => nil + :id => nil, + :start_score => nil }.update(opts) - content_tag :div, "", "data-average" => obj.average(options[:dimension]) ? obj.average(options[:dimension]).avg : 0, :id => options[:id], + content_tag :div, "", "data-average" => options[:start_score].nil? ? (obj.average(options[:dimension]) ? obj.average(options[:dimension]).avg : 0):options[:start_score], :id => options[:id], :class => "#{options[:class]}#{jdisabled?(options[:static])}", "data-id" => obj.id, "data-kls" => obj.class.name, "data-dimension" => options[:dimension] end