c617106f
孙向锦
添加即时测功能
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<%@ 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 prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>即时测</title>
<!-- Bootstrap -->
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
|
757dfed6
孙向锦
样例报表
|
19
20
|
<link rel="stylesheet" href="../static/ace/css/datepicker.css" />
|
c617106f
孙向锦
添加即时测功能
|
21
|
<link href="../static/css/teach.css" rel="stylesheet">
|
757dfed6
孙向锦
样例报表
|
22
|
<link href="../static/css/paper.css?t=1" rel="stylesheet">
|
c617106f
孙向锦
添加即时测功能
|
23
24
|
</head>
<body>
|
757dfed6
孙向锦
样例报表
|
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
|
<div class="head_box">
<div class="box_header">
<div class="head_box_l">
<p>
<span class="right_b"></span>即时测试卷管理
</p>
</div>
<div class="head_box_r">
<input class="date-picker" type="text" placeholder="开始日期" name="lastStart" id="lastStart" data-date-format="yyyy-mm-dd" readonly="readonly" value=""/>
<input type="text" class="date-picker" placeholder="结束日期" name="lastEnd" id="lastEnd" data-date-format="yyyy-mm-dd" readonly="readonly" value=""/>
<select name="dealer_id_2" id="dealer_id_2" class="selectpicker show-tick form-control" data-width="98%" data-first-option="false" required data-live-search="true">
<!--<option value="0">初一1501班</option>
<option value="0">初一1502班</option>
<option value="0">初一1503班</option>
<option value="0">初一1504班</option>
<option value="0">初一1505班</option>-->
</select>
<a onclick="tosearch();"><img
src="../static/images/search.png" /></a>
</div>
<div class="clear"></div>
</div>
<div style="padding:0 5%;background:#fff;">
<table class="table table-striped">
<col style="width: 10%" />
<col style="width: 20%" />
<col style="width: 10%" />
<col style="width: 10%" />
<col style="width: 10%" />
<col style="width: 20%" />
<col style="width: 10%" />
<col style="width: 10%" />
<thead>
<tr>
<th><input type="checkbox" name='ids' id="ids" />序号</th>
<th>试卷名称</th>
<th>班级</th>
<th>科目</th>
<th>考试时长</th>
<th>创建时间</th>
<th>查看</th>
<th>操作</th>
</tr>
</thead>
</table>
</div>
<div class="clearfix"></div>
|
c617106f
孙向锦
添加即时测功能
|
73
|
</div>
|
757dfed6
孙向锦
样例报表
|
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
|
<div class="table_box">
<table class="table table-striped">
<col style="width: 10%" />
<col style="width: 20%" />
<col style="width: 10%" />
<col style="width: 10%" />
<col style="width: 10%" />
<col style="width: 20%" />
<col style="width: 10%" />
<tbody id="tab_body">
</tbody>
</table>
<div class="footer">
<div class="creat">
<input type="button" id="creatPaper" value="新建试卷" />
</div>
<div class="removeAll">
<input type="button" onclick="deleteAll()" value="批量删除" />
</div>
<div class="page_box">
<div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div>
</div>
</div>
|
c617106f
孙向锦
添加即时测功能
|
101
|
</div>
|
757dfed6
孙向锦
样例报表
|
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
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<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">请选择班级</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="classList">
<ul>
</ul>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" id="submit" onclick="setQUestion()">确定</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
|
c617106f
孙向锦
添加即时测功能
|
127
|
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
|
757dfed6
孙向锦
样例报表
|
128
129
130
131
|
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="../static/ace/js/date-time/bootstrap-datepicker.js"></script>
<script src="../static/ace/js/bootbox.js"></script>
|
c617106f
孙向锦
添加即时测功能
|
132
|
<script>
|
757dfed6
孙向锦
样例报表
|
133
134
135
136
|
var url="/SunvoteEducation";
var class_html="",option_html="";
var user_id= "",
|
c617106f
孙向锦
添加即时测功能
|
137
138
139
|
subject_id="",
class_id="";
$(document).ready(function(){
|
757dfed6
孙向锦
样例报表
|
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
|
getList();
timeList();
$.ajax({
url:url+"/teacher/info",
async:false,
type:"post",
success:function(data){
console.log(data);
subject_id=data.data.subjectList[0].SUBJECT_ID;
user_id=data.data.ID;
if(data.data.classInfoList.length>0){
for(var i=0;i<data.data.classInfoList.length;i++){
class_html += '<li data-classId="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</li>';
option_html += '<option value="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</option>'
}
$(".classList").html(class_html+'<div class="clearfix"></div>');
$("#dealer_id_2").html(option_html);
}
}
})
//日期框
$('.date-picker').datepicker({
autoclose: true,
todayHighlight: true
});
window.top.loading.remove();
})
function getList(start_date,end_date,class_id){
var tab_html="";
|
c617106f
孙向锦
添加即时测功能
|
172
173
174
175
176
177
178
179
180
|
$.ajax({
url:url+"/api/v1/paper",
async:false,
type:"post",
data:{
paper_type:"101",
user_id:user_id,
subject_id:subject_id,
class_id:class_id,
|
757dfed6
孙向锦
样例报表
|
181
182
183
184
|
currentpage:"1",
showcount:"",
start_date:start_date,
end_date:end_date
|
c617106f
孙向锦
添加即时测功能
|
185
186
|
},
success:function(data){
|
757dfed6
孙向锦
样例报表
|
187
|
console.log(data);
|
c617106f
孙向锦
添加即时测功能
|
188
|
for(var i=0;i<data.data.length;i++){
|
757dfed6
孙向锦
样例报表
|
189
|
tab_html += '<tr data-id="'+data.data[i].PAPER_ID+'" data-classid="'+data.data[i].CLASS_ID+'"><td><input type="checkbox" name="ids" id="ids" value="'+data.data[i].PAPER_ID+'"/>'+(i+1)+'</td><td>'+data.data[i].TITLE+'</td><td>'+getClassName(data.data[i].CLASS_ID)+'</td><td>'+getSubjectName(data.data[i].SUBJECT_ID)+'</td><td>'+data.data[i].EXAM_TIME+'分钟</td><td>'+data.data[i].CREATE_DATE+'</td><td><a onclick="jump($(this))">查看</a></td><td><a href="#" onclick="del($(this));"><img src="../static/images/remove.png" /></a></td></tr>';
|
c617106f
孙向锦
添加即时测功能
|
190
191
|
}
$("#tab_body").html(tab_html);
|
757dfed6
孙向锦
样例报表
|
192
|
window.top.loading.remove();
|
c617106f
孙向锦
添加即时测功能
|
193
|
}
|
757dfed6
孙向锦
样例报表
|
194
195
196
197
198
199
200
201
202
203
204
|
});
}
$('#ids').on('click', function(){
var th_checked = $("#ids").prop('checked');//checkbox inside "TH" table header
$(".table_box .table").find('tbody > tr').each(function(){
var row = this;
if(th_checked) $(row).find('input[type=checkbox]').eq(0).prop('checked', true);
else $(row).find('input[type=checkbox]').eq(0).prop('checked', false);
});
});
|
c617106f
孙向锦
添加即时测功能
|
205
|
function jump(obj){
|
757dfed6
孙向锦
样例报表
|
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
var id=obj.closest("tr").attr("data-id");
var classid=obj.closest("tr").attr("data-classid");
location.href="paper_view.do?PAPER_ID="+id+"&classID="+classid+"&userid="+user_id;
}
$(".classList").on("click","li",function(){
$(this).siblings().removeClass("active");
$(this).addClass("active");
class_id=$(this).attr("data-classid");
});
$("#creatPaper").click(function(){
$('#myModal').modal('show');
});
function setQUestion(){
if($(".classList .active").length>0){
|
9f7ad69b
孙向锦
吴杰0827修改
|
220
|
location.href="set_question.do?subject_id="+subject_id+"&class_id="+class_id+"&user_id="+user_id;
|
757dfed6
孙向锦
样例报表
|
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
|
}else{
alert("请先选择班级");
}
window.top.loading.show();
console.log($(".classList .active").length);
//location.href="";
}
function getSubjectName(id){
var subjectName="";
$.ajax({
url:url+"/api/v1/subjectcname",
async:false,
type:"post",
data:{id:id},
success:function(data){
subjectName=data.data;
}
})
return subjectName;
}
function getClassName(id){
var className="";
$.ajax({
url:url+"/api/v1/classname",
async:false,
type:"post",
data:{id:id},
success:function(data){
className=data.data;
}
})
return className;
}
function getday(month){
var time=[];
var d= new Date();
d.setMonth(month-1);
d.setDate(1);
var day=d.getDate();
var month=d.getMonth()+1;
if((d.getMonth()+1)<10){
var month="0"+(d.getMonth()+1);
}
var year=d.getFullYear();
var startTime=year+"-"+month+"-"+day;
d.setMonth(month);
var end_day=d.getDate();
var end_month=d.getMonth()+1;
if((d.getMonth()+1)<10){
var end_month="0"+(d.getMonth()+1);
}
var end_year=d.getFullYear();
var endTime=end_year+"-"+end_month+"-"+end_day;
time[0]=startTime;
time[1]=endTime;
return time;
}
function timeList(){
var time = new Date();
var now_month=time.getMonth()+1;
time.setMonth(now_month-1)
if(time.getMonth()!= 0 ){
var preceding_month = time.getMonth();
}else
var preceding_month = 12;
time.setMonth(now_month-2)
if(time.getMonth()!= 0 ){
var last_month = time.getMonth();
}else
var last_month = 12;
var option_html="";
option_html += '<option value="'+now_month+'">'+now_month+'月</option><option value="'+preceding_month+'">'+preceding_month+'月</option><option value="'+last_month+'">'+last_month+'月</option>';
$("#dealer_id_1").html(option_html);
}
function tosearch(){
//var timeBox=getday($("#dealer_id_1").val());
var start_date=$("#lastStart").val();
var end_date=$("#lastEnd").val();
var class_id=$("#dealer_id_2").val();
getList(start_date,end_date,class_id);
}
function del(obj){
//var remove = new remove();
var id=obj.closest("tr").attr("data-id");
window.top.remove.init({"title":"删除","func":function(success){
if(success){
var url = "<%=basePath%>paper/delete.do?PAPER_ID="+id+"&tm="+new Date().getTime();
window.top.loading.show();
$.get(url,function(data){
tosearch();
});
}
else{
console.log("false");
}
}});
window.top.remove.show();
}
function deleteAll(){
window.top.remove.init({"title":"删除","func":function(success){
if(success){
var str = '';
for(var i=0;i < document.getElementsByName('ids').length;i++){
if(document.getElementsByName('ids')[i].checked){
if(str=='') str += document.getElementsByName('ids')[i].value;
else str += ',' + document.getElementsByName('ids')[i].value;
}
}
if(str==''){
}else{
$.ajax({
type: "POST",
url: '<%=basePath%>paper/deleteAll.do?tm='+new Date().getTime(),
data: {DATA_IDS:str},
dataType:'json',
//beforeSend: validateData,
cache: false,
success: function(data){
$.each(data.list, function(i, list){
tosearch();
});
}
});
}
}
else{
console.log("false");
}
}});
window.top.remove.show();
|
c617106f
孙向锦
添加即时测功能
|
353
|
}
|
c617106f
孙向锦
添加即时测功能
|
354
355
|
</script>
</html>
|