进入作品评分界面,评分等数据的初始化

This commit is contained in:
sw 2015-05-27 08:55:33 +08:00
parent a006e2e462
commit fa3b9e2af0
5 changed files with 8 additions and 5 deletions

View File

@ -62,6 +62,7 @@ class StudentWorkController < ApplicationController
end end
def show def show
@score = student_work_score @work,User.current
respond_to do |format| respond_to do |format|
format.js format.js
end end

View File

@ -6,13 +6,13 @@
</li> </li>
<li > <li >
<span class="tit_fb mt2"> 评分:</span> <span class="tit_fb mt2"> 评分:</span>
<input type="number" name="score" id="score_<%= work.id%>" value="50" min="0" max="100" size="4" data-units="dollars" /> <input type="number" name="score" id="score_<%= work.id%>" value="<%= score.nil? ? 50 : score.score%>" min="0" max="100" size="4" data-units="dollars" />
<span class=" ml5">分</span> <span class=" ml5">分</span>
<div class="cl"></div></li> <div class="cl"></div></li>
<li > <li >
<span class="tit_fb"> 批阅结果:</span> <span class="tit_fb"> 批阅结果:</span>
<div> <div>
<%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work} %> <%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %>
</div> </div>
<a href="javascript:void(0);" class="blue_n_btn fr" onclick="$(this).parent().parent().submit();">提交</a> <a href="javascript:void(0);" class="blue_n_btn fr" onclick="$(this).parent().parent().submit();">提交</a>
<div class="cl"></div> <div class="cl"></div>

View File

@ -33,7 +33,7 @@
<div class="cl"></div> <div class="cl"></div>
<div id="add_student_score"> <div id="add_student_score">
<%= render :partial => 'add_score',:locals => {:work => work}%> <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
</div> </div>
</ul> </ul>

View File

@ -1,5 +1,7 @@
<div class="fl"> <div class="fl">
<span id="attachments_fields<%= work.id%>" xmlns="http://www.w3.org/1999/html"></span> <span id="attachments_fields<%= work.id%>" xmlns="http://www.w3.org/1999/html">
</span>
<div class="cl"></div> <div class="cl"></div>
<span class="add_attachment" style="font-weight:normal;"> <span class="add_attachment" style="font-weight:normal;">
<%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %> <%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>

View File

@ -2,6 +2,6 @@ if($("#about_hwork_<%= @work.id%>").children().length > 0)
{$("#about_hwork_<%= @work.id%>").html("");} {$("#about_hwork_<%= @work.id%>").html("");}
else 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'}); $('#score_<%= @work.id%>').peSlider({range: 'min'});
} }