Commit 4926e3fd75724808673abbc8de8946259b53549d

Authored by jack
1 parent 5cf10579

1.修复bug

WebRoot/WEB-INF/jsp/sunvote/paper/paper_list4.jsp
... ... @@ -73,7 +73,8 @@
73 73 <col style="width: 10%" />
74 74 <col style="width: 10%" />
75 75 <col style="width: 10%" />
76   - <col style="width: 20%" />
  76 + <col style="width: 10%" />
  77 + <col style="width: 10%" />
77 78 <col style="width: 10%" />
78 79 <col style="width: 10%" />
79 80 <thead>
... ... @@ -85,6 +86,7 @@
85 86 <th>出卷老师</th>
86 87 <th>创建时间</th>
87 88 <th>建议考试时长</th>
  89 + <th>考试次数</th>
88 90 <th>总分</th>
89 91 <th>操作</th>
90 92 </tr>
... ... @@ -99,7 +101,8 @@
99 101 <col style="width: 10%" />
100 102 <col style="width: 10%" />
101 103 <col style="width: 10%" />
102   - <col style="width: 20%" />
  104 + <col style="width: 10%" />
  105 + <col style="width: 10%" />
103 106 <col style="width: 10%" />
104 107 <col style="width: 10%" />
105 108 <tbody>
... ... @@ -114,6 +117,7 @@
114 117 <td >${myelfun:findTeacherName(var.USER_ID)}</td>
115 118 <td >${var.CREATE_DATE}</td>
116 119 <td >${var.EXAM_TIME}</td>
  120 + <td >${var.TEST_NUM}</td>
117 121 <td >${var.SCORE}</td>
118 122 <td ><a href="<%=basePath%>paper/paperRep.do?paper_id=${var.PAPER_ID}">查看成绩</a></td>
119 123 </tr>
... ...
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list5.jsp
... ... @@ -60,10 +60,11 @@
60 60 <col style="width: 10%" />
61 61 <col style="width: 15%" />
62 62 <col style="width: 15%" />
63   - <col style="width: 10%" />
64   - <col style="width: 10%" />
65   - <col style="width: 15%" />
66   - <col style="width: 10%" />
  63 + <col style="width: 8%" />
  64 + <col style="width: 8%" />
  65 + <col style="width: 13%" />
  66 + <col style="width: 8%" />
  67 + <col style="width: 8%" />
67 68 <col style="width: 15%" />
68 69 <thead>
69 70 <tr>
... ... @@ -73,6 +74,7 @@
73 74 <th>年级</th>
74 75 <th>科目</th>
75 76 <th>建议考试时长</th>
  77 + <th>考试次数</th>
76 78 <th>总分</th>
77 79 <th>操作</th>
78 80 </tr>
... ... @@ -85,10 +87,11 @@
85 87 <col style="width: 10%" />
86 88 <col style="width: 15%" />
87 89 <col style="width: 15%" />
88   - <col style="width: 10%" />
89   - <col style="width: 10%" />
90   - <col style="width: 15%" />
91   - <col style="width: 10%" />
  90 + <col style="width: 8%" />
  91 + <col style="width: 8%" />
  92 + <col style="width: 13%" />
  93 + <col style="width: 8%" />
  94 + <col style="width: 8%" />
92 95 <col style="width: 15%" />
93 96 <tbody>
94 97 <c:choose>
... ... @@ -101,6 +104,7 @@
101 104 <td >${myelfun:findGradeName(var.GRADE_ID)}</td>
102 105 <td >${myelfun:findSubjectCName(var.SUBJECT_ID)}</td>
103 106 <td >${var.EXAM_TIME}</td>
  107 + <td >${var.TEST_NUM}</td>
