diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 15bafe698..6985cd900 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -382,19 +382,19 @@ class HomeworkAttachController < ApplicationController if User.current.admin? || User.current.member_of_course?(@homework.bid.courses.first) # 打分统计 stars_reates = @homework. rates(:quality) - stars_reates_count = stars_reates.count == 0 ? 1 : stars_reates.count - stars_status = stars_reates.select("stars, count(*) as scount").group("stars") - @stars_status_map = Hash.new(0.0) - stars_status.each do |star_status| - percent = (star_status.scount * 1.0/ stars_reates_count) * 100.to_f - percent_m = format("%.2f", percent) - @stars_status_map["star#{star_status.stars.to_i}".to_sym] = - percent_m.to_s + "%" - end + #stars_reates_count = stars_reates.count == 0 ? 1 : stars_reates.count + #stars_status = stars_reates.select("stars, count(*) as scount").group("stars") + #@stars_status_map = Hash.new(0.0) + #stars_status.each do |star_status| + # percent = (star_status.scount * 1.0/ stars_reates_count) * 100.to_f + # percent_m = format("%.2f", percent) + # @stars_status_map["star#{star_status.stars.to_i}".to_sym] = + # percent_m.to_s + "%" + #end #是否已经进行过评价 @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 #@limit = 10 #@jours留言 is null条件用以兼容历史数据 @jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC") diff --git a/app/views/homework_attach/_show.html.erb b/app/views/homework_attach/_show.html.erb index f754a7424..c0b397483 100644 --- a/app/views/homework_attach/_show.html.erb +++ b/app/views/homework_attach/_show.html.erb @@ -1,81 +1,77 @@ -<% reply_allow = JournalsForMessage.create_by_user? User.current %> - - -<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%> -
- <% if @homework.description != nil && @homework.description != "" %> - <%= @homework.description %> - <% else %> -
<%= l(:label_attachment) %>: - - - <% if @is_evaluation || is_teacher%> - <% options = {:author => true } %> - <%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %> - <% else %> - <%= l(:label_cant_download) %> - <% end %> - -
- -+ <% if @homework.description != nil && @homework.description != "" %> + <%= @homework.description %> + <% else %> +
<%= l(:label_attachment) %>: + + + <% options = {:author => true } %> + <%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %> + +
+ +