Commit 4b6a5239ca0932b92e96c558798f6fb2d7c8e840
1 parent
107fa3a0
管理员界面
Showing
13 changed files
with
1043 additions
and
17 deletions
WebRoot/WEB-INF/jsp/sunvote/admin/admin_main.jsp
| ... | ... | @@ -92,7 +92,12 @@ |
| 92 | 92 | <p>试卷管理<span class="right jiao"></span></p> |
| 93 | 93 | <ul class="menu_1"> |
| 94 | 94 | <li > |
| 95 | - <p id="qingsongkao_paper">轻松考试卷管理</p> | |
| 95 | + <p >轻松考试卷管理</p> | |
| 96 | + <ul class="menu_2"> | |
| 97 | + <li ><p id="new_paper">出卷</p></li> | |
| 98 | + <li ><p id="qingsongkao_paper">查看所有试卷</p></li> | |
| 99 | + | |
| 100 | + </ul> | |
| 96 | 101 | </li> |
| 97 | 102 | <li> |
| 98 | 103 | <p id="jishice_paper">即时测试卷管理</p> |
| ... | ... | @@ -107,18 +112,29 @@ |
| 107 | 112 | |
| 108 | 113 | <ul class="menu_1"> |
| 109 | 114 | <li > |
| 110 | - <p>轻松考测验分析</p> | |
| 115 | + <p>轻松考统考</p> | |
| 116 | + </li> | |
| 117 | + <li > | |
| 118 | + <p>轻松考班级情况</p> | |
| 111 | 119 | <ul class="menu_2"> |
| 112 | - <c:forEach items="${pd.TEACHER}" var="var" varStatus="vs"> | |
| 113 | - <li onclick="event.stopPropagation();report('${var.CLASS_ID}')"><p>${var.CLASS_NAME} 成绩</p></li> | |
| 120 | + <c:forEach items="${gradeInfos}" var="var" varStatus="vs"> | |
| 121 | + <c:forEach items="${var.classInfos}" var="var1" varStatus="vs1"> | |
| 122 | + <li onclick="event.stopPropagation();report('${var1.ID}')"> | |
| 123 | + <p>${ var1.CLASS_NAME }</p> | |
| 124 | + </li> | |
| 125 | + </c:forEach> | |
| 114 | 126 | </c:forEach> |
| 115 | 127 | </ul> |
| 116 | 128 | </li> |
| 117 | 129 | <li> |
| 118 | 130 | <p>即时测测验分析</p> |
| 119 | 131 | <ul class="menu_2"> |
| 120 | - <c:forEach items="${pd.TEACHER}" var="var" varStatus="vs"> | |
| 121 | - <li onclick="event.stopPropagation();report2('${var.CLASS_ID}')"><p>${var.CLASS_NAME} 成绩</p></li> | |
| 132 | + <c:forEach items="${gradeInfos}" var="var" varStatus="vs"> | |
| 133 | + <c:forEach items="${var.classInfos}" var="var1" varStatus="vs1"> | |
| 134 | + <li onclick="event.stopPropagation();report2('${var1.ID}')"> | |
| 135 | + <p>${ var1.CLASS_NAME }</p> | |
| 136 | + </li> | |
| 137 | + </c:forEach> | |
| 122 | 138 | </c:forEach> |
| 123 | 139 | </ul> |
| 124 | 140 | </li> |
| ... | ... | @@ -166,6 +182,7 @@ |
| 166 | 182 | </div> |
| 167 | 183 | <div class="clearfix"></div> |
| 168 | 184 | </div> |
| 185 | + | |
| 169 | 186 | <div class="form-group"> |
| 170 | 187 | <label for="enter_time" class="col-sm-4 control-label">测验时长(分钟)</label> |
| 171 | 188 | <div class="col-sm-6"> |
| ... | ... | @@ -173,7 +190,28 @@ |
| 173 | 190 | </div> |
| 174 | 191 | <div class="clearfix"></div> |
| 175 | 192 | </div> |
| 176 | - | |
| 193 | + <div class="form-group"> | |
| 194 | + <label for="enter_time" class="col-sm-4 control-label">年级</label> | |
| 195 | + <div class="col-sm-6"> | |
| 196 | + <select class="chosen-select form-control" name="grade_id" id="grade_id" data-placeholder="这里输入所属学校"> | |
| 197 | + <c:forEach items="${gradeInfos}" var="var" varStatus="vs"> | |
| 198 | + <option value="${var.GRADE_ID}">${var.GNAME}</option> | |
| 199 | + </c:forEach> | |
| 200 | + </select> | |
| 201 | + </div> | |
| 202 | + <div class="clearfix"></div> | |
| 203 | + </div> | |
| 204 | + <div class="form-group"> | |
| 205 | + <label for="enter_time" class="col-sm-4 control-label">科目</label> | |
| 206 | + <div class="col-sm-6"> | |
| 207 | + <select class="chosen-select form-control" name="subject_id" id="subject_id" data-placeholder="这里输入所属学校"> | |
| 208 | + <c:forEach items="${subjectInfos}" var="var" varStatus="vs"> | |
| 209 | + <option value="${var.SUBJECT_ID}">${var.SCNAME}</option> | |
| 210 | + </c:forEach> | |
| 211 | + </select> | |
| 212 | + </div> | |
| 213 | + <div class="clearfix"></div> | |
| 214 | + </div> | |
| 177 | 215 | </div> |
| 178 | 216 | <div class="modal-footer"> |
| 179 | 217 | <button type="button" class="btn btn-primary" id="time_submit">确定</button> |
| ... | ... | @@ -191,6 +229,7 @@ |
| 191 | 229 | <script src="../static/js/dailog.js"></script> |
| 192 | 230 | <script type="text/javascript"> |
| 193 | 231 | |
| 232 | + var schoolId = '${SCHOOL_ID}'; | |
| 194 | 233 | function subject(school_id){ |
| 195 | 234 | var path = "../subject/listcs.do?school_id=" + school_id ; |
| 196 | 235 | //if($("#mainFrame").attr('src') != (path)){ |
| ... | ... | @@ -240,10 +279,12 @@ |
| 240 | 279 | $("#time_submit").click(function(){ |
| 241 | 280 | var name = $("#enter_title").val(); |
| 242 | 281 | var time = $("#enter_time").val(); |
| 282 | + var grade_id = $("#grade_id").val(); | |
| 283 | + var subject_id = $("#subject_id").val(); | |
| 243 | 284 | if(name != null&& name != '' && time != null && time != ''){ |
| 244 | 285 | var itime = parseInt(time); |
| 245 | 286 | if(itime > 0 && itime <= 300){ |
| 246 | - self.location.href = "<%=basePath%>" + "paper/npaper.do?" + "name=" + name + "&time=" + time ; | |
| 287 | + self.location.href = "<%=basePath%>" + "paper/npaper.do?paper_type=2&" + "name=" + name + "&grade_id=" + grade_id +"&subject_id=" + subject_id + "&school_id=" + schoolId + "&time=" + time ; | |
| 247 | 288 | $(".title_time").modal("hide"); |
| 248 | 289 | }else{ |
| 249 | 290 | alert("请输入正确的时间,时间不能超过300分钟"); |
| ... | ... | @@ -252,7 +293,16 @@ |
| 252 | 293 | }); |
| 253 | 294 | |
| 254 | 295 | $("#qingsongkao_paper").click(function (){ |
| 255 | - var path = "../paper/list2.do?" ; | |
| 296 | + var path = "../paper/list4.do?school_id=" + schoolId ; | |
| 297 | + //$(".content_r").html('<iframe name="mainFrame" id="mainFrame" frameborder="0" style="width:100%;height:'+$(".content_l").height()+'px;" src=' + path + '></iframe>'); | |
| 298 | + if($("#mainFrame").attr('src') != (path)){ | |
| 299 | + $("#mainFrame").attr('src',path); | |
| 300 | + window.top.loading.show(); | |
| 301 | + } | |
| 302 | + }); | |
| 303 | + | |
| 304 | + $("#new_paper").click(function (){ | |
| 305 | + var path = "../paper/list5.do?school_id=" + schoolId ; | |
| 256 | 306 | //$(".content_r").html('<iframe name="mainFrame" id="mainFrame" frameborder="0" style="width:100%;height:'+$(".content_l").height()+'px;" src=' + path + '></iframe>'); |
| 257 | 307 | if($("#mainFrame").attr('src') != (path)){ |
| 258 | 308 | $("#mainFrame").attr('src',path); |
| ... | ... | @@ -261,7 +311,7 @@ |
| 261 | 311 | }); |
| 262 | 312 | |
| 263 | 313 | $("#jishice_paper").click(function (){ |
| 264 | - var path = "../teacher/teach_paper.do?" ; | |
| 314 | + var path = "../teacher/teach_paper.do?school_id=" + schoolId; | |
| 265 | 315 | //if($("#mainFrame").attr('src') != (path)){ |
| 266 | 316 | $("#mainFrame").attr('src',path); |
| 267 | 317 | window.top.loading.show(); | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list4.jsp
0 → 100644
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" | |
| 2 | + pageEncoding="UTF-8"%> | |
| 3 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
| 4 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | |
| 5 | +<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%> | |
| 6 | +<% | |
| 7 | + String path = request.getContextPath(); | |
| 8 | + String basePath = request.getScheme() + "://" | |
| 9 | + + request.getServerName() + ":" + request.getServerPort() + path + "/"; | |
| 10 | +%> | |
| 11 | +<html lang="zh-CN"> | |
| 12 | +<head> | |
| 13 | +<meta charset="utf-8"> | |
| 14 | +<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| 15 | +<meta name="viewport" content="width=device-width, initial-scale=1"> | |
| 16 | +<title>中天电子-教育管理系统</title> | |
| 17 | + | |
| 18 | +<!-- Bootstrap --> | |
| 19 | +<link | |
| 20 | + href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" | |
| 21 | + rel="stylesheet"> | |
| 22 | +<link href="../static/css/teach.css" rel="stylesheet"> | |
| 23 | +<link rel="stylesheet" href="../static/ace/css/datepicker.css" /> | |
| 24 | +<script src="../static/js/loading.js"></script> | |
| 25 | +<script src="../static/js/remove.js?a=1"></script> | |
| 26 | +<script src="../static/js/dailog.js"></script> | |
| 27 | + | |
| 28 | +<!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> | |
| 29 | +<!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> | |
| 30 | +<!--[if lt IE 9]> | |
| 31 | + <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> | |
| 32 | + <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> | |
| 33 | + <![endif]--> | |
| 34 | +</head> | |
| 35 | +<body> | |
| 36 | + | |
| 37 | + <form action="../paper/list4.do" method="post" name="Form" id="Form"> | |
| 38 | + <div class="head_box"> | |
| 39 | + <div class="box_header"> | |
| 40 | + <div class="head_box_l"> | |
| 41 | + <p> | |
| 42 | + <span class="right_b"></span>试卷管理 | |
| 43 | + </p> | |
| 44 | + </div> | |
| 45 | + <div class="head_box_r"> | |
| 46 | + <input type="hidden" name="SCHOOL_ID" id="PAPER_ID" value="${pd.SCHOOL_ID}"/> | |
| 47 | + <input class="date-picker" type="text" placeholder="开始日期" name="lastStart" id="lastStart" data-date-format="yyyy-mm-dd" readonly="readonly" value="${pd.LASTSTART }"/> | |
| 48 | + <input type="text" class="date-picker" placeholder="结束日期" name="lastEnd" name="lastEnd" data-date-format="yyyy-mm-dd" readonly="readonly" value="${pd.LASTEND}"/> | |
| 49 | + <a href="#" onclick="tosearch();"><img | |
| 50 | + src="../static/images/search.png" /></a> | |
| 51 | + </div> | |
| 52 | + <div class="clear"></div> | |
| 53 | + </div> | |
| 54 | + <div style="padding:0 5%;background:#fff;"> | |
| 55 | + <table class="table table-striped"> | |
| 56 | + <col style="width: 10%" /> | |
| 57 | + <col style="width: 10%" /> | |
| 58 | + <col style="width: 10%" /> | |
| 59 | + <col style="width: 10%" /> | |
| 60 | + <col style="width: 10%" /> | |
| 61 | + <col style="width: 10%" /> | |
| 62 | + <col style="width: 10%" /> | |
| 63 | + <col style="width: 10%" /> | |
| 64 | + <col style="width: 10%" /> | |
| 65 | + <thead> | |
| 66 | + <tr> | |
| 67 | + <th><input type="checkbox" name='ids' id="ids" />序号</th> | |
| 68 | + <th>测验标题</th> | |
| 69 | + <th>年级</th> | |
| 70 | + <th>班级</th> | |
| 71 | + <th>出卷老师</th> | |
| 72 | + <th>创建时间</th> | |
| 73 | + <th>建议考试时长</th> | |
| 74 | + <th>总分</th> | |
| 75 | + <th>操作</th> | |
| 76 | + </tr> | |
| 77 | + </thead> | |
| 78 | + </table> | |
| 79 | + </div> | |
| 80 | + </div> | |
| 81 | + <div class="table_box"> | |
| 82 | + <table class="table table-striped"> | |
| 83 | + <col style="width: 10%" /> | |
| 84 | + <col style="width: 10%" /> | |
| 85 | + <col style="width: 10%" /> | |
| 86 | + <col style="width: 10%" /> | |
| 87 | + <col style="width: 10%" /> | |
| 88 | + <col style="width: 10%" /> | |
| 89 | + <col style="width: 10%" /> | |
| 90 | + <col style="width: 10%" /> | |
| 91 | + <col style="width: 10%" /> | |
| 92 | + <tbody> | |
| 93 | + <c:choose> | |
| 94 | + <c:when test="${not empty varList}"> | |
| 95 | + <c:forEach items="${varList}" var="var" varStatus="vs"> | |
| 96 | + <tr> | |
| 97 | + <td><input type="checkbox" name='ids' id="ids" value="${var.PAPER_ID}"/>${vs.index+1}</td> | |
| 98 | + <td ><a target="_blank" href="<%=basePath%>paper/iteminfo.do?paper_id=${var.PAPER_ID}">${var.TITLE}</a></td> | |
| 99 | + <td >${myelfun:findGradeName(var.GRADE_ID)}</td> | |
| 100 | + <td >${myelfun:findSubjectCName(var.SUBJECT_ID)}</td> | |
| 101 | + <td >${myelfun:findTeacherName(var.USER_ID)}</td> | |
| 102 | + <td >${var.CREATE_DATE}</td> | |
| 103 | + <td >${var.EXAM_TIME}</td> | |
| 104 | + <td >${var.SCORE}</td> | |
| 105 | + <td> | |
| 106 | + <a href="#" onclick="del('${var.PAPER_ID}');"><img src="../static/images/remove.png" /></a> | |
| 107 | + </td> | |
| 108 | + </tr> | |
| 109 | + | |
| 110 | + </c:forEach> | |
| 111 | + </c:when> | |
| 112 | + <c:otherwise> | |
| 113 | + <tr class="main_info"> | |
| 114 | + <td colspan="100" class="center" >没有相关数据</td> | |
| 115 | + </tr> | |
| 116 | + </c:otherwise> | |
| 117 | + </c:choose> | |
| 118 | + </tbody> | |
| 119 | + </table> | |
| 120 | + <div class="footer"> | |
| 121 | + <!-- <div class="creat"> | |
| 122 | + <input type="button" onclick="parent.$('.title_time').modal('show');" value="新建试卷" /> | |
| 123 | + </div> | |
| 124 | + <div class="removeAll"> | |
| 125 | + <input type="button" onclick="deleteAll()" value="批量删除" /> | |
| 126 | + </div> --> | |
| 127 | + <div class="page_box"> | |
| 128 | + | |
| 129 | + <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div> | |
| 130 | + </div> | |
| 131 | + </div> | |
| 132 | + </div> | |
| 133 | + </form> | |
| 134 | +</body> | |
| 135 | + | |
| 136 | +<%@ include file="../../system/index/foot2.jsp"%> | |
| 137 | +<script src="../static/ace/js/date-time/bootstrap-datepicker.js"></script> | |
| 138 | +<script type="text/javascript"> | |
| 139 | + | |
| 140 | + $(document).ready(function(){ | |
| 141 | + window.top.loading.remove(); | |
| 142 | + }); | |
| 143 | + | |
| 144 | + function tosearch(){ | |
| 145 | + window.top.loading.remove(); | |
| 146 | + $("#Form").submit(); | |
| 147 | + } | |
| 148 | + | |
| 149 | + $('#ids').on('click', function(){ | |
| 150 | + var th_checked = $("#ids").prop('checked');//checkbox inside "TH" table header | |
| 151 | + | |
| 152 | + $(".table_box .table").find('tbody > tr').each(function(){ | |
| 153 | + var row = this; | |
| 154 | + if(th_checked) $(row).find('input[type=checkbox]').eq(0).prop('checked', true); | |
| 155 | + else $(row).find('input[type=checkbox]').eq(0).prop('checked', false); | |
| 156 | + }); | |
| 157 | + }); | |
| 158 | + | |
| 159 | + function del(Id){ | |
| 160 | + //var remove = new remove(); | |
| 161 | + window.top.remove.init({"title":"删除","func":function(success){ | |
| 162 | + if(success){ | |
| 163 | + var url = "<%=basePath%>paper/delete.do?PAPER_ID="+Id+"&qingsongkao=true&tm="+new Date().getTime(); | |
| 164 | + window.top.loading.show(); | |
| 165 | + $.get(url,function(data){ | |
| 166 | + tosearch(); | |
| 167 | + }); | |
| 168 | + } | |
| 169 | + else{ | |
| 170 | + console.log("false"); | |
| 171 | + } | |
| 172 | + }}); | |
| 173 | + remove.show(); | |
| 174 | + } | |
| 175 | + | |
| 176 | + $(function() { | |
| 177 | + | |
| 178 | + //日期框 | |
| 179 | + $('.date-picker').datepicker({ | |
| 180 | + autoclose: true, | |
| 181 | + todayHighlight: true | |
| 182 | + }); | |
| 183 | + | |
| 184 | + }); | |
| 185 | + | |
| 186 | + function deleteAll(){ | |
| 187 | + window.top.remove.init({"title":"删除","func":function(success){ | |
| 188 | + if(success){ | |
| 189 | + var str = ''; | |
| 190 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | |
| 191 | + if(document.getElementsByName('ids')[i].checked){ | |
| 192 | + if(str=='') str += document.getElementsByName('ids')[i].value; | |
| 193 | + else str += ',' + document.getElementsByName('ids')[i].value; | |
| 194 | + } | |
| 195 | + } | |
| 196 | + if(str==''){ | |
| 197 | + | |
| 198 | + }else{ | |
| 199 | + $.ajax({ | |
| 200 | + type: "POST", | |
| 201 | + url: '<%=basePath%>paper/deleteAll.do?tm='+new Date().getTime(), | |
| 202 | + data: {DATA_IDS:str}, | |
| 203 | + dataType:'json', | |
| 204 | + //beforeSend: validateData, | |
| 205 | + cache: false, | |
| 206 | + success: function(data){ | |
| 207 | + $.each(data.list, function(i, list){ | |
| 208 | + tosearch(); | |
| 209 | + }); | |
| 210 | + } | |
| 211 | + }); | |
| 212 | + } | |
| 213 | + } | |
| 214 | + else{ | |
| 215 | + console.log("false"); | |
| 216 | + } | |
| 217 | + }}); | |
| 218 | + window.top.remove.show(); | |
| 219 | + } | |
| 220 | + | |
| 221 | + | |
| 222 | +</script> | |
| 223 | +</html> | |
| 0 | 224 | \ No newline at end of file | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list5.jsp
0 → 100644
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" | |
| 2 | + pageEncoding="UTF-8"%> | |
| 3 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
| 4 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | |
| 5 | +<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%> | |
| 6 | +<% | |
| 7 | + String path = request.getContextPath(); | |
| 8 | + String basePath = request.getScheme() + "://" | |
| 9 | + + request.getServerName() + ":" + request.getServerPort() + path + "/"; | |
| 10 | +%> | |
| 11 | +<html lang="zh-CN"> | |
| 12 | +<head> | |
| 13 | +<meta charset="utf-8"> | |
| 14 | +<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| 15 | +<meta name="viewport" content="width=device-width, initial-scale=1"> | |
| 16 | +<title>中天电子-教育管理系统</title> | |
| 17 | + | |
| 18 | +<!-- Bootstrap --> | |
| 19 | +<link | |
| 20 | + href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" | |
| 21 | + rel="stylesheet"> | |
| 22 | +<link href="../static/css/teach.css" rel="stylesheet"> | |
| 23 | +<link rel="stylesheet" href="../static/ace/css/datepicker.css" /> | |
| 24 | +<script src="../static/js/loading.js"></script> | |
| 25 | +<script src="../static/js/remove.js?a=1"></script> | |
| 26 | +<script src="../static/js/dailog.js"></script> | |
| 27 | + | |
| 28 | +<!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> | |
| 29 | +<!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> | |
| 30 | +<!--[if lt IE 9]> | |
| 31 | + <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> | |
| 32 | + <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> | |
| 33 | + <![endif]--> | |
| 34 | +</head> | |
| 35 | +<body> | |
| 36 | + | |
| 37 | + <form action="../paper/list5.do" method="post" name="Form" id="Form"> | |
| 38 | + <div class="head_box"> | |
| 39 | + <div class="box_header"> | |
| 40 | + <div class="head_box_l"> | |
| 41 | + <p> | |
| 42 | + <span class="right_b"></span>试卷管理 | |
| 43 | + </p> | |
| 44 | + </div> | |
| 45 | + <div class="head_box_r"> | |
| 46 | + <input class="date-picker" type="text" placeholder="开始日期" name="lastStart" id="lastStart" data-date-format="yyyy-mm-dd" readonly="readonly" value="${pd.LASTSTART }"/> | |
| 47 | + <input type="text" class="date-picker" placeholder="结束日期" name="lastEnd" name="lastEnd" data-date-format="yyyy-mm-dd" readonly="readonly" value="${pd.LASTEND}"/> | |
| 48 | + <a href="#" onclick="tosearch();"><img | |
| 49 | + src="../static/images/search.png" /></a> | |
| 50 | + </div> | |
| 51 | + <div class="clear"></div> | |
| 52 | + </div> | |
| 53 | + <div style="padding:0 5%;background:#fff;"> | |
| 54 | + <table class="table table-striped"> | |
| 55 | + <col style="width: 5%" /> | |
| 56 | + <col style="width: 15%" /> | |
| 57 | + <col style="width: 15%" /> | |
| 58 | + <col style="width: 15%" /> | |
| 59 | + <col style="width: 15%" /> | |
| 60 | + <col style="width: 15%" /> | |
| 61 | + <col style="width: 15%" /> | |
| 62 | + <col style="width: 5%" /> | |
| 63 | + <thead> | |
| 64 | + <tr> | |
| 65 | + <th><input type="checkbox" name='ids' id="ids" />序号</th> | |
| 66 | + <th>测验标题</th> | |
| 67 | + <th>创建时间</th> | |
| 68 | + <th>年级</th> | |
| 69 | + <th>科目</th> | |
| 70 | + <th>建议考试时长</th> | |
| 71 | + <th>总分</th> | |
| 72 | + <th>操作</th> | |
| 73 | + </tr> | |
| 74 | + </thead> | |
| 75 | + </table> | |
| 76 | + </div> | |
| 77 | + </div> | |
| 78 | + <div class="table_box"> | |
| 79 | + <table class="table table-striped"> | |
| 80 | + <col style="width: 5%" /> | |
| 81 | + <col style="width: 15%" /> | |
| 82 | + <col style="width: 15%" /> | |
| 83 | + <col style="width: 15%" /> | |
| 84 | + <col style="width: 15%" /> | |
| 85 | + <col style="width: 15%" /> | |
| 86 | + <col style="width: 15%" /> | |
| 87 | + <col style="width: 5%" /> | |
| 88 | + <tbody> | |
| 89 | + <c:choose> | |
| 90 | + <c:when test="${not empty varList}"> | |
| 91 | + <c:forEach items="${varList}" var="var" varStatus="vs"> | |
| 92 | + <tr> | |
| 93 | + <td><input type="checkbox" name='ids' id="ids" value="${var.PAPER_ID}"/>${vs.index+1}</td> | |
| 94 | + <td ><a target="_blank" href="<%=basePath%>paper/iteminfo.do?paper_id=${var.PAPER_ID}">${var.TITLE}</a></td> | |
| 95 | + <td >${var.CREATE_DATE}</td> | |
| 96 | + <td >${myelfun:findGradeName(var.GRADE_ID)}</td> | |
| 97 | + <td >${myelfun:findSubjectCName(var.SUBJECT_ID)}</td> | |
| 98 | + <td >${var.EXAM_TIME}</td> | |
| 99 | + <td >${var.SCORE}</td> | |
| 100 | + <td> | |
| 101 | + <a href="#" onclick="del('${var.PAPER_ID}');"><img src="../static/images/remove.png" /></a> | |
| 102 | + </td> | |
| 103 | + </tr> | |
| 104 | + | |
| 105 | + </c:forEach> | |
| 106 | + </c:when> | |
| 107 | + <c:otherwise> | |
| 108 | + <tr class="main_info"> | |
| 109 | + <td colspan="100" class="center" >没有相关数据</td> | |
| 110 | + </tr> | |
| 111 | + </c:otherwise> | |
| 112 | + </c:choose> | |
| 113 | + </tbody> | |
| 114 | + </table> | |
| 115 | + <div class="footer"> | |
| 116 | + <div class="creat"> | |
| 117 | + <input type="button" onclick="parent.$('.title_time').modal('show');" value="新建试卷" /> | |
| 118 | + </div> | |
| 119 | + <div class="removeAll"> | |
| 120 | + <input type="button" onclick="deleteAll()" value="批量删除" /> | |
| 121 | + </div> | |
| 122 | + <div class="page_box"> | |
| 123 | + | |
| 124 | + <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div> | |
| 125 | + </div> | |
| 126 | + </div> | |
| 127 | + </div> | |
| 128 | + </form> | |
| 129 | +</body> | |
| 130 | + | |
| 131 | +<%@ include file="../../system/index/foot2.jsp"%> | |
| 132 | +<script src="../static/ace/js/date-time/bootstrap-datepicker.js"></script> | |
| 133 | +<script type="text/javascript"> | |
| 134 | + | |
| 135 | + $(document).ready(function(){ | |
| 136 | + window.top.loading.remove(); | |
| 137 | + }); | |
| 138 | + | |
| 139 | + function tosearch(){ | |
| 140 | + window.top.loading.remove(); | |
| 141 | + $("#Form").submit(); | |
| 142 | + } | |
| 143 | + | |
| 144 | + $('#ids').on('click', function(){ | |
| 145 | + var th_checked = $("#ids").prop('checked');//checkbox inside "TH" table header | |
| 146 | + | |
| 147 | + $(".table_box .table").find('tbody > tr').each(function(){ | |
| 148 | + var row = this; | |
| 149 | + if(th_checked) $(row).find('input[type=checkbox]').eq(0).prop('checked', true); | |
| 150 | + else $(row).find('input[type=checkbox]').eq(0).prop('checked', false); | |
| 151 | + }); | |
| 152 | + }); | |
| 153 | + | |
| 154 | + function del(Id){ | |
| 155 | + //var remove = new remove(); | |
| 156 | + window.top.remove.init({"title":"删除","func":function(success){ | |
| 157 | + if(success){ | |
| 158 | + var url = "<%=basePath%>paper/delete.do?PAPER_ID="+Id+"&qingsongkao=true&tm="+new Date().getTime(); | |
| 159 | + window.top.loading.show(); | |
| 160 | + $.get(url,function(data){ | |
| 161 | + tosearch(); | |
| 162 | + }); | |
| 163 | + } | |
| 164 | + else{ | |
| 165 | + console.log("false"); | |
| 166 | + } | |
| 167 | + }}); | |
| 168 | + remove.show(); | |
| 169 | + } | |
| 170 | + | |
| 171 | + $(function() { | |
| 172 | + | |
| 173 | + //日期框 | |
| 174 | + $('.date-picker').datepicker({ | |
| 175 | + autoclose: true, | |
| 176 | + todayHighlight: true | |
| 177 | + }); | |
| 178 | + | |
| 179 | + }); | |
| 180 | + | |
| 181 | + function deleteAll(){ | |
| 182 | + window.top.remove.init({"title":"删除","func":function(success){ | |
| 183 | + if(success){ | |
| 184 | + var str = ''; | |
| 185 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | |
| 186 | + if(document.getElementsByName('ids')[i].checked){ | |
| 187 | + if(str=='') str += document.getElementsByName('ids')[i].value; | |
| 188 | + else str += ',' + document.getElementsByName('ids')[i].value; | |
| 189 | + } | |
| 190 | + } | |
| 191 | + if(str==''){ | |
| 192 | + | |
| 193 | + }else{ | |
| 194 | + $.ajax({ | |
| 195 | + type: "POST", | |
| 196 | + url: '<%=basePath%>paper/deleteAll.do?tm='+new Date().getTime(), | |
| 197 | + data: {DATA_IDS:str}, | |
| 198 | + dataType:'json', | |
| 199 | + //beforeSend: validateData, | |
| 200 | + cache: false, | |
| 201 | + success: function(data){ | |
| 202 | + $.each(data.list, function(i, list){ | |
| 203 | + tosearch(); | |
| 204 | + }); | |
| 205 | + } | |
| 206 | + }); | |
| 207 | + } | |
| 208 | + } | |
| 209 | + else{ | |
| 210 | + console.log("false"); | |
| 211 | + } | |
| 212 | + }}); | |
| 213 | + window.top.remove.show(); | |
| 214 | + } | |
| 215 | + | |
| 216 | + | |
| 217 | +</script> | |
| 218 | +</html> | |
| 0 | 219 | \ No newline at end of file | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/teacher/creat_question.jsp
| ... | ... | @@ -191,7 +191,7 @@ |
| 191 | 191 | <script> |
| 192 | 192 | var testData = ${pd.JSON}; |
| 193 | 193 | var URL = "<%=basePath%>api/v1/uploadpaper"; |
| 194 | - var JUMP_URL = "<%=basePath%>/main/teacher"; | |
| 194 | + var JUMP_URL = "<%=basePath%>/${JUMP_URL}"; | |
| 195 | 195 | if(testData.questions.length>0){ |
| 196 | 196 | var title = testData.title; |
| 197 | 197 | if(title == null || title == ''){ | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/teacher/teach_paper1.jsp
0 → 100644
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | |
| 2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
| 3 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | |
| 4 | +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> | |
| 5 | +<% | |
| 6 | + String path = request.getContextPath(); | |
| 7 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | |
| 8 | +%> | |
| 9 | +<!DOCTYPE html> | |
| 10 | +<html lang="zh-CN"> | |
| 11 | + <head> | |
| 12 | + <meta charset="utf-8"> | |
| 13 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| 14 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| 15 | + <title>即时测</title> | |
| 16 | + | |
| 17 | + <!-- Bootstrap --> | |
| 18 | + <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | |
| 19 | + | |
| 20 | + <link rel="stylesheet" href="../static/ace/css/datepicker.css" /> | |
| 21 | + <link href="../static/css/teach.css" rel="stylesheet"> | |
| 22 | + <link href="../static/css/paper.css?t=1" rel="stylesheet"> | |
| 23 | + </head> | |
| 24 | + <body> | |
| 25 | + | |
| 26 | + <div class="head_box"> | |
| 27 | + <div class="box_header"> | |
| 28 | + <div class="head_box_l"> | |
| 29 | + <p> | |
| 30 | + <span class="right_b"></span>即时测试卷管理 | |
| 31 | + </p> | |
| 32 | + </div> | |
| 33 | + <div class="head_box_r"> | |
| 34 | + <input class="date-picker" type="text" placeholder="开始日期" name="lastStart" id="lastStart" data-date-format="yyyy-mm-dd" readonly="readonly" value=""/> | |
| 35 | + <input type="text" class="date-picker" placeholder="结束日期" name="lastEnd" id="lastEnd" data-date-format="yyyy-mm-dd" readonly="readonly" value=""/> | |
| 36 | + <select name="dealer_id_2" id="dealer_id_2" class="selectpicker show-tick form-control" data-width="98%" data-first-option="false" required data-live-search="true"> | |
| 37 | + <!--班级列表--> | |
| 38 | + </select> | |
| 39 | + <a onclick="tosearch();"><img | |
| 40 | + src="../static/images/search.png" /></a> | |
| 41 | + </div> | |
| 42 | + <div class="clear"></div> | |
| 43 | + </div> | |
| 44 | + <div style="padding:0 5%;background:#fff;"> | |
| 45 | + <table class="table table-striped"> | |
| 46 | + <col style="width: 10%" /> | |
| 47 | + <col style="width: 20%" /> | |
| 48 | + <col style="width: 10%" /> | |
| 49 | + <col style="width: 10%" /> | |
| 50 | + <col style="width: 10%" /> | |
| 51 | + <col style="width: 20%" /> | |
| 52 | + <col style="width: 10%" /> | |
| 53 | + <col style="width: 10%" /> | |
| 54 | + <thead> | |
| 55 | + <tr> | |
| 56 | + <th><input type="checkbox" name='ids' id="ids" />序号</th> | |
| 57 | + <th>试卷名称</th> | |
| 58 | + <th>班级</th> | |
| 59 | + <th>科目</th> | |
| 60 | + <th>考试时长</th> | |
| 61 | + <th>创建时间</th> | |
| 62 | + <th>查看</th> | |
| 63 | + <th>操作</th> | |
| 64 | + </tr> | |
| 65 | + </thead> | |
| 66 | + </table> | |
| 67 | + </div> | |
| 68 | + <div class="clearfix"></div> | |
| 69 | + </div> | |
| 70 | + <div class="table_box"> | |
| 71 | + <table class="table table-striped"> | |
| 72 | + <col style="width: 10%" /> | |
| 73 | + <col style="width: 20%" /> | |
| 74 | + <col style="width: 10%" /> | |
| 75 | + <col style="width: 10%" /> | |
| 76 | + <col style="width: 10%" /> | |
| 77 | + <col style="width: 20%" /> | |
| 78 | + <col style="width: 10%" /> | |
| 79 | + <tbody id="tab_body"> | |
| 80 | + | |
| 81 | + </tbody> | |
| 82 | + </table> | |
| 83 | + | |
| 84 | + | |
| 85 | + <div class="footer"> | |
| 86 | + <!-- <div class="creat"> | |
| 87 | + <input type="button" id="creatPaper" value="新建试卷" /> | |
| 88 | + </div> | |
| 89 | + <div class="removeAll"> | |
| 90 | + <input type="button" onclick="deleteAll()" value="批量删除" /> | |
| 91 | + </div> --> | |
| 92 | + <div class="page_box"> | |
| 93 | + | |
| 94 | + <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div> | |
| 95 | + </div> | |
| 96 | + </div> | |
| 97 | + </div> | |
| 98 | + <div class="modal fade" id="myModal" tabindex="-1" role="dialog"> | |
| 99 | + <div class="modal-dialog" role="document"> | |
| 100 | + <div class="modal-content"> | |
| 101 | + <div class="modal-header"> | |
| 102 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
| 103 | + <h4 class="modal-title">请选择班级</h4> | |
| 104 | + </div> | |
| 105 | + <div class="modal-body"> | |
| 106 | + <form class="form-horizontal"> | |
| 107 | + <div class="classList"> | |
| 108 | + <ul> | |
| 109 | + | |
| 110 | + </ul> | |
| 111 | + </div> | |
| 112 | + </form> | |
| 113 | + </div> | |
| 114 | + <div class="modal-footer"> | |
| 115 | + <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> | |
| 116 | + <button type="button" class="btn btn-primary" id="submit" onclick="setQUestion()">确定</button> | |
| 117 | + </div> | |
| 118 | + </div><!-- /.modal-content --> | |
| 119 | + </div><!-- /.modal-dialog --> | |
| 120 | + </div><!-- /.modal --> | |
| 121 | + | |
| 122 | + | |
| 123 | + <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> | |
| 124 | + <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> | |
| 125 | + <script src="../static/ace/js/date-time/bootstrap-datepicker.js"></script> | |
| 126 | + <script src="../static/ace/js/bootbox.js"></script> | |
| 127 | + <script src="../static/js/teach_paper.js?a=2"></script> | |
| 128 | +</html> | |
| 0 | 129 | \ No newline at end of file | ... | ... |
WebRoot/static/js/control-604.js
WebRoot/static/js/teach_paper1.js
0 → 100644
| 1 | + var url=""; | |
| 2 | + var class_html="", | |
| 3 | + option_html=""; | |
| 4 | + var user_id= "", | |
| 5 | + subject_id="", | |
| 6 | + class_id=""; | |
| 7 | + $(document).ready(function(){ | |
| 8 | + | |
| 9 | + timeList(); | |
| 10 | + $.ajax({ | |
| 11 | + url:url+"/SunvoteEducation/teacher/info", | |
| 12 | + async:false, | |
| 13 | + type:"post", | |
| 14 | + success:function(data){ | |
| 15 | + console.log(data); | |
| 16 | + subject_id=data.data.subjectList[0].SUBJECT_ID; | |
| 17 | + user_id=data.data.ID; | |
| 18 | + | |
| 19 | + if(data.data.classInfoList.length>0){ | |
| 20 | + for(var i=0;i<data.data.classInfoList.length;i++){ | |
| 21 | + class_html += '<li data-classId="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</li>'; | |
| 22 | + option_html += '<option value="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</option>' | |
| 23 | + } | |
| 24 | + $(".classList").html(class_html+'<div class="clearfix"></div>'); | |
| 25 | + $(".classList li").eq(0).addClass("active"); | |
| 26 | + $("#dealer_id_2").html(option_html); | |
| 27 | + } | |
| 28 | + getList(); | |
| 29 | + }, | |
| 30 | + error: function (XMLHttpRequest, textStatus, errorThrown) { | |
| 31 | + // 错误信息 | |
| 32 | + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); | |
| 33 | + window.top.loading.remove(); | |
| 34 | + } | |
| 35 | + }) | |
| 36 | + | |
| 37 | + //日期框 | |
| 38 | + $('.date-picker').datepicker({ | |
| 39 | + autoclose: true, | |
| 40 | + todayHighlight: true | |
| 41 | + }); | |
| 42 | + window.top.loading.remove(); | |
| 43 | + }) | |
| 44 | + | |
| 45 | + function getList(start_date,end_date,class_id){ //获取试卷列表 | |
| 46 | + var tab_html=""; | |
| 47 | + $.ajax({ | |
| 48 | + url:url+"/SunvoteEducation/api/v1/paper", | |
| 49 | + async:false, | |
| 50 | + type:"post", | |
| 51 | + data:{ | |
| 52 | + paper_type:"101", | |
| 53 | + user_id:user_id, | |
| 54 | + subject_id:subject_id, | |
| 55 | + class_id:class_id, | |
| 56 | + currentpage:"1", | |
| 57 | + showcount:"", | |
| 58 | + start_date:start_date, | |
| 59 | + end_date:end_date | |
| 60 | + }, | |
| 61 | + success:function(data){ | |
| 62 | + console.log(data); | |
| 63 | + for(var i=0;i<data.data.length;i++){ | |
| 64 | + tab_html += '<tr data-id="'+data.data[i].PAPER_ID+'" data-classid="'+data.data[i].CLASS_ID+'"><td><input type="checkbox" name="ids" id="ids" value="'+data.data[i].PAPER_ID+'"/>'+(i+1)+'</td><td>'+data.data[i].TITLE+'</td><td>'+getClassName(data.data[i].CLASS_ID)+'</td><td>'+getSubjectName(data.data[i].SUBJECT_ID)+'</td><td>'+data.data[i].EXAM_TIME+'分钟</td><td>'+data.data[i].CREATE_DATE+'</td><td><a onclick="jump($(this))">查看</a></td><td><a href="#" onclick="del($(this));"><img src="../static/images/remove.png" /></a></td></tr>'; | |
| 65 | + } | |
| 66 | + $("#tab_body").html(tab_html); | |
| 67 | + window.top.loading.remove(); | |
| 68 | + }, | |
| 69 | + error: function (XMLHttpRequest, textStatus, errorThrown) { | |
| 70 | + // 错误信息 | |
| 71 | + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); | |
| 72 | + window.top.loading.remove(); | |
| 73 | + } | |
| 74 | + }); | |
| 75 | + } | |
| 76 | + $('#ids').on('click', function(){ | |
| 77 | + var th_checked = $("#ids").prop('checked');//checkbox inside "TH" table header | |
| 78 | + | |
| 79 | + $(".table_box .table").find('tbody > tr').each(function(){ | |
| 80 | + var row = this; | |
| 81 | + if(th_checked) $(row).find('input[type=checkbox]').eq(0).prop('checked', true); | |
| 82 | + else $(row).find('input[type=checkbox]').eq(0).prop('checked', false); | |
| 83 | + }); | |
| 84 | + }); | |
| 85 | + function jump(obj){ //预览试卷 | |
| 86 | + window.top.loading.show(); | |
| 87 | + var id=obj.closest("tr").attr("data-id"); | |
| 88 | + var classid=obj.closest("tr").attr("data-classid"); | |
| 89 | + location.href="paper_view2.do?PAPER_ID="+id+"&classID="+classid+"&userid="+user_id; | |
| 90 | + } | |
| 91 | + $(".classList").on("click","li",function(){ | |
| 92 | + $(this).siblings().removeClass("active"); | |
| 93 | + $(this).addClass("active"); | |
| 94 | + | |
| 95 | + }); | |
| 96 | + $("#creatPaper").click(function(){ //新建试卷 | |
| 97 | + $('#myModal').modal('show'); | |
| 98 | + }); | |
| 99 | + function setQUestion(){ //新建试卷-选择班级 | |
| 100 | + if($(".classList .active").length>0){ | |
| 101 | + class_id=$(".classList .active").attr("data-classid"); | |
| 102 | + location.href="set_question.do?subject_id="+subject_id+"&class_id="+class_id+"&user_id="+user_id; | |
| 103 | + }else{ | |
| 104 | + alert("请先选择班级"); | |
| 105 | + } | |
| 106 | + window.top.loading.show(); | |
| 107 | + console.log($(".classList .active").length); | |
| 108 | + //location.href=""; | |
| 109 | + } | |
| 110 | + function getSubjectName(id){ //获取科目中文名 | |
| 111 | + var subjectName=""; | |
| 112 | + $.ajax({ | |
| 113 | + url:url+"/SunvoteEducation/api/v1/subjectcname", | |
| 114 | + async:false, | |
| 115 | + type:"post", | |
| 116 | + data:{id:id}, | |
| 117 | + success:function(data){ | |
| 118 | + subjectName=data.data; | |
| 119 | + }, | |
| 120 | + error: function (XMLHttpRequest, textStatus, errorThrown) { | |
| 121 | + // 错误信息 | |
| 122 | + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); | |
| 123 | + window.top.loading.remove(); | |
| 124 | + } | |
| 125 | + }) | |
| 126 | + return subjectName; | |
| 127 | + } | |
| 128 | + function getClassName(id){ //获取班级中文名 | |
| 129 | + var className=""; | |
| 130 | + $.ajax({ | |
| 131 | + url:url+"/SunvoteEducation/api/v1/classname", | |
| 132 | + async:false, | |
| 133 | + type:"post", | |
| 134 | + data:{id:id}, | |
| 135 | + success:function(data){ | |
| 136 | + className=data.data; | |
| 137 | + }, | |
| 138 | + error: function (XMLHttpRequest, textStatus, errorThrown) { | |
| 139 | + // 错误信息 | |
| 140 | + alert("状态码:"+XMLHttpRequest.status+"状态:"+XMLHttpRequest.readyState+"错误信息:"+textStatus+""); | |
| 141 | + window.top.loading.remove(); | |
| 142 | + } | |
| 143 | + }) | |
| 144 | + return className; | |
| 145 | + } | |
| 146 | + function getday(month){ //获取日期 | |
| 147 | + var time=[]; | |
| 148 | + var d= new Date(); | |
| 149 | + d.setMonth(month-1); | |
| 150 | + d.setDate(1); | |
| 151 | + var day=d.getDate(); | |
| 152 | + var month=d.getMonth()+1; | |
| 153 | + if((d.getMonth()+1)<10){ | |
| 154 | + var month="0"+(d.getMonth()+1); | |
| 155 | + } | |
| 156 | + var year=d.getFullYear(); | |
| 157 | + var startTime=year+"-"+month+"-"+day; | |
| 158 | + d.setMonth(month); | |
| 159 | + var end_day=d.getDate(); | |
| 160 | + var end_month=d.getMonth()+1; | |
| 161 | + if((d.getMonth()+1)<10){ | |
| 162 | + var end_month="0"+(d.getMonth()+1); | |
| 163 | + } | |
| 164 | + var end_year=d.getFullYear(); | |
| 165 | + var endTime=end_year+"-"+end_month+"-"+end_day; | |
| 166 | + time[0]=startTime; | |
| 167 | + time[1]=endTime; | |
| 168 | + return time; | |
| 169 | + } | |
| 170 | + function timeList(){ //渲染时间列表 | |
| 171 | + var time = new Date(); | |
| 172 | + var now_month=time.getMonth()+1; | |
| 173 | + time.setMonth(now_month-1) | |
| 174 | + if(time.getMonth()!= 0 ){ | |
| 175 | + var preceding_month = time.getMonth(); | |
| 176 | + }else | |
| 177 | + var preceding_month = 12; | |
| 178 | + time.setMonth(now_month-2) | |
| 179 | + if(time.getMonth()!= 0 ){ | |
| 180 | + var last_month = time.getMonth(); | |
| 181 | + }else | |
| 182 | + var last_month = 12; | |
| 183 | + var option_html=""; | |
| 184 | + option_html += '<option value="'+now_month+'">'+now_month+'月</option><option value="'+preceding_month+'">'+preceding_month+'月</option><option value="'+last_month+'">'+last_month+'月</option>'; | |
| 185 | + $("#dealer_id_1").html(option_html); | |
| 186 | + } | |
| 187 | + function tosearch(){ //搜索 | |
| 188 | + //var timeBox=getday($("#dealer_id_1").val()); | |
| 189 | + var start_date=$("#lastStart").val(); | |
| 190 | + var end_date=$("#lastEnd").val(); | |
| 191 | + var class_id=$("#dealer_id_2").val(); | |
| 192 | + getList(start_date,end_date,class_id); | |
| 193 | + } | |
| 194 | + | |
| 195 | + function del(obj){ //删除 | |
| 196 | + //var remove = new remove(); | |
| 197 | + var id=obj.closest("tr").attr("data-id"); | |
| 198 | + window.top.remove.init({"title":"删除","func":function(success){ | |
| 199 | + if(success){ | |
| 200 | + var url = "/SunvoteEducation/paper/delete.do?PAPER_ID="+id+"&tm="+new Date().getTime(); | |
| 201 | + window.top.loading.show(); | |
| 202 | + $.get(url,function(data){ | |
| 203 | + tosearch(); | |
| 204 | + }); | |
| 205 | + } | |
| 206 | + else{ | |
| 207 | + console.log("false"); | |
| 208 | + } | |
| 209 | + }}); | |
| 210 | + window.top.remove.show(); | |
| 211 | + } | |
| 212 | + function deleteAll(){ //批量删除 | |
| 213 | + window.top.remove.init({"title":"删除","func":function(success){ | |
| 214 | + if(success){ | |
| 215 | + var str = ''; | |
| 216 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | |
| 217 | + if(document.getElementsByName('ids')[i].checked){ | |
| 218 | + if(str=='') str += document.getElementsByName('ids')[i].value; | |
| 219 | + else str += ',' + document.getElementsByName('ids')[i].value; | |
| 220 | + } | |
| 221 | + } | |
| 222 | + if(str==''){ | |
| 223 | + | |
| 224 | + }else{ | |
| 225 | + $.ajax({ | |
| 226 | + type: "POST", | |
| 227 | + url: '/SunvoteEducation/paper/deleteAll.do?tm='+new Date().getTime(), | |
| 228 | + data: {DATA_IDS:str}, | |
| 229 | + dataType:'json', | |
| 230 | + //beforeSend: validateData, | |
| 231 | + cache: false, | |
| 232 | + success: function(data){ | |
| 233 | + $.each(data.list, function(i, list){ | |
| 234 | + tosearch(); | |
| 235 | + }); | |
| 236 | + } | |
| 237 | + }); | |
| 238 | + } | |
| 239 | + } | |
| 240 | + else{ | |
| 241 | + console.log("false"); | |
| 242 | + } | |
| 243 | + }}); | |
| 244 | + window.top.remove.show(); | |
| 245 | + } | |
| 0 | 246 | \ No newline at end of file | ... | ... |
resources/mybatis1/sunvote/PaperMapper.xml
| ... | ... | @@ -138,6 +138,9 @@ |
| 138 | 138 | <if test="pd.PAPER_TYPE != null and pd.PAPER_TYPE != ''"><!-- 关键词检索 --> |
| 139 | 139 | and PAPER_TYPE = #{pd.PAPER_TYPE} |
| 140 | 140 | </if> |
| 141 | + <if test="pd.SCHOOL_ID != null and pd.SCHOOL_ID != ''"><!-- 关键词检索 --> | |
| 142 | + and SCHOOL_ID = #{pd.SCHOOL_ID} | |
| 143 | + </if> | |
| 141 | 144 | |
| 142 | 145 | order by CREATE_DATE DESC |
| 143 | 146 | </select> |
| ... | ... | @@ -148,6 +151,11 @@ |
| 148 | 151 | <include refid="Field"></include> |
| 149 | 152 | from |
| 150 | 153 | <include refid="tableName"></include> |
| 154 | + where 1 =1 | |
| 155 | + | |
| 156 | + <if test="SCHOOL_ID != null and SCHOOL_ID != ''"><!-- 关键词检索 --> | |
| 157 | + and SCHOOL_ID = #{SCHOOL_ID} | |
| 158 | + </if> | |
| 151 | 159 | |
| 152 | 160 | order by CREATE_DATE DESC |
| 153 | 161 | </select> |
| ... | ... | @@ -172,6 +180,12 @@ |
| 172 | 180 | <if test="pd.CLASS_ID != null and pd.CLASS_ID != ''"> |
| 173 | 181 | and CLASS_ID = #{pd.CLASS_ID} |
| 174 | 182 | </if> |
| 183 | + <if test="GRADE_ID != null and GRADE_ID != ''"> | |
| 184 | + and GRADE_ID = #{pd.GRADE_ID} | |
| 185 | + </if> | |
| 186 | + <if test="pd.SCHOOL_ID != null and pd.SCHOOL_ID != ''"> | |
| 187 | + and SCHOOL_ID = #{pd.SCHOOL_ID} | |
| 188 | + </if> | |
| 175 | 189 | |
| 176 | 190 | <if test="pd.START_DATE != null and pd.START_DATE != ''"><!-- 关键词检索 --> |
| 177 | 191 | and (CREATE_DATE > #{pd.START_DATE}) | ... | ... |
src/com/fh/bean/Paper.java
| ... | ... | @@ -19,6 +19,16 @@ public class Paper { |
| 19 | 19 | private String user_id = ""; |
| 20 | 20 | |
| 21 | 21 | private String class_id = "" ; |
| 22 | + | |
| 23 | + private String school_id = "" ; | |
| 24 | + | |
| 25 | + public String getSchool_id() { | |
| 26 | + return school_id; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public void setSchool_id(String school_id) { | |
| 30 | + this.school_id = school_id; | |
| 31 | + } | |
| 22 | 32 | |
| 23 | 33 | private List<Question> questions = new ArrayList<Question>(); |
| 24 | 34 | ... | ... |
src/com/fh/controller/api/V1.java
| ... | ... | @@ -494,7 +494,7 @@ public class V1 extends BaseController { |
| 494 | 494 | long cur = System.currentTimeMillis(); |
| 495 | 495 | PageData pd = this.getPageData(); |
| 496 | 496 | ResponseGson<List<PageData>> res = new ResponseGson<List<PageData>>(); |
| 497 | - if (pd.containsKey("PAPER_TYPE") && pd.containsKey("USER_ID")) { | |
| 497 | + if (pd.containsKey("PAPER_TYPE")) { | |
| 498 | 498 | String CURRENTPAGE = pd.getString("CURRENTPAGE"); |
| 499 | 499 | String SHOWCOUNT = pd.getString("SHOWCOUNT"); |
| 500 | 500 | if (CURRENTPAGE != null && SHOWCOUNT != null |
| ... | ... | @@ -541,6 +541,7 @@ public class V1 extends BaseController { |
| 541 | 541 | paper.setSubject_id(ppd.getString("SUBJECT_ID")); |
| 542 | 542 | paper.setGrade_id(ppd.getString("GRADE_ID")); |
| 543 | 543 | paper.setScore(ppd.getString("SCORE")); |
| 544 | + paper.setSchool_id(ppd.getString("SCHOOL_ID")); | |
| 544 | 545 | paper.setQuestions(new ArrayList<Question>()); |
| 545 | 546 | |
| 546 | 547 | List<PageData> questList = v1Service |
| ... | ... | @@ -760,6 +761,7 @@ public class V1 extends BaseController { |
| 760 | 761 | + (System.currentTimeMillis() - cur)); |
| 761 | 762 | return res.toJson(); |
| 762 | 763 | } |
| 764 | + | |
| 763 | 765 | |
| 764 | 766 | /** |
| 765 | 767 | * 试卷详细信息 |
| ... | ... | @@ -1229,7 +1231,7 @@ public class V1 extends BaseController { |
| 1229 | 1231 | paperPd.put("PAPER_STATE", "0"); |
| 1230 | 1232 | paperPd.put("REMARK", ""); |
| 1231 | 1233 | String schoolID = Myelfun.getUserID(paper.getUser_id()); |
| 1232 | - paperPd.put("SCHOOL_ID", schoolID); | |
| 1234 | + paperPd.put("SCHOOL_ID", paper.getSchool_id() == null ? schoolID:paper.getSchool_id()); | |
| 1233 | 1235 | paperPd.put("CREATE_DATE", Tools.date2Str(new Date())); |
| 1234 | 1236 | paperPd.put("MODIFY_DATE", Tools.date2Str(new Date())); |
| 1235 | 1237 | ... | ... |
src/com/fh/controller/sunvote/Myelfun.java
src/com/fh/controller/sunvote/paper/PaperController.java
| ... | ... | @@ -248,21 +248,29 @@ public class PaperController extends BaseController { |
| 248 | 248 | ModelAndView mv = this.getModelAndView(); |
| 249 | 249 | PageData pd = new PageData(); |
| 250 | 250 | pd = this.getPageData(); |
| 251 | + String paperType = pd.getString("PAPER_TYPE") ; | |
| 251 | 252 | Paper paper = new Paper(); |
| 252 | 253 | paper.setTitle(pd.getString("NAME")); |
| 253 | 254 | paper.setExam_time(pd.getString("TIME")); |
| 254 | 255 | Session session = Jurisdiction.getSession(); |
| 255 | 256 | User user = (User)session.getAttribute(Const.SESSION_USER); |
| 256 | 257 | paper.setUser_id(user.getUSER_ID()); |
| 257 | - paper.setPaper_type("1"); | |
| 258 | - paper.setSubject_id(getSubjectId()); | |
| 259 | - paper.setGrade_id(getGradeID()); | |
| 258 | + paper.setPaper_type(paperType == null ? "1" :paperType); | |
| 259 | + paper.setSubject_id(pd.getString("SUBJECT_ID") == null ? getSubjectId():pd.getString("SUBJECT_ID")); | |
| 260 | + paper.setGrade_id(pd.getString("GRADE_ID") == null ? getGradeID() : pd.getString("GRADE_ID")); | |
| 261 | + paper.setSchool_id(pd.getString("SCHOOL_ID") == null ? getSchoolID() : pd.getString("SCHOOL_ID")); | |
| 260 | 262 | paper.setQuestions(new ArrayList<Question>()); |
| 263 | + | |
| 261 | 264 | pd.put("JSON", paper.toJson()); |
| 262 | 265 | logger.info(paper.toJson()); |
| 263 | 266 | |
| 264 | 267 | mv.setViewName("sunvote/teacher/creat_question"); |
| 265 | 268 | mv.addObject("pd", pd); |
| 269 | + if(paperType != null && "2".equals(paperType)){ | |
| 270 | + mv.addObject("JUMP_URL", "/main/admin"); | |
| 271 | + }else{ | |
| 272 | + mv.addObject("JUMP_URL", "/main/teacher"); | |
| 273 | + } | |
| 266 | 274 | mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 |
| 267 | 275 | return mv; |
| 268 | 276 | } |
| ... | ... | @@ -325,6 +333,114 @@ public class PaperController extends BaseController { |
| 325 | 333 | return mv; |
| 326 | 334 | } |
| 327 | 335 | |
| 336 | + /**列表 | |
| 337 | + * @param page | |
| 338 | + * @throws Exception | |
| 339 | + */ | |
| 340 | + @RequestMapping(value="/list4") | |
| 341 | + public ModelAndView list4(Page page) throws Exception{ | |
| 342 | + ModelAndView mv = this.getModelAndView(); | |
| 343 | + PageData pd = new PageData(); | |
| 344 | + pd = this.getPageData(); | |
| 345 | + String keywords = pd.getString("keywords"); //关键词检索条件 | |
| 346 | + if(null != keywords && !"".equals(keywords)){ | |
| 347 | + pd.put("keywords", keywords.trim()); | |
| 348 | + } | |
| 349 | + pd.put("PAPER_TYPE","1"); | |
| 350 | + page.setPd(pd); | |
| 351 | + List<PageData> varList = paperService.list(page); //列出Paper列表 | |
| 352 | + pd.put("PAPER_TYPE","2"); | |
| 353 | + List<PageData> varList2 = paperService.list(page); //列出Paper列表 | |
| 354 | + varList.addAll(varList2); | |
| 355 | + mv.setViewName("sunvote/paper/paper_list4"); | |
| 356 | + | |
| 357 | + for(PageData p:varList){ | |
| 358 | + String examTime = p.getString("EXAM_TIME"); | |
| 359 | + if(examTime != null){ | |
| 360 | + try{ | |
| 361 | + int et = Integer.parseInt(examTime); | |
| 362 | + String min = (et / 60 ) + "" ; | |
| 363 | + if(min.length() < 2){ | |
| 364 | + min = "0" + min ; | |
| 365 | + } | |
| 366 | + String sec = (et % 60 ) + "" ; | |
| 367 | + if(sec.length() < 2){ | |
| 368 | + sec = "0" + sec ; | |
| 369 | + } | |
| 370 | + if(et > 60){ | |
| 371 | + examTime = min + ":" + sec; | |
| 372 | + }else{ | |
| 373 | + examTime = "00:" + sec; | |
| 374 | + } | |
| 375 | + }catch(Exception e){ | |
| 376 | + e.printStackTrace(); | |
| 377 | + } | |
| 378 | + } | |
| 379 | + if(examTime == null){ | |
| 380 | + examTime = "00:00"; | |
| 381 | + } | |
| 382 | + p.put("EXAM_TIME", examTime); | |
| 383 | + } | |
| 384 | + | |
| 385 | + mv.addObject("varList", varList); | |
| 386 | + mv.addObject("pd", pd); | |
| 387 | + mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 | |
| 388 | + return mv; | |
| 389 | + } | |
| 390 | + | |
| 391 | + | |
| 392 | + /**列表 | |
| 393 | + * @param page | |
| 394 | + * @throws Exception | |
| 395 | + */ | |
| 396 | + @RequestMapping(value="/list5") | |
| 397 | + public ModelAndView list5(Page page) throws Exception{ | |
| 398 | + ModelAndView mv = this.getModelAndView(); | |
| 399 | + PageData pd = new PageData(); | |
| 400 | + pd = this.getPageData(); | |
| 401 | + String keywords = pd.getString("keywords"); //关键词检索条件 | |
| 402 | + if(null != keywords && !"".equals(keywords)){ | |
| 403 | + pd.put("keywords", keywords.trim()); | |
| 404 | + } | |
| 405 | + pd.put("PAPER_TYPE","2"); | |
| 406 | + pd.put("USER_ID", this.getUserID()); | |
| 407 | + page.setPd(pd); | |
| 408 | + List<PageData> varList = paperService.list(page); //列出Paper列表 | |
| 409 | + mv.setViewName("sunvote/paper/paper_list5"); | |
| 410 | + | |
| 411 | + for(PageData p:varList){ | |
| 412 | + String examTime = p.getString("EXAM_TIME"); | |
| 413 | + if(examTime != null){ | |
| 414 | + try{ | |
| 415 | + int et = Integer.parseInt(examTime); | |
| 416 | + String min = (et / 60 ) + "" ; | |
| 417 | + if(min.length() < 2){ | |
| 418 | + min = "0" + min ; | |
| 419 | + } | |
| 420 | + String sec = (et % 60 ) + "" ; | |
| 421 | + if(sec.length() < 2){ | |
| 422 | + sec = "0" + sec ; | |
| 423 | + } | |
| 424 | + if(et > 60){ | |
| 425 | + examTime = min + ":" + sec; | |
| 426 | + }else{ | |
| 427 | + examTime = "00:" + sec; | |
| 428 | + } | |
| 429 | + }catch(Exception e){ | |
| 430 | + e.printStackTrace(); | |
| 431 | + } | |
| 432 | + } | |
| 433 | + if(examTime == null){ | |
| 434 | + examTime = "00:00"; | |
| 435 | + } | |
| 436 | + p.put("EXAM_TIME", examTime); | |
| 437 | + } | |
| 438 | + | |
| 439 | + mv.addObject("varList", varList); | |
| 440 | + mv.addObject("pd", pd); | |
| 441 | + mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 | |
| 442 | + return mv; | |
| 443 | + } | |
| 328 | 444 | |
| 329 | 445 | /**列表 |
| 330 | 446 | * @param page | ... | ... |
src/com/fh/controller/sunvote/teacher/TeacherController.java
| ... | ... | @@ -171,6 +171,25 @@ public class TeacherController extends BaseController { |
| 171 | 171 | mv.addObject("pd", pd); |
| 172 | 172 | return mv; |
| 173 | 173 | } |
| 174 | + | |
| 175 | + /** | |
| 176 | + * 列表 | |
| 177 | + * | |
| 178 | + * @param page | |
| 179 | + * @throws Exception | |
| 180 | + */ | |
| 181 | + @RequestMapping(value = "/teach_paper1") | |
| 182 | + public ModelAndView teach_paper1(Page page) throws Exception { | |
| 183 | + logBefore(logger, Jurisdiction.getUsername() + "列表Paper"); | |
| 184 | + String userId = this.getUserID(); | |
| 185 | + ModelAndView mv = this.getModelAndView(); | |
| 186 | + PageData pd = new PageData(); | |
| 187 | + pd = this.getPageData(); | |
| 188 | + mv.setViewName("sunvote/teacher/teach_paper1"); | |
| 189 | + pd.put("userId", userId); | |
| 190 | + mv.addObject("pd", pd); | |
| 191 | + return mv; | |
| 192 | + } | |
| 174 | 193 | /** |
| 175 | 194 | * 列表 |
| 176 | 195 | * | ... | ... |