104 108 <td >${var.SCORE}</td>
105 109 <td>
106 110 <a href="<%=basePath%>paper/paperRep.do?paper_id=${var.PAPER_ID}">查看成绩</a>
... ...
WebRoot/WEB-INF/jsp/sunvote/paper/test_list1.jsp
... ... @@ -55,8 +55,9 @@
55 55 </div>
56 56 <div class="table_box" style="padding:0 5%;background:#fff;">
57 57 <div style="padding:15px 0;background:#fff;" class="paper_title">
58   - &nbsp;
59   - 试卷名称:${myelfun:findPaperName(pd.PAPER_ID)}
  58 + <b>试卷名称:</b>${myelfun:findPaperName(pd.PAPER_ID)}
  59 + <br/>
  60 + <b>试卷总分:</b>${pd.TOTAL_SCORE}分
60 61 </div>
61 62  
62 63 <table id="simple-table"
... ... @@ -69,13 +70,13 @@
69 70 <th><div style="width:80px">考试时间</div></th>
70 71 <th><div style="width:80px">平均分</div></th>
71 72 <th><div style="width:80px">班级总人数</div></th>
72   - <th><div style="width:80px" title="得分>=80%">优秀人数</div></th>
  73 + <th><div style="width:80px" title="得分>=80%">优秀人数<img src="../static/images/tip.png" style="width:12px"></div></th>
73 74 <th><div style="width:80px">优秀率</div></th>
74   - <th><div style="width:80px" title="得分>=70%">良好人数</div></th>
  75 + <th><div style="width:80px" title="得分>=70%">良好人数<img src="../static/images/tip.png" style="width:12px"></div></th>
75 76 <th><div style="width:80px">良好率</div></th>
76   - <th><div style="width:80px" title="得分>=60%">及格人数</div></th>
  77 + <th><div style="width:80px" title="得分>=60%">及格人数<img src="../static/images/tip.png" style="width:12px"></div></th>
77 78 <th><div style="width:80px">及格率</div></th>
78   - <th><div style="width:80px" title="得分>=30%">低分人数</div></th>
  79 + <th><div style="width:80px" title="得分>=30%">低分人数<img src="../static/images/tip.png" style="width:12px"></div></th>
79 80 <th><div style="width:80px">低分率</div></th>
80 81 <th><div style="width:80px">操作</div></th>
81 82 </tr>
... ... @@ -174,7 +175,7 @@
174 175 <td >
175 176  
176 177 <c:if test="${not empty var.class_id }">
177   - <a href="<%=basePath%>paper/paperRep2.do?CLASS_ID=${var.class_id}&PAPER_ID=${pd.PAPER_ID}&TESTPAPER_ID=${var.testpaper_id}">查看成绩</a>
  178 + <a href="<%=basePath%>paper/paperRep2.do?CLASS_ID=${var.class_id}&PAPER_ID=${pd.PAPER_ID}&TESTPAPER_ID=${var.testpaper_id}&CREAT_TIME=${var.creat_time}">查看成绩</a>
178 179 </c:if>
179 180 <c:if test="${empty var.class_id }">
180 181 <a href="<%=basePath%>paper/paperRep2.do?PAPER_ID=${pd.PAPER_ID}&TESTPAPER_ID=${var.testpaperList}">查看成绩</a>
... ...
WebRoot/WEB-INF/jsp/sunvote/paper/test_list2.jsp
... ... @@ -58,12 +58,14 @@
58 58 <div class="table_box" style="padding:0 5%;background:#fff;">
59 59 <div style="padding:15px 0;background:#fff;" class="paper_title">
60 60 &nbsp;
61   - 试卷名称:${myelfun:findPaperName(pd.PAPER_ID)}
  61 + <b>试卷名称:</b>${myelfun:findPaperName(pd.PAPER_ID)}
62 62  
63 63 <c:if test="${not empty pd.CLASS_ID }">
64   - 班级名称:${myelfun:findClassName(pd.CLASS_ID)}
  64 + &nbsp;&nbsp;&nbsp;&nbsp;<b>班级名称:</b>${myelfun:findClassName(pd.CLASS_ID)}
  65 + &nbsp;&nbsp;&nbsp;&nbsp;<b>考试时间:</b>${pd.CREAT_TIME}
65 66 </c:if>
66 67  
  68 +
