From 9ffe32e1213044a1e0a67d93dffa36eab048e028 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 15 Dec 2014 09:10:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=8F=AF=E4=BB=A5=E4=B8=8D=E5=AF=B9?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E4=BD=9C=E4=B8=9A=E8=BF=9B=E8=A1=8C=E8=AF=84?= =?UTF-8?q?=E5=88=86=EF=BC=8C=E5=8F=AA=E8=BF=9B=E8=A1=8C=E8=AF=84=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 2 +- app/views/homework_attach/_addjour.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 564f60ac3..72755dc6a 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -427,7 +427,7 @@ class HomeworkAttachController < ApplicationController @homework = HomeworkAttach.find(params[:homework_id]) #保存评分 - @homework.rate(@m_score.to_i,User.current.id,:quality) if @m_score && @m_score != "0" + @homework.rate(@m_score.to_i,User.current.id,:quality) if @m_score #保存评论 @is_comprehensive_evaluation = @is_teacher ? 1 : (@is_anonymous_comments ? 2 : 3) #判断当前评论是老师评论?匿评?留言 if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" #有没有留言 diff --git a/app/views/homework_attach/_addjour.html.erb b/app/views/homework_attach/_addjour.html.erb index d07c713db..48beebdf8 100644 --- a/app/views/homework_attach/_addjour.html.erb +++ b/app/views/homework_attach/_addjour.html.erb @@ -21,7 +21,7 @@ function submit_jours(is_teacher) { - if($("#stars_value").val() == "0"){alert("您还没有打分");return;} + if(!is_teacher&&$("#stars_value").val() == "0"){alert("您还没有打分");return;} if(!is_teacher&&$("#new_form_user_message").val() == ""){alert("您还没有填写评语");return;} $('#new_form_user_message').parent().submit(); } From 5343ee2cfb11672180a6daea8df1b28362481716 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 15 Dec 2014 09:19:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BD=93=E8=AF=84=E5=88=86=E4=B8=BA0?= =?UTF-8?q?=E5=88=86=E6=97=B6=E6=98=BE=E7=A4=BA=E4=B8=BA=E6=9C=AA=E8=AF=84?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_attach/_homework.html.erb | 2 +- app/views/homework_attach/_review.html.erb | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index 802a021a4..c2b87832c 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -32,7 +32,7 @@ <% unless is_student_batch_homework %> <%= l(:label_teacher_score)%>: - <%= homework.t_score.nil? ? l(:label_without_score) : format("%.2f",homework.t_score)%> + <%= (homework.t_score.nil? || (homework.t_score && homework.t_score.to_i == 0)) ? l(:label_without_score) : format("%.2f",homework.t_score)%>    <% end %> diff --git a/app/views/homework_attach/_review.html.erb b/app/views/homework_attach/_review.html.erb index 6663bc6fe..b4508d225 100644 --- a/app/views/homework_attach/_review.html.erb +++ b/app/views/homework_attach/_review.html.erb @@ -26,12 +26,14 @@ <%= format_time(review.created_at) %> - - <%= l(:label_work_rating) %>: - -
- <%= render :partial => 'homework_attach/show_static_star', :locals => {:start_score => review.stars } %> -
+ <% if review.stars && review.stars.to_i > 0%> + + <%= l(:label_work_rating) %>: + +
+ <%= render :partial => 'homework_attach/show_static_star', :locals => {:start_score => review.stars } %> +
+ <% end %>

<%= textilizable jour.nil? ? "" : jour.notes%>