From 06361246c77bc6c4de204637e421f52658b701c6 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 22 Aug 2016 15:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=B7=B2=E6=8F=90=E4=BA=A4=E4=BA=BA=E6=95=B0=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 1 + app/views/student_work/_student_work_list.html.erb | 2 +- app/views/student_work/add_score.js.erb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 8f3ebff98..722845ef7 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -868,6 +868,7 @@ class StudentWorkController < ApplicationController update_org_activity(@homework.class,@homework.id) if @work.save @work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => @work.id).first + @count = @homework.student_works.has_committed.count respond_to do |format| format.js end diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index cc078bf9c..e05df2892 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -2,7 +2,7 @@ 作品 - (<%= @student_work_count%>人已交) + (<%= @student_work_count%>人已交) <%# my_work = @homework.student_works.where("user_id = #{User.current.id}").first %> <% my_work = cur_user_works_for_homework @homework %> diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index e4341869f..c961fb077 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -17,3 +17,5 @@ $("#score_list_<%= @work.id%>").removeAttr("style"); $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>"); $("#work_num_<%= @work.id%>").html(num); <% end%> + +$("#student_work_count").html("<%=@count %>");