Commit ee61a3f09d84cc38cb7dbc1de55930e92733e2ab

Authored by 孙向锦
1 parent 053a45fd

增强判断

WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp
... ... @@ -201,9 +201,11 @@
201 201 $("#time_submit").click(function(){
202 202 var name = $("#enter_title").val();
203 203 var time = $("#enter_time").val();
  204 + if(name != null&& name != '' && time != null && time != ''){
  205 + self.location.href = "<%=basePath%>" + "paper/npaper.do?" + "name=" + name + "&time=" + time ;
  206 + $(".title_time").modal("hide");
  207 + }
204 208 //window.open("<%=basePath%>" + "paper/npaper.do?" + "name=" + name + "&time=" + time);
205   - self.location.href = "<%=basePath%>" + "paper/npaper.do?" + "name=" + name + "&time=" + time ;
206   - $(".title_time").modal("hide");
207 209 });
208 210 $("#test").click(function(){
209 211 $(".content_r").html('<iframe name="mainFrame" id="mainFrame" frameborder="0" src="paper/list2.do?" style="width:100%;height:'+$(".content_l").height()+'px;"></iframe>');
... ...
WebRoot/static/js/control-604.js
... ... @@ -118,7 +118,7 @@
118 118 var num_ans=$("#num_ans").val();
119 119 var fraction=$("#fraction").val();
120 120 if(answer==''){
121   - alert("请输入题目答案,以分号隔开");
  121 + alert("请输入题目答案");
122 122 return;
123 123 }else if(fraction==''){
124 124 alert("请输入题目分数");
... ... @@ -138,12 +138,15 @@
138 138 //var answer_2=$("#answer_2").val();
139 139 var num_ans_2=$("#num_ans_2").val();
140 140 var fraction2=parseInt($("#fraction2").val());
141   - if(index_s_2==''){
  141 + if(isNaN(index_s_2)){
142 142 alert("请输入题目开始序号");
143 143 return;
144   - }else if(index_e_2==''){
  144 + }else if(isNaN(index_e_2)){
145 145 alert("请输入题目结束序号");
146 146 return;
  147 + }else if(isNaN(fraction2)){
  148 + alert("请输入题目分数");
  149 + return;
147 150 }
148 151 //console.log(typeof(type_2));
149 152 addQuestion(type_2,num_ans_2,index_s_2,index_e_2,fraction2);
... ...