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'%> -
-
-

<%= @homework.name %>

- -
- <% if @homework.users.count > 0 %> -
<%= l(:label_participation_person) %>: - <% if @is_anonymous_comments && @is_comprehensive_evaluation != 1 %> - <%= l(:label_anonymous) %> - <%else%> - <% @homework.users.each do |homework_user| %> - <%= link_to homework_user, user_path(homework_user)%> - <% if @homework.users.count > 1 && homework_user != @homework.users.last %> - 、                 - <% end %> - <% end %> - <% end %> - -
- <% end %> -

- <% if @homework.description != nil && @homework.description != "" %> - <%= @homework.description %> - <% else %> -

- <%= l(:label_homework_without_description) %> -
- <% end %> -

-

<%= 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 %> - -

- -
- <%= render :partial => 'show_star',:locals => {:is_comprehensive_evaluation => @is_comprehensive_evaluation,:totle_score => @totle_score,:has_evaluation => @has_evaluation , - :homework => @homework} %> -
-
-
- <%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation} %> -
-
-
- - <%= render :partial => 'histoey_new' %> - -
+<% reply_allow = JournalsForMessage.create_by_user? User.current %> + + +<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%> +
+
+

<%= @homework.name %>

+ +
+ <% if @homework.users.count > 0 %> +
<%= l(:label_participation_person) %>: + <% if @is_anonymous_comments && @is_comprehensive_evaluation != 1 %> + <%= l(:label_anonymous) %> + <%else%> + <% @homework.users.each do |homework_user| %> + <%= link_to homework_user, user_path(homework_user)%> + <% if @homework.users.count > 1 && homework_user != @homework.users.last %> + 、                 + <% end %> + <% end %> + <% end %> + +
+ <% end %> +

+ <% if @homework.description != nil && @homework.description != "" %> + <%= @homework.description %> + <% else %> +

+ <%= l(:label_homework_without_description) %> +
+ <% end %> +

+

<%= l(:label_attachment) %>: + + + <% options = {:author => true } %> + <%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %> + +

+ +
+ <%= render :partial => 'show_star',:locals => {:is_comprehensive_evaluation => @is_comprehensive_evaluation,:totle_score => @totle_score,:has_evaluation => @has_evaluation , + :homework => @homework} %> +
+
+
+ <%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation} %> +
+
+
+ + <%= render :partial => 'histoey_new' %> + +
\ No newline at end of file diff --git a/app/views/homework_attach/_show_star.html.erb b/app/views/homework_attach/_show_star.html.erb index 2181fbf90..7cb49fed9 100644 --- a/app/views/homework_attach/_show_star.html.erb +++ b/app/views/homework_attach/_show_star.html.erb @@ -4,7 +4,7 @@ <% elsif is_comprehensive_evaluation == 2 %> <% if has_evaluation %> <%= l(:label_work_rating) %>: - <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %> + <%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %> <% else %> <%= l(:label_work_rating) %>: <%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %> diff --git a/public/javascripts/seems_rateable/jRating.js b/public/javascripts/seems_rateable/jRating.js index 02cb7d979..afe1ce330 100644 --- a/public/javascripts/seems_rateable/jRating.js +++ b/public/javascripts/seems_rateable/jRating.js @@ -138,7 +138,7 @@ $("p.jRatingInfos").remove(); }, click : function(e){ - var flag = confirm("确定评分?(学生评分之后将无法修改)"); + var flag = confirm("确定评分?"); if(!flag) { e.cancel();