From fa3b9e2af09d14321fb8a297fe6d0e37860468c4 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 27 May 2015 08:55:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=85=A5=E4=BD=9C=E5=93=81=E8=AF=84?= =?UTF-8?q?=E5=88=86=E7=95=8C=E9=9D=A2=EF=BC=8C=E8=AF=84=E5=88=86=E7=AD=89?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96?= 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/_add_score.html.erb | 4 ++-- app/views/student_work/_show.html.erb | 2 +- app/views/student_work/_student_work_attachment_form.html.erb | 4 +++- app/views/student_work/show.js.erb | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 5e09c5460..7e3bab1d6 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -62,6 +62,7 @@ class StudentWorkController < ApplicationController end def show + @score = student_work_score @work,User.current respond_to do |format| format.js end diff --git a/app/views/student_work/_add_score.html.erb b/app/views/student_work/_add_score.html.erb index 66aeee68c..68f4185b4 100644 --- a/app/views/student_work/_add_score.html.erb +++ b/app/views/student_work/_add_score.html.erb @@ -6,13 +6,13 @@
  • 评分: - +
  • 批阅结果:
    - <%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work} %> + <%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %>
    提交
    diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index ea9f9a420..5506a9951 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -33,7 +33,7 @@
    - <%= render :partial => 'add_score',:locals => {:work => work}%> + <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
    diff --git a/app/views/student_work/_student_work_attachment_form.html.erb b/app/views/student_work/_student_work_attachment_form.html.erb index 00028f481..5290ad9bb 100644 --- a/app/views/student_work/_student_work_attachment_form.html.erb +++ b/app/views/student_work/_student_work_attachment_form.html.erb @@ -1,5 +1,7 @@
    - + + +
    <%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %> diff --git a/app/views/student_work/show.js.erb b/app/views/student_work/show.js.erb index 1f7e98e48..f208aa52e 100644 --- a/app/views/student_work/show.js.erb +++ b/app/views/student_work/show.js.erb @@ -2,6 +2,6 @@ if($("#about_hwork_<%= @work.id%>").children().length > 0) {$("#about_hwork_<%= @work.id%>").html("");} else { - $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => @work}) %>"); + $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => @work,:score => @score}) %>"); $('#score_<%= @work.id%>').peSlider({range: 'min'}); } \ No newline at end of file