Commit d7348237114a673d44973191d6b5080d06dc98c4

Authored by jack
1 parent ca546da0

1.修改课后练报表页面

WebRoot/WEB-INF/jsp/sunvote/homework/homework_list.jsp
... ... @@ -184,8 +184,8 @@
184 184 parent.$("#mainFrame").attr('src',path);
185 185 window.top.loading.show();
186 186 }
187   - function homeReport(){
188   - var path = '<%=basePath%>homework/report.do?';
  187 + function homeReport(homework_id){
  188 + var path = '<%=basePath%>homework/report2.do?HOMEWORK_ID='+homework_id;
189 189 parent.$("#mainFrame").attr('src',path);
190 190 window.top.loading.show();
191 191 }
... ...
WebRoot/WEB-INF/jsp/sunvote/homework/homework_report.jsp
... ... @@ -52,6 +52,7 @@
52 52 float:left;
53 53 list-style:none;
54 54 border:1px solid #ddd;
  55 + cursor: pointer;
55 56 }
56 57 .correct{
57 58 color:#28be56;
... ... @@ -68,17 +69,21 @@
68 69 }
69 70 .q_charts{
70 71 width:100%;
71   - height:200px;
  72 + height:240px;
  73 + postion:relative;
  74 + margin-top:20px;
  75 + text-align:center;
72 76 }
73 77 .rel{
74   - width:20px;
  78 + width:40px;
75 79 height:100%;
  80 + position:relative;
76 81 }
77 82 .ans_correct{
78   - background:#f00;
  83 + background:#28be56;
79 84 }
80 85 .ans_error{
81   - background:#ff0;
  86 + background:#ff5353;
82 87 }
83 88 .ans_list{
84 89 display:inline-block;
... ... @@ -86,13 +91,57 @@
86 91 margin:0 10px;
87 92 }
88 93 .ans_list p{
89   - margin:0;
  94 + margin-bottom:0;
  95 + margin-top:5px;
90 96 line-height:20px;
  97 + text-align:center;
  98 + }
  99 + .ans_option{
  100 + cursor: pointer;
91 101 }
92 102 .p_num{
93   -
  103 + position:absolute;
  104 + top:-20px;
94 105 }
95   -
  106 + .ans_error_round{
  107 + width:20px;
  108 + height:20px;
  109 + margin:0 auto;
  110 + background:#ff5353;
  111 + color:#fff;
  112 + border-radius:10px;
  113 + }
  114 + .ans_correct_round{
  115 + width:20px;
  116 + height:20px;
  117 + margin:0 auto;
  118 + background:#28be56;
  119 + color:#fff;
  120 + border-radius:10px;
  121 + }
  122 + .student_list{
  123 + width:100%;
  124 + padding:10px;
  125 + background:#f3f3f3;
  126 + box-sizing:border-box;
  127 + }
  128 + .cle:after{
  129 + visibility:hidden;
  130 + display:block;
  131 + font-size:0;
  132 + content:'\20';
  133 + clear:both;
  134 + height:0;
  135 + }
  136 + .student_list li{
  137 + width:120px;
  138 + height:20px;
  139 + list-style:none;
  140 + text-align:center;
  141 + line-height:20px;
  142 + float:left;
  143 + }
  144 +
96 145 </style>
97 146 </head>
98 147  
... ... @@ -105,7 +154,7 @@
105 154 </div>
106 155 <div class="clear"></div>
107 156 </div>
108   -<div style="padding:0 20px;padding-top:3%;margin-top:102px;">
  157 +<div style="padding:0 20px;padding-top:3%;padding-bottom:3%;margin-top:102px;">
109 158 <div class="overall">
110 159 <h3>作业总体情况:</h3>
111 160 <table class="table table-bordered ">
... ... @@ -117,13 +166,17 @@
117 166 <tbody>
118 167 <tr>
119 168 <td>提交情况:25/30</td>
120   - <td>题量:10</td>
121   - <td>最高得分率:100%</td>
  169 + <td>题量:${page_data.QUESTION_COUNT}</td>
  170 + <td>最高得分率:${page_data.GET_MAX_SCORE*100/page_data.ALL_SCORE}%</td>
122 171 <td>最低得分率:10%</td>
123   - <td>平均得分率:60%</td>
  172 + <td>平均得分率:${page_data.GET_SCORE_PERSENT}</td>
124 173 </tr>
125 174 <tr>
126   - <td colspan="5">未提交人:张三、李四</td>
  175 + <td colspan="5">未提交人:${data[0].STUDENT_NAME }
  176 + <c:forEach items="${data}" begin="1" var="var" varStatus="vs">
  177 + 、${var.STUDENT_NAME}
  178 + </c:forEach>
  179 + </td>
