|
|
|
@ -92,7 +92,7 @@
|
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
|
<div class="fl mb10 shixunsboxs">
|
|
|
|
|
<div class="newshixunbox" onclick="add_shixun();">
|
|
|
|
|
<div class="newshixunboxfont" >新增实训题</div>
|
|
|
|
|
新增实训题
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
@ -123,7 +123,7 @@
|
|
|
|
|
function add_shixun_question(){
|
|
|
|
|
var result = true;
|
|
|
|
|
var Uarry=$("#shixun_question_ul li:visible");//获取ul中所有的li元素
|
|
|
|
|
|
|
|
|
|
let resulttype=[]
|
|
|
|
|
for(var i = 1; i <= Uarry.length; i++){
|
|
|
|
|
|
|
|
|
|
var first = parseInt($("#minute"+i).val());
|
|
|
|
@ -136,42 +136,51 @@
|
|
|
|
|
if(first<0){
|
|
|
|
|
$("#scorezero"+i).show();
|
|
|
|
|
$("#minute"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
resulttype.push(false)
|
|
|
|
|
}else if(isNaN(first)){
|
|
|
|
|
$("#scorenull"+i).show();
|
|
|
|
|
$("#minute"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
resulttype.push(false)
|
|
|
|
|
}else if(first>100){
|
|
|
|
|
$("#scoreone"+i).show();
|
|
|
|
|
$("#minute"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
resulttype.push(false)
|
|
|
|
|
} else {
|
|
|
|
|
$("#scorezero"+i).hide();
|
|
|
|
|
$("#scorenull"+i).hide();
|
|
|
|
|
$("#scoreone"+i).hide();
|
|
|
|
|
$("#minute"+i).removeClass("borderFF8121");
|
|
|
|
|
resulttype.push(true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(last<0){
|
|
|
|
|
$("#topicnull"+i).show();
|
|
|
|
|
$("#topic"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
resulttype.push(false)
|
|
|
|
|
}else if(isNaN(last)){
|
|
|
|
|
$("#topicinteger"+i).show();
|
|
|
|
|
$("#topic"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
resulttype.push(false)
|
|
|
|
|
}else if(last>available){
|
|
|
|
|
$("#topicreater"+i).show();
|
|
|
|
|
$("#topic"+i).addClass("borderFF8121");
|
|
|
|
|
result = false;
|
|
|
|
|
resulttype.push(false)
|
|
|
|
|
} else {
|
|
|
|
|
$("#topicnull"+i).hide();
|
|
|
|
|
$("#topicinteger"+i).hide();
|
|
|
|
|
$("#topicreater"+i).hide();
|
|
|
|
|
$("#topic"+i).removeClass("borderFF8121");
|
|
|
|
|
resulttype.push(true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(var i=0; i<resulttype.length; i++){
|
|
|
|
|
if(resulttype[i]===false){
|
|
|
|
|
result=false
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(result);
|
|
|
|
|
|
|
|
|
|
if(result){
|
|
|
|
|
$("#new_shixun_question").submit();
|
|
|
|
|
} else{
|
|
|
|
|