日期:2014-05-17 浏览次数:20819 次
$.ajax({
url: getRootPath()+"/subjectidIsPaper.action",
data:{
subjectid:subjectid
},
dataType : 'json',
type: "POST",
success: function(data){
var arr=data.data;
var questioncount = arr[0].num;
var totalmark = arr[0].score;
var duration = arr[0].duration;
if (questioncount==0
------解决方案--------------------
totalmark==0
------解决方案--------------------
duration==0) {
alert("该科目没有试卷规则!请重新选择!");
return false;
} else {
examIsOk(subjectid,subjectname);
}
}
});
public String subjectidIsPaper(){
HttpServletRequest request = ServletActionContext.getRequest();
String subjectid = request.getParameter("subjectid").toString();
String jsonStr=paperMService.subjectidIsPaper(subjectid);
ServletActionContext.getResponse().setContentType("text/html");
ServletActionContext.getResponse().setCharacterEncoding("utf-8");
PrintWriter out = null;
try {
out = ServletActionContext.getResponse().getWriter();
} catch (IOException e) {
e.printStackTrace();
}
if(jsonStr == "{data:]}"
------解决方案--------------------
jsonStr.equals("{data:]}")){
jsonStr = "{data:[{num:\"0\",scor