127 180 </tr>
128 181 </tbody>
129 182 </table>
... ... @@ -161,15 +214,40 @@
161 214 <p>正确答案:D 得分率:84%</p>
162 215 <div class="q_charts">
163 216 <div class="ans_list" style="height:50px;">
164   - <p class="p_num">8人</p>
165   - <div class="rel ans_correct"></div>
  217 +
  218 + <div class="rel ans_correct">
  219 + <p class="p_num">8人</p>
  220 + </div>
166 221 <p class="ans_option">A</p>
167 222 </div>
168   - <div class="ans_list" style="height:100px;">
169   - <p class="p_num">8人</p>
170   - <div class="rel ans_correct"></div>
171   - <p class="ans_option">A</p>
  223 + <div class="ans_list" style="height:100px;">
  224 + <div class="rel ans_error">
  225 + <p class="p_num">16人</p>
  226 + </div>
  227 + <p class="ans_option">B</p>
172 228 </div>
  229 + <div class="ans_list" style="height:200px;">
  230 + <div class="rel ans_correct">
  231 + <p class="p_num">32人</p>
  232 + </div>
  233 + <p class="ans_option">C</p>
  234 + </div>
  235 + <div class="ans_list" style="height:150px;">
  236 + <div class="rel ans_correct">
  237 + <p class="p_num">24人</p>
  238 + </div>
  239 + <p class="ans_option ans_correct_round">D</p>
  240 + </div>
  241 + </div>
  242 + <div class="student_list cle">
  243 + <li>黄某某</li>
  244 + <li>黄某某</li>
  245 + <li>黄某某</li>
  246 + <li>黄某某</li>
  247 + <li>黄某某</li>
  248 + <li>黄某某</li>
  249 + <li>黄某某</li>
  250 + <li>黄某某</li>
173 251 </div>
174 252 </div>
175 253 </div>
... ... @@ -196,6 +274,21 @@
196 274  
197 275 <script type="text/javascript">
198 276 $(function() {
  277 + var ans_details = '${page_data.ANSWER_PERSENT}';
  278 +
  279 + if(ans_details != ''){
  280 + var _html="";
  281 + var ans_arry = ans_details.split(",");
  282 + for(i = 0;i<ans_arry.length;i++){
  283 + temp = parseInt(ans_arry[i].replace("%",""));
  284 + if(temp>=80){
  285 + _html+='<li class="list correct">'+i+'('+ans_arry[i]+')'+'</li>';
  286 + }else{
  287 + _html+='<li class="list erro">'+(i+1)+'('+ans_arry[i]+')'+'</li>';
  288 + }
  289 + }
  290 + $(".single ul").html(_html);
  291 + }
199 292  
200 293 //日期框
201 294 $('.date-picker').datepicker({
... ... @@ -350,6 +443,27 @@
350 443  
351 444 $(document).on("click",".list",function(){
352 445 $('#myModal').modal('toggle')
  446 + });
  447 +
  448 + $(document).on("click",".ans_option",function(){
  449 + var className = $(this).siblings(".rel").attr("class");
  450 +
  451 +
  452 + $(".ans_option").attr("class","ans_option");
  453 + if(className.indexOf("ans_error")>0){
  454 + if($(this).hasClass("ans_error_round")){
  455 + return;
  456 + }else{
  457 + $(this).addClass("ans_error_round");
  458 + }
  459 +
  460 + }else{
  461 + if($(this).hasClass("ans_correct_round")){
  462 + return;
  463 + }else{
  464 + $(this).addClass("ans_correct_round");
  465 + }
  466 + }
353 467 })
354 468  
355 469 });
... ...
src/com/fh/controller/sunvote/homework/HomeworkController.java
... ... @@ -308,14 +308,14 @@ public class HomeworkController extends BaseController {
308 308 pageData = homeworkService.findById(pageData);
309 309 List<PageData> data = homeworkReporkService.findNoAnswerByHomeworkID(pageData);
310 310 pageData.put("NO_COUNT", data.size());
311   - modelAndView.addObject("pageData", pageData); // 报表统计情况
  311 + modelAndView.addObject("page_data", pageData); // 报表统计情况
312 312 modelAndView.addObject("data", data);// 未答学生列表
313 313  
314 314 }
315 315 if(isChineseLanguageClient()){
316   - modelAndView.setViewName("sunvote/homework/??????");
  316 + modelAndView.setViewName("sunvote/homework/homework_report");
317 317 }else{
318   - modelAndView.setViewName("sunvote/homework/??????");
  318 + modelAndView.setViewName("sunvote/homework/en_homework_report");
319 319 }
320 320  
321 321 return modelAndView;
... ... @@ -428,7 +428,7 @@ public class HomeworkController extends BaseController {
428 428 String[] answers = answer.split(";");
429 429 if(answers.length >= indexint -1){
430 430 String ans = answers[indexint - 1];
431   - String[] anss = ans.split(":");
  431 + String[] anss = ans.split(",");
432 432 if(anss != null && anss.length == 2){
433 433 PageData tresult = null;
434 434 for(PageData ptd : result){
... ...