homework_report.jsp
14.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>${info.CLASS_NAME}成绩报表</title>
<base href="<%=basePath%>">
<!-- 下拉框 -->
<link rel="stylesheet" href="static/ace/css/chosen.css" />
<link type="text/css" href="static/css/tablescroller.css" rel="stylesheet" />
<!-- <link
href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet"> -->
<link rel="stylesheet" href="static/css/bootstrap.min.css" />
<!-- 日期框 -->
<link rel="stylesheet" href="static/ace/css/datepicker.css" />
<link rel="stylesheet" href="static/css/teach.css" />
<style>
.font span{ font-size: 12px;
font-weight: initial;color:#000;}
.search_btn{width:30px;}
.btn{margin:0 5px;}
.center{height:39px;}
.box_header{position:fixed;top:0;left:0;width:100%;}
.clear{clear:both}
ul{
padding:0;
}
.list{
width:120px;
height:40px;
line-height:40px;
font-weight:bold;
text-align:center;
margin-right:10px;
margin-top:10px;
float:left;
list-style:none;
border:1px solid #ddd;
cursor: pointer;
}
.correct{
color:#28be56;
}
.erro{
color:#ff5353;
}
.overall h3,.single h3{
font-size:16px;
font-weight:bold;
}
.single{
margin-top:50px;
}
.q_charts{
width:100%;
height:240px;
postion:relative;
margin-top:20px;
text-align:center;
}
.rel{
width:40px;
height:100%;
position:relative;
}
.ans_correct{
background:#28be56;
}
.ans_error{
background:#ff5353;
}
.ans_list{
display:inline-block;
margin:0 10px;
}
.ans_list p{
margin:auto;
margin-bottom:0;
margin-top:5px;
line-height:20px;
text-align:center;
}
.ans_option{
cursor: pointer;
}
.p_num{
position:absolute;
top:-20px;
}
.ans_error_round{
width:20px;
height:20px;
margin:0 auto;
background:#ff5353;
color:#fff;
border-radius:10px;
}
.ans_correct_round{
width:20px;
height:20px;
margin:0 auto;
background:#28be56;
color:#fff;
border-radius:10px;
}
.student_list{
width:100%;
padding:10px;
background:#f3f3f3;
box-sizing:border-box;
}
.cle:after{
visibility:hidden;
display:block;
font-size:0;
content:'\20';
clear:both;
height:0;
}
.student_list li{
width:120px;
height:20px;
list-style:none;
text-align:center;
line-height:20px;
float:left;
}
</style>
</head>
<body style="background:#fff;height:auto;">
<div class="box_header">
<div class="head_box_l">
<p>
<span class="right_b"></span>练习报表
</p>
</div>
<div class="clear"></div>
</div>
<div style="padding:0 20px;padding-top:3%;padding-bottom:3%;margin-top:102px;">
<div class="overall">
<h3>作业总体情况:</h3>
<table class="table table-bordered ">
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 20%" />
<tbody>
<tr>
<td>提交情况:${page_data.COMPLETE_DESC}</td>
<td>题量:${page_data.QUESTION_COUNT}</td>
<td>最高得分率:<fmt:formatNumber type="number"
value="${page_data.ALL_SCORE == 0 ? 0: (page_data.GET_MAX_SCORE*100 / page_data.ALL_SCORE )}"
maxFractionDigits="2" />%</td>
<td>最低得分率:<fmt:formatNumber type="number"
value="${page_data.ALL_SCORE == 0 ? 0: (page_data.GET_MIN_SCORE*100 / page_data.ALL_SCORE )}"
maxFractionDigits="2" />%</td>
<td>平均得分率:${page_data.GET_SCORE_PERSENT}</td>
</tr>
<tr>
<td colspan="5">未提交人:${data[0].STUDENT_NAME }
<c:forEach items="${data}" begin="1" var="var" varStatus="vs">
、${var.STUDENT_NAME}
</c:forEach>
</td>
</tr>
</tbody>
</table>
</div>
<div class="single">
<h3>单题正确率详情:</h3>
<ul>
<li class="list correct">1(60%)</li>
<li class="list erro">2(60%)</li>
<li class="list correct">3(60%)</li>
<li class="list correct">4(60%)</li>
<li class="list correct">5(60%)</li>
<li class="list correct">6(60%)</li>
<li class="list correct">7(60%)</li>
<li class="list correct">8(60%)</li>
<li class="list correct">9(60%)</li>
<li class="list correct">10(60%)</li>
<li class="list correct">11(60%)</li>
<li class="list correct">12(60%)</li>
</ul>
<div class="clear"></div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document" style="z-index:1041">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">第一题【3分】</h4>
</div>
<div class="modal-body">
<p>正确答案:D 得分率:84%</p>
<div class="q_charts">
<div class="ans_list" style="height:50px;">
<div class="rel ans_correct">
<p class="p_num">8人</p>
</div>
<p class="ans_option">A</p>
</div>
<div class="ans_list" style="height:100px;">
<div class="rel ans_error">
<p class="p_num">16人</p>
</div>
<p class="ans_option">B</p>
</div>
<div class="ans_list" style="height:200px;">
<div class="rel ans_correct">
<p class="p_num">32人</p>
</div>
<p class="ans_option">C</p>
</div>
<div class="ans_list" style="height:150px;">
<div class="rel ans_correct">
<p class="p_num">24人</p>
</div>
<p class="ans_option ans_correct_round">D</p>
</div>
</div>
<div class="student_list cle">
<li>黄某某</li>
<li>黄某某</li>
<li>黄某某</li>
<li>黄某某</li>
<li>黄某某</li>
<li>黄某某</li>
<li>黄某某</li>
<li>黄某某</li>
</div>
</div>
</div>
</div>
</div>
<%@ include file="../../system/index/foot.jsp"%>
<script src="static/ace/js/bootbox.js"></script>
<!-- ace scripts -->
<script src="static/ace/js/ace/ace.js"></script>
<!-- 下拉框 -->
<script src="static/ace/js/chosen.jquery.js"></script>
<!-- 日期框 -->
<script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
<!--提示框-->
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
<script language="javascript" src="static/js/tablescroller.js"></script>
<script language="javascript" src="static/js/tablescroller.jquery.js"></script>
<script type="text/javascript">
$(function() {
var ans_details = '${page_data.ANSWER_PERSENT}';
if(ans_details != ''){
var _html="";
var ans_arry = ans_details.split(",");
for(i = 0;i<ans_arry.length;i++){
temp = parseInt(ans_arry[i].replace("%",""));
if(temp>=80){
_html+='<li class="list correct">'+i+'('+ans_arry[i]+')'+'</li>';
}else{
_html+='<li class="list erro">'+(i+1)+'('+ans_arry[i]+')'+'</li>';
}
}
$(".single ul").html(_html);
}
//日期框
$('.date-picker').datepicker({
autoclose : true,
todayHighlight : true
});
//下拉框
if (!ace.vars['touch']) {
$('.chosen-select').chosen({
allow_single_deselect : true
});
$(window).off('resize.chosen').on('resize.chosen', function() {
$('.chosen-select').each(function() {
var $this = $(this);
$this.next().css({
'width' : $this.parent().width()
});
});
}).trigger('resize.chosen');
$(document).on('settings.ace.chosen',
function(e, event_name, event_val) {
if (event_name != 'sidebar_collapsed')
return;
$('.chosen-select').each(function() {
var $this = $(this);
$this.next().css({
'width' : $this.parent().width()
});
});
});
$('#chosen-multiple-style .btn').on(
'click',
function(e) {
var target = $(this).find('input[type=radio]');
var which = parseInt(target.val());
if (which == 2)
$('#form-field-select-4').addClass(
'tag-input-style');
else
$('#form-field-select-4').removeClass(
'tag-input-style');
});
}
//复选框全选控制
var active_class = 'active';
$('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on(
'click',
function() {
var th_checked = this.checked;//checkbox inside "TH" table header
$(this).closest('table').find('tbody > tr').each(
function() {
var row = this;
if (th_checked)
$(row).addClass(active_class).find(
'input[type=checkbox]').eq(0)
.prop('checked', true);
else
$(row).removeClass(active_class).find(
'input[type=checkbox]').eq(0)
.prop('checked', false);
});
});
});
var role = '${pd.ROLE}';
function precent(avg,total){
if(total == 0){
return "0%"
}
return Math.round(avg / total * 100)/100 + '%' ;
}
function homeReport(classId){
var path = '<%=basePath%>homework/report.do?School_id=${pd.SCHOOL_ID}&CLASS_ID='+classId;
console.log(path);
parent.$("#mainFrame").attr('src',path);
window.top.loading.show();
}
function tosearch(){
var url = "<%=basePath%>homework/report.do?CLASS_ID=${pd.CLASS_ID}" ;
var startDate = $("#lastStart").val();
var endDate = $("#lastEnd").val();
//var subject_id = $("#SUBJECT_ID").val();
url = url + "&START_DATE=" + startDate ;
if(endDate != null){
url = url + "&END_DATE=" + endDate;
}
window.location.href = url;
window.top.loading.show();
/* $("#Form").sumbit(); */
}
function tosearch_week(type){ //上一周 本周 下一周
console.log('${pd.CLASS_ID}');
var url = "<%=basePath%>homework/report.do?CLASS_ID=${pd.CLASS_ID}" ;
url = url + "&CURRENT_WEEK=" + type ;
console.log(url);
window.location.href = url;
window.top.loading.show();
/* $("#Form").sumbit(); */
}
function student(classid,studentid){
var url = "<%=basePath%>homework/student.do?STUDENT_ID=" + studentid + "&CLASS_ID=" + classid ;
var startDate = $("#lastStart").val();
var endDate = $("#lastEnd").val();
url = url + "&START_DATE=" + startDate + "&END_DATE=" + endDate ;
window.location.href = url;
window.top.loading.show();
}
function paper(class_id,testpaper_id){
var url = "<%=basePath%>homework/homework_report?HOMEWORK_ID=" + testpaper_id + "&CLASS_ID=" + class_id;
var startDate = $("#lastStart").val();
var endDate = $("#lastEnd").val();
url = url + "&START_DATE=" + startDate + "&END_DATE=" + endDate ;
window.self.location.href = url;
window.top.loading.show();
}
$(document).ready(function(){
window.top.loading.remove();
var sour = "${pd.DATA.HOMEWORKS}";
if(sour != null && sour.length > 3){
var _width = $('#mainFrame', parent.document).width()-40;
var _heigh = $('#mainFrame', parent.document).height()-350;
var options = {
width: _width,
height: _heigh,
pinnedRows: 5,
pinnedCols: 4,
container: "#scrollableTable",
removeOriginal: true
};
$("#simple-table").tablescroller(options);
var name_height = $(".kc").last().parent().height()-18.5;
console.log(name_height);
$(".th_name").height(name_height);
}
var data ={};
$(document).on("click",".list",function(){
$.ajax({
url:"<%=basePath%>homework/homeworkindex",
type:"post",
data:{HOMEWORK_ID:'${page_data.HOMEWORK_ID}',INDEX:($(this).index()+1)},
success:function(res){
res = JSON.parse(res);
data=res.DATA;
console.log(res.ANSWER);
var stundent_num=[];
var _html='';
for(j=0;j<res.DATA.length;j++){
stundent_num[j]=res.DATA[j].length;
}
max_num=Math.max.apply(null,stundent_num);
for(i=0;i<res.DATA.length;i++){
if(String.fromCharCode(65+i)==res.ANSWER){
_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>'
}else{
_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>';
}
}
var student_option_list='';
for(i=1;i<data[0].length;i++){
student_option_list+='<li>'+data[0][i]+'</li>';
}
$(".student_list").html(student_option_list);
$(".q_charts").html(_html);
//console.log(max_num);
$('#myModal').modal('toggle')
}
})
});
$(document).on("click",".ans_option",function(){
var className = $(this).siblings(".rel").attr("class");
$(".ans_option").attr("class","ans_option");
if(className.indexOf("ans_error")>0){
if($(this).hasClass("ans_error_round")){
return;
}else{
$(this).addClass("ans_error_round");
}
}else{
if($(this).hasClass("ans_correct_round")){
return;
}else{
$(this).addClass("ans_correct_round");
}
}
//显示答题名单
var _index = $(this).closest(".ans_list").index();
console.log(data[_index].length);
var student_option_list='';
for(i=1;i<data[_index].length;i++){
student_option_list+='<li>'+data[_index][i]+'</li>';
}
$(".student_list").html(student_option_list);
})
});
</script>
</body>
</html>