From 5799d08a0d986556406c65b420470a30f5db2779 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 17 Jul 2015 16:17:38 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=80=81=E5=B8=88=E8=AF=84=E7=BC=96?=
=?UTF-8?q?=E7=A8=8B=E4=BD=9C=E4=B8=9A=E5=BE=97=E5=88=86=E5=90=8E=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E9=94=99=E8=AF=AF=202=E3=80=81=E7=BC=96=E7=A8=8B?=
=?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=B3=BB=E7=BB=9F=E5=BE=97=E5=88=86=E4=B8=8D?=
=?UTF-8?q?=E7=8E=B0=E5=AE=9E=E5=90=8E=E9=9D=A2=E6=8B=AC=E5=8F=B7=E5=92=8C?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../_evaluation_student_work.html.erb | 2 +-
app/views/student_work/add_score.js.erb | 19 +++++++++++--------
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/app/views/student_work/_evaluation_student_work.html.erb b/app/views/student_work/_evaluation_student_work.html.erb
index b83917481..b5bdd6f55 100644
--- a/app/views/student_work/_evaluation_student_work.html.erb
+++ b/app/views/student_work/_evaluation_student_work.html.erb
@@ -26,7 +26,7 @@
<%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%>
- <% unless student_work.student_score.nil?%>
+ <% unless student_work.student_score.nil? || student_work.homework_common.homework_type == 2%>
(<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>)
diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb
index 9298de8fc..1de92b51a 100644
--- a/app/views/student_work/add_score.js.erb
+++ b/app/views/student_work/add_score.js.erb
@@ -2,20 +2,23 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti
$('#score_<%= @work.id%>').peSlider({range: 'min'});
<% if @is_new%>
-$("#score_list_<%= @work.id%>").prepend("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>
");
+ $("#score_list_<%= @work.id%>").prepend("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>
");
<% else %>
-$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>");
+ $("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>");
<% end%>
+
$("#score_list_<%= @work.id%>").removeAttr("style");
<% if @is_teacher %>
-<% if @homework.homework_type == 1%>
-$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>");
-<% else%>
-$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'student_work',:locals => {:student_work => @work}) %>");
-<% end%>
+ <% if @homework.homework_type == 1%>
+ $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>");
+ <% elsif @homework.homework_type == 2%>
+ $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>");
+ <% else%>
+ $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'student_work',:locals => {:student_work => @work}) %>");
+ <% end%>
<% else %>
-$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work}) %>");
+ $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work}) %>");
<% end%>