67 69 </div>
68 70  
69 71 <table id="simple-table"
... ... @@ -91,6 +93,9 @@
91 93 <c:choose>
92 94 <c:when test="${not empty varList}">
93 95 <c:forEach items="${varList}" var="var" varStatus="vs">
  96 +
  97 + <c:set var="right" value="${var.ANSWERNUM == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM * 100)}"></c:set>
  98 +
94 99 <tr>
95 100  
96 101 <td>${var.QUESTION_RANK}</td>
... ... @@ -98,9 +103,18 @@
98 103 <td >${var.ANSWERNUM}</td>
99 104 <td >${var.RIGHTNUM}</td>
100 105 <td >
101   - <fmt:formatNumber type="number"
102   - value="${var.ANSWERNUM == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM * 100)}"
103   - maxFractionDigits="2" />%
  106 + <c:if test="${right<=50}">
  107 + <span style="color:red"><fmt:formatNumber type="number"
  108 + value="${right}"
  109 + maxFractionDigits="2" />%</span>
  110 + </c:if>
  111 + <c:if test="${right>50}">
  112 + <span style="color:red"><fmt:formatNumber type="number"
  113 + value="${right}"
  114 + maxFractionDigits="2" />%</span>
  115 + </c:if>
  116 +
  117 +
104 118 </td>
105 119 <td >${var.QUESTION_SCORE}</td>
106 120 <td >
... ...
WebRoot/WEB-INF/jsp/sunvote/student/student_list2.jsp
... ... @@ -27,6 +27,10 @@
27 27 <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
28 28 <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
29 29 <![endif]-->
  30 +<style type="text/css">
  31 + #remove{
  32 + background:#ccc}
  33 +</style>
30 34 </head>
31 35 <body>
32 36  
... ... @@ -44,15 +48,17 @@
44 48 <div style="padding:0 5%;background:#fff;">
45 49 <table class="table table-striped">
46 50 <col style="width: 10%" />
47   - <col style="width: 22%" />
48   - <col style="width: 22%" />
49   - <col style="width: 23%" />
50   - <col style="width: 23%" />
  51 + <col style="width: 20%" />
  52 + <col style="width: 20%" />
  53 + <col style="width: 10%" />
  54 + <col style="width: 20%" />
  55 + <col style="width: 20%" />
51 56 <thead>
52 57 <tr>
53 58 <th><input type="checkbox" value="0" name='ids' id="ids" />序号</th>
54 59 <th>姓名</th>
55 60 <th>学号</th>
  61 + <th>性别</th>
56 62 <th>键盘ID</th>
57 63 <th>操作</th>
58 64 </tr>
... ... @@ -64,10 +70,11 @@
64 70 <div class="table_box">
65 71 <table class="table table-striped">
66 72 <col style="width: 10%" />
67   - <col style="width: 22%" />
68   - <col style="width: 22%" />
69   - <col style="width: 23%" />
70   - <col style="width: 23%" />
  73 + <col style="width: 20%" />
  74 + <col style="width: 20%" />
  75 + <col style="width: 10%" />
  76 + <col style="width: 20%" />
  77 + <col style="width: 20%" />
71 78 <tbody>
72 79 <c:choose>
73 80 <c:when test="${not empty varList}">
... ... @@ -76,6 +83,14 @@
76 83 <td><input type="checkbox" name='ids' id="ids" value="${var.ID}" />${vs.index+1}</td>
77 84 <td class='center'>${var.NAME}</td>
78 85 <td>${var.NUMBER}</td>
  86 + <td>
  87 + <c:if test="${var.SEX == 0}">
  88 + 女
  89 + </c:if>
  90 + <c:if test="${var.SEX == 1}">
  91 + 男
  92 + </c:if>
  93 + </td>
79 94 <td>${var.KEYPAD_ID}</td>
80 95 <td><a href="#" onclick="edit('${var.ID}');" style="margin-right:10px;"><img src="../static/images/eidtor.png" /></a><a href="#" onclick="del('${var.ID}');"><img src="../static/images/remove.png" /></a></td>
81 96  
... ... @@ -106,7 +121,7 @@
106 121 <input type="button" onclick="export2();" value="批量导出" />
107 122 </div>
108 123 <div class="removeAll" >
109   - <input type="button" onclick="deleteAll();" value="批量删除" />
  124 + <input type="button" onclick="deleteAll();" disabled id="remove" value="批量删除" />
