迟交扣分0-50分
This commit is contained in:
parent
a8283a2861
commit
16aea5ef42
|
@ -48,7 +48,8 @@
|
|||
<ul class="ml10">
|
||||
<li>
|
||||
<label class="label02">迟交扣分: </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"> 分</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
|
|
@ -43,7 +43,8 @@
|
|||
|
||||
<li>
|
||||
<label class="label02">迟交扣分: </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"> 分</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue