Commit 0a0c0f6ad29e5a607a2178a6a68f941f35356310

Authored by jack
1 parent c33910d6

1.bug修复

WebRoot/WEB-INF/jsp/sunvote/paper/test_list2.jsp
... ... @@ -82,7 +82,7 @@
82 82 <th><div style="width:80px">答案</div></th>
83 83 <th><div style="width:80px">答题人数</div></th>
84 84 <th><div style="width:80px">正确人数</div></th>
85   - <th><div style="width:80px" title="正确率=正确人数/答题人数">正确率<img src="../static/images/tip.png" style="width:16px"></div></th>
  85 + <th><div style="width:80px" title="正确率=正确人数/答题人数*100">正确率<img src="../static/images/tip.png" style="width:16px"></div></th>
86 86 <th><div style="width:80px">满分值</div></th>
87 87 <th><div style="width:80px" title="平均分=正确人数/答题人数*题目分数">平均分<img src="../static/images/tip.png" style="width:16px"></div></th>
88 88 <c:forEach begin="0" end="${pd.MAX-1}" var="var" varStatus="vs">
... ... @@ -90,7 +90,7 @@
90 90 <th><div style="width:80px" title="选${myelfun:jstlInt2Char(var+1)}比例=选${myelfun:jstlInt2Char(var+1)}人数/答题人数*100">选${myelfun:jstlInt2Char(var+1)}比例<img src="../static/images/tip.png" style="width:16px"></div></th>
91 91 </c:forEach>
92 92 <th><div style="width:80px">漏选人数</div></th>
93   - <th><div style="width:80px">漏选比例</div></th>
  93 + <th><div style="width:80px" title="漏选比例=漏选人数/班级总人数*100">漏选比例<img src="../static/images/tip.png" style="width:16px"></div></th>
94 94  
95 95 </tr>
96 96 </thead>
... ... @@ -99,13 +99,13 @@
99 99 <c:when test="${not empty varList}">
100 100 <c:forEach items="${varList}" var="var" varStatus="vs">
101 101  
102   - <c:set var="right" value="${var.ANSWERNUM2 == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM2 * 100)}"></c:set>
  102 + <c:set var="right" value="${var.ANSWERNUM == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM * 100)}"></c:set>
103 103  
104 104 <tr>
105 105  
106 106 <td>${var.QUESTION_RANK}</td>
107 107 <td>${var.ANSWER}</td>
108   - <td >${var.ANSWERNUM2}</td>
  108 + <td >${var.ANSWERNUM}</td>
109 109 <td >${var.RIGHTNUM}</td>
110 110 <td >
111 111 <c:if test="${right<=50}">
... ... @@ -124,7 +124,7 @@
124 124 <td >${var.QUESTION_SCORE}</td>
125 125 <td >
126 126 <fmt:formatNumber type="number"
127   - value="${var.ANSWERNUM2 == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM2)*var.QUESTION_SCORE}"
  127 + value="${var.ANSWERNUM == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM)*var.QUESTION_SCORE}"
128 128 maxFractionDigits="2" />
129 129 </td>
130 130 <c:set var="lth" value="${fn:length(var.optin_info)-1}"></c:set>
... ... @@ -134,7 +134,7 @@
134 134 <td>${optin_info[vs.index]}</td>
135 135 <td>
136 136 <fmt:formatNumber type="number"
137   - value="${var.ANSWERNUM2 == 0 ? 0: (optin_info[vs.index] / var.ANSWERNUM2 * 100)}"
  137 + value="${var.ANSWERNUM == 0 ? 0: (optin_info[vs.index] / var.ANSWERNUM * 100)}"
138 138 maxFractionDigits="2" />%
139 139 </td>
140 140 </c:if>
... ...
src/com/fh/controller/sunvote/paper/PaperController.java
... ... @@ -442,10 +442,13 @@ public class PaperController extends BaseController {
442 442 temp.put("TEST_ID", tpListArray);
443 443  
444 444 List<PageData> queInfo = testpaperinfoService.listTestPaperQuestionIDinfo(temp);
445   - List<PageData> answer_num = testpaperService.listAll(pd);
446 445 int answer[] = new int[option_num+1];
447 446 int right = 0;
  447 + int lost = 0;
448 448 for(int j=0;j<queInfo.size();j++){
  449 + if(queInfo.get(j).get("ANSWER").toString().isEmpty()){
  450 + lost++;
  451 + }
449 452 if(queInfo.get(j).get("RIGHT")!=null&&!queInfo.get(j).get("RIGHT").toString().isEmpty()){
450 453 if(queInfo.get(j).get("RIGHT").toString().equals("1")){
451 454 right++;
... ... @@ -464,8 +467,8 @@ public class PaperController extends BaseController {
464 467 }
465 468 }
466 469 temp.put("RIGHTNUM", right);
467   - temp.put("ANSWERNUM",queInfo.size());
468   - temp.put("ANSWERNUM2",answer_num.size());
  470 + temp.put("ANSWERNUM",(queInfo.size()-lost));
  471 + temp.put("ANSWERNUM2",queInfo.size());
469 472 temp.put("optin_info", answer);
470 473 templist.add(temp);
471 474 }
... ... @@ -533,7 +536,11 @@ public class PaperController extends BaseController {
533 536 List<PageData> queInfo = testpaperinfoService.listTestPaperQuestionIDinfo(temp);
534 537 int answer[] = new int[option_num+1];
535 538 int right = 0;
  539 + int lost = 0;
536 540 for(int j=0;j<queInfo.size();j++){
  541 + if(queInfo.get(j).get("ANSWER").toString().isEmpty()){
  542 + lost++;
  543 + }
537 544 if(queInfo.get(j).get("RIGHT")!=null&&!queInfo.get(j).get("RIGHT").toString().isEmpty()){
538 545 if(queInfo.get(j).get("RIGHT").toString().equals("1")){
539 546 right++;
... ... @@ -552,7 +559,8 @@ public class PaperController extends BaseController {
552 559 }
553 560 }
554 561 temp.put("RIGHTNUM", right);
555   - temp.put("ANSWERNUM",queInfo.size());
  562 + temp.put("ANSWERNUM",(queInfo.size()-lost));
  563 + temp.put("ANSWERNUM2",queInfo.size());
556 564 temp.put("optin_info", JSONUtils.toJSONString(answer));
557 565 templist.add(temp);
558 566 }
... ... @@ -623,7 +631,7 @@ public class PaperController extends BaseController {
623 631 }
624 632  
625 633 vpd.put("var"+(max*2+8), Integer.valueOf(optoin.get(optoin.size()-1))); //8
626   - vpd.put("var"+(max*2+9), decimalFormat.format(Integer.valueOf(optoin.get(optoin.size()-1))*100/Integer.valueOf(varOList.get(i).getString("ANSWERNUM")))+"%"); //9
  634 + vpd.put("var"+(max*2+9), decimalFormat.format(Integer.valueOf(optoin.get(optoin.size()-1))*100/Integer.valueOf(varOList.get(i).getString("ANSWERNUM2")))+"%"); //9
627 635  
628 636 varList.add(vpd);
629 637 }
... ...