迟交扣分0-50分

This commit is contained in:
sw 2015-08-14 15:44:54 +08:00
parent a8283a2861
commit 16aea5ef42
3 changed files with 22 additions and 2 deletions

View File

@ -48,7 +48,8 @@
<ul class="ml10">
<li>
<label class="label02">迟交扣分:&nbsp;</label>
<%= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
<%#= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
<input type="number" value="<%= homework.late_penalty%>" min="0" max="50" class="fl mb10 h26 w70" name="late_penalty" onkeyup="check_late_penalty()">
<span class="fl mt5">&nbsp;分</span>
<div class="cl"></div>
</li>

View File

@ -43,7 +43,8 @@
<li>
<label class="label02">迟交扣分:&nbsp;</label>
<%= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
<%#= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
<input type="number" value="<%= homework.late_penalty%>" min="0" max="50" class="fl mb10 h26 w70" name="late_penalty" onkeyup="check_late_penalty()">
<span class="fl mt5">&nbsp;分</span>
<div class="cl"></div>
</li>

View File

@ -412,6 +412,24 @@ function regex_homework_name()
}
}
//处理迟交扣分
function check_late_penalty()
{
var obj = $("input[name='late_penalty']");
var regex = /^\d+$/;
if(regex.test(obj.val()))
{
if(obj.val() > 50)
{
obj.val("50");
}
}
else
{
obj.val("0");
}
}
//验证匿评数量
function regex_evaluation_num()
{