作品列表中的已提交人数无法自动刷新

yuanke_cache
cxt 9 years ago
parent 572ad5a162
commit 06361246c7

@ -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

@ -2,7 +2,7 @@
<span class="c_dark f14 fb fl mr15">
作品
<font class="f12 c_red">
(<%= @student_work_count%>人已交)
(<span id="student_work_count"><%= @student_work_count%></span>人已交)
</font>
<%# my_work = @homework.student_works.where("user_id = #{User.current.id}").first %>
<% my_work = cur_user_works_for_homework @homework %>

@ -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 %>");

Loading…
Cancel
Save