Commit ff7ab13edb06dba67e0a430e8c700f4c33c9a8e3
1 parent
ddbc622f
修复一些小bug
Showing
7 changed files
with
156 additions
and
126 deletions
WebRoot/WEB-INF/jsp/sunvote/teacher/teach_paper.jsp
... | ... | @@ -124,5 +124,5 @@ |
124 | 124 | <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> |
125 | 125 | <script src="../static/ace/js/date-time/bootstrap-datepicker.js"></script> |
126 | 126 | <script src="../static/ace/js/bootbox.js"></script> |
127 | - <script src="../static/js/teach_paper.js?a=1"></script> | |
127 | + <script src="../static/js/teach_paper.js?a=2"></script> | |
128 | 128 | </html> |
129 | 129 | \ No newline at end of file | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 | </ul> |
102 | 102 | </li> |
103 | 103 | <li> |
104 | - <p>云测验测验分析</p> | |
104 | + <p>即时测测验分析</p> | |
105 | 105 | <ul class="menu_2"> |
106 | 106 | <c:forEach items="${pd.TEACHER}" var="var" varStatus="vs"> |
107 | 107 | <li onclick="event.stopPropagation();report2('${var.CLASS_ID}')"><p>${var.CLASS_NAME} 成绩</p></li> | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_report_1.jsp
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | <th class="center"><div style="width:80px;">课程总分</div></th> |
68 | 68 | <c:forEach items="${testpaperList}" var="var" varStatus="vs"> |
69 | 69 | <th class="center kc"><a |
70 | - onclick="paper('${info.CLASS_ID}','${var.TESTPAPER_ID}');"><div style="width:180px;" class="font">${var.NAME}</br><span>${var.CREATE_DATE}</span></div></a></th> | |
70 | + onclick="paper('${info.CLASS_ID}','${var.TESTPAPER_ID}');"><div style="width:180px; margin: 0 auto;" class="font">${var.NAME}</br><span>${var.CREATE_DATE}</span></div></a></th> | |
71 | 71 | </c:forEach> |
72 | 72 | </tr> |
73 | 73 | </thead> |
... | ... | @@ -249,36 +249,27 @@ |
249 | 249 | $(document).ready(function(){ |
250 | 250 | window.top.loading.remove(); |
251 | 251 | |
252 | + var sour = "${testpaperList}"; | |
252 | 253 | |
253 | - | |
254 | - //alert(window.top.document.getElmentById("mainFrame").clienHeight); | |
255 | - var _width = $('#mainFrame', parent.document).width()-40; | |
256 | - var _heigh = $('#mainFrame', parent.document).height()-100; | |
257 | - //console.log(_heigh); | |
258 | - | |
259 | - var options = { | |
260 | - width: _width, | |
261 | - height: _heigh, | |
262 | - pinnedRows: 4, | |
263 | - pinnedCols: 3, | |
264 | - container: "#scrollableTable", | |
265 | - removeOriginal: true | |
266 | - }; | |
267 | - | |
268 | - var sour = ${testpaperList}; | |
269 | - | |
270 | - if(sour != null && sour.length > 0){ | |
271 | - $("#simple-table").tablescroller(options); | |
272 | - var name_height = $(".kc").last().parent().height()-18.5; | |
273 | - console.log(name_height); | |
274 | - $(".th_name").height(name_height); | |
254 | + if(sour != null && sour.length > 3){ | |
255 | + var _width = $('#mainFrame', parent.document).width()-40; | |
256 | + var _heigh = $('#mainFrame', parent.document).height()-100; | |
257 | + var options = { | |
258 | + width: _width, | |
259 | + height: _heigh, | |
260 | + pinnedRows: 4, | |
261 | + pinnedCols: 3, | |
262 | + container: "#scrollableTable", | |
263 | + removeOriginal: true | |
264 | + }; | |
265 | + $("#simple-table").tablescroller(options); | |
266 | + var name_height = $(".kc").last().parent().height()-18.5; | |
267 | + console.log(name_height); | |
268 | + $(".th_name").height(name_height); | |
275 | 269 | } |
276 | 270 | |
277 | 271 | }); |
278 | 272 | |
279 | - | |
280 | - //console.log('${studentList}'); | |
281 | - | |
282 | 273 | </script> |
283 | 274 | |
284 | 275 | </body> | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/teacher/test_list.jsp
... | ... | @@ -25,7 +25,7 @@ |
25 | 25 | <div class="box_header"> |
26 | 26 | <div class="head_box_l"> |
27 | 27 | <p> |
28 | - <span class="right_b"></span>云测验测验分析 | |
28 | + <span class="right_b"></span>即时测测验分析 | |
29 | 29 | </p> |
30 | 30 | </div> |
31 | 31 | <div class="head_box_r"> |
... | ... | @@ -46,9 +46,9 @@ |
46 | 46 | <thead> |
47 | 47 | <tr> |
48 | 48 | <th>序号</th> |
49 | - <th>创建时间</th> | |
49 | + <th>测验名称</th> | |
50 | 50 | <th>班级</th> |
51 | - <th>试卷名称</th> | |
51 | + <th>创建时间</th> | |
52 | 52 | <th>查看</th> |
53 | 53 | </tr> |
54 | 54 | </thead> |
... | ... | @@ -79,5 +79,8 @@ |
79 | 79 | <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> |
80 | 80 | <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> |
81 | 81 | <script src="../static/ace/js/date-time/bootstrap-datepicker.js"></script> |
82 | - <script src="../static/js/test_list.js"></script> | |
82 | + <script type="text/javascript"> | |
83 | + var user_id= "${pd.userId}"; | |
84 | + </script> | |
85 | + <script src="../static/js/test_list.js?a=2"></script> | |
83 | 86 | </html> |
84 | 87 | \ No newline at end of file | ... | ... |
WebRoot/static/js/set_question.js
... | ... | @@ -7,6 +7,8 @@ var url=""; |
7 | 7 | var pageNum=1; |
8 | 8 | var end=0; |
9 | 9 | var flag=0; |
10 | + var paper_title = "" ; | |
11 | + var paper_time = "0" ; | |
10 | 12 | |
11 | 13 | |
12 | 14 | $(document).ready(function(){ |
... | ... | @@ -35,6 +37,9 @@ var url=""; |
35 | 37 | for(var i=0;i<data.data.length;i++){ |
36 | 38 | point_html +='<li data-id="'+data.data[i].KNOWLEDGE_ID+'" data-img-click=0 data-span-click=0><img src="../static/images/add.png" class="add" /><span>'+(i+1)+data.data[i].NAME+'</span></li>'; |
37 | 39 | } |
40 | + if(data.data.length > 0){ | |
41 | + paper_title = data.data[0].NAME; | |
42 | + } | |
38 | 43 | $(".section").children("ul").html(point_html); |
39 | 44 | getQuestion($(".section li").eq(0)); |
40 | 45 | } |
... | ... | @@ -269,11 +274,13 @@ var url=""; |
269 | 274 | pageNum=1; |
270 | 275 | $(".question_box ul").html(""); |
271 | 276 | var that=$(this).closest("li"); |
272 | - if($(".tab .active").attr("data-index")==1){ | |
277 | + if($(".tab .active").attr("data-index")==1){ | |
278 | + paper_title = this.textContent; | |
273 | 279 | getQuestion(that); |
274 | 280 | $(".menu_active").removeClass(); |
275 | 281 | that.addClass("menu_active"); |
276 | 282 | }else{ |
283 | + paper_title = this.textContent; | |
277 | 284 | getQuestion(that); |
278 | 285 | $(".menu_active").removeClass(); |
279 | 286 | that.addClass("menu_active"); |
... | ... | @@ -339,10 +346,14 @@ var url=""; |
339 | 346 | } |
340 | 347 | }); |
341 | 348 | $(".topic").click(function(){ |
342 | - if(parseInt($("#all_que_num").text())>0) | |
349 | + if(parseInt($("#all_que_num").text())>0){ | |
350 | + paper_time = parseInt($("#all_que_num").text()) > 75 ? "150" : (parseInt($("#all_que_num").text()) * 2); | |
351 | + $("#title").val(paper_title); | |
352 | + $("#time").val(paper_time); | |
343 | 353 | $('#myModal').modal('show'); |
344 | - else | |
354 | + }else{ | |
345 | 355 | alert("请先选择题目") |
356 | + } | |
346 | 357 | }); |
347 | 358 | $(".view_more").click(function(){ //加载更多 |
348 | 359 | flag++; |
... | ... | @@ -376,7 +387,7 @@ var url=""; |
376 | 387 | grade_id: "", |
377 | 388 | class_id: class_id, |
378 | 389 | user_id: user_id, |
379 | - score: "100", | |
390 | + score: "", | |
380 | 391 | questions: question_arry |
381 | 392 | }; |
382 | 393 | sessionStorage.setItem("data",JSON.stringify(data)); | ... | ... |
WebRoot/static/js/teach_paper.js
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | subject_id="", |
6 | 6 | class_id=""; |
7 | 7 | $(document).ready(function(){ |
8 | - getList(); | |
8 | + | |
9 | 9 | timeList(); |
10 | 10 | $.ajax({ |
11 | 11 | url:url+"/SunvoteEducation/teacher/info", |
... | ... | @@ -25,6 +25,7 @@ |
25 | 25 | $(".classList li").eq(0).addClass("active"); |
26 | 26 | $("#dealer_id_2").html(option_html); |
27 | 27 | } |
28 | + getList(); | |
28 | 29 | } |
29 | 30 | }) |
30 | 31 | ... | ... |
WebRoot/static/js/test_list.js
1 | -var url=""; | |
2 | - | |
3 | - var option_html=""; | |
4 | - var user_id= "8dbef15bb6d043ec94b719ede583b033", | |
5 | - subject_id=""; | |
6 | - | |
7 | - function getQueryString(name) { | |
8 | - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); | |
9 | - var r = window.location.search.substr(1).match(reg); | |
10 | - if (r != null) return unescape(r[2]); return null; | |
11 | - } | |
12 | - var class_id=getQueryString("classid"); | |
13 | - $(document).ready(function(){ | |
14 | - getList(); | |
15 | - $.ajax({ | |
16 | - url:url+"/SunvoteEducation/teacher/info", | |
17 | - async:false, | |
18 | - type:"post", | |
19 | - success:function(data){ | |
20 | - subject_id=data.data.subjectList[0].SUBJECT_ID; | |
21 | - user_id=data.data.ID; | |
22 | - if(data.data.classInfoList.length>0){ | |
23 | - for(var i=0;i<data.data.classInfoList.length;i++){ | |
24 | - option_html += '<option value="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</option>' | |
25 | - } | |
26 | - $("#dealer_id_2").html(option_html); | |
27 | - } | |
28 | - } | |
29 | - }) | |
30 | - //日期框 | |
31 | - $('.date-picker').datepicker({ | |
32 | - autoclose: true, | |
33 | - todayHighlight: true | |
34 | - }); | |
35 | - window.top.loading.remove(); | |
36 | - }) | |
37 | - function getList(start_date,end_date,class_id){ //获取测验列表 | |
38 | - var tab_html=""; | |
39 | - $.ajax({ | |
40 | - url:url+"/SunvoteEducation/api/v1/testpaper", | |
41 | - async:false, | |
42 | - type:"post", | |
43 | - data:{ | |
44 | - paper_type:"101", | |
45 | - user_id:user_id, | |
46 | - subject_id:subject_id, | |
47 | - class_id:class_id, | |
48 | - currentpage:"1", | |
49 | - showcount:"", | |
50 | - start_date:start_date, | |
51 | - end_date:end_date | |
1 | +var url = ""; | |
2 | +var option_html = ""; | |
3 | +var subject_id = ""; | |
4 | + | |
5 | +function getQueryString(name) { | |
6 | + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); | |
7 | + var r = window.location.search.substr(1).match(reg); | |
8 | + if (r != null) | |
9 | + return unescape(r[2]); | |
10 | + return null; | |
11 | +} | |
12 | +var class_id = getQueryString("classid"); | |
13 | +$(document) | |
14 | + .ready( | |
15 | + function() { | |
16 | + | |
17 | + $.ajax({ | |
18 | + url : url + "/SunvoteEducation/teacher/info", | |
19 | + async : false, | |
20 | + type : "post", | |
21 | + success : function(data) { | |
22 | + subject_id = data.data.subjectList[0].SUBJECT_ID; | |
23 | + user_id = data.data.ID; | |
24 | + if (data.data.classInfoList.length > 0) { | |
25 | + for (var i = 0; i < data.data.classInfoList.length; i++) { | |
26 | + option_html += '<option value="' | |
27 | + + data.data.classInfoList[i].CLASS_ID | |
28 | + + '">' | |
29 | + + data.data.classInfoList[i].CLASS_NAME | |
30 | + + '</option>' | |
31 | + } | |
32 | + $("#dealer_id_2").html(option_html); | |
33 | + } | |
34 | + getList(); | |
35 | + } | |
36 | + }) | |
37 | + // 日期框 | |
38 | + $('.date-picker').datepicker({ | |
39 | + autoclose : true, | |
40 | + todayHighlight : true | |
41 | + }); | |
42 | + window.top.loading.remove(); | |
43 | + }) | |
44 | +function getList(start_date, end_date, class_id) { // 获取测验列表 | |
45 | + var tab_html = ""; | |
46 | + if(class_id == null){ | |
47 | + class_id = getQueryString("classid"); | |
48 | + } | |
49 | + $.ajax({ | |
50 | + url : url + "/SunvoteEducation/api/v1/testpaper", | |
51 | + async : false, | |
52 | + type : "post", | |
53 | + data : { | |
54 | + test_type : "101", | |
55 | + user_id : user_id, | |
56 | + subject_id : subject_id, | |
57 | + class_id : class_id, | |
58 | + currentpage : "1", | |
59 | + showcount : "", | |
60 | + start_date : start_date, | |
61 | + end_date : end_date | |
52 | 62 | }, |
53 | - success:function(data){ | |
63 | + success : function(data) { | |
54 | 64 | console.log(data); |
55 | - for(var i=0;i<data.data.length;i++){ | |
56 | - tab_html += '<tr><td>'+(i+1)+'</td><td>'+data.data[i].createDate+'</td><td>'+getClassName(data.data[i].classId)+'</td><td>'+data.data[i].name+'</td><td><a onclick="window.top.loading.show();jump($(this));" data-id="'+data.data[i].testpaperId+'" >查看</a></td></tr>' | |
65 | + for (var i = 0; i < data.data.length; i++) { | |
66 | + tab_html += '<tr><td>' | |
67 | + + (i + 1) | |
68 | + + '</td><td>' | |
69 | + + data.data[i].name | |
70 | + + '</td><td>' | |
71 | + + getClassName(data.data[i].classId) | |
72 | + + '</td><td>' | |
73 | + + data.data[i].createDate | |
74 | + + '</td><td><a onclick="window.top.loading.show();jump($(this));" data-id="' | |
75 | + + data.data[i].testpaperId | |
76 | + + '" >查看</a></td></tr>' | |
57 | 77 | } |
58 | 78 | $("#tab_body").html(tab_html); |
59 | 79 | } |
60 | 80 | }); |
81 | +} | |
82 | +function jump(obj) { // 预览测验详情 | |
83 | + var id = obj.attr("data-id"); | |
84 | + location.href = "paper_view1.do?testpaperId=" + id; | |
85 | +} | |
86 | +function getSubjectName(id) { // 获取科目中文名 | |
87 | + var subjectName = ""; | |
88 | + $.ajax({ | |
89 | + url : url + "/SunvoteEducation/api/v1/subjectcname", | |
90 | + async : false, | |
91 | + type : "post", | |
92 | + data : { | |
93 | + id : id | |
94 | + }, | |
95 | + success : function(data) { | |
96 | + subjectName = data.data; | |
61 | 97 | } |
62 | - function jump(obj){ //预览测验详情 | |
63 | - var id=obj.attr("data-id"); | |
64 | - location.href="paper_view1.do?testpaperId="+id; | |
65 | - } | |
66 | - function getSubjectName(id){ //获取科目中文名 | |
67 | - var subjectName=""; | |
68 | - $.ajax({ | |
69 | - url:url+"/SunvoteEducation/api/v1/subjectcname", | |
70 | - async:false, | |
71 | - type:"post", | |
72 | - data:{id:id}, | |
73 | - success:function(data){ | |
74 | - subjectName=data.data; | |
75 | - } | |
76 | - }) | |
77 | - return subjectName; | |
78 | - } | |
79 | - function getClassName(id){ //获取班级中文名 | |
80 | - var className=""; | |
81 | - $.ajax({ | |
82 | - url:url+"/SunvoteEducation/api/v1/classname", | |
83 | - async:false, | |
84 | - type:"post", | |
85 | - data:{id:id}, | |
86 | - success:function(data){ | |
87 | - className=data.data; | |
88 | - } | |
89 | - }) | |
90 | - return className; | |
98 | + }) | |
99 | + return subjectName; | |
100 | +} | |
101 | +function getClassName(id) { // 获取班级中文名 | |
102 | + var className = ""; | |
103 | + $.ajax({ | |
104 | + url : url + "/SunvoteEducation/api/v1/classname", | |
105 | + async : false, | |
106 | + type : "post", | |
107 | + data : { | |
108 | + id : id | |
109 | + }, | |
110 | + success : function(data) { | |
111 | + className = data.data; | |
91 | 112 | } |
92 | - function tosearch(){ //搜索 | |
93 | - var start_date=$("#lastStart").val(); | |
94 | - var end_date=$("#lastEnd").val(); | |
95 | - var class_id=$("#dealer_id_2").val(); | |
96 | - getList(start_date,end_date,class_id); | |
97 | - } | |
98 | 113 | \ No newline at end of file |
114 | + }) | |
115 | + return className; | |
116 | +} | |
117 | +function tosearch() { //搜索 | |
118 | + var start_date = $("#lastStart").val(); | |
119 | + var end_date = $("#lastEnd").val(); | |
120 | + var class_id = $("#dealer_id_2").val(); | |
121 | + getList(start_date, end_date, class_id); | |
122 | +} | |
99 | 123 | \ No newline at end of file | ... | ... |