Commit f4a7359454522a54843d62cf39f5317fea0b34dc
1 parent
739794be
1.增加班级统计报表和导出
Showing
23 changed files
with
1130 additions
and
46 deletions
WebRoot/WEB-INF/jsp/save_result2.jsp
@@ -15,10 +15,32 @@ | @@ -15,10 +15,32 @@ | ||
15 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | 15 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
16 | 16 | ||
17 | <script type="text/javascript" src="static/js/jquery-1.7.2.js"></script> | 17 | <script type="text/javascript" src="static/js/jquery-1.7.2.js"></script> |
18 | - | 18 | +<style type="text/css"> |
19 | + #zhongxin{ | ||
20 | + text-align:center; | ||
21 | + padding-top:50px; | ||
22 | + } | ||
23 | + .fail{ | ||
24 | + text-align:center; | ||
25 | + margin-bottom:-30px; | ||
26 | + } | ||
27 | + .fail p{ | ||
28 | + font-size:16px; | ||
29 | + color:#ff006a; | ||
30 | + font-weight:bolder; | ||
31 | + } | ||
32 | +</style> | ||
19 | </head> | 33 | </head> |
20 | <body> | 34 | <body> |
35 | + <c:if test="${state =='fail'}"> | ||
36 | + <div class="fail"> | ||
37 | + <img src="static/images/fail.png" width="100px" /> | ||
38 | + | ||
39 | + <p>导入失败</p> | ||
40 | + </div> | ||
41 | + </c:if> | ||
21 | <div id="zhongxin">${msg}</div> | 42 | <div id="zhongxin">${msg}</div> |
43 | + | ||
22 | <script type="text/javascript"> | 44 | <script type="text/javascript"> |
23 | var msg = "${msg}"; | 45 | var msg = "${msg}"; |
24 | if(msg=="success" || msg==""){ | 46 | if(msg=="success" || msg==""){ |
WebRoot/WEB-INF/jsp/sunvote/admin/admin_main.jsp
@@ -30,7 +30,11 @@ | @@ -30,7 +30,11 @@ | ||
30 | <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> | 30 | <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> |
31 | <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> | 31 | <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> |
32 | <![endif]--> | 32 | <![endif]--> |
33 | - | 33 | +<style> |
34 | + .menu_2 .active{ | ||
35 | + background:#000; | ||
36 | + } | ||
37 | +</style> | ||
34 | </head> | 38 | </head> |
35 | <body> | 39 | <body> |
36 | <div class="header"> | 40 | <div class="header"> |
@@ -60,7 +64,7 @@ | @@ -60,7 +64,7 @@ | ||
60 | <p> | 64 | <p> |
61 | 年级管理<span class="right jiao"></span> | 65 | 年级管理<span class="right jiao"></span> |
62 | </p> | 66 | </p> |
63 | - <ul class="menu_1"> | 67 | + <ul class="menu_2"> |
64 | <c:forEach items="${gradeInfos}" var="var" varStatus="vs"> | 68 | <c:forEach items="${gradeInfos}" var="var" varStatus="vs"> |
65 | <li | 69 | <li |
66 | onclick="event.stopPropagation();chooseListClass('${SCHOOL_ID}','${var.ID}')"> | 70 | onclick="event.stopPropagation();chooseListClass('${SCHOOL_ID}','${var.ID}')"> |
@@ -185,7 +189,7 @@ | @@ -185,7 +189,7 @@ | ||
185 | 系统设置<span class="right jiao"></span> | 189 | 系统设置<span class="right jiao"></span> |
186 | </p> | 190 | </p> |
187 | 191 | ||
188 | - <ul class="menu_1"> | 192 | + <ul class="menu_2"> |
189 | <li> | 193 | <li> |
190 | <p onclick="event.stopPropagation();school('${SCHOOL_ID}')">学校设置</p> | 194 | <p onclick="event.stopPropagation();school('${SCHOOL_ID}')">学校设置</p> |
191 | 195 | ||
@@ -495,6 +499,11 @@ | @@ -495,6 +499,11 @@ | ||
495 | if (defaultUrl != '' && defaultUrl != '') { | 499 | if (defaultUrl != '' && defaultUrl != '') { |
496 | $("#mainFrame").attr('src', defaultUrl); | 500 | $("#mainFrame").attr('src', defaultUrl); |
497 | } | 501 | } |
502 | + | ||
503 | + $(".menu_2 li").click(function(){ | ||
504 | + $(".active").removeClass("active"); | ||
505 | + $(this).addClass("active"); | ||
506 | + }) | ||
498 | </script> | 507 | </script> |
499 | </body> | 508 | </body> |
500 | </html> | 509 | </html> |
501 | \ No newline at end of file | 510 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list2.jsp
@@ -56,8 +56,8 @@ | @@ -56,8 +56,8 @@ | ||
56 | <col style="width: 20%" /> | 56 | <col style="width: 20%" /> |
57 | <col style="width: 20%" /> | 57 | <col style="width: 20%" /> |
58 | <col style="width: 20%" /> | 58 | <col style="width: 20%" /> |
59 | - <col style="width: 20%" /> | ||
60 | <col style="width: 10%" /> | 59 | <col style="width: 10%" /> |
60 | + <col style="width: 20%" /> | ||
61 | <thead> | 61 | <thead> |
62 | <tr> | 62 | <tr> |
63 | <th><input type="checkbox" name='ids' id="ids" />序号</th> | 63 | <th><input type="checkbox" name='ids' id="ids" />序号</th> |
@@ -72,13 +72,14 @@ | @@ -72,13 +72,14 @@ | ||
72 | </div> | 72 | </div> |
73 | </div> | 73 | </div> |
74 | <div class="table_box"> | 74 | <div class="table_box"> |
75 | + | ||
75 | <table class="table table-striped"> | 76 | <table class="table table-striped"> |
76 | <col style="width: 10%" /> | 77 | <col style="width: 10%" /> |
77 | <col style="width: 20%" /> | 78 | <col style="width: 20%" /> |
78 | <col style="width: 20%" /> | 79 | <col style="width: 20%" /> |
79 | <col style="width: 20%" /> | 80 | <col style="width: 20%" /> |
80 | - <col style="width: 20%" /> | ||
81 | <col style="width: 10%" /> | 81 | <col style="width: 10%" /> |
82 | + <col style="width: 20%" /> | ||
82 | <tbody> | 83 | <tbody> |
83 | <c:choose> | 84 | <c:choose> |
84 | <c:when test="${not empty varList}"> | 85 | <c:when test="${not empty varList}"> |
@@ -90,6 +91,7 @@ | @@ -90,6 +91,7 @@ | ||
90 | <td >${var.EXAM_TIME}</td> | 91 | <td >${var.EXAM_TIME}</td> |
91 | <td >${var.SCORE}</td> | 92 | <td >${var.SCORE}</td> |
92 | <td> | 93 | <td> |
94 | + <a href="<%=basePath%>paper/paperRep.do?paper_id=${var.PAPER_ID}">查看成绩</a> | ||
93 | <a href="#" onclick="del('${var.PAPER_ID}');"><img src="../static/images/remove.png" /></a> | 95 | <a href="#" onclick="del('${var.PAPER_ID}');"><img src="../static/images/remove.png" /></a> |
94 | </td> | 96 | </td> |
95 | </tr> | 97 | </tr> |
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list4.jsp
@@ -86,6 +86,7 @@ | @@ -86,6 +86,7 @@ | ||
86 | <th>创建时间</th> | 86 | <th>创建时间</th> |
87 | <th>建议考试时长</th> | 87 | <th>建议考试时长</th> |
88 | <th>总分</th> | 88 | <th>总分</th> |
89 | + <th>操作</th> | ||
89 | </tr> | 90 | </tr> |
90 | </thead> | 91 | </thead> |
91 | </table> | 92 | </table> |
@@ -114,6 +115,7 @@ | @@ -114,6 +115,7 @@ | ||
114 | <td >${var.CREATE_DATE}</td> | 115 | <td >${var.CREATE_DATE}</td> |
115 | <td >${var.EXAM_TIME}</td> | 116 | <td >${var.EXAM_TIME}</td> |
116 | <td >${var.SCORE}</td> | 117 | <td >${var.SCORE}</td> |
118 | + <td ><a href="<%=basePath%>paper/paperRep.do?paper_id=${var.PAPER_ID}">查看成绩</a></td> | ||
117 | </tr> | 119 | </tr> |
118 | 120 | ||
119 | </c:forEach> | 121 | </c:forEach> |
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list5.jsp
@@ -99,6 +99,7 @@ | @@ -99,6 +99,7 @@ | ||
99 | <td >${var.EXAM_TIME}</td> | 99 | <td >${var.EXAM_TIME}</td> |
100 | <td >${var.SCORE}</td> | 100 | <td >${var.SCORE}</td> |
101 | <td> | 101 | <td> |
102 | + <a href="<%=basePath%>paper/paperRep.do?paper_id=${var.PAPER_ID}">查看成绩</a> | ||
102 | <a href="#" onclick="del('${var.PAPER_ID}');"><img src="../static/images/remove.png" /></a> | 103 | <a href="#" onclick="del('${var.PAPER_ID}');"><img src="../static/images/remove.png" /></a> |
103 | </td> | 104 | </td> |
104 | </tr> | 105 | </tr> |
WebRoot/WEB-INF/jsp/sunvote/paper/test_list1.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 rel="stylesheet" href="../static/css/bootstrap.min.css" /> | ||
23 | +<link href="../static/css/teach.css" rel="stylesheet"> | ||
24 | +<link rel="stylesheet" href="../static/ace/css/datepicker.css" /> | ||
25 | +<link type="text/css" href="../static/css/tablescroller.css" rel="stylesheet" /> | ||
26 | +<script src="../static/js/loading.js"></script> | ||
27 | +<script src="../static/js/remove.js?a=1"></script> | ||
28 | + | ||
29 | + | ||
30 | +<!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> | ||
31 | +<!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> | ||
32 | +<!--[if lt IE 9]> | ||
33 | + <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> | ||
34 | + <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> | ||
35 | + <![endif]--> | ||
36 | +</head> | ||
37 | +<body> | ||
38 | + | ||
39 | + <form action="../paper/list4.do" method="post" name="Form" id="Form"> | ||
40 | + <div class="head_box"> | ||
41 | + <div class="box_header"> | ||
42 | + <div class="head_box_l"> | ||
43 | + <p> | ||
44 | + <span class="right_b"></span>试卷测验列表 | ||
45 | + </p> | ||
46 | + </div> | ||
47 | + <div class="head_box_r"> | ||
48 | + <button type="button" class="btn btn-primary" onclick="window.history.go(-1)" autocomplete="off">返回</button> | ||
49 | + <button type="button" class="btn btn-primary" onclick="export1()" autocomplete="off">导出</button> | ||
50 | + </div> | ||
51 | + | ||
52 | + <div class="clear"></div> | ||
53 | + </div> | ||
54 | + | ||
55 | + </div> | ||
56 | + <div class="table_box" style="padding:0 5%;background:#fff;"> | ||
57 | + <div style="padding:15px 0;background:#fff;" class="paper_title"> | ||
58 | + | ||
59 | + 试卷名称:${myelfun:findPaperName(pd.PAPER_ID)} | ||
60 | + </div> | ||
61 | + | ||
62 | + <table id="simple-table" | ||
63 | + class="table table-striped table-bordered table-hover" | ||
64 | + style="margin-top:0px;margin-bottom:0;"> | ||
65 | + <thead> | ||
66 | + <tr> | ||
67 | + <th><div style="width:80px">序号</div></th> | ||
68 | + <th><div style="width:80px">班级名称</div></th> | ||
69 | + <th><div style="width:80px">考试时间</div></th> | ||
70 | + <th><div style="width:80px">平均分</div></th> | ||
71 | + <th><div style="width:80px">班级总人数</div></th> | ||
72 | + <th><div style="width:80px">优秀人数</div></th> | ||
73 | + <th><div style="width:80px">优秀率</div></th> | ||
74 | + <th><div style="width:80px">良好人数</div></th> | ||
75 | + <th><div style="width:80px">良好率</div></th> | ||
76 | + <th><div style="width:80px">及格人数</div></th> | ||
77 | + <th><div style="width:80px">及格率</div></th> | ||
78 | + <th><div style="width:80px">低分人数</div></th> | ||
79 | + <th><div style="width:80px">低分率</div></th> | ||
80 | + <th><div style="width:80px">操作</div></th> | ||
81 | + </tr> | ||
82 | + </thead> | ||
83 | + <tbody> | ||
84 | + <c:choose> | ||
85 | + <c:when test="${not empty varList}"> | ||
86 | + <c:forEach items="${varList}" var="var" varStatus="vs"> | ||
87 | + <tr> | ||
88 | + | ||
89 | + <td>${vs.index+1}</td> | ||
90 | + <td>${myelfun:findClassName(var.class_id)}</td> | ||
91 | + <td >${var.creat_time}</td> | ||
92 | + <td >${var.avg_score}</td> | ||
93 | + <td >${var.student_num}</td> | ||
94 | + <td >${var.you}</td> | ||
95 | + <td > | ||
96 | + <fmt:formatNumber type="number" | ||
97 | + value="${var.student_num == 0 ? 0: (var.you / var.student_num * 100)}" | ||
98 | + maxFractionDigits="2" />% | ||
99 | + </td> | ||
100 | + <td >${var.liang}</td> | ||
101 | + <td > | ||
102 | + <fmt:formatNumber type="number" | ||
103 | + value="${var.student_num == 0 ? 0: (var.liang / var.student_num * 100)}" | ||
104 | + maxFractionDigits="2" />% | ||
105 | + </td> | ||
106 | + <td >${var.jige}</td> | ||
107 | + <td > | ||
108 | + <fmt:formatNumber type="number" | ||
109 | + value="${var.student_num == 0 ? 0: (var.jige / var.student_num * 100)}" | ||
110 | + maxFractionDigits="2" />% | ||
111 | + </td> | ||
112 | + <td >${var.difen}</td> | ||
113 | + <td > | ||
114 | + <fmt:formatNumber type="number" | ||
115 | + value="${var.student_num == 0 ? 0: (var.difen / var.student_num * 100)}" | ||
116 | + maxFractionDigits="2" />% | ||
117 | + </td> | ||
118 | + <td ><a href="<%=basePath%>paper/paperRep2.do?PAPER_ID=${pd.PAPER_ID}&TESTPAPER_ID=${var.testpaper_id}">查看成绩</a></td> | ||
119 | + </tr> | ||
120 | + | ||
121 | + </c:forEach> | ||
122 | + </c:when> | ||
123 | + <c:otherwise> | ||
124 | + <tr class="main_info"> | ||
125 | + <td colspan="100" class="center" >没有相关数据</td> | ||
126 | + </tr> | ||
127 | + </c:otherwise> | ||
128 | + </c:choose> | ||
129 | + </tbody> | ||
130 | + </table> | ||
131 | + | ||
132 | + <div id="scrollableTable"></div> | ||
133 | + | ||
134 | + <div class="footer"> | ||
135 | + <!-- <div class="creat"> | ||
136 | + <input type="button" onclick="parent.$('.title_time').modal('show');" value="新建试卷" /> | ||
137 | + </div> | ||
138 | + <div class="removeAll"> | ||
139 | + <input type="button" onclick="deleteAll()" value="批量删除" /> | ||
140 | + </div> --> | ||
141 | + <div class="page_box"> | ||
142 | + | ||
143 | + <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div> | ||
144 | + </div> | ||
145 | + </div> | ||
146 | + </div> | ||
147 | + </form> | ||
148 | +</body> | ||
149 | + | ||
150 | +<%@ include file="../../system/index/foot2.jsp"%> | ||
151 | +<script src="../static/ace/js/date-time/bootstrap-datepicker.js"></script> | ||
152 | + | ||
153 | + <script language="javascript" src="../static/js/tablescroller.js"></script> | ||
154 | + <script language="javascript" src="../static/js/tablescroller.jquery.js"></script> | ||
155 | +<script type="text/javascript"> | ||
156 | + | ||
157 | + $(document).ready(function(){ | ||
158 | + window.top.loading.remove(); | ||
159 | + $(".table_box").css("padding-top",$(".head_box").height()); | ||
160 | + | ||
161 | + var _heigh = $('#mainFrame', parent.document).height()-150; | ||
162 | + | ||
163 | + var options = { | ||
164 | + width: '100%', | ||
165 | + height: _heigh, | ||
166 | + pinnedRows: 1, | ||
167 | + pinnedCols: 5, | ||
168 | + container: "#scrollableTable", | ||
169 | + removeOriginal: true | ||
170 | + }; | ||
171 | + | ||
172 | + //$("#simple-table").tablescroller(options); | ||
173 | + }); | ||
174 | + | ||
175 | + | ||
176 | + | ||
177 | + function tosearch(){ | ||
178 | + window.top.loading.remove(); | ||
179 | + $("#Form").submit(); | ||
180 | + } | ||
181 | + | ||
182 | + $('#ids').on('click', function(){ | ||
183 | + var th_checked = $("#ids").prop('checked');//checkbox inside "TH" table header | ||
184 | + | ||
185 | + $(".table_box .table").find('tbody > tr').each(function(){ | ||
186 | + var row = this; | ||
187 | + if(th_checked) $(row).find('input[type=checkbox]').eq(0).prop('checked', true); | ||
188 | + else $(row).find('input[type=checkbox]').eq(0).prop('checked', false); | ||
189 | + }); | ||
190 | + }); | ||
191 | + | ||
192 | + function del(Id){ | ||
193 | + //var remove = new remove(); | ||
194 | + window.top.remove.init({"title":"删除","func":function(success){ | ||
195 | + if(success){ | ||
196 | + var url = "<%=basePath%>paper/delete.do?PAPER_ID="+Id+"&qingsongkao=true&tm="+new Date().getTime(); | ||
197 | + window.top.loading.show(); | ||
198 | + $.get(url,function(data){ | ||
199 | + tosearch(); | ||
200 | + }); | ||
201 | + } | ||
202 | + else{ | ||
203 | + console.log("false"); | ||
204 | + } | ||
205 | + }}); | ||
206 | + remove.show(); | ||
207 | + } | ||
208 | + | ||
209 | + $(function() { | ||
210 | + | ||
211 | + //日期框 | ||
212 | + $('.date-picker').datepicker({ | ||
213 | + autoclose: true, | ||
214 | + todayHighlight: true | ||
215 | + }); | ||
216 | + | ||
217 | + }); | ||
218 | + | ||
219 | + function deleteAll(){ | ||
220 | + window.top.remove.init({"title":"删除","func":function(success){ | ||
221 | + if(success){ | ||
222 | + var str = ''; | ||
223 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
224 | + if(document.getElementsByName('ids')[i].checked){ | ||
225 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
226 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
227 | + } | ||
228 | + } | ||
229 | + if(str==''){ | ||
230 | + | ||
231 | + }else{ | ||
232 | + $.ajax({ | ||
233 | + type: "POST", | ||
234 | + url: '<%=basePath%>paper/deleteAll.do?tm='+new Date().getTime(), | ||
235 | + data: {DATA_IDS:str}, | ||
236 | + dataType:'json', | ||
237 | + //beforeSend: validateData, | ||
238 | + cache: false, | ||
239 | + success: function(data){ | ||
240 | + $.each(data.list, function(i, list){ | ||
241 | + tosearch(); | ||
242 | + }); | ||
243 | + } | ||
244 | + }); | ||
245 | + } | ||
246 | + } | ||
247 | + else{ | ||
248 | + console.log("false"); | ||
249 | + } | ||
250 | + }}); | ||
251 | + window.top.remove.show(); | ||
252 | + } | ||
253 | + | ||
254 | + function export1(){ | ||
255 | + window.open('<%=basePath%>paper/export1?PAPER_ID=${pd.PAPER_ID}', '_blank'); | ||
256 | + } | ||
257 | + | ||
258 | +</script> | ||
259 | +</html> | ||
0 | \ No newline at end of file | 260 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/sunvote/paper/test_list2.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="fn" uri="http://java.sun.com/jsp/jstl/functions" %> | ||
5 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | ||
6 | +<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%> | ||
7 | +<% | ||
8 | + String path = request.getContextPath(); | ||
9 | + String basePath = request.getScheme() + "://" | ||
10 | + + request.getServerName() + ":" + request.getServerPort() + path + "/"; | ||
11 | +%> | ||
12 | +<html lang="zh-CN"> | ||
13 | +<head> | ||
14 | +<meta charset="utf-8"> | ||
15 | +<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
16 | +<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
17 | +<title>教育管理系统</title> | ||
18 | + | ||
19 | +<!-- Bootstrap --> | ||
20 | +<!-- <link | ||
21 | + href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" | ||
22 | + rel="stylesheet"> --> | ||
23 | + <link rel="stylesheet" href="../static/css/bootstrap.min.css" /> | ||
24 | +<link href="../static/css/teach.css" rel="stylesheet"> | ||
25 | +<link rel="stylesheet" href="../static/ace/css/datepicker.css" /> | ||
26 | +<link type="text/css" href="../static/css/tablescroller.css" rel="stylesheet" /> | ||
27 | +<script src="../static/js/loading.js"></script> | ||
28 | +<script src="../static/js/remove.js?a=1"></script> | ||
29 | + | ||
30 | + | ||
31 | +<!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> | ||
32 | +<!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> | ||
33 | +<!--[if lt IE 9]> | ||
34 | + <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> | ||
35 | + <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> | ||
36 | + <![endif]--> | ||
37 | +</head> | ||
38 | +<body> | ||
39 | + | ||
40 | + <form action="../paper/list4.do" method="post" name="Form" id="Form"> | ||
41 | + <div class="head_box"> | ||
42 | + <div class="box_header"> | ||
43 | + <div class="head_box_l"> | ||
44 | + <p> | ||
45 | + <span class="right_b"></span>试卷测验列表 | ||
46 | + </p> | ||
47 | + </div> | ||
48 | + | ||
49 | + <div class="head_box_r"> | ||
50 | + <button type="button" class="btn btn-primary" onclick="window.history.go(-1)" autocomplete="off">返回</button> | ||
51 | + <button type="button" class="btn btn-primary" onclick="export2()" autocomplete="off">导出</button> | ||
52 | + </div> | ||
53 | + | ||
54 | + <div class="clear"></div> | ||
55 | + </div> | ||
56 | + | ||
57 | + </div> | ||
58 | + <div class="table_box" style="padding:0 5%;background:#fff;"> | ||
59 | + <div style="padding:15px 0;background:#fff;" class="paper_title"> | ||
60 | + | ||
61 | + 试卷名称:${myelfun:findPaperName(pd.PAPER_ID)} | ||
62 | + </div> | ||
63 | + | ||
64 | + <table id="simple-table" | ||
65 | + class="table table-striped table-bordered table-hover" | ||
66 | + style="margin-top:0px;margin-bottom:0;"> | ||
67 | + <thead> | ||
68 | + <tr> | ||
69 | + <th><div style="width:80px">题号</div></th> | ||
70 | + <th><div style="width:80px">答案</div></th> | ||
71 | + <th><div style="width:80px">答题人数</div></th> | ||
72 | + <th><div style="width:80px">正确人数</div></th> | ||
73 | + <th><div style="width:80px">正确率</div></th> | ||
74 | + <th><div style="width:80px">满分值</div></th> | ||
75 | + <th><div style="width:80px">平均分</div></th> | ||
76 | + <c:forEach begin="0" end="${pd.MAX-1}" var="var" varStatus="vs"> | ||
77 | + <th><div style="width:80px">选 ${myelfun:jstlInt2Char(var+1)}人数</div></th> | ||
78 | + <th><div style="width:80px">选${myelfun:jstlInt2Char(var+1)}比例</div></th> | ||
79 | + </c:forEach> | ||
80 | + <th><div style="width:80px">漏选人数</div></th> | ||
81 | + <th><div style="width:80px">漏选比例</div></th> | ||
82 | + | ||
83 | + </tr> | ||
84 | + </thead> | ||
85 | + <tbody> | ||
86 | + <c:choose> | ||
87 | + <c:when test="${not empty varList}"> | ||
88 | + <c:forEach items="${varList}" var="var" varStatus="vs"> | ||
89 | + <tr> | ||
90 | + | ||
91 | + <td>${var.QUESTION_RANK}</td> | ||
92 | + <td>${var.ANSWER}</td> | ||
93 | + <td >${var.ANSWERNUM}</td> | ||
94 | + <td >${var.RIGHTNUM}</td> | ||
95 | + <td > | ||
96 | + <fmt:formatNumber type="number" | ||
97 | + value="${var.ANSWERNUM == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM * 100)}" | ||
98 | + maxFractionDigits="2" />% | ||
99 | + </td> | ||
100 | + <td >${var.QUESTION_SCORE}</td> | ||
101 | + <td > | ||
102 | + <fmt:formatNumber type="number" | ||
103 | + value="${var.ANSWERNUM == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM)*var.QUESTION_SCORE}" | ||
104 | + maxFractionDigits="2" /> | ||
105 | + </td> | ||
106 | + <c:forEach items="${var.optin_info}" begin="0" end="${pd.MAX}" var="var1" varStatus="vs"> | ||
107 | + <td>${var1}</td> | ||
108 | + <td> | ||
109 | + <fmt:formatNumber type="number" | ||
110 | + value="${var.ANSWERNUM == 0 ? 0: (var1 / var.ANSWERNUM * 100)}" | ||
111 | + maxFractionDigits="2" />% | ||
112 | + </td> | ||
113 | + </c:forEach> | ||
114 | + | ||
115 | + </tr> | ||
116 | + | ||
117 | + </c:forEach> | ||
118 | + </c:when> | ||
119 | + <c:otherwise> | ||
120 | + <tr class="main_info"> | ||
121 | + <td colspan="100" class="center" >没有相关数据</td> | ||
122 | + </tr> | ||
123 | + </c:otherwise> | ||
124 | + </c:choose> | ||
125 | + </tbody> | ||
126 | + </table> | ||
127 | + | ||
128 | + | ||
129 | + | ||
130 | + <div class="footer"> | ||
131 | + <!-- <div class="creat"> | ||
132 | + <input type="button" onclick="parent.$('.title_time').modal('show');" value="新建试卷" /> | ||
133 | + </div> | ||
134 | + <div class="removeAll"> | ||
135 | + <input type="button" onclick="deleteAll()" value="批量删除" /> | ||
136 | + </div> --> | ||
137 | + <div class="page_box"> | ||
138 | + | ||
139 | + <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div> | ||
140 | + </div> | ||
141 | + </div> | ||
142 | + </div> | ||
143 | + </form> | ||
144 | +</body> | ||
145 | + | ||
146 | +<%@ include file="../../system/index/foot2.jsp"%> | ||
147 | +<script src="../static/ace/js/date-time/bootstrap-datepicker.js"></script> | ||
148 | + | ||
149 | + <script language="javascript" src="../static/js/tablescroller.js"></script> | ||
150 | + <script language="javascript" src="../static/js/tablescroller.jquery.js"></script> | ||
151 | +<script type="text/javascript"> | ||
152 | + | ||
153 | + $(document).ready(function(){ | ||
154 | + window.top.loading.remove(); | ||
155 | + $(".table_box").css("padding-top",$(".head_box").height()); | ||
156 | + | ||
157 | + var _heigh = $('#mainFrame', parent.document).height()-150; | ||
158 | + | ||
159 | + var options = { | ||
160 | + width: '100%', | ||
161 | + height: _heigh, | ||
162 | + pinnedRows: 1, | ||
163 | + pinnedCols: 5, | ||
164 | + container: "#scrollableTable", | ||
165 | + removeOriginal: true | ||
166 | + }; | ||
167 | + | ||
168 | + $("#simple-table").tablescroller(options); | ||
169 | + }); | ||
170 | + | ||
171 | + | ||
172 | + | ||
173 | + function tosearch(){ | ||
174 | + window.top.loading.remove(); | ||
175 | + $("#Form").submit(); | ||
176 | + } | ||
177 | + | ||
178 | + $('#ids').on('click', function(){ | ||
179 | + var th_checked = $("#ids").prop('checked');//checkbox inside "TH" table header | ||
180 | + | ||
181 | + $(".table_box .table").find('tbody > tr').each(function(){ | ||
182 | + var row = this; | ||
183 | + if(th_checked) $(row).find('input[type=checkbox]').eq(0).prop('checked', true); | ||
184 | + else $(row).find('input[type=checkbox]').eq(0).prop('checked', false); | ||
185 | + }); | ||
186 | + }); | ||
187 | + | ||
188 | + function del(Id){ | ||
189 | + //var remove = new remove(); | ||
190 | + window.top.remove.init({"title":"删除","func":function(success){ | ||
191 | + if(success){ | ||
192 | + var url = "<%=basePath%>paper/delete.do?PAPER_ID="+Id+"&qingsongkao=true&tm="+new Date().getTime(); | ||
193 | + window.top.loading.show(); | ||
194 | + $.get(url,function(data){ | ||
195 | + tosearch(); | ||
196 | + }); | ||
197 | + } | ||
198 | + else{ | ||
199 | + console.log("false"); | ||
200 | + } | ||
201 | + }}); | ||
202 | + remove.show(); | ||
203 | + } | ||
204 | + | ||
205 | + $(function() { | ||
206 | + | ||
207 | + //日期框 | ||
208 | + $('.date-picker').datepicker({ | ||
209 | + autoclose: true, | ||
210 | + todayHighlight: true | ||
211 | + }); | ||
212 | + | ||
213 | + }); | ||
214 | + | ||
215 | + function deleteAll(){ | ||
216 | + window.top.remove.init({"title":"删除","func":function(success){ | ||
217 | + if(success){ | ||
218 | + var str = ''; | ||
219 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
220 | + if(document.getElementsByName('ids')[i].checked){ | ||
221 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
222 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
223 | + } | ||
224 | + } | ||
225 | + if(str==''){ | ||
226 | + | ||
227 | + }else{ | ||
228 | + $.ajax({ | ||
229 | + type: "POST", | ||
230 | + url: '<%=basePath%>paper/deleteAll.do?tm='+new Date().getTime(), | ||
231 | + data: {DATA_IDS:str}, | ||
232 | + dataType:'json', | ||
233 | + //beforeSend: validateData, | ||
234 | + cache: false, | ||
235 | + success: function(data){ | ||
236 | + $.each(data.list, function(i, list){ | ||
237 | + tosearch(); | ||
238 | + }); | ||
239 | + } | ||
240 | + }); | ||
241 | + } | ||
242 | + } | ||
243 | + else{ | ||
244 | + console.log("false"); | ||
245 | + } | ||
246 | + }}); | ||
247 | + window.top.remove.show(); | ||
248 | + } | ||
249 | + function export2(){ | ||
250 | + window.open("<%=basePath%>paper/export2?PAPER_ID=${pd.PAPER_ID}&TESTPAPER_ID=${pd.TESTPAPER_ID}","_blank"); | ||
251 | + } | ||
252 | + | ||
253 | +</script> | ||
254 | +</html> | ||
0 | \ No newline at end of file | 255 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/sunvote/subject/subject_list2.jsp
@@ -16,7 +16,6 @@ | @@ -16,7 +16,6 @@ | ||
16 | <link rel="stylesheet" href="static/ace/css/chosen.css" /> | 16 | <link rel="stylesheet" href="static/ace/css/chosen.css" /> |
17 | <!-- jsp文件头和头部 --> | 17 | <!-- jsp文件头和头部 --> |
18 | 18 | ||
19 | -<link href="../static/css/teach.css" rel="stylesheet"> | ||
20 | <!-- 日期框 --> | 19 | <!-- 日期框 --> |
21 | <link rel="stylesheet" href="static/ace/css/datepicker.css" /> | 20 | <link rel="stylesheet" href="static/ace/css/datepicker.css" /> |
22 | <!-- <link | 21 | <!-- <link |
@@ -24,6 +23,10 @@ | @@ -24,6 +23,10 @@ | ||
24 | rel="stylesheet"> --> | 23 | rel="stylesheet"> --> |
25 | <link rel="stylesheet" href="static/css/bootstrap.min.css" /> | 24 | <link rel="stylesheet" href="static/css/bootstrap.min.css" /> |
26 | <link href="static/css/teach.css" rel="stylesheet"> | 25 | <link href="static/css/teach.css" rel="stylesheet"> |
26 | +<style type="text/css"> | ||
27 | + #remove{ | ||
28 | + background:#ccc} | ||
29 | +</style> | ||
27 | </head> | 30 | </head> |
28 | <body class="no-skin"> | 31 | <body class="no-skin"> |
29 | <form action="subject/listcs.do" method="post" name="Form" id="Form"> | 32 | <form action="subject/listcs.do" method="post" name="Form" id="Form"> |
@@ -68,7 +71,7 @@ | @@ -68,7 +71,7 @@ | ||
68 | <c:when test="${not empty varList}"> | 71 | <c:when test="${not empty varList}"> |
69 | <c:forEach items="${varList}" var="var" varStatus="vs"> | 72 | <c:forEach items="${varList}" var="var" varStatus="vs"> |
70 | <tr> | 73 | <tr> |
71 | - <td><input type="checkbox" name='ids' id="ids" | 74 | + <td><input type="checkbox" name='ids' class="ids" |
72 | value="${var.ID}" />${vs.index+1}</td> | 75 | value="${var.ID}" />${vs.index+1}</td> |
73 | <td class='center'>${var.CNAME}</td> | 76 | <td class='center'>${var.CNAME}</td> |
74 | <td class='center'>${var.ENAME}</td> | 77 | <td class='center'>${var.ENAME}</td> |
@@ -91,7 +94,7 @@ | @@ -91,7 +94,7 @@ | ||
91 | <input type="button" onclick="add()" value="添加科目" /> | 94 | <input type="button" onclick="add()" value="添加科目" /> |
92 | </div> | 95 | </div> |
93 | <div class="removeAll"> | 96 | <div class="removeAll"> |
94 | - <input type="button" onclick="del()" value="移除科目" /> | 97 | + <input type="button" onclick="del()" disabled id="remove" value="移除科目" /> |
95 | </div> | 98 | </div> |
96 | <div class="page_box"> | 99 | <div class="page_box"> |
97 | 100 | ||
@@ -179,6 +182,32 @@ | @@ -179,6 +182,32 @@ | ||
179 | }); | 182 | }); |
180 | window.top.modal.show(); | 183 | window.top.modal.show(); |
181 | } | 184 | } |
185 | + $('#ids').on('click', function(){ | ||
186 | + var th_checked = $("#ids").prop('checked');//checkbox inside "TH" table header | ||
187 | + | ||
188 | + $(".table_box .table").find('tbody > tr').each(function(){ | ||
189 | + var row = this; | ||
190 | + if(th_checked) $(row).find('input[type=checkbox]').eq(0).prop('checked', true); | ||
191 | + else $(row).find('input[type=checkbox]').eq(0).prop('checked', false); | ||
192 | + }); | ||
193 | + }); | ||
194 | + | ||
195 | + $("input[type=checkbox]").on('click',function(){ | ||
196 | + var str = ''; | ||
197 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
198 | + if(document.getElementsByName('ids')[i].checked){ | ||
199 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
200 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
201 | + } | ||
202 | + } | ||
203 | + if(str==''){ | ||
204 | + $("#remove").attr("disabled","disabled"); | ||
205 | + $("#remove").css("background","#ccc"); | ||
206 | + }else{ | ||
207 | + $("#remove").removeAttr("disabled"); | ||
208 | + $("#remove").css("background","#f29c9f"); | ||
209 | + } | ||
210 | + }) | ||
182 | </script> | 211 | </script> |
183 | 212 | ||
184 | 213 |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp
@@ -27,6 +27,11 @@ | @@ -27,6 +27,11 @@ | ||
27 | <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> | 27 | <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> |
28 | <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> | 28 | <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> |
29 | <![endif]--> | 29 | <![endif]--> |
30 | + <style> | ||
31 | + .menu_2 .active{ | ||
32 | + background:#000; | ||
33 | + } | ||
34 | +</style> | ||
30 | </head> | 35 | </head> |
31 | <body> | 36 | <body> |
32 | <div class="header"> | 37 | <div class="header"> |
@@ -284,6 +289,10 @@ | @@ -284,6 +289,10 @@ | ||
284 | if (defaultUrl != '' && defaultUrl != '') { | 289 | if (defaultUrl != '' && defaultUrl != '') { |
285 | $("#mainFrame").attr('src', defaultUrl); | 290 | $("#mainFrame").attr('src', defaultUrl); |
286 | } | 291 | } |
292 | + $(".menu_2 li").click(function(){ | ||
293 | + $(".active").removeClass("active"); | ||
294 | + $(this).addClass("active"); | ||
295 | + }) | ||
287 | </script> | 296 | </script> |
288 | </body> | 297 | </body> |
289 | </html> | 298 | </html> |
290 | \ No newline at end of file | 299 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_report_1.jsp
@@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
82 | <th class="center"><div style="width:80px;">课程总分</div></th> | 82 | <th class="center"><div style="width:80px;">课程总分</div></th> |
83 | <c:forEach items="${testpaperList}" var="var" varStatus="vs"> | 83 | <c:forEach items="${testpaperList}" var="var" varStatus="vs"> |
84 | <th class="center kc"><a | 84 | <th class="center kc"><a |
85 | - onclick="paper('${info.CLASS_ID}','${var.TESTPAPER_ID}');"><div style="width:180px; margin: 0 auto;cursor:hand" class="font">${var.NAME}</br><span>${var.CREATE_DATE}</span></div></a></th> | 85 | + onclick="paper('${info.CLASS_ID}','${var.TESTPAPER_ID}');"><div style="width:180px; margin: 0 auto;cursor:hand" class="font"><div style="width:100%;overflow:hidden;text-overflow:ellipsis;white-space: nowrap;">${var.NAME}</div><span>${var.CREATE_DATE}</span></div></a></th> |
86 | </c:forEach> | 86 | </c:forEach> |
87 | </tr> | 87 | </tr> |
88 | </thead> | 88 | </thead> |
@@ -239,6 +239,16 @@ | @@ -239,6 +239,16 @@ | ||
239 | var url = "<%=basePath%>report/report.do?classid=${info.CLASS_ID}" ; | 239 | var url = "<%=basePath%>report/report.do?classid=${info.CLASS_ID}" ; |
240 | var startDate = $("#lastStart").val(); | 240 | var startDate = $("#lastStart").val(); |
241 | var endDate = $("#lastEnd").val(); | 241 | var endDate = $("#lastEnd").val(); |
242 | + var temp=""; | ||
243 | + var sd = parseInt(startDate.replace(/-/g,"")); | ||
244 | + var ed = parseInt(endDate.replace(/-/g,"")); | ||
245 | + if(sd>ed){ | ||
246 | + temp = startDate; | ||
247 | + startDate = endDate; | ||
248 | + endDate = temp; | ||
249 | + } | ||
250 | + $("#lastStart").val(startDate); | ||
251 | + $("#lastEnd").val(endDate); | ||
242 | var subject_id = $("#SUBJECT_ID").val(); | 252 | var subject_id = $("#SUBJECT_ID").val(); |
243 | url = url + "&start_date=" + startDate ; | 253 | url = url + "&start_date=" + startDate ; |
244 | if(endDate != null){ | 254 | if(endDate != null){ |
WebRoot/WEB-INF/tld/elfun.tld
@@ -146,7 +146,7 @@ | @@ -146,7 +146,7 @@ | ||
146 | <description>数字转字符</description><!-- 对该标签的说明 --> | 146 | <description>数字转字符</description><!-- 对该标签的说明 --> |
147 | <name>jstlInt2Char</name><!-- 定义标签名,放在短标签之后 --> | 147 | <name>jstlInt2Char</name><!-- 定义标签名,放在短标签之后 --> |
148 | <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | 148 | <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> |
149 | - <function-signature>java.lang.String findSoftwareName(int)</function-signature><!-- 标签处理域值的具体的类方法 --> | 149 | + <function-signature>java.lang.String jstlInt2Char(int)</function-signature><!-- 标签处理域值的具体的类方法 --> |
150 | <example>${myelfun:jstlInt2Char(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | 150 | <example>${myelfun:jstlInt2Char(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> |
151 | </function> | 151 | </function> |
152 | 152 |
WebRoot/static/files/Template.xls
No preview for this file type
WebRoot/static/files/Template1.xls
No preview for this file type
WebRoot/static/images/fail.png
0 → 100644
30.2 KB
resources/mybatis1/sunvote/StudentMapper.xml
@@ -108,6 +108,16 @@ | @@ -108,6 +108,16 @@ | ||
108 | NAME = #{NAME} | 108 | NAME = #{NAME} |
109 | </select> | 109 | </select> |
110 | 110 | ||
111 | + <!-- 通过ID获取数据 --> | ||
112 | + <select id="countByClassId" parameterType="String" resultType="Integer"> | ||
113 | + select | ||
114 | + count(0) | ||
115 | + from | ||
116 | + <include refid="tableName"></include> | ||
117 | + where | ||
118 | + CLASS_ID = #{classid} | ||
119 | + </select> | ||
120 | + | ||
111 | <!-- 列表 --> | 121 | <!-- 列表 --> |
112 | <select id="datalistPage" parameterType="page" resultType="pd"> | 122 | <select id="datalistPage" parameterType="page" resultType="pd"> |
113 | select | 123 | select |
src/com/fh/controller/api/V1.java
@@ -551,10 +551,13 @@ public class V1 extends BaseController { | @@ -551,10 +551,13 @@ public class V1 extends BaseController { | ||
551 | PageData p = teacherService.findById2(pd.get("USER_ID").toString()); | 551 | PageData p = teacherService.findById2(pd.get("USER_ID").toString()); |
552 | if(p != null){ | 552 | if(p != null){ |
553 | pd.put("SCHOOL_ID", p.get("SCHOOL_ID")); | 553 | pd.put("SCHOOL_ID", p.get("SCHOOL_ID")); |
554 | - pd.remove("USER_ID"); | 554 | + //pd.remove("USER_ID"); |
555 | }else{ | 555 | }else{ |
556 | pd.put("SCHOOL_ID", ""); | 556 | pd.put("SCHOOL_ID", ""); |
557 | } | 557 | } |
558 | + if(pd.getString("PAPER_TYPE").equals("2")){ | ||
559 | + pd.remove("USER_ID"); | ||
560 | + } | ||
558 | List<PageData> pageList = paperService.listAllByType(pd); | 561 | List<PageData> pageList = paperService.listAllByType(pd); |
559 | res.setData(pageList); | 562 | res.setData(pageList); |
560 | } else { | 563 | } else { |
src/com/fh/controller/sunvote/Myelfun.java
src/com/fh/controller/sunvote/paper/PaperController.java
@@ -2,8 +2,12 @@ package com.fh.controller.sunvote.paper; | @@ -2,8 +2,12 @@ package com.fh.controller.sunvote.paper; | ||
2 | 2 | ||
3 | import java.io.PrintWriter; | 3 | import java.io.PrintWriter; |
4 | import java.text.DateFormat; | 4 | import java.text.DateFormat; |
5 | +import java.text.DecimalFormat; | ||
5 | import java.text.SimpleDateFormat; | 6 | import java.text.SimpleDateFormat; |
6 | import java.util.ArrayList; | 7 | import java.util.ArrayList; |
8 | +import java.util.Arrays; | ||
9 | +import java.util.Collections; | ||
10 | +import java.util.Comparator; | ||
7 | import java.util.Date; | 11 | import java.util.Date; |
8 | import java.util.HashMap; | 12 | import java.util.HashMap; |
9 | import java.util.List; | 13 | import java.util.List; |
@@ -20,9 +24,12 @@ import org.springframework.web.bind.annotation.RequestMapping; | @@ -20,9 +24,12 @@ import org.springframework.web.bind.annotation.RequestMapping; | ||
20 | import org.springframework.web.bind.annotation.ResponseBody; | 24 | import org.springframework.web.bind.annotation.ResponseBody; |
21 | import org.springframework.web.servlet.ModelAndView; | 25 | import org.springframework.web.servlet.ModelAndView; |
22 | 26 | ||
27 | +import com.alibaba.druid.support.json.JSONUtils; | ||
23 | import com.fh.bean.Paper; | 28 | import com.fh.bean.Paper; |
24 | import com.fh.bean.Question; | 29 | import com.fh.bean.Question; |
30 | +import com.fh.controller.api.ResponseGson; | ||
25 | import com.fh.controller.base.BaseController; | 31 | import com.fh.controller.base.BaseController; |
32 | +import com.fh.controller.sunvote.Myelfun; | ||
26 | import com.fh.entity.Page; | 33 | import com.fh.entity.Page; |
27 | import com.fh.entity.system.User; | 34 | import com.fh.entity.system.User; |
28 | import com.fh.service.api.V1Manager; | 35 | import com.fh.service.api.V1Manager; |
@@ -31,6 +38,12 @@ import com.fh.service.sunvote.paper.PaperManager; | @@ -31,6 +38,12 @@ import com.fh.service.sunvote.paper.PaperManager; | ||
31 | import com.fh.service.sunvote.paperquestion.PaperQuestionManager; | 38 | import com.fh.service.sunvote.paperquestion.PaperQuestionManager; |
32 | import com.fh.service.sunvote.question.QuestionManager; | 39 | import com.fh.service.sunvote.question.QuestionManager; |
33 | import com.fh.service.sunvote.schoolgradesubject.SchoolGradeSubjectManager; | 40 | import com.fh.service.sunvote.schoolgradesubject.SchoolGradeSubjectManager; |
41 | +import com.fh.service.sunvote.sclass.SClassManager; | ||
42 | +import com.fh.service.sunvote.sclass.impl.SClassService; | ||
43 | +import com.fh.service.sunvote.student.StudentManager; | ||
44 | +import com.fh.service.sunvote.studenttest.StudentTestManager; | ||
45 | +import com.fh.service.sunvote.testpaper.TestPaperManager; | ||
46 | +import com.fh.service.sunvote.testpaperinfo.TestPaperInfoManager; | ||
34 | import com.fh.util.AppUtil; | 47 | import com.fh.util.AppUtil; |
35 | import com.fh.util.Const; | 48 | import com.fh.util.Const; |
36 | import com.fh.util.Jurisdiction; | 49 | import com.fh.util.Jurisdiction; |
@@ -49,6 +62,15 @@ public class PaperController extends BaseController { | @@ -49,6 +62,15 @@ public class PaperController extends BaseController { | ||
49 | @Resource(name="paperService") | 62 | @Resource(name="paperService") |
50 | private PaperManager paperService; | 63 | private PaperManager paperService; |
51 | 64 | ||
65 | + @Resource(name="testpaperService") | ||
66 | + private TestPaperManager testpaperService; | ||
67 | + | ||
68 | + @Resource(name="testpaperinfoService") | ||
69 | + private TestPaperInfoManager testpaperinfoService; | ||
70 | + | ||
71 | + @Resource(name="studentService") | ||
72 | + private StudentManager stundentService; | ||
73 | + | ||
52 | @Resource(name="paperquestionService") | 74 | @Resource(name="paperquestionService") |
53 | private PaperQuestionManager paperquestionService; | 75 | private PaperQuestionManager paperquestionService; |
54 | 76 | ||
@@ -64,6 +86,12 @@ public class PaperController extends BaseController { | @@ -64,6 +86,12 @@ public class PaperController extends BaseController { | ||
64 | @Resource(name="pagetemplateService") | 86 | @Resource(name="pagetemplateService") |
65 | private PageTemplateManager pagetemplateService; | 87 | private PageTemplateManager pagetemplateService; |
66 | 88 | ||
89 | + @Resource(name="studenttestService") | ||
90 | + private StudentTestManager studenttestService; | ||
91 | + | ||
92 | + @Resource(name="sclassService") | ||
93 | + private SClassManager sclassService; | ||
94 | + | ||
67 | /**保存 | 95 | /**保存 |
68 | * @param | 96 | * @param |
69 | * @throws Exception | 97 | * @throws Exception |
@@ -164,6 +192,403 @@ public class PaperController extends BaseController { | @@ -164,6 +192,403 @@ public class PaperController extends BaseController { | ||
164 | return mv; | 192 | return mv; |
165 | } | 193 | } |
166 | 194 | ||
195 | + @RequestMapping(value="/paperRep") | ||
196 | + public ModelAndView paperRep() throws Exception{ | ||
197 | + ModelAndView mv = this.getModelAndView(); | ||
198 | + PageData pd = new PageData(); | ||
199 | + List<PageData> templist = new ArrayList<PageData>(); | ||
200 | + PageData saveData = new PageData(); | ||
201 | + | ||
202 | + ResponseGson<PageData> res = new ResponseGson(); | ||
203 | + pd = this.getPageData(); | ||
204 | + if(pd.containsKey("PAPER_ID")){ | ||
205 | + List<PageData> list = testpaperService.listAll(pd); | ||
206 | + | ||
207 | + pd.put("testpaperlist", list); | ||
208 | + for(int i = 0 ;i<list.size();i++){ | ||
209 | + PageData data = new PageData(); | ||
210 | + | ||
211 | + PageData pdtemp = new PageData(); | ||
212 | + pdtemp.put("CLASS_ID", list.get(i).get("SCLASS_ID").toString()); | ||
213 | + List<PageData> studentlist = stundentService.listAllClass(pdtemp); | ||
214 | + data.put("testpaper_id", list.get(i).get("TESTPAPER_ID")); | ||
215 | + data.put("student_num", studentlist.size()); | ||
216 | + data.put("creat_time", list.get(i).get("CREATE_DATE")); | ||
217 | + data.put("avg_score", list.get(i).get("AVG_SCORE")); | ||
218 | + data.put("class_id", list.get(i).get("SCLASS_ID")); | ||
219 | + pdtemp.put("TEST_ID", list.get(i).get("TESTPAPER_ID")); | ||
220 | + List<PageData> l = studenttestService.listAll(pdtemp); | ||
221 | + | ||
222 | + Integer you = 0; | ||
223 | + Integer liang = 0; | ||
224 | + Integer jige = 0; | ||
225 | + Integer difen = 0; | ||
226 | + Float total = Float.valueOf(list.get(i).get("TOTAL_SCORE").toString()); | ||
227 | + | ||
228 | + for(int j = 0; j<l.size();j++){ | ||
229 | + Float score = Float.valueOf(l.get(j).get("SCORE").toString()); | ||
230 | + if(total != 0){ | ||
231 | + if(score/total>=0.8){ | ||
232 | + you++; | ||
233 | + }else if(score/total>=0.7){ | ||
234 | + liang++; | ||
235 | + }else if(score/total>=0.6){ | ||
236 | + jige++; | ||
237 | + }else if(score/total<0.3){ | ||
238 | + difen++; | ||
239 | + } | ||
240 | + } | ||
241 | + | ||
242 | + } | ||
243 | + | ||
244 | + data.put("you",you); | ||
245 | + data.put("liang",liang); | ||
246 | + data.put("jige",jige); | ||
247 | + data.put("difen",difen); | ||
248 | + | ||
249 | + templist.add(data); | ||
250 | + } | ||
251 | + } | ||
252 | + saveData.put("list", templist); | ||
253 | + | ||
254 | + mv.setViewName("sunvote/paper/test_list1"); | ||
255 | + mv.addObject("varList", templist); | ||
256 | + mv.addObject("pd",pd); | ||
257 | + res.setData(saveData); | ||
258 | + return mv; | ||
259 | + } | ||
260 | + | ||
261 | + @RequestMapping(value="/export1") | ||
262 | + public ModelAndView export1() throws Exception{ | ||
263 | + ModelAndView mv = this.getModelAndView(); | ||
264 | + PageData pd = new PageData(); | ||
265 | + List<PageData> templist = new ArrayList<PageData>(); | ||
266 | + PageData saveData = new PageData(); | ||
267 | + | ||
268 | + ResponseGson<PageData> res = new ResponseGson(); | ||
269 | + pd = this.getPageData(); | ||
270 | + if(pd.containsKey("PAPER_ID")){ | ||
271 | + List<PageData> list = testpaperService.listAll(pd); | ||
272 | + | ||
273 | + pd.put("testpaperlist", list); | ||
274 | + for(int i = 0 ;i<list.size();i++){ | ||
275 | + PageData data = new PageData(); | ||
276 | + | ||
277 | + PageData pdtemp = new PageData(); | ||
278 | + pdtemp.put("CLASS_ID", list.get(i).get("SCLASS_ID").toString()); | ||
279 | + List<PageData> studentlist = stundentService.listAllClass(pdtemp); | ||
280 | + data.put("testpaper_id", list.get(i).get("TESTPAPER_ID")); | ||
281 | + data.put("student_num", studentlist.size()); | ||
282 | + data.put("creat_time", list.get(i).get("CREATE_DATE")); | ||
283 | + data.put("avg_score", list.get(i).get("AVG_SCORE")); | ||
284 | + data.put("class_id", list.get(i).get("SCLASS_ID")); | ||
285 | + pdtemp.put("TEST_ID", list.get(i).get("TESTPAPER_ID")); | ||
286 | + List<PageData> l = studenttestService.listAll(pdtemp); | ||
287 | + | ||
288 | + Integer you = 0; | ||
289 | + Integer liang = 0; | ||
290 | + Integer jige = 0; | ||
291 | + Integer difen = 0; | ||
292 | + Float total = Float.valueOf(list.get(i).get("TOTAL_SCORE").toString()); | ||
293 | + | ||
294 | + for(int j = 0; j<l.size();j++){ | ||
295 | + Float score = Float.valueOf(l.get(j).get("SCORE").toString()); | ||
296 | + if(total != 0){ | ||
297 | + if(score/total>=0.8){ | ||
298 | + you++; | ||
299 | + }else if(score/total>=0.7){ | ||
300 | + liang++; | ||
301 | + }else if(score/total>=0.6){ | ||
302 | + jige++; | ||
303 | + }else if(score/total<0.3){ | ||
304 | + difen++; | ||
305 | + } | ||
306 | + } | ||
307 | + | ||
308 | + } | ||
309 | + | ||
310 | + data.put("you",you); | ||
311 | + data.put("liang",liang); | ||
312 | + data.put("jige",jige); | ||
313 | + data.put("difen",difen); | ||
314 | + | ||
315 | + templist.add(data); | ||
316 | + } | ||
317 | + } | ||
318 | + | ||
319 | + Map<String,Object> dataMap = new HashMap<String,Object>(); | ||
320 | + List<String> titles = new ArrayList<String>(); | ||
321 | + titles.add("序号"); //1 | ||
322 | + titles.add("班级名称"); //2 | ||
323 | + titles.add("考试时间"); //3 | ||
324 | + titles.add("平均分"); //4 | ||
325 | + titles.add("班级总人数"); //5 | ||
326 | + titles.add("优秀人数"); //6 | ||
327 | + titles.add("优秀率"); //7 | ||
328 | + titles.add("良好人数"); //8 | ||
329 | + titles.add("良好率"); //9 | ||
330 | + titles.add("及格人数"); //10 | ||
331 | + titles.add("及格率"); //11 | ||
332 | + titles.add("低分人数"); //12 | ||
333 | + titles.add("低分率"); //13 | ||
334 | + dataMap.put("titles", titles); | ||
335 | + List<PageData> varOList = templist; | ||
336 | + List<PageData> varList = new ArrayList<PageData>(); | ||
337 | + DecimalFormat decimalFormat=new DecimalFormat("0.00"); | ||
338 | + for(int i=0;i<varOList.size();i++){ | ||
339 | + PageData vpd = new PageData(); | ||
340 | + vpd.put("ID", varOList.get(i).getString("class_id")); | ||
341 | + PageData c = sclassService.findById(vpd); | ||
342 | + vpd.remove("ID"); | ||
343 | + | ||
344 | + Integer you = Integer.valueOf(varOList.get(i).getString("you")); | ||
345 | + Integer liang = Integer.valueOf(varOList.get(i).getString("liang")); | ||
346 | + Integer jige = Integer.valueOf(varOList.get(i).getString("jige")); | ||
347 | + Integer difen = Integer.valueOf(varOList.get(i).getString("difen")); | ||
348 | + Integer student_num = Integer.valueOf(varOList.get(i).getString("student_num")); | ||
349 | + | ||
350 | + | ||
351 | + vpd.put("var1", i+1); //1 | ||
352 | + vpd.put("var2", c.getString("CLASS_NAME")); //2 | ||
353 | + vpd.put("var3", varOList.get(i).getString("creat_time")); //3 | ||
354 | + vpd.put("var4", varOList.get(i).getString("avg_score")); //4 | ||
355 | + vpd.put("var5", student_num); //5 | ||
356 | + vpd.put("var6", you); //6 | ||
357 | + vpd.put("var7", student_num==0?0:decimalFormat.format(you*100/student_num)+"%"); //7 | ||
358 | + vpd.put("var8", liang); //8 | ||
359 | + vpd.put("var9", student_num==0?0:decimalFormat.format(liang*100/student_num)+"%"); //9 | ||
360 | + vpd.put("var10", jige); //10 | ||
361 | + vpd.put("var11", student_num==0?0:decimalFormat.format(jige*100/student_num)+"%"); //11 | ||
362 | + vpd.put("var12", difen); //12 | ||
363 | + vpd.put("var13", student_num==0?0:decimalFormat.format(difen*100/student_num)+"%"); //13 | ||
364 | + varList.add(vpd); | ||
365 | + } | ||
366 | + dataMap.put("varList", varList); | ||
367 | + ObjectExcelView erv = new ObjectExcelView(); | ||
368 | + mv = new ModelAndView(erv,dataMap); | ||
369 | + return mv; | ||
370 | + } | ||
371 | + @RequestMapping(value="/paperRep2") | ||
372 | + public ModelAndView paperRep2() throws Exception{ | ||
373 | + ModelAndView mv = this.getModelAndView(); | ||
374 | + PageData pd = new PageData(); | ||
375 | + List<PageData> templist = new ArrayList<PageData>(); | ||
376 | + PageData saveData = new PageData(); | ||
377 | + | ||
378 | + ResponseGson<PageData> res = new ResponseGson(); | ||
379 | + pd = this.getPageData(); | ||
380 | + if(pd.containsKey("PAPER_ID")){ | ||
381 | + List<PageData> list = paperquestionService.listAll(pd); | ||
382 | + List<PageData> test = new ArrayList<PageData>(); | ||
383 | + int onum[] = new int[list.size()]; | ||
384 | + | ||
385 | + for(int i = 0;i<list.size();i++){ | ||
386 | + PageData temp = new PageData(); | ||
387 | + String questionid = list.get(i).get("QUESTION_ID").toString(); | ||
388 | + | ||
389 | + if(list.get(i).get("NO_NAME")==null||list.get(i).get("NO_NAME").toString().isEmpty()){ | ||
390 | + continue; | ||
391 | + } | ||
392 | + Float que_score = Float.valueOf(list.get(i).get("SCORE").toString()); | ||
393 | + temp.put("QUESTION_ID", questionid); | ||
394 | + PageData question = questionService.findById(temp); | ||
395 | + temp.put("ANSWER",question.get("ANSWER").toString()); | ||
396 | + temp.put("QUESTION_RANK", list.get(i).get("RANK").toString()); | ||
397 | + temp.put("QUESTION_SCORE", que_score); | ||
398 | + | ||
399 | + PageData que = questionService.findById(temp); | ||
400 | + Integer option_num = 0; | ||
401 | + if(!que.get("OPTION_NUM").toString().isEmpty()){ | ||
402 | + option_num = Integer.valueOf(que.get("OPTION_NUM").toString()); | ||
403 | + onum[i]=option_num; | ||
404 | + } | ||
405 | + | ||
406 | + temp.put("TEST_ID", pd.get("TESTPAPER_ID")); | ||
407 | + List<PageData> queInfo = testpaperinfoService.listTestPaperQuestionIDinfo(temp); | ||
408 | + int answer[] = new int[option_num+1]; | ||
409 | + int right = 0; | ||
410 | + for(int j=0;j<queInfo.size();j++){ | ||
411 | + if(queInfo.get(j).get("RIGHT")!=null&&!queInfo.get(j).get("RIGHT").toString().isEmpty()){ | ||
412 | + if(queInfo.get(j).get("RIGHT").toString().equals("1")){ | ||
413 | + right++; | ||
414 | + } | ||
415 | + } | ||
416 | + if(queInfo.get(j).get("ANSWER")!=null&&!queInfo.get(j).get("ANSWER").toString().isEmpty()){ | ||
417 | + for(int o=0;o<option_num;o++ ){ | ||
418 | + String s = String.valueOf((char)(65+o)) ; | ||
419 | + if(queInfo.get(j).get("ANSWER").toString().equals(s)){ | ||
420 | + answer[o]++; | ||
421 | + } | ||
422 | + } | ||
423 | + } | ||
424 | + else{ | ||
425 | + answer[option_num]++; | ||
426 | + } | ||
427 | + } | ||
428 | + temp.put("RIGHTNUM", right); | ||
429 | + temp.put("ANSWERNUM",queInfo.size()); | ||
430 | + temp.put("optin_info", answer); | ||
431 | + templist.add(temp); | ||
432 | + } | ||
433 | + Arrays.sort(onum); | ||
434 | + int max = onum[onum.length-1]; | ||
435 | + pd.put("MAX",max); | ||
436 | + } | ||
437 | + | ||
438 | + Collections.sort(templist,new Comparator<PageData>(){ | ||
439 | + | ||
440 | + @Override | ||
441 | + public int compare(PageData o1, PageData o2) { | ||
442 | + Integer o1GetScore = Integer.valueOf(o1.getString("QUESTION_RANK")); | ||
443 | + Integer o2GetScore = Integer.valueOf(o2.getString("QUESTION_RANK")); | ||
444 | + return o1GetScore.compareTo(o2GetScore); | ||
445 | + } | ||
446 | + | ||
447 | + }); | ||
448 | + mv.setViewName("sunvote/paper/test_list2"); | ||
449 | + mv.addObject("varList", templist); | ||
450 | + mv.addObject("pd",pd); | ||
451 | + res.setData(saveData); | ||
452 | + return mv; | ||
453 | + } | ||
454 | + | ||
455 | + @RequestMapping(value="/export2") | ||
456 | + public ModelAndView export2() throws Exception{ | ||
457 | + ModelAndView mv = this.getModelAndView(); | ||
458 | + PageData pd = new PageData(); | ||
459 | + List<PageData> templist = new ArrayList<PageData>(); | ||
460 | + PageData saveData = new PageData(); | ||
461 | + | ||
462 | + ResponseGson<PageData> res = new ResponseGson(); | ||
463 | + pd = this.getPageData(); | ||
464 | + if(pd.containsKey("PAPER_ID")){ | ||
465 | + List<PageData> list = paperquestionService.listAll(pd); | ||
466 | + List<PageData> test = new ArrayList<PageData>(); | ||
467 | + int onum[] = new int[list.size()]; | ||
468 | + | ||
469 | + for(int i = 0;i<list.size();i++){ | ||
470 | + PageData temp = new PageData(); | ||
471 | + String questionid = list.get(i).get("QUESTION_ID").toString(); | ||
472 | + | ||
473 | + if(list.get(i).get("NO_NAME")==null||list.get(i).get("NO_NAME").toString().isEmpty()){ | ||
474 | + continue; | ||
475 | + } | ||
476 | + Float que_score = Float.valueOf(list.get(i).get("SCORE").toString()); | ||
477 | + temp.put("QUESTION_ID", questionid); | ||
478 | + PageData question = questionService.findById(temp); | ||
479 | + temp.put("ANSWER",question.get("ANSWER").toString()); | ||
480 | + temp.put("QUESTION_RANK", list.get(i).get("RANK").toString()); | ||
481 | + temp.put("QUESTION_SCORE", que_score); | ||
482 | + | ||
483 | + PageData que = questionService.findById(temp); | ||
484 | + Integer option_num = 0; | ||
485 | + if(!que.get("OPTION_NUM").toString().isEmpty()){ | ||
486 | + option_num = Integer.valueOf(que.get("OPTION_NUM").toString()); | ||
487 | + onum[i]=option_num; | ||
488 | + } | ||
489 | + | ||
490 | + temp.put("TEST_ID", pd.get("TESTPAPER_ID")); | ||
491 | + List<PageData> queInfo = testpaperinfoService.listTestPaperQuestionIDinfo(temp); | ||
492 | + int answer[] = new int[option_num+1]; | ||
493 | + int right = 0; | ||
494 | + for(int j=0;j<queInfo.size();j++){ | ||
495 | + if(queInfo.get(j).get("RIGHT")!=null&&!queInfo.get(j).get("RIGHT").toString().isEmpty()){ | ||
496 | + if(queInfo.get(j).get("RIGHT").toString().equals("1")){ | ||
497 | + right++; | ||
498 | + } | ||
499 | + } | ||
500 | + if(queInfo.get(j).get("ANSWER")!=null&&!queInfo.get(j).get("ANSWER").toString().isEmpty()){ | ||
501 | + for(int o=0;o<option_num;o++ ){ | ||
502 | + String s = String.valueOf((char)(65+o)) ; | ||
503 | + if(queInfo.get(j).get("ANSWER").toString().equals(s)){ | ||
504 | + answer[o]++; | ||
505 | + } | ||
506 | + } | ||
507 | + } | ||
508 | + else{ | ||
509 | + answer[option_num]++; | ||
510 | + } | ||
511 | + } | ||
512 | + temp.put("RIGHTNUM", right); | ||
513 | + temp.put("ANSWERNUM",queInfo.size()); | ||
514 | + temp.put("optin_info", JSONUtils.toJSONString(answer)); | ||
515 | + templist.add(temp); | ||
516 | + } | ||
517 | + Arrays.sort(onum); | ||
518 | + int max = onum[onum.length-1]; | ||
519 | + pd.put("MAX",max); | ||
520 | + } | ||
521 | + | ||
522 | + Collections.sort(templist,new Comparator<PageData>(){ | ||
523 | + | ||
524 | + @Override | ||
525 | + public int compare(PageData o1, PageData o2) { | ||
526 | + Integer o1GetScore = Integer.valueOf(o1.getString("QUESTION_RANK")); | ||
527 | + Integer o2GetScore = Integer.valueOf(o2.getString("QUESTION_RANK")); | ||
528 | + return o1GetScore.compareTo(o2GetScore); | ||
529 | + } | ||
530 | + | ||
531 | + }); | ||
532 | + | ||
533 | + | ||
534 | +// mv.addObject("varList", templist); | ||
535 | +// mv.addObject("pd",pd); | ||
536 | + | ||
537 | + Map<String,Object> dataMap = new HashMap<String,Object>(); | ||
538 | + List<String> titles = new ArrayList<String>(); | ||
539 | + titles.add("题号"); //1 | ||
540 | + titles.add("答案"); //2 | ||
541 | + titles.add("答题人数"); //3 | ||
542 | + titles.add("正确人数"); //4 | ||
543 | + titles.add("正确率"); //5 | ||
544 | + titles.add("满分值"); //6 | ||
545 | + titles.add("平均分"); //7 | ||
546 | + Integer max = Integer.valueOf(pd.getString("MAX")); | ||
547 | + for(int x = 0 ;x<max;x++){ | ||
548 | + titles.add("选"+Myelfun.jstlInt2Char(x+1)+"人数"); //8 | ||
549 | + titles.add("选"+Myelfun.jstlInt2Char(x+1)+"比例"); //9 | ||
550 | + } | ||
551 | + titles.add("漏选人数"); //10 | ||
552 | + titles.add("漏选比例"); //11 | ||
553 | + dataMap.put("titles", titles); | ||
554 | + List<PageData> varOList = templist; | ||
555 | + List<PageData> varList = new ArrayList<PageData>(); | ||
556 | + DecimalFormat decimalFormat=new DecimalFormat("0.00"); | ||
557 | + for(int i=0;i<varOList.size();i++){ | ||
558 | + PageData vpd = new PageData(); | ||
559 | + | ||
560 | + vpd.put("var1", varOList.get(i).getString("QUESTION_RANK")); //1 | ||
561 | + vpd.put("var2", varOList.get(i).getString("ANSWER")); //2 | ||
562 | + vpd.put("var3", varOList.get(i).getString("ANSWERNUM")); //3 | ||
563 | + vpd.put("var4", varOList.get(i).getString("RIGHTNUM")); //4 | ||
564 | + vpd.put("var5", decimalFormat.format(Integer.valueOf(varOList.get(i).getString("RIGHTNUM"))*100/Integer.valueOf(varOList.get(i).getString("ANSWERNUM")))+"%"); //5 | ||
565 | + vpd.put("var6", varOList.get(i).getString("QUESTION_SCORE")); //6 | ||
566 | + vpd.put("var7", decimalFormat.format(Integer.valueOf(varOList.get(i).getString("RIGHTNUM"))*Float.valueOf(varOList.get(i).getString("QUESTION_SCORE"))/Integer.valueOf(varOList.get(i).getString("ANSWERNUM")))); //7 | ||
567 | + String s = varOList.get(i).get("optin_info").toString(); | ||
568 | + s = s.replace("[", ""); | ||
569 | + s = s.replace("]", ""); | ||
570 | + List<String> optoin = Arrays.asList(s.split(",")); | ||
571 | + for(int y = 0 ;y<max;y++){ | ||
572 | + Integer nn = Integer.valueOf(optoin.get(y)); | ||
573 | + nn = (nn==null?0:nn); | ||
574 | + vpd.put("var"+(8+2*y), nn); //8 | ||
575 | + vpd.put("var"+(9+2*y), decimalFormat.format(nn*100/Integer.valueOf(varOList.get(i).getString("ANSWERNUM")))+"%"); //9 | ||
576 | + | ||
577 | + } | ||
578 | + | ||
579 | + vpd.put("var"+(max*2+8), Integer.valueOf(optoin.get(max))); //8 | ||
580 | + vpd.put("var"+(max*2+9), decimalFormat.format(Integer.valueOf(optoin.get(max))*100/Integer.valueOf(varOList.get(i).getString("ANSWERNUM")))+"%"); //9 | ||
581 | + | ||
582 | + varList.add(vpd); | ||
583 | + } | ||
584 | + dataMap.put("varList", varList); | ||
585 | + ObjectExcelView erv = new ObjectExcelView(); | ||
586 | + mv = new ModelAndView(erv,dataMap); | ||
587 | + | ||
588 | + | ||
589 | + return mv; | ||
590 | + } | ||
591 | + | ||
167 | @RequestMapping(value="/iteminfo") | 592 | @RequestMapping(value="/iteminfo") |
168 | public ModelAndView iteminfo() throws Exception{ | 593 | public ModelAndView iteminfo() throws Exception{ |
169 | logBefore(logger, Jurisdiction.getUsername()+"Paper详细信息"); | 594 | logBefore(logger, Jurisdiction.getUsername()+"Paper详细信息"); |
@@ -336,17 +761,17 @@ public class PaperController extends BaseController { | @@ -336,17 +761,17 @@ public class PaperController extends BaseController { | ||
336 | try{ | 761 | try{ |
337 | int et = Integer.parseInt(examTime); | 762 | int et = Integer.parseInt(examTime); |
338 | String min = (et / 60 ) + "" ; | 763 | String min = (et / 60 ) + "" ; |
339 | - if(min.length() < 2){ | ||
340 | - min = "0" + min ; | ||
341 | - } | 764 | +// if(min.length() < 2){ |
765 | +// min = "0" + min ; | ||
766 | +// } | ||
342 | String sec = (et % 60 ) + "" ; | 767 | String sec = (et % 60 ) + "" ; |
343 | if(sec.length() < 2){ | 768 | if(sec.length() < 2){ |
344 | sec = "0" + sec ; | 769 | sec = "0" + sec ; |
345 | } | 770 | } |
346 | - if(et > 60){ | ||
347 | - examTime = min + ":" + sec; | 771 | + if(et >= 60){ |
772 | + examTime = min + "时" + sec+"分"; | ||
348 | }else{ | 773 | }else{ |
349 | - examTime = "00:" + sec; | 774 | + examTime = "0时" + sec+"分"; |
350 | } | 775 | } |
351 | }catch(Exception e){ | 776 | }catch(Exception e){ |
352 | e.printStackTrace(); | 777 | e.printStackTrace(); |
@@ -397,24 +822,24 @@ public class PaperController extends BaseController { | @@ -397,24 +822,24 @@ public class PaperController extends BaseController { | ||
397 | try{ | 822 | try{ |
398 | int et = Integer.parseInt(examTime); | 823 | int et = Integer.parseInt(examTime); |
399 | String min = (et / 60 ) + "" ; | 824 | String min = (et / 60 ) + "" ; |
400 | - if(min.length() < 2){ | ||
401 | - min = "0" + min ; | ||
402 | - } | 825 | +// if(min.length() < 2){ |
826 | +// min = "0" + min ; | ||
827 | +// } | ||
403 | String sec = (et % 60 ) + "" ; | 828 | String sec = (et % 60 ) + "" ; |
404 | if(sec.length() < 2){ | 829 | if(sec.length() < 2){ |
405 | sec = "0" + sec ; | 830 | sec = "0" + sec ; |
406 | } | 831 | } |
407 | - if(et > 60){ | ||
408 | - examTime = min + ":" + sec; | 832 | + if(et >= 60){ |
833 | + examTime = min + "时" + sec +"分"; | ||
409 | }else{ | 834 | }else{ |
410 | - examTime = "00:" + sec; | 835 | + examTime = "0时" + sec + "分"; |
411 | } | 836 | } |
412 | }catch(Exception e){ | 837 | }catch(Exception e){ |
413 | e.printStackTrace(); | 838 | e.printStackTrace(); |
414 | } | 839 | } |
415 | } | 840 | } |
416 | if(examTime == null){ | 841 | if(examTime == null){ |
417 | - examTime = "00:00"; | 842 | + examTime = "0"; |
418 | } | 843 | } |
419 | p.put("EXAM_TIME", examTime); | 844 | p.put("EXAM_TIME", examTime); |
420 | } | 845 | } |
@@ -465,24 +890,24 @@ public class PaperController extends BaseController { | @@ -465,24 +890,24 @@ public class PaperController extends BaseController { | ||
465 | try{ | 890 | try{ |
466 | int et = Integer.parseInt(examTime); | 891 | int et = Integer.parseInt(examTime); |
467 | String min = (et / 60 ) + "" ; | 892 | String min = (et / 60 ) + "" ; |
468 | - if(min.length() < 2){ | ||
469 | - min = "0" + min ; | ||
470 | - } | 893 | +// if(min.length() < 2){ |
894 | +// min = "0" + min ; | ||
895 | +// } | ||
471 | String sec = (et % 60 ) + "" ; | 896 | String sec = (et % 60 ) + "" ; |
472 | if(sec.length() < 2){ | 897 | if(sec.length() < 2){ |
473 | sec = "0" + sec ; | 898 | sec = "0" + sec ; |
474 | } | 899 | } |
475 | - if(et > 60){ | ||
476 | - examTime = min + ":" + sec; | 900 | + if(et >= 60){ |
901 | + examTime = min + "时" + sec+"分"; | ||
477 | }else{ | 902 | }else{ |
478 | - examTime = "00:" + sec; | 903 | + examTime = "0时" + sec+"分"; |
479 | } | 904 | } |
480 | }catch(Exception e){ | 905 | }catch(Exception e){ |
481 | e.printStackTrace(); | 906 | e.printStackTrace(); |
482 | } | 907 | } |
483 | } | 908 | } |
484 | if(examTime == null){ | 909 | if(examTime == null){ |
485 | - examTime = "00:00"; | 910 | + examTime = "0"; |
486 | } | 911 | } |
487 | p.put("EXAM_TIME", examTime); | 912 | p.put("EXAM_TIME", examTime); |
488 | } | 913 | } |
@@ -521,24 +946,24 @@ public class PaperController extends BaseController { | @@ -521,24 +946,24 @@ public class PaperController extends BaseController { | ||
521 | try{ | 946 | try{ |
522 | int et = Integer.parseInt(examTime); | 947 | int et = Integer.parseInt(examTime); |
523 | String min = (et / 60 ) + "" ; | 948 | String min = (et / 60 ) + "" ; |
524 | - if(min.length() < 2){ | ||
525 | - min = "0" + min ; | ||
526 | - } | 949 | +// if(min.length() < 2){ |
950 | +// min = "0" + min ; | ||
951 | +// } | ||
527 | String sec = (et % 60 ) + "" ; | 952 | String sec = (et % 60 ) + "" ; |
528 | if(sec.length() < 2){ | 953 | if(sec.length() < 2){ |
529 | sec = "0" + sec ; | 954 | sec = "0" + sec ; |
530 | } | 955 | } |
531 | if(et > 60){ | 956 | if(et > 60){ |
532 | - examTime = min + ":" + sec; | 957 | + examTime = min + "时" + sec+"分"; |
533 | }else{ | 958 | }else{ |
534 | - examTime = "00:" + sec; | 959 | + examTime = "0时" + sec+"分"; |
535 | } | 960 | } |
536 | }catch(Exception e){ | 961 | }catch(Exception e){ |
537 | e.printStackTrace(); | 962 | e.printStackTrace(); |
538 | } | 963 | } |
539 | } | 964 | } |
540 | if(examTime == null){ | 965 | if(examTime == null){ |
541 | - examTime = "00:00"; | 966 | + examTime = "0"; |
542 | } | 967 | } |
543 | p.put("EXAM_TIME", examTime); | 968 | p.put("EXAM_TIME", examTime); |
544 | } | 969 | } |
src/com/fh/controller/sunvote/student/StudentController.java
@@ -147,12 +147,17 @@ public class StudentController extends BaseController { | @@ -147,12 +147,17 @@ public class StudentController extends BaseController { | ||
147 | for(int i = 1 ; i < listPd.size();i++){ | 147 | for(int i = 1 ; i < listPd.size();i++){ |
148 | PageData savePd = new PageData(); | 148 | PageData savePd = new PageData(); |
149 | PageData temp = listPd.get(i); | 149 | PageData temp = listPd.get(i); |
150 | - for(int j = 0 ; ;j++){ | ||
151 | - if(temp.get("var" + j) == null){ | ||
152 | - break ; | ||
153 | - } | 150 | + for(int j = 0 ;j<3 ;j++){ |
151 | +// if(temp.get("var" + j) == null){ | ||
152 | +// break ; | ||
153 | +// } | ||
154 | if(temp.get("var" + j) != null && !"".equals(temp.get("var" + j).toString())){ | 154 | if(temp.get("var" + j) != null && !"".equals(temp.get("var" + j).toString())){ |
155 | savePd.put(pd.getString("var" + j).toUpperCase(), temp.get("var" + j)); | 155 | savePd.put(pd.getString("var" + j).toUpperCase(), temp.get("var" + j)); |
156 | + }else{ | ||
157 | + mv.addObject("msg","本次成功导入"+(i-1>=0?i-1:0)+"条数据,第"+i+"行有空数据"); | ||
158 | + mv.addObject("state","fail"); | ||
159 | + mv.setViewName("save_result2"); | ||
160 | + return mv; | ||
156 | } | 161 | } |
157 | } | 162 | } |
158 | if(!savePd.containsKey("ID")){ | 163 | if(!savePd.containsKey("ID")){ |
@@ -179,6 +184,7 @@ public class StudentController extends BaseController { | @@ -179,6 +184,7 @@ public class StudentController extends BaseController { | ||
179 | 184 | ||
180 | } | 185 | } |
181 | } | 186 | } |
187 | + mv.addObject("state","success"); | ||
182 | mv.addObject("msg","success"); | 188 | mv.addObject("msg","success"); |
183 | mv.setViewName("save_result2"); | 189 | mv.setViewName("save_result2"); |
184 | return mv; | 190 | return mv; |
src/com/fh/controller/sunvote/teacher/TeacherController.java
@@ -726,6 +726,7 @@ public class TeacherController extends BaseController { | @@ -726,6 +726,7 @@ public class TeacherController extends BaseController { | ||
726 | if (null != DATA_IDS && !"".equals(DATA_IDS)) { | 726 | if (null != DATA_IDS && !"".equals(DATA_IDS)) { |
727 | String ArrayDATA_IDS[] = DATA_IDS.split(","); | 727 | String ArrayDATA_IDS[] = DATA_IDS.split(","); |
728 | teacherService.deleteAll(ArrayDATA_IDS); | 728 | teacherService.deleteAll(ArrayDATA_IDS); |
729 | + userService.deleteAllU(ArrayDATA_IDS); | ||
729 | pd.put("msg", "ok"); | 730 | pd.put("msg", "ok"); |
730 | } else { | 731 | } else { |
731 | pd.put("msg", "no"); | 732 | pd.put("msg", "no"); |
@@ -798,6 +799,34 @@ public class TeacherController extends BaseController { | @@ -798,6 +799,34 @@ public class TeacherController extends BaseController { | ||
798 | savePd.put("ID", teacherId); | 799 | savePd.put("ID", teacherId); |
799 | savePd.put("SCHOOL_ID", schoolID); | 800 | savePd.put("SCHOOL_ID", schoolID); |
800 | 801 | ||
802 | + PageData p = new PageData(); | ||
803 | + p.put("USERNAME", savePd.getString("ACCOUT")); | ||
804 | + | ||
805 | + if(null==userService.findByUsername(p)){ | ||
806 | + p.put("USER_ID", savePd.get("ID")); | ||
807 | + p.put("ROLE_ID", "57bb1e6f138247a0b05cc721a5da1b64"); | ||
808 | + p.put("PASSWORD", | ||
809 | + new SimpleHash("SHA-1", savePd.getString("ACCOUT"), savePd | ||
810 | + .getString("PASSWORD")).toString()); // 密码加密 | ||
811 | + p.put("LAST_LOGIN", ""); // 最后登录时间 | ||
812 | + p.put("IP", ""); // IP | ||
813 | + p.put("STATUS", "0"); // 状态 | ||
814 | + p.put("SKIN", "default"); | ||
815 | + p.put("RIGHTS", ""); | ||
816 | + p.put("NAME",savePd.getString("NAME") ); | ||
817 | + | ||
818 | + userService.saveU(p); | ||
819 | + FHLOG.save(Jurisdiction.getUsername(), | ||
820 | + "新增系统用户:" + pd.getString("USERNAME")); | ||
821 | + }else{ | ||
822 | + mv.addObject("state","fail"); | ||
823 | + mv.addObject("msg","本次成功导入"+(i-1>=0?i-1:0)+"条数据,第"+i+"行用户名系统已存在。"); | ||
824 | + mv.setViewName("save_result2"); | ||
825 | + return mv; | ||
826 | + } | ||
827 | + | ||
828 | + | ||
829 | + | ||
801 | teacherService.save(savePd); | 830 | teacherService.save(savePd); |
802 | } | 831 | } |
803 | 832 |
src/com/fh/entity/Page.java
@@ -97,13 +97,13 @@ public class Page { | @@ -97,13 +97,13 @@ public class Page { | ||
97 | sb.append(" <ul class=\"pagination pull-right no-margin\">\n"); | 97 | sb.append(" <ul class=\"pagination pull-right no-margin\">\n"); |
98 | if(currentPage==1){ | 98 | if(currentPage==1){ |
99 | sb.append(" <li><a>" + total +totalResult+articles + "</a></li>\n"); | 99 | sb.append(" <li><a>" + total +totalResult+articles + "</a></li>\n"); |
100 | - sb.append(" <li><span style='padding:0'><input type=\"number\" value=\"\" id=\"toGoPage\" style=\"width:80px;text-align:center;float:left\" placeholder=\"" + pageNumber + "\"/></span></li>\n"); | 100 | + sb.append(" <li><span style='padding:0'><input type=\"number\" min=\"1\" value=\"\" id=\"toGoPage\" style=\"width:80px;text-align:center;float:left\" placeholder=\"" + pageNumber + "\"/></span></li>\n"); |
101 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"toTZ();\" class=\"btn btn-mini btn-success\">" + jump + "</a></li>\n"); | 101 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"toTZ();\" class=\"btn btn-mini btn-success\">" + jump + "</a></li>\n"); |
102 | sb.append(" <li><a>" + frist + "</a></li>\n"); | 102 | sb.append(" <li><a>" + frist + "</a></li>\n"); |
103 | sb.append(" <li><a>" + previous + "</a></li>\n"); | 103 | sb.append(" <li><a>" + previous + "</a></li>\n"); |
104 | }else{ | 104 | }else{ |
105 | sb.append(" <li><a>"+ total +"<font color=red>"+totalResult+"</font>" + articles + "</a></li>\n"); | 105 | sb.append(" <li><a>"+ total +"<font color=red>"+totalResult+"</font>" + articles + "</a></li>\n"); |
106 | - sb.append(" <li><input type=\"number\" value=\"\" id=\"toGoPage\" style=\"width:80px;text-align:center;float:left\" placeholder=\"" + pageNumber + "\"/></li>\n"); | 106 | + sb.append(" <li><input type=\"number\" min=\"1\" value=\"\" id=\"toGoPage\" style=\"width:80px;text-align:center;float:left\" placeholder=\"" + pageNumber + "\"/></li>\n"); |
107 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"toTZ();\" class=\"btn btn-mini btn-success\">" + jump + "</a></li>\n"); | 107 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"toTZ();\" class=\"btn btn-mini btn-success\">" + jump + "</a></li>\n"); |
108 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"nextPage(1)\">" + frist + "</a></li>\n"); | 108 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"nextPage(1)\">" + frist + "</a></li>\n"); |
109 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"nextPage("+(currentPage-1)+")\">" + previous + "</a></li>\n"); | 109 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"nextPage("+(currentPage-1)+")\">" + previous + "</a></li>\n"); |
@@ -127,7 +127,7 @@ public class Page { | @@ -127,7 +127,7 @@ public class Page { | ||
127 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"nextPage("+(currentPage+1)+")\">" + next + "</a></li>\n"); | 127 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"nextPage("+(currentPage+1)+")\">" + next + "</a></li>\n"); |
128 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"nextPage("+totalPage+")\">" + tail + "</a></li>\n"); | 128 | sb.append(" <li style=\"cursor:pointer;\"><a onclick=\"nextPage("+totalPage+")\">" + tail + "</a></li>\n"); |
129 | } | 129 | } |
130 | - sb.append(" <li><a>" + total +totalResult+articles + "</a></li>\n"); | 130 | +// sb.append(" <li><a>" + total +totalResult+articles + "</a></li>\n"); |
131 | sb.append(" <li><span class=\"enter\"><select title='" + displayNumber + "' style=\"width:55px;float:left;height:32px;margin-top:1px;border:0\" onchange=\"changeCount(this.value)\">\n"); | 131 | sb.append(" <li><span class=\"enter\"><select title='" + displayNumber + "' style=\"width:55px;float:left;height:32px;margin-top:1px;border:0\" onchange=\"changeCount(this.value)\">\n"); |
132 | sb.append(" <option value='"+showCount+"'>"+showCount+"</option>\n"); | 132 | sb.append(" <option value='"+showCount+"'>"+showCount+"</option>\n"); |
133 | sb.append(" <option value='10'>10</option>\n"); | 133 | sb.append(" <option value='10'>10</option>\n"); |
src/com/fh/service/sunvote/student/StudentManager.java
@@ -41,6 +41,12 @@ public interface StudentManager{ | @@ -41,6 +41,12 @@ public interface StudentManager{ | ||
41 | * @param page | 41 | * @param page |
42 | * @throws Exception | 42 | * @throws Exception |
43 | */ | 43 | */ |
44 | + public Integer countByClassId(String classid)throws Exception; | ||
45 | + | ||
46 | + /**列表 | ||
47 | + * @param page | ||
48 | + * @throws Exception | ||
49 | + */ | ||
44 | public List<PageData> datalistclassPage(Page page)throws Exception; | 50 | public List<PageData> datalistclassPage(Page page)throws Exception; |
45 | 51 | ||
46 | /**列表(全部) | 52 | /**列表(全部) |
src/com/fh/service/sunvote/student/impl/StudentService.java
@@ -57,6 +57,14 @@ public class StudentService implements StudentManager{ | @@ -57,6 +57,14 @@ public class StudentService implements StudentManager{ | ||
57 | * @param page | 57 | * @param page |
58 | * @throws Exception | 58 | * @throws Exception |
59 | */ | 59 | */ |
60 | + public Integer countByClassId(String classid)throws Exception{ | ||
61 | + return (Integer)dao.findForList("StudentMapper.countByClassId", classid); | ||
62 | + } | ||
63 | + | ||
64 | + /**列表 | ||
65 | + * @param page | ||
66 | + * @throws Exception | ||
67 | + */ | ||
60 | @SuppressWarnings("unchecked") | 68 | @SuppressWarnings("unchecked") |
61 | public List<PageData> datalistclassPage(Page page)throws Exception{ | 69 | public List<PageData> datalistclassPage(Page page)throws Exception{ |
62 | return (List<PageData>)dao.findForList("StudentMapper.dataclasslistPage", page); | 70 | return (List<PageData>)dao.findForList("StudentMapper.dataclasslistPage", page); |