|
|
|
@ -53,7 +53,7 @@
|
|
|
|
|
|
|
|
|
|
<div class="fr mr40 shixun-title-font">
|
|
|
|
|
<span class="color-red mr5 shixun-title-font">*</span>分值:
|
|
|
|
|
<input id="minute<%= i %>" value="<%= @exercise.level_setting(i).try(:score) %>" name="ques_scores[]" class="borderFF8121"/> 分/题
|
|
|
|
|
<input id="minute<%= i %>" value="<%= @exercise.level_setting(i).try(:score) %>" name="ques_scores[]" /> 分/题
|
|
|
|
|
<div class="colorFF8121sum none" id="scoregreater<%= i %>">*大于等于0,且不能大于100</div>
|
|
|
|
|
<div class="colorFF8121sum none" id="scorenull<%= i %>">*不能为空</div>
|
|
|
|
|
<div class="colorFF8121sum none" id="scorezero<%= i %>">*必须大于等于0</div>
|
|
|
|
@ -62,7 +62,7 @@
|
|
|
|
|
|
|
|
|
|
<div class="fr mr40 shixun-title-font">
|
|
|
|
|
<span class="color-red mr5 shixun-title-font">*</span>
|
|
|
|
|
随机出题量:<input id="topic<%= i %>" value="<%= @exercise.level_setting(i).try(:num) || questions_list.try(:count) %>" name="ques_nums[]" class="borderFF8121"/> 题
|
|
|
|
|
随机出题量:<input id="topic<%= i %>" value="<%= @exercise.level_setting(i).try(:num) || questions_list.try(:count) %>" name="ques_nums[]" /> 题
|
|
|
|
|
<div class="colorFF8121 none" id="topicnull<%= i %>">*不能为空</div>
|
|
|
|
|
<div class="colorFF8121 none" id="topicinteger<%= i %>">*必须为正整数</div>
|
|
|
|
|
<div class="colorFF8121 none" id="topicreater<%= i %>">*不能大于可用题数</div>
|
|
|
|
@ -134,32 +134,40 @@
|
|
|
|
|
|
|
|
|
|
if(first<0){
|
|
|
|
|
$("#scorezero"+i).show();
|
|
|
|
|
$("#minute"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
}else if(isNaN(first)){
|
|
|
|
|
$("#scorenull"+i).show();
|
|
|
|
|
$("#minute"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
}else if(first>100){
|
|
|
|
|
$("#scoreone"+i).show();
|
|
|
|
|
$("#minute"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
} else {
|
|
|
|
|
$("#scorezero"+i).hide();
|
|
|
|
|
$("#scorenull"+i).hide();
|
|
|
|
|
$("#scoreone"+i).hide();
|
|
|
|
|
$("#minute"+i).removeClass("borderFF8121");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(last<0){
|
|
|
|
|
$("#topicnull"+i).show();
|
|
|
|
|
$("#topic"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
}else if(isNaN(last)){
|
|
|
|
|
$("#topicinteger"+i).show();
|
|
|
|
|
$("#topic"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
}else if(last>available){
|
|
|
|
|
$("#topicreater"+i).show();
|
|
|
|
|
$("#topic"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
} else {
|
|
|
|
|
$("#topicnull"+i).hide();
|
|
|
|
|
$("#topicinteger"+i).hide();
|
|
|
|
|
$("#topicreater"+i).hide();
|
|
|
|
|
$("#topic"+i).removeClass("borderFF8121");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(result);
|
|
|
|
|