110 125 </div>
111 126 <div class="page_box">
112 127 <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div>
... ... @@ -220,6 +235,22 @@
220 235 function export2(){
221 236 window.open('<%=basePath%>student/excel?class_id=${pd.CLASS_ID}','_blank');
222 237 }
  238 + $("input[type=checkbox]").on('click',function(){
  239 + var str = '';
  240 + for(var i=0;i < document.getElementsByName('ids').length;i++){
  241 + if(document.getElementsByName('ids')[i].checked){
  242 + if(str=='') str += document.getElementsByName('ids')[i].value;
  243 + else str += ',' + document.getElementsByName('ids')[i].value;
  244 + }
  245 + }
  246 + if(str==''){
  247 + $("#remove").attr("disabled","disabled");
  248 + $("#remove").css("background","#ccc");
  249 + }else{
  250 + $("#remove").removeAttr("disabled");
  251 + $("#remove").css("background","#f29c9f");
  252 + }
  253 + })
223 254  
224 255 </script>
225 256 </html>
226 257 \ No newline at end of file
... ...
WebRoot/static/images/tip.png 0 → 100644

378 Bytes

resources/mybatis1/sunvote/StudentMapper.xml
... ... @@ -88,6 +88,17 @@
88 88 </select>
89 89  
90 90 <!-- 通过ID获取数据 -->
  91 + <select id="findByNumberAndKeyPadId" parameterType="pd" resultType="pd">
  92 + select
  93 + <include refid="Field"></include>
  94 + from
  95 + <include refid="tableName"></include>
  96 + where
  97 + NAME = #{NAME}
  98 + and NUMBER = #{NUMBER}
  99 + and KEYPAD_ID = #{KEYPAD_ID}
  100 + </select>
  101 + <!-- 通过ID获取数据 -->
