Commit f5451f32da187864a693ffd2907d8751cebbd2a5
1 parent
d8d825b7
分数相同,名词也相同
Showing
2 changed files
with
28 additions
and
1 deletions
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_report_test.jsp
... | ... | @@ -91,7 +91,7 @@ |
91 | 91 | <td class="center"><div style="width:80px;">${var.NAME}</div></td> |
92 | 92 | <td class="center"><div style="width:80px;">${var.GETSCORE}</div></td> |
93 | 93 | <%-- <td class="center">${var.RIGHT}</td> --%> |
94 | - <td class="center"><div style="width:80px;">${vs.index + 1}</div></td> | |
94 | + <td class="center"><div style="width:80px;">${var.RANK_NUM}</div></td> | |
95 | 95 | <c:forEach items="${questionInfo}" var="var1" varStatus="vs1"> |
96 | 96 | <td class="center" <c:if test="${var.detail[vs1.index].RIGHT== '1'}">style="background:#0bb8b9"</c:if>div style="width:80px;margin:0 auto;">${var.detail[vs1.index].ANSWER}</div></td> |
97 | 97 | </c:forEach> | ... | ... |
src/com/fh/controller/sunvote/report/ReportController.java
... | ... | @@ -351,6 +351,33 @@ public class ReportController extends BaseController { |
351 | 351 | } |
352 | 352 | |
353 | 353 | }); |
354 | + for(int i = 0 ; i < studentList.size(); i++){ | |
355 | + PageData tpd1 = studentList.get(i); | |
356 | + if(i == 0){ | |
357 | + tpd1.put("RANK_NUM", (i+1)); | |
358 | + }else{ | |
359 | + PageData tpd2 = studentList.get(i-1); | |
360 | + String o1GetScore = tpd1.getString("GETSCORE"); | |
361 | + String o2GetScore = tpd2.getString("GETSCORE"); | |
362 | + float o1score = 0 ; | |
363 | + float o2score = 0 ; | |
364 | + try{ | |
365 | + o1score = Float.parseFloat(o1GetScore); | |
366 | + }catch(Exception e){ | |
367 | + o1score = -1 ; | |
368 | + } | |
369 | + try{ | |
370 | + o2score = Float.parseFloat(o2GetScore); | |
371 | + }catch(Exception e){ | |
372 | + o2score = -1 ; | |
373 | + } | |
374 | + if(o2score - o1score == 0){ | |
375 | + tpd1.put("RANK_NUM",tpd2.get("RANK_NUM")); | |
376 | + }else{ | |
377 | + tpd1.put("RANK_NUM", (i+1)); | |
378 | + } | |
379 | + } | |
380 | + } | |
354 | 381 | |
355 | 382 | classPageData.put("studentNum", studentList.size()); |
356 | 383 | mv.addObject("classInfo", classPageData); | ... | ... |