diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp index 7aea2a2..d58d8c0 100644 --- a/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp +++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp @@ -201,9 +201,11 @@ $("#time_submit").click(function(){ var name = $("#enter_title").val(); var time = $("#enter_time").val(); + if(name != null&& name != '' && time != null && time != ''){ + self.location.href = "<%=basePath%>" + "paper/npaper.do?" + "name=" + name + "&time=" + time ; + $(".title_time").modal("hide"); + } //window.open("<%=basePath%>" + "paper/npaper.do?" + "name=" + name + "&time=" + time); - self.location.href = "<%=basePath%>" + "paper/npaper.do?" + "name=" + name + "&time=" + time ; - $(".title_time").modal("hide"); }); $("#test").click(function(){ $(".content_r").html(''); diff --git a/WebRoot/static/js/control-604.js b/WebRoot/static/js/control-604.js index de33f70..c87b242 100644 --- a/WebRoot/static/js/control-604.js +++ b/WebRoot/static/js/control-604.js @@ -118,7 +118,7 @@ var num_ans=$("#num_ans").val(); var fraction=$("#fraction").val(); if(answer==''){ - alert("请输入题目答案,以分号隔开"); + alert("请输入题目答案"); return; }else if(fraction==''){ alert("请输入题目分数"); @@ -138,12 +138,15 @@ //var answer_2=$("#answer_2").val(); var num_ans_2=$("#num_ans_2").val(); var fraction2=parseInt($("#fraction2").val()); - if(index_s_2==''){ + if(isNaN(index_s_2)){ alert("请输入题目开始序号"); return; - }else if(index_e_2==''){ + }else if(isNaN(index_e_2)){ alert("请输入题目结束序号"); return; + }else if(isNaN(fraction2)){ + alert("请输入题目分数"); + return; } //console.log(typeof(type_2)); addQuestion(type_2,num_ans_2,index_s_2,index_e_2,fraction2);