91 102 <select id="findByClassId" parameterType="pd" resultType="pd">
92 103 select
93 104 <include refid="Field"></include>
... ...
src/com/fh/controller/sunvote/paper/PaperController.java
... ... @@ -199,12 +199,12 @@ public class PaperController extends BaseController {
199 199 List<PageData> templist = new ArrayList<PageData>();
200 200 PageData saveData = new PageData();
201 201 DecimalFormat decimalFormat=new DecimalFormat("0.00");
202   -
  202 + String total_score = "";
203 203 ResponseGson<PageData> res = new ResponseGson();
204 204 pd = this.getPageData();
205 205 if(pd.containsKey("PAPER_ID")){
206 206 List<PageData> list = testpaperService.listAll(pd);
207   -
  207 + total_score = list.get(0).getString("TOTAL_SCORE");
208 208 pd.put("testpaperlist", list);
209 209 Integer you_sum = 0; //优秀总人数
210 210 Integer liang_sum = 0; //良好总人数
... ... @@ -283,7 +283,7 @@ public class PaperController extends BaseController {
283 283  
284 284  
285 285 saveData.put("list", templist);
286   -
  286 + pd.put("TOTAL_SCORE", total_score);
287 287 mv.setViewName("sunvote/paper/test_list1");
288 288 mv.addObject("varList", templist);
289 289 mv.addObject("pd",pd);
... ... @@ -858,6 +858,9 @@ public class PaperController extends BaseController {
858 858  
859 859 for(PageData p:varList){
860 860 String examTime = p.getString("EXAM_TIME");
  861 + PageData temp = new PageData();
  862 + temp.put("PAPER_ID", p.getString("PAPER_ID"));
  863 + List<PageData> li = testpaperService.listAll(temp);
861 864 if(examTime != null){
862 865 try{
863 866 int et = Integer.parseInt(examTime);
... ... @@ -882,6 +885,7 @@ public class PaperController extends BaseController {
882 885 examTime = "0";
883 886 }
884 887 p.put("EXAM_TIME", examTime);
  888 + p.put("TEST_NUM", li.size());
885 889 }
886 890  
887 891 PageData tpd = new PageData();
... ... @@ -926,6 +930,10 @@ public class PaperController extends BaseController {
926 930  
927 931 for(PageData p:varList){
928 932 String examTime = p.getString("EXAM_TIME");
  933 + PageData temp = new PageData();
  934 + temp.put("PAPER_ID", p.getString("PAPER_ID"));
  935 + List<PageData> li = testpaperService.listAll(temp);
  936 +
929 937 if(examTime != null){
930 938 try{
931 939 int et = Integer.parseInt(examTime);
... ... @@ -950,6 +958,7 @@ public class PaperController extends BaseController {
950 958 examTime = "0";
951 959 }
952 960 p.put("EXAM_TIME", examTime);
  961 + p.put("TEST_NUM", li.size());
953 962 }
954 963  
955 964 mv.addObject("varList", varList);
... ...
src/com/fh/controller/sunvote/student/StudentController.java
... ... @@ -147,20 +147,27 @@ public class StudentController extends BaseController {
147 147 for(int i = 1 ; i < listPd.size();i++){
148 148 PageData savePd = new PageData();
149 149 PageData temp = listPd.get(i);
150   - for(int j = 0 ;j<3 ;j++){
  150 +
  151 + for(int j = 0 ;j<4 ;j++){
151 152 // if(temp.get("var" + j) == null){
152 153 // break ;
153 154 // }
154 155 if(temp.get("var" + j) != null && !"".equals(temp.get("var" + j).toString())){
155 156 savePd.put(pd.getString("var" + j).toUpperCase(), temp.get("var" + j));
156 157 }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;
  158 + if(j==3){
  159 + continue;
  160 + }else{
  161 + mv.addObject("msg","本次成功导入"+(i-1>=0?i-1:0)+"条数据,第"+i+"行有空数据");
  162 + mv.addObject("state","fail");
  163 + mv.setViewName("save_result2");
  164 + return mv;
  165 + }
161 166 }
162 167 }
163   - if(!savePd.containsKey("ID")){
  168 + List<PageData> lnum = studentService.findByNumberAndKeyPadId(savePd);
  169 +
  170 + if(lnum.size()<1){
164 171 if (savePd.values().size() > 0) {
165 172 String studentId = this.get32UUID();
166 173 savePd.put("ID", studentId);
... ... @@ -178,7 +185,11 @@ public class StudentController extends BaseController {
178 185 }
179 186  
180 187 }else{
181   - studentService.edit(savePd);
  188 + mv.addObject("msg","本次成功导入"+(i-1>=0?i-1:0)+"条数据,学号不可重复,请检查学生名单后重新导入");
  189 + mv.addObject("state","fail");
  190 + mv.setViewName("save_result2");
  191 + return mv;
  192 +
182 193 }
183 194 }
184 195  
... ...
src/com/fh/service/sunvote/student/StudentManager.java
... ... @@ -57,6 +57,8 @@ public interface StudentManager{
57 57  
58 58 public List<PageData> findByClassId(PageData pd)throws Exception;
59 59  
  60 +
  61 + public List<PageData> findByNumberAndKeyPadId(PageData pd)throws Exception;
60 62 /**通过id获取数据
61 63 * @param pd
62 64 * @throws Exception
... ...
src/com/fh/service/sunvote/student/impl/StudentService.java
... ... @@ -84,6 +84,11 @@ public class StudentService implements StudentManager{
84 84 return (List<PageData>)dao.findForList("StudentMapper.findByClassId", pd);
85 85 }
86 86  
  87 + @SuppressWarnings("unchecked")
  88 + public List<PageData> findByNumberAndKeyPadId(PageData pd)throws Exception{
  89 + return (List<PageData>)dao.findForList("StudentMapper.findByNumberAndKeyPadId", pd);
  90 + }
  91 +
87 92  
88 93 @SuppressWarnings("unchecked")
89 94 public List<PageData> listAllClass(PageData pd)throws Exception{
... ...