diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/paper_view1.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/paper_view1.jsp index 2c0fad8..e5b9041 100644 --- a/WebRoot/WEB-INF/jsp/sunvote/teacher/paper_view1.jsp +++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/paper_view1.jsp @@ -143,7 +143,7 @@ - + diff --git a/WebRoot/static/js/paper_view.js b/WebRoot/static/js/paper_view.js index 2523849..a54a2c7 100644 --- a/WebRoot/static/js/paper_view.js +++ b/WebRoot/static/js/paper_view.js @@ -66,6 +66,11 @@ function getQueryString(name) { star(j,parseInt(data.data[j].DIFFICULTY)); } } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) @@ -157,6 +162,11 @@ function getQueryString(name) { success:function(data){ alert("上传成功"); window.history.go(-2); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) }) \ No newline at end of file diff --git a/WebRoot/static/js/paper_view1.js b/WebRoot/static/js/paper_view1.js index 0066ba1..8b361cf 100644 --- a/WebRoot/static/js/paper_view1.js +++ b/WebRoot/static/js/paper_view1.js @@ -119,6 +119,8 @@ function getQueryString(name) { } for(k=0;k抽'); } } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) }) @@ -166,9 +173,16 @@ function getQueryString(name) { success:function(data){ console.log(data); for(var i=0;i'+data.data[i].NAME+''+data.data[i].ANSWER+''+data.data[i].PRESS_TIME+'秒'; } $(".student_list").html(student_html); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }); $('#myModal').modal('show'); diff --git a/WebRoot/static/js/paper_view2.js b/WebRoot/static/js/paper_view2.js index 601f869..a057170 100644 --- a/WebRoot/static/js/paper_view2.js +++ b/WebRoot/static/js/paper_view2.js @@ -55,6 +55,11 @@ function getQueryString(name) { } } window.top.loading.remove(); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) }) diff --git a/WebRoot/static/js/set_question.js b/WebRoot/static/js/set_question.js index f2ac07f..06f2f69 100644 --- a/WebRoot/static/js/set_question.js +++ b/WebRoot/static/js/set_question.js @@ -42,6 +42,11 @@ var url=""; } $(".section").children("ul").html(point_html); getQuestion($(".section li").eq(0)); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) } @@ -63,6 +68,11 @@ var url=""; } } getQuestion($(".section li").eq(0)); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) } @@ -83,6 +93,11 @@ var url=""; _html +='
  • '+(i+1)+data.data[i].NAME+'
  • '; } obj.children('ul').html(_html); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) } @@ -153,7 +168,7 @@ var url=""; // 状态 console.log(XMLHttpRequest.readyState); // 错误信息 - console.log(textStatus); + alert(textStatus); flag=0; pageNum-=1; if(pageNum<1) @@ -203,7 +218,12 @@ var url=""; $("#book_name").text($(".name").eq(0).text()+"/"+$(".float_box").eq(0).find('li').eq(0).text()); } - } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); + } }) } @@ -220,6 +240,11 @@ var url=""; textBookName[i]={"name":data.data[i].NAME,"id":data.data[i].ID}; } } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) return textBookName; @@ -232,6 +257,11 @@ var url=""; data:{id:class_id}, success:function(data){ $(".classList li").html(data.data); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) } diff --git a/WebRoot/static/js/teach_paper.js b/WebRoot/static/js/teach_paper.js index 2c97a1c..ecef41f 100644 --- a/WebRoot/static/js/teach_paper.js +++ b/WebRoot/static/js/teach_paper.js @@ -26,6 +26,11 @@ $("#dealer_id_2").html(option_html); } getList(); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) @@ -60,7 +65,12 @@ } $("#tab_body").html(tab_html); window.top.loading.remove(); - } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); + } }); } $('#ids').on('click', function(){ @@ -106,7 +116,12 @@ data:{id:id}, success:function(data){ subjectName=data.data; - } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); + } }) return subjectName; } @@ -119,7 +134,12 @@ data:{id:id}, success:function(data){ className=data.data; - } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); + } }) return className; } diff --git a/WebRoot/static/js/test_list.js b/WebRoot/static/js/test_list.js index 6e70bd5..01c1f74 100644 --- a/WebRoot/static/js/test_list.js +++ b/WebRoot/static/js/test_list.js @@ -10,8 +10,7 @@ function getQueryString(name) { return null; } var class_id = getQueryString("classid"); -$(document) - .ready( +$(document).ready( function() { $.ajax({ @@ -32,6 +31,11 @@ $(document) $("#dealer_id_2").html(option_html); } getList(); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }) // 日期框 @@ -76,6 +80,11 @@ function getList(start_date, end_date, class_id) { // 获取测验列表 + '" >查看' } $("#tab_body").html(tab_html); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); } }); } @@ -109,7 +118,12 @@ function getClassName(id) { // 获取班级中文名 }, success : function(data) { className = data.data; - } + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + // 错误信息 + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); + window.top.loading.remove(); + } }) return className; } diff --git a/resources/mybatis1/api/V1Mapper.xml b/resources/mybatis1/api/V1Mapper.xml index 854c3a8..5cb2637 100644 --- a/resources/mybatis1/api/V1Mapper.xml +++ b/resources/mybatis1/api/V1Mapper.xml @@ -181,6 +181,44 @@ + diff --git a/src/com/fh/controller/api/V1.java b/src/com/fh/controller/api/V1.java index 7c1520c..74a351e 100644 --- a/src/com/fh/controller/api/V1.java +++ b/src/com/fh/controller/api/V1.java @@ -561,10 +561,10 @@ public class V1 extends BaseController { .getString("PROBLEM_TYPE_ID")); question.setRank(qpd.getString("RANK")); question.setNo_name(qpd.getString("NO_NAME")); + question.setQuestions(new ArrayList()); if ("-1".equals("" + qpd.getString("P_ID"))) { PageData pidPd = new PageData(); pidPd.put("PID", question.getQuestion_id()); - question.setQuestions(new ArrayList()); List qs = v1Service .getQuestionsByPID(pidPd); for (PageData q : qs) { @@ -1471,7 +1471,7 @@ public class V1 extends BaseController { testPaper.getCreateDate() == null ? Tools .date2Str(new Date()) : testPaper .getCreateDate()); - testPd.put("TEST_TYPE", testPaper.getTest_type() != null ? testPaper.getTest_type() :"101"); + testPd.put("TEST_TYPE", testPaper.getTest_type() != null ? testPaper.getTest_type() :"1"); List listData = testpaperService.listAll(testPd); if (!(listData != null && listData.size() > 0)) { testPd.put("START_DATE", testPaper.getStartDate()); @@ -1563,7 +1563,7 @@ public class V1 extends BaseController { return res.toJson(); - } + } /** * 上传测验成绩 @@ -1590,7 +1590,7 @@ public class V1 extends BaseController { testPaper.getCreateDate() == null ? Tools .date2Str(new Date()) : testPaper .getCreateDate()); - testPd.put("TEST_TYPE", testPaper.getTest_type() != null ? testPaper.getTest_type() :"101"); + testPd.put("TEST_TYPE", testPaper.getTest_type() != null ? testPaper.getTest_type() :"1"); List listData = testpaperService.listAll(testPd); if ((listData != null && listData.size() > 0)) { testPaperId = listData.get(0).getString("TESTPAPER_ID"); @@ -1794,7 +1794,7 @@ public class V1 extends BaseController { } else { res.setDataError(); } - logger.info("uploadupdatetestpaper cost time:" + logger.info("uploadupdateTestpaper2 cost time:" + (System.currentTimeMillis() - cur)); return res.toJson(); @@ -2788,6 +2788,23 @@ public class V1 extends BaseController { } + /** + * 根据ID班级名称 + * @param id + * @return + * @throws Exception + */ + @RequestMapping(value = "/wrongquestion", produces = "application/json;charset=UTF-8") + @ResponseBody + public String wrongquestion() throws Exception { + ResponseGson> res = new ResponseGson(); + PageData pageData = this.getPageData(); + List list = v1Service.getLastWrongQuestionInfo(pageData); + res.setData(list); + return res.toJson(); + + } + @RequestMapping(value = "/uploadfile", produces = "application/json;charset=UTF-8") @ResponseBody public String uploadFile(@RequestParam(value="file",required=false)MultipartFile file, HttpServletRequest request) throws Exception{ diff --git a/src/com/fh/controller/sunvote/teacher/TeacherController.java b/src/com/fh/controller/sunvote/teacher/TeacherController.java index 55afcd1..1c1691c 100644 --- a/src/com/fh/controller/sunvote/teacher/TeacherController.java +++ b/src/com/fh/controller/sunvote/teacher/TeacherController.java @@ -184,6 +184,7 @@ public class TeacherController extends BaseController { ModelAndView mv = this.getModelAndView(); PageData pd = new PageData(); pd = this.getPageData(); + pd.put("userId", userId); mv.setViewName("sunvote/teacher/test_list"); mv.addObject("pd", pd); return mv; @@ -202,6 +203,7 @@ public class TeacherController extends BaseController { ModelAndView mv = this.getModelAndView(); PageData pd = new PageData(); pd = this.getPageData(); + pd.put("userId", userId); mv.setViewName("sunvote/teacher/paper_view"); mv.addObject("pd", pd); return mv; @@ -220,6 +222,7 @@ public class TeacherController extends BaseController { ModelAndView mv = this.getModelAndView(); PageData pd = new PageData(); pd = this.getPageData(); + pd.put("userId", userId); mv.setViewName("sunvote/teacher/paper_view2"); mv.addObject("pd", pd); return mv; @@ -238,6 +241,7 @@ public class TeacherController extends BaseController { ModelAndView mv = this.getModelAndView(); PageData pd = new PageData(); pd = this.getPageData(); + pd.put("userId", userId); mv.setViewName("sunvote/teacher/paper_view1"); mv.addObject("pd", pd); return mv; @@ -253,8 +257,10 @@ public class TeacherController extends BaseController { public ModelAndView set_question(Page page) throws Exception { logBefore(logger, Jurisdiction.getUsername() + "列表Paper"); ModelAndView mv = this.getModelAndView(); + String userId = this.getUserID(); PageData pd = new PageData(); pd = this.getPageData(); + pd.put("userId", userId); mv.setViewName("sunvote/teacher/set_question"); mv.addObject("pd", pd); return mv; diff --git a/src/com/fh/service/api/V1Manager.java b/src/com/fh/service/api/V1Manager.java index 746b280..b802828 100644 --- a/src/com/fh/service/api/V1Manager.java +++ b/src/com/fh/service/api/V1Manager.java @@ -14,12 +14,11 @@ public interface V1Manager { public List getTestPaperInfo(PageData pd) throws Exception; - public List getQuestionsByPID(PageData pd) throws Exception; public List getTeacherInfo(PageData pd) throws Exception; public List getQuestionWrongInfo(PageData pd) throws Exception ; - + public List getLastWrongQuestionInfo(PageData pd) throws Exception; } diff --git a/src/com/fh/service/api/impl/V1Service.java b/src/com/fh/service/api/impl/V1Service.java index 39cf0b5..abd724a 100644 --- a/src/com/fh/service/api/impl/V1Service.java +++ b/src/com/fh/service/api/impl/V1Service.java @@ -50,5 +50,10 @@ public class V1Service implements V1Manager { public List getQuestionWrongInfo(PageData pd) throws Exception { return (List)dao.findForList("V1Mapper.getQuestionWrongInfo", pd); } + + @Override + public List getLastWrongQuestionInfo(PageData pd) throws Exception { + return (List)dao.findForList("V1Mapper.getLastWrongQuestionInfo", pd); + } }