Commit 90f42dacfb51dd115b79a2f588b9f06de1185976

Authored by jack
1 parent 61c5da7d

1.完善报表页面

WebRoot/WEB-INF/jsp/sunvote/homework/homework_report.jsp
... ... @@ -172,7 +172,9 @@
172 172 <td>最高得分率:<fmt:formatNumber type="number"
173 173 value="${page_data.ALL_SCORE == 0 ? 0: (page_data.GET_MAX_SCORE*100 / page_data.ALL_SCORE )}"
174 174 maxFractionDigits="2" />%</td>
175   - <td>最低得分率:10%</td>
  175 + <td>最低得分率:<fmt:formatNumber type="number"
  176 + value="${page_data.ALL_SCORE == 0 ? 0: (page_data.GET_MIN_SCORE*100 / page_data.ALL_SCORE )}"
  177 + maxFractionDigits="2" />%</td>
176 178 <td>平均得分率:${page_data.GET_SCORE_PERSENT}</td>
177 179 </tr>
178 180 <tr>
... ... @@ -445,6 +447,7 @@
445 447 }
446 448  
447 449  
  450 + var data ={};
448 451 $(document).on("click",".list",function(){
449 452 $.ajax({
450 453 url:"<%=basePath%>homework/homeworkindex",
... ... @@ -452,28 +455,28 @@
452 455 data:{HOMEWORK_ID:'${page_data.HOMEWORK_ID}',INDEX:($(this).index()+1)},
453 456 success:function(res){
454 457 res = JSON.parse(res);
455   - console.log(res);
  458 + data=res.DATA;
  459 + console.log(res.ANSWER);
  460 +
456 461 var stundent_num=[];
457 462 var _html='';
458   - for(i=0;i<res.length;i++){
459   - if(typeof(res[i].STUDENTS) =="undefined"){
460   - stundent_num[i]=0;
461   - }else{
462   - stundent_num[i]=res[i].STUDENTS.length;
463   - }
  463 + for(j=0;j<res.DATA.length;j++){
  464 + stundent_num[j]=res.DATA[j].length;
464 465 }
465 466 max_num=Math.max.apply(null,stundent_num);
466   - for(i=0;i<res.length;i++){
467   - if(typeof(res[i].RIGHT) =="undefined"){
468   - _html += '<div class="ans_list" style="height:'+(stundent_num[i]*200/max_num).toFixed(2)+'px;"><div class="rel ans_error"><p class="p_num">'+stundent_num[i]+'人</p></div><p class="ans_option">'+res[i].ANSWER+'</p></div>';
469   -
  467 + for(i=0;i<res.DATA.length;i++){
  468 + if(String.fromCharCode(65+i)==res.ANSWER){
  469 + _html += '<div class="ans_list" style="height:'+(stundent_num[i]*200/max_num).toFixed(2)+'px;"><div class="rel ans_correct"><p class="p_num">'+res.DATA[i].length+'人</p></div><p class="ans_option">'+String.fromCharCode(65+i)+'</p></div>'
470 470 }else{
471   - if(res[i].RIGHT == true)
472   - _html += '<div class="ans_list" style="height:'+(stundent_num[i]*200/max_num).toFixed(2)+'px;"><div class="rel ans_correct"><p class="p_num">'+stundent_num[i]+'人</p></div><p class="ans_option">'+res[i].ANSWER+'</p></div>'
473   - else
474   - _html += '<div class="ans_list" style="height:'+(stundent_num[i]*200/max_num).toFixed(2)+'px;"><div class="rel ans_error"><p class="p_num">'+stundent_num[i]+'人</p></div><p class="ans_option">'+res[i].ANSWER+'</p></div>';
  471 + _html += '<div class="ans_list" style="height:'+(stundent_num[i]*200/max_num).toFixed(2)+'px;"><div class="rel ans_error"><p class="p_num">'+res.DATA[i].length+'人</p></div><p class="ans_option">'+String.fromCharCode(65+i)+'</p></div>';
475 472 }
476 473 }
  474 + var student_option_list='';
  475 + for(i=1;i<data[0].length;i++){
  476 + student_option_list+='<li>'+data[0][i]+'</li>';
  477 + }
  478 + $(".student_list").html(student_option_list);
  479 +
477 480 $(".q_charts").html(_html);
478 481 //console.log(max_num);
479 482 $('#myModal').modal('toggle')
... ... @@ -501,6 +504,16 @@
501 504 $(this).addClass("ans_correct_round");
502 505 }
503 506 }
  507 +
  508 + //显示答题名单
  509 + var _index = $(this).closest(".ans_list").index();
  510 + console.log(data[_index].length);
  511 + var student_option_list='';
  512 + for(i=1;i<data[_index].length;i++){
  513 + student_option_list+='<li>'+data[_index][i]+'</li>';
  514 + }
  515 + $(".student_list").html(student_option_list);
  516 +
504 517 })
505 518  
506 519 });
... ...
resources/mybatis1/sunvote/HomeworkProblemMapper.xml
... ... @@ -100,7 +100,7 @@
100 100 from
101 101 <include refid="tableName"></include>
102 102 where
103   - CODE = #{CODE},
  103 + CODE = #{CODE}
104 104 and RANK = #{RANK}
105 105 </select>
106 106  
... ...