Commit c617106f9779fc983efcef02d9021b12538569dd
1 parent
2ad7ca45
添加即时测功能
Showing
42 changed files
with
2301 additions
and
166 deletions
.settings/org.eclipse.core.resources.prefs
1 | eclipse.preferences.version=1 | 1 | eclipse.preferences.version=1 |
2 | encoding//WebRoot/WEB-INF/jsp/sunvote/paper/paper_list2.jsp=UTF-8 | 2 | encoding//WebRoot/WEB-INF/jsp/sunvote/paper/paper_list2.jsp=UTF-8 |
3 | encoding//WebRoot/WEB-INF/jsp/sunvote/teacher/creat_question.jsp=UTF-8 | 3 | encoding//WebRoot/WEB-INF/jsp/sunvote/teacher/creat_question.jsp=UTF-8 |
4 | +encoding//WebRoot/WEB-INF/jsp/sunvote/teacher/paper_view.jsp=UTF-8 | ||
5 | +encoding//WebRoot/WEB-INF/jsp/sunvote/teacher/set_question.jsp=UTF-8 | ||
4 | encoding//WebRoot/WEB-INF/jsp/sunvote/teacher/stduent_report.jsp=UTF-8 | 6 | encoding//WebRoot/WEB-INF/jsp/sunvote/teacher/stduent_report.jsp=UTF-8 |
7 | +encoding//WebRoot/WEB-INF/jsp/sunvote/teacher/teach_paper.jsp=UTF-8 | ||
5 | encoding//WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp=UTF-8 | 8 | encoding//WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp=UTF-8 |
6 | encoding//WebRoot/WEB-INF/jsp/system/appuser/appuser_list.jsp=UTF-8 | 9 | encoding//WebRoot/WEB-INF/jsp/system/appuser/appuser_list.jsp=UTF-8 |
7 | encoding//WebRoot/WEB-INF/jsp/system/fhsms/fhsms_list.jsp=UTF-8 | 10 | encoding//WebRoot/WEB-INF/jsp/system/fhsms/fhsms_list.jsp=UTF-8 |
WebRoot/WEB-INF/jsp/sunvote/teacher/creat_question.jsp
@@ -190,7 +190,7 @@ | @@ -190,7 +190,7 @@ | ||
190 | <script> | 190 | <script> |
191 | var testData = ${pd.JSON}; | 191 | var testData = ${pd.JSON}; |
192 | var URL = "<%=basePath%>api/v1/uploadpaper"; | 192 | var URL = "<%=basePath%>api/v1/uploadpaper"; |
193 | - var JUMP_URL = "<%=basePath%>/main/teacher"; | 193 | + var JUMP_URL = "<%=basePath%>/main/teacher"; |
194 | if(testData.questions.length>0){ | 194 | if(testData.questions.length>0){ |
195 | var title = testData.title; | 195 | var title = testData.title; |
196 | if(title == null || title == ''){ | 196 | if(title == null || title == ''){ |
WebRoot/WEB-INF/jsp/sunvote/teacher/paper_view.jsp
0 → 100644
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | ||
3 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | ||
4 | +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> | ||
5 | +<% | ||
6 | + String path = request.getContextPath(); | ||
7 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
8 | +%> | ||
9 | +<!DOCTYPE html> | ||
10 | +<html lang="zh-CN"> | ||
11 | + <head> | ||
12 | + <meta charset="utf-8"> | ||
13 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
14 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
15 | + <title>中天电子-教育管理系统</title> | ||
16 | + | ||
17 | + <!-- Bootstrap --> | ||
18 | + <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | ||
19 | + <link href="../static/css/teach.css" rel="stylesheet"> | ||
20 | + <link href="../static/css/paper_view.css" rel="stylesheet"> | ||
21 | + | ||
22 | + <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> | ||
23 | + <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> | ||
24 | + <!--[if lt IE 9]> | ||
25 | + <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> | ||
26 | + <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> | ||
27 | + <![endif]--> | ||
28 | + <style> | ||
29 | + .analysis table{display:inline-block;vertical-align:middle;} | ||
30 | + .resolve_box img{vertical-align:top;} | ||
31 | + </style> | ||
32 | + </head> | ||
33 | + <body> | ||
34 | + <div class="container"> | ||
35 | + <div class="page-header"> | ||
36 | + <h3 class="col-md-6" id="paper_title"></h3> | ||
37 | + <h3 class="col-md-6">考试时长:<span id="time"></span>分钟</h3> | ||
38 | + <div class="clearfix"></div> | ||
39 | + </div> | ||
40 | + <div class="content_report"> | ||
41 | + <div class="col-md-3 left_menu"> | ||
42 | + <ul> | ||
43 | + <li class="active">学生完成情况</li> | ||
44 | + <li>题目分析</li> | ||
45 | + </ul> | ||
46 | + </div> | ||
47 | + <div class="col-md-9 report"> | ||
48 | + <div class="report_info"> | ||
49 | + <ul> | ||
50 | + <li>未完成学生 1/1</li> | ||
51 | + <li>平均错题数 0</li> | ||
52 | + <li>正确率 0%</li> | ||
53 | + <li>平均用时 0秒</li> | ||
54 | + </ul> | ||
55 | + <div class="clearfix"></div> | ||
56 | + </div> | ||
57 | + <div class="table_box"> | ||
58 | + <table class="table table-striped"> | ||
59 | + <thead> | ||
60 | + <tr> | ||
61 | + <th>姓名</th> | ||
62 | + <th>答题时间</th> | ||
63 | + <th>答对数</th> | ||
64 | + <th>答错数</th> | ||
65 | + <th>错题详情</th> | ||
66 | + <th>一键催交</th> | ||
67 | + </tr> | ||
68 | + </thead> | ||
69 | + <tbody> | ||
70 | + <tr> | ||
71 | + <td>杨大辉</td> | ||
72 | + <td>未完成</td> | ||
73 | + <td>--</td> | ||
74 | + <td>--</td> | ||
75 | + <td>--</td> | ||
76 | + <td>催作业</td> | ||
77 | + </tr> | ||
78 | + <tr> | ||
79 | + <td>何禾</td> | ||
80 | + <td>2018/6/21</td> | ||
81 | + <td>--</td> | ||
82 | + <td>--</td> | ||
83 | + <td>--</td> | ||
84 | + <td>催作业</td> | ||
85 | + </tr> | ||
86 | + </tbody> | ||
87 | + </table> | ||
88 | + </div> | ||
89 | + </div> | ||
90 | + <div class="col-md-9 analysis" style="display:none;"> | ||
91 | + <ul> | ||
92 | + <li> | ||
93 | + <div class="stem"> | ||
94 | + <p>1.如图,检测4个足球,其中超过标准质量的克数记为正数,不足标准质量的克数记为负数.从轻重的角度看,最接近标准的是( )</p> | ||
95 | + </div> | ||
96 | + <div class="option"> | ||
97 | + <ul> | ||
98 | + <li><span>A.</span><img src="images/option_1.png" /></li> | ||
99 | + <li><span>B.</span><img src="images/option_2.png" /></li> | ||
100 | + <li><span>C.</span><img src="images/option_3.png" /></li> | ||
101 | + <li><span>D.</span><img src="images/option_4.png" /></li> | ||
102 | + </ul> | ||
103 | + <div class="clearfix"></div> | ||
104 | + </div> | ||
105 | + <div class="resolve"> | ||
106 | + <div class="resolve_box"> | ||
107 | + <p>【答案】 A</p> | ||
108 | + <p>【解析】由图数一数,可知总共有7位小同学,其中扎小辫的女孩有2人,男孩有5人。 | ||
109 | + 故选A。</p> | ||
110 | + | ||
111 | + <p>【考点】 10以内数的认识</p> | ||
112 | + </div> | ||
113 | + <div class="clearfix"></div> | ||
114 | + <div class="tab_report_box"> | ||
115 | + <div class="col-md-3"> | ||
116 | + <p>答错人数</p> | ||
117 | + <div class="round_w_orange"> | ||
118 | + <div class="round_n_orange"> | ||
119 | + <span>0/0</span> | ||
120 | + </div> | ||
121 | + </div> | ||
122 | + </div> | ||
123 | + <div class="col-md-3"> | ||
124 | + <p>错误率</p> | ||
125 | + <div class="round_w_red"> | ||
126 | + <div class="round_n_red"> | ||
127 | + <span>100%</span> | ||
128 | + </div> | ||
129 | + </div> | ||
130 | + </div> | ||
131 | + <div class="col-md-6"> | ||
132 | + <div id="main" style="width:250px;height:140px;"></div> | ||
133 | + </div> | ||
134 | + <div class="clearfix"></div> | ||
135 | + </div> | ||
136 | + </div> | ||
137 | + | ||
138 | + <div class="star_box"> | ||
139 | + <div class="col-md-6">错误学生:0/0</div> | ||
140 | + <div class="col-md-6"> | ||
141 | + <div class="star"> | ||
142 | + <span style="float:left;">难度</span> | ||
143 | + <ul> | ||
144 | + <li class="on"></li> | ||
145 | + <li class="on"></li> | ||
146 | + <li class="off"></li> | ||
147 | + <li class="off"></li> | ||
148 | + <li class="off"></li> | ||
149 | + </ul> | ||
150 | + </div> | ||
151 | + <div class="resolve_click"> | ||
152 | + <a onclick="slide($(this))">查看解析</a> | ||
153 | + </div> | ||
154 | + </div> | ||
155 | + <div class="clearfix"></div> | ||
156 | + </div> | ||
157 | + </li> | ||
158 | + </ul> | ||
159 | + </div> | ||
160 | + </div> | ||
161 | + | ||
162 | + </div> | ||
163 | + <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> | ||
164 | + <script src="js/echars.js"></script> | ||
165 | + <script> | ||
166 | + var url="http://127.0.0.1:8080/SunvoteEducation/" | ||
167 | + function slide(obj){ //查看解析 | ||
168 | + obj.closest(".star_box").siblings(".resolve").slideToggle(function(){ | ||
169 | + if($(".resolve").css("display") == "none") | ||
170 | + obj.text("查看解析"); | ||
171 | + else | ||
172 | + obj.text("收起解析"); | ||
173 | + }); | ||
174 | + } | ||
175 | + $(".left_menu li").click(function(){ | ||
176 | + if($(this).index()==0){ | ||
177 | + $(this).siblings().removeClass("active"); | ||
178 | + $(this).addClass("active"); | ||
179 | + $(".analysis").css("display","none"); | ||
180 | + $(".report").css("display","block"); | ||
181 | + }else if($(this).index()==1){ | ||
182 | + $(this).siblings().removeClass("active"); | ||
183 | + $(this).addClass("active"); | ||
184 | + $(".report").css("display","none"); | ||
185 | + $(".analysis").css("display","block"); | ||
186 | + } | ||
187 | + }) | ||
188 | + | ||
189 | + function bar(index){ | ||
190 | + var myChart = echarts.init(document.getElementById('main'+index)); | ||
191 | + myChart.setOption({ | ||
192 | + color: ['#3398DB'], | ||
193 | + tooltip : { | ||
194 | + trigger: 'axis', | ||
195 | + axisPointer : { // 坐标轴指示器,坐标轴触发有效 | ||
196 | + type : 'line' // 默认为直线,可选为:'line' | 'shadow' | ||
197 | + } | ||
198 | + }, | ||
199 | + grid: { | ||
200 | + top: 15, | ||
201 | + left: '0%', | ||
202 | + right: '0%', | ||
203 | + bottom: '0%', | ||
204 | + containLabel: true | ||
205 | + }, | ||
206 | + xAxis : [ | ||
207 | + { | ||
208 | + type : 'category', | ||
209 | + data : ['A', 'B', 'C', 'D'], | ||
210 | + axisTick: { | ||
211 | + alignWithLabel: true | ||
212 | + }, | ||
213 | + axisLabel: { | ||
214 | + show:true, | ||
215 | + textStyle:{ | ||
216 | + color: function (value){ | ||
217 | + console.log(value); | ||
218 | + return value == "C" ? '#75b3ff' : '#fcb35b'; | ||
219 | + } | ||
220 | + } | ||
221 | + } | ||
222 | + } | ||
223 | + | ||
224 | + | ||
225 | + ], | ||
226 | + yAxis : [ | ||
227 | + { | ||
228 | + type : 'value' | ||
229 | + } | ||
230 | + ], | ||
231 | + series : [ | ||
232 | + { | ||
233 | + name:'直接访问', | ||
234 | + type:'bar', | ||
235 | + barWidth: '60%', | ||
236 | + data:[10, 0, 20, 5], | ||
237 | + itemStyle: { | ||
238 | + //通常情况下: | ||
239 | + normal:{ | ||
240 | + //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组 | ||
241 | + color: function (params){ | ||
242 | + var colorList = ['#fcb35b','#fcb35b','#75b3ff','#fcb35b']; | ||
243 | + return colorList[params.dataIndex]; | ||
244 | + }, | ||
245 | + label : {show: true,position:'top',distance:-4} | ||
246 | + } | ||
247 | + } | ||
248 | + } | ||
249 | + ] | ||
250 | + }); | ||
251 | + } | ||
252 | + | ||
253 | +function getQueryString(name) { | ||
254 | + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); | ||
255 | + var r = window.location.search.substr(1).match(reg); | ||
256 | + if (r != null) return unescape(r[2]); return null; | ||
257 | + } | ||
258 | + var PAPER_ID=getQueryString("PAPER_ID"); | ||
259 | + var _html=""; | ||
260 | + $(document).ready(function(){ | ||
261 | + $.ajax({ | ||
262 | + url:url+"/api/v1/paperinfo", | ||
263 | + async:false, | ||
264 | + type:"post", | ||
265 | + data:{PAPER_ID:PAPER_ID}, | ||
266 | + success:function(data){ | ||
267 | + console.log(data); | ||
268 | + $("#paper_title").html(data.data.title); | ||
269 | + $("#time").html(data.data.exam_time); | ||
270 | + if(data.data.questions.length>0){ | ||
271 | + for(var i=0;i<data.data.questions.length;i++){ | ||
272 | + _html += '<li><div class="stem"></div><div class="option"><ul></ul><div class="clearfix"></div></div><div class="resolve"><div class="resolve_box"><p>【答案】 '+data.data.questions[i].answer+'</p><p><span>【解析】</span>'+data.data.questions[i].analysis+'</p></div><div class="clearfix"></div><div class="tab_report_box"><div class="col-md-3"><p>答错人数</p><div class="round_w_orange"><div class="round_n_orange"><span>0/0</span></div></div></div><div class="col-md-3"><p>错误率</p><div class="round_w_red"><div class="round_n_red"><span>100%</span></div></div></div><div class="col-md-6"><div id="main'+i+'" style="width:250px;height:140px;"></div></div><div class="clearfix"></div></div></div><div class="star_box"><div class="col-md-6">错误学生:0/0</div><div class="col-md-6"><div class="star"><span style="float:left;">难度</span></div><div class="resolve_click"><a onclick="slide($(this))">查看解析</a></div></div><div class="clearfix"></div></div></li>'; | ||
273 | + } | ||
274 | + console.log(_html); | ||
275 | + $(".analysis ul").html(_html); | ||
276 | + for(var j=0;j<data.data.questions.length;j++){ | ||
277 | + var option_html=""; | ||
278 | + $(".analysis li .stem").eq(j).append('<span>'+(j+1)+'、</span>'+data.data.questions[j].content); | ||
279 | + var arry_option=data.data.questions[j].option_content; | ||
280 | + arry_option=arry_option.replace("[",""); | ||
281 | + arry_option=arry_option.replace("]",""); | ||
282 | + arry_option=arry_option.split(","); | ||
283 | + for(var x=0;x<arry_option.length;x++){ | ||
284 | + option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>'; | ||
285 | + } | ||
286 | + $(".option").eq(j).find("ul").html(option_html); | ||
287 | + | ||
288 | + star(j,parseInt(data.data.questions[j].difficulty)); | ||
289 | + bar(j); | ||
290 | + } | ||
291 | + } | ||
292 | + } | ||
293 | + }) | ||
294 | + }) | ||
295 | + function star(index,num){ //难度星级 | ||
296 | + $(".star").eq(index).append('<ul></ul>'); | ||
297 | + var li_html=""; | ||
298 | + for(var i=1;i<=num;i++){ | ||
299 | + li_html +='<li class="on"></li>'; | ||
300 | + } | ||
301 | + for(var j=num;j<5;j++){ | ||
302 | + li_html += '<li class="off"></li>'; | ||
303 | + } | ||
304 | + | ||
305 | + $(".star").eq(index).find("ul").html(li_html); | ||
306 | + } | ||
307 | + </script> | ||
308 | + | ||
309 | +<!-- <li><div class="stem"></div><div class="option"><ul></ul><div class="clearfix"></div></div><div class="resolve"><div class="resolve_box"><p>【答案】 A</p><p>【解析】</p></div><div class="clearfix"></div><div class="tab_report_box"><div class="col-md-3"><p>答错人数</p><div class="round_w_orange"><div class="round_n_orange"><span>0/0</span></div></div></div><div class="col-md-3"><p>错误率</p><div class="round_w_red"><div class="round_n_red"><span>100%</span></div></div></div><div class="col-md-6"><div id="main" style="width:250px;height:140px;"></div></div><div class="clearfix"></div></div></div><div class="star_box"><div class="col-md-6">错误学生:0/0</div><div class="col-md-6"><div class="star"><span style="float:left;">难度</span></div><div class="resolve_click"><a onclick="slide($(this))">查看解析</a></div></div><div class="clearfix"></div></div></li> --> | ||
310 | + | ||
311 | +</html> | ||
312 | + | ||
313 | + | ||
314 | + | ||
315 | + | ||
316 | + |
WebRoot/WEB-INF/jsp/sunvote/teacher/set_question.jsp
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html lang="zh-CN"> | ||
3 | + <head> | ||
4 | + <meta charset="utf-8"> | ||
5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
6 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
7 | + <title>中天电子-教育管理系统</title> | ||
8 | + | ||
9 | + <!-- Bootstrap --> | ||
10 | + <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | ||
11 | + <link href="../static/css/teach.css" rel="stylesheet"> | ||
12 | + <link href="../static/css/set_quetion.css" rel="stylesheet"> | ||
13 | + | ||
14 | + <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> | ||
15 | + <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> | ||
16 | + <!--[if lt IE 9]> | ||
17 | + <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> | ||
18 | + <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> | ||
19 | + <![endif]--> | ||
20 | + <style> | ||
21 | + table{display:inline-block;vertical-align: middle;} | ||
22 | + .resolve_box img{vertical-align:top;} | ||
23 | + </style> | ||
24 | + </head> | ||
25 | + <body> | ||
26 | + <div class="container"> | ||
27 | + <div class="choose_class"> | ||
28 | + <div class="col-md-2"> | ||
29 | + <p>选择班级</p> | ||
30 | + </div> | ||
31 | + <div class="col-md-10"> | ||
32 | + <ul> | ||
33 | + <li>一年级1502班</li> | ||
34 | + </ul> | ||
35 | + </div> | ||
36 | + <div class="clearfix"></div> | ||
37 | + </div> | ||
38 | + <div class="col-md-3 left_menu"> | ||
39 | + <div class="tab"> | ||
40 | + <ul> | ||
41 | + <li class="active" data-index=0><p>同步教材</p></li> | ||
42 | + <li data-index=1><p>知识点</p></li> | ||
43 | + <div class="clearfix"></div> | ||
44 | + </ul> | ||
45 | + </div> | ||
46 | + <div class="choose_book"> | ||
47 | + <div class="book"><p><span>西师大版/一年级上</span></p><img src="../static/images/down_arrow.png" /><div class="clearfix"></div></div> | ||
48 | + <div class="book_box"> | ||
49 | + <ul> | ||
50 | + <li> | ||
51 | + <p>人教版</p> | ||
52 | + <img src="../static/images/arrow_right.png" /> | ||
53 | + <div class="clearfix"></div> | ||
54 | + <div class="float_box"> | ||
55 | + <ul> | ||
56 | + <li>一年级1502班</li> | ||
57 | + <li>一年级1502班</li> | ||
58 | + <li>一年级1502班</li> | ||
59 | + <li>一年级1502班</li> | ||
60 | + <li>一年级1502班</li> | ||
61 | + <div class="clearfix"></div> | ||
62 | + </ul> | ||
63 | + </div> | ||
64 | + </li> | ||
65 | + <li> | ||
66 | + <p>人教版</p> | ||
67 | + <img src="../static/images/arrow_right.png" /> | ||
68 | + <div class="clearfix"></div> | ||
69 | + </li> | ||
70 | + <li> | ||
71 | + <p>人教版</p> | ||
72 | + <img src="../static/images/arrow_right.png" /> | ||
73 | + <div class="clearfix"></div> | ||
74 | + </li> | ||
75 | + <li> | ||
76 | + <p>人教版</p> | ||
77 | + <img src="../static/images/arrow_right.png" /> | ||
78 | + <div class="clearfix"></div> | ||
79 | + </li> | ||
80 | + <li> | ||
81 | + <p>人教版</p> | ||
82 | + <img src="../static/images/arrow_right.png" /> | ||
83 | + <div class="clearfix"></div> | ||
84 | + </li> | ||
85 | + <li> | ||
86 | + <p>人教版</p> | ||
87 | + <img src="../static/images/arrow_right.png" /> | ||
88 | + <div class="clearfix"></div> | ||
89 | + </li><li> | ||
90 | + <p>人教版</p> | ||
91 | + <img src="../static/images/arrow_right.png" /> | ||
92 | + <div class="clearfix"></div> | ||
93 | + </li> | ||
94 | + <li> | ||
95 | + <p>人教版</p> | ||
96 | + <img src="../static/images/arrow_right.png" /> | ||
97 | + <div class="clearfix"></div> | ||
98 | + <div class="float_box"> | ||
99 | + <ul> | ||
100 | + <li>一年级1502班</li> | ||
101 | + <li>一年级1502班</li> | ||
102 | + <li>一年级1502班</li> | ||
103 | + <li>一年级1502班</li> | ||
104 | + <li>一年级1502班</li> | ||
105 | + <div class="clearfix"></div> | ||
106 | + </ul> | ||
107 | + </div> | ||
108 | + </li> | ||
109 | + </ul> | ||
110 | + | ||
111 | + </div> | ||
112 | + <!-- <div class="gary"></div> --> | ||
113 | + </div> | ||
114 | + <div class="section"> | ||
115 | + <ul> | ||
116 | + <!-- <li> | ||
117 | + <img src="../static/images/add.png" /><span>1 准备课</span> | ||
118 | + <ul> | ||
119 | + <li> | ||
120 | + <span>●</span> | ||
121 | + <span>1.1 数一数</span> | ||
122 | + </li> | ||
123 | + <li> | ||
124 | + <span>●</span> | ||
125 | + <span>1.1 数一数</span> | ||
126 | + </li> | ||
127 | + </ul> | ||
128 | + </li> | ||
129 | + <li><img src="../static/images/reduce.png" />期中</li> --> | ||
130 | + </ul> | ||
131 | + </div> | ||
132 | + </div> | ||
133 | + <div class="col-md-9 right_content"> | ||
134 | + <!-- <div class="screen"> | ||
135 | + <div class="tag"> | ||
136 | + <dl> | ||
137 | + <dt>题目难度:</dt> | ||
138 | + <dd>基础题</dd> | ||
139 | + <dd>中档题</dd> | ||
140 | + <dd>难题</dd> | ||
141 | + </dl> | ||
142 | + </div> | ||
143 | + <div class="tag"> | ||
144 | + <dl> | ||
145 | + <dt>题目来源:</dt> | ||
146 | + <dd>云题库</dd> | ||
147 | + <dd>个人题库</dd> | ||
148 | + </dl> | ||
149 | + </div> | ||
150 | + </div> --> | ||
151 | + <div class="question_box"> | ||
152 | + <ul> | ||
153 | + <!-- <li> | ||
154 | + <div class="content"> | ||
155 | + <span>1、</span> | ||
156 | + <img src="http://image.yuncelian.com/1/2018/1/2a5074aa7d5f0dc7df586005922cb60d.png" style="vertical-align:middle;FLOAT:right" />如图,▱ABCD的对角线AC、BD交于点O,AE平分∠BAD交BC于点E,且∠ADC=60°,AB=<span class="YclQues" mathtag="math" style="whiteSpace:nowrap;wordSpacing:normal;wordWrap:normal"><table cellpadding="-1" cellspacing="-1" style="margin-right:1px"><tr><td style="border-bottom:1px solid black">1</td></tr><tr><td>2</td></tr></table></span>BC,连接OE.下列结论:①∠CAD=30°;②S<SUB>▱ABCD</SUB>=AB•AC;③OB=AB;④OE=<span class="YclQues" mathtag="math" style="whiteSpace:nowrap;wordSpacing:normal;wordWrap:normal"><table cellpadding="-1" cellspacing="-1" style="margin-right:1px"><tr><td style="border-bottom:1px solid black">1</td></tr><tr><td>4</td></tr></table></span>BC,成立的个数有( ) | ||
157 | + </div> | ||
158 | + <div class="option"> | ||
159 | + <ul> | ||
160 | + <li><span>A.</span>1个</li> | ||
161 | + <li><span>B.</span>2个</li> | ||
162 | + <li><span>C.</span>3个</li> | ||
163 | + <li><span>D.</span>4个</li> | ||
164 | + <div class="clearfix"></div> | ||
165 | + </ul> | ||
166 | + </div> | ||
167 | + <div class="resolve"> | ||
168 | + <div class="resolve_box"> | ||
169 | + <p><span>【答案】</span> A</p> | ||
170 | + <p><span>【解析】</span><img src="http://image.yuncelian.com/1/analysis/00ca500f-224f-584e-b92f-d7863238e2a8.png"></p> | ||
171 | + | ||
172 | + <p>【考点】 10以内数的认识</p> | ||
173 | + </div> | ||
174 | + <div class="clearfix"></div> | ||
175 | + </div> | ||
176 | + <div class="star_box"> | ||
177 | + <div class="col-md-6"> | ||
178 | + <div class="star"> | ||
179 | + <span style="float:left;">难度</span> | ||
180 | + <ul data-num="4"> | ||
181 | + <li class="on"></li> | ||
182 | + <li class="on"></li> | ||
183 | + <li class="off"></li> | ||
184 | + <li class="off"></li> | ||
185 | + <li class="off"></li> | ||
186 | + </ul> | ||
187 | + </div> | ||
188 | + <div class="resolve_click"> | ||
189 | + <a onclick="slide($(this))">查看解析</a> | ||
190 | + <div class="check_box"></div> | ||
191 | + </div> | ||
192 | + | ||
193 | + | ||
194 | + | ||
195 | + </div> | ||
196 | + <div class="clearfix"></div> | ||
197 | + </div> | ||
198 | + </li> --> | ||
199 | + | ||
200 | + </ul> | ||
201 | + </div> | ||
202 | + </div> | ||
203 | + </div> | ||
204 | + <div class="basket"> | ||
205 | + <div class="basket_box"> | ||
206 | + <p class="col-md-4">已选:<span id="all_que_num">0</span>题</p> | ||
207 | + <p class="col-md-8"><input type="button" value="清空" class="btn btn-danger clear_que"/><button type="button" class="btn btn-primary btn-lg topic" > | ||
208 | + 完成选题 | ||
209 | +</button></p> | ||
210 | + </div> | ||
211 | + </div> | ||
212 | + <div class="modal fade" id="myModal" tabindex="-1" role="dialog"> | ||
213 | + <div class="modal-dialog" role="document"> | ||
214 | + <div class="modal-content"> | ||
215 | + <div class="modal-header"> | ||
216 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | ||
217 | + <h4 class="modal-title">完成选题</h4> | ||
218 | + </div> | ||
219 | + <div class="modal-body"> | ||
220 | + <form class="form-horizontal"> | ||
221 | + <div class="form-group"> | ||
222 | + <label for="inputEmail3" class="col-sm-2 control-label">试卷标题</label> | ||
223 | + <div class="col-sm-10"> | ||
224 | + <input type="text" class="form-control" id="title" placeholder="例:初二数学"> | ||
225 | + </div> | ||
226 | + </div> | ||
227 | + <div class="form-group"> | ||
228 | + <label for="inputPassword3" class="col-sm-2 control-label">考试时长</label> | ||
229 | + <div class="col-sm-10"> | ||
230 | + <input type="text" class="form-control" id="time" placeholder="例:120分钟"> | ||
231 | + </div> | ||
232 | + </div> | ||
233 | + </form> | ||
234 | + </div> | ||
235 | + <div class="modal-footer"> | ||
236 | + <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> | ||
237 | + <button type="button" class="btn btn-primary" id="submit">确定</button> | ||
238 | + </div> | ||
239 | + </div><!-- /.modal-content --> | ||
240 | + </div><!-- /.modal-dialog --> | ||
241 | + </div><!-- /.modal --> | ||
242 | + <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> | ||
243 | + <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> | ||
244 | + <script> | ||
245 | + //http://192.168.0.113:8080/SunvoteEducation/api/v1/point 所有知识点 | ||
246 | + var url="http://127.0.0.1:8080"; | ||
247 | + var temp_tag; | ||
248 | + var temp_data; | ||
249 | + | ||
250 | + $(document).ready(function(){ | ||
251 | + getChapter(); | ||
252 | + getTeachingMaterial(); | ||
253 | + }); | ||
254 | + function getPoint(){ //获取知识点 | ||
255 | + $.ajax({ | ||
256 | + url:url+"/SunvoteEducation/api/v1/point", | ||
257 | + async:false, | ||
258 | + type:"post", | ||
259 | + data:{depth:"",subject_id:20,p_id:"",knowledge_from:101}, | ||
260 | + success:function(data){ | ||
261 | + console.log(data); | ||
262 | + var point_html=""; | ||
263 | + for(var i=0;i<data.data.length;i++){ | ||
264 | + point_html +='<li data-id="'+data.data[i].KNOWLEDGE_ID+'" data-click=0><img src="../static/images/add.png" /><span>'+(i+1)+data.data[i].NAME+'</span></li>'; | ||
265 | + } | ||
266 | + $(".section").children("ul").html(point_html); | ||
267 | + } | ||
268 | + }) | ||
269 | + } | ||
270 | + function getChapter(){ //获取章节 | ||
271 | + $(".section").children("ul").html(""); | ||
272 | + $.ajax({ | ||
273 | + url:url+"/SunvoteEducation/api/v1/chapter", | ||
274 | + async:false, | ||
275 | + type:"post", | ||
276 | + data:{TEACHINGMATERIAL_ID:"14f2ad40-d4d6-4558-af5b-c9e3703c1ee8"}, | ||
277 | + success:function(data){ | ||
278 | + console.log(data); | ||
279 | + for(var i=0;i<data.data.length;i++){ | ||
280 | + $(".section").children("ul").append('<li data-id="'+data.data[i].ID+'" data-click=0><img src="../static/images/add.png" /><span>'+data.data[i].NAME+'</span></li>'); | ||
281 | + if(data.data[i].CHILDREN.length>0){ | ||
282 | + $(".section").children("ul").children("li").eq(i).append("<ul></ul>"); | ||
283 | + for(var j=0;j<data.data[i].CHILDREN.length;j++){ | ||
284 | + $(".section").children("ul").children("li").eq(i).children("ul").append('<li data-id="'+data.data[i].CHILDREN[j].ID+'" onclick="getQuestion($(this))"><span>●</span><span>'+data.data[i].CHILDREN[j].NAME+'</span></li>'); | ||
285 | + } | ||
286 | + } | ||
287 | + } | ||
288 | + | ||
289 | + } | ||
290 | + }) | ||
291 | + } | ||
292 | + function getMenu(id,obj){ //获取知识点下级内容 | ||
293 | + var _html=""; | ||
294 | + $.ajax({ | ||
295 | + url:url+"/SunvoteEducation/api/v1/point", | ||
296 | + async:false, | ||
297 | + type:"post", | ||
298 | + data:{depth:"",subject_id:20,p_id:id,knowledge_from:101}, | ||
299 | + success:function(data){ | ||
300 | + console.log(data); | ||
301 | + obj.append('<ul></ul>'); | ||
302 | + for(var i=0;i<data.data.length;i++){ | ||
303 | + console.log(typeof(data.data[i].CHILDREN)); | ||
304 | + if(data.data[i].CHILDREN===undefined) | ||
305 | + _html +='<li data-id="'+data.data[i].KNOWLEDGE_ID+'" data-click=0 onclick="getQuestion($(this))"><span>●</span><span>'+(i+1)+data.data[i].NAME+'</span></li>'; | ||
306 | + else | ||
307 | + _html +='<li data-id="'+data.data[i].KNOWLEDGE_ID+'" data-click=0><img src="../static/images/add.png" /><span>'+(i+1)+data.data[i].NAME+'</span></li>'; | ||
308 | + } | ||
309 | + obj.children('ul').html(_html); | ||
310 | + } | ||
311 | + }) | ||
312 | + } | ||
313 | + function slide(obj){ //查看解析 | ||
314 | + obj.closest(".star_box").siblings(".resolve").slideToggle(function(){ | ||
315 | + if($(".resolve").css("display") == "none") | ||
316 | + obj.text("查看解析"); | ||
317 | + else | ||
318 | + obj.text("收起解析"); | ||
319 | + }); | ||
320 | + | ||
321 | + } | ||
322 | + function getQuestion(obj){ //获取题目 | ||
323 | + var knowledge_id="",chapter_id=""; | ||
324 | + if($(".tab .active").attr("data-index")==1){ | ||
325 | + knowledge_id=obj.attr("data-id"); | ||
326 | + }else{ | ||
327 | + chapter_id=obj.attr("data-id"); | ||
328 | + } | ||
329 | + | ||
330 | + var _html=""; | ||
331 | + | ||
332 | + $.ajax({ | ||
333 | + url:url+"/SunvoteEducation/api/v1/questions", | ||
334 | + async:false, | ||
335 | + type:"post", | ||
336 | + data:{chapter_id:chapter_id,teachingmaterial_id:"",knowledge_id:knowledge_id,question_from:101,user_id:"",problem_type:"",subject_id:"",count:""}, | ||
337 | + success:function(data){ | ||
338 | + console.log(data); | ||
339 | + if(data.data.length>0){ | ||
340 | + for(var i=0;i<data.data.length;i++){ | ||
341 | + _html += '<li data-id="'+data.data[i].QUESTION_ID+'"><div class="content"></div><div class="option"><ul></ul></div><div class="resolve"><div class="resolve_box"><p><span>【答案】</span> '+data.data[i].ANSWER+'</p><p><span>【解析】</span>'+data.data[i].ANALYSIS+'</p></div></div><div class="star_box"><div class="col-md-6"><div class="star"><span style="float:left;">难度</span></div><div class="resolve_click"><a onclick="slide($(this))">查看解析</a><div class="check_box"></div></div></div><div class="clearfix"></div></div></li>'; | ||
342 | + } | ||
343 | + $(".question_box ul").html(_html); | ||
344 | + for(var j=0;j<data.data.length;j++){ | ||
345 | + var option_html=""; | ||
346 | + $(".question_box li .content").eq(j).append('<span>'+(j+1)+'、</span>'+data.data[j].CONTENT); | ||
347 | + var arry_option=data.data[j].OPTION_CONTENT; | ||
348 | + arry_option=arry_option.replace("[",""); | ||
349 | + arry_option=arry_option.replace("]",""); | ||
350 | + arry_option=arry_option.split(","); | ||
351 | + for(var x=0;x<arry_option.length;x++){ | ||
352 | + option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>'; | ||
353 | + } | ||
354 | + $(".option").eq(j).find("ul").html(option_html); | ||
355 | + | ||
356 | + star(j,parseInt(data.data[j].DIFFICULTY)); | ||
357 | + | ||
358 | + } | ||
359 | + } | ||
360 | + } | ||
361 | + }) | ||
362 | + } | ||
363 | + function getTeachingMaterial(){ //获取教材版本 | ||
364 | + $.ajax({ | ||
365 | + url:url+"/SunvoteEducation/api/v1/teachingmaterial", | ||
366 | + async:false, | ||
367 | + type:"post", | ||
368 | + data:{subject_id:20}, | ||
369 | + success:function(data){ | ||
370 | + console.log(data); | ||
371 | + if(data.data.length>0){ | ||
372 | + var teach_html=""; | ||
373 | + for(var i=0;i<data.data.length;i++){ | ||
374 | + teach_html += '<li data-id="'+data.data[i].ID+'"><p>'+data.data[i].NAME+'</p><img src="../static/images/arrow_right.png" /><div class="clearfix"></div></li>'; | ||
375 | + } | ||
376 | + $(".book_box ul").html(teach_html); | ||
377 | + } | ||
378 | + | ||
379 | + } | ||
380 | + }) | ||
381 | + } | ||
382 | + function star(index,num){ //难度星级 | ||
383 | + $(".star").eq(index).append('<ul></ul>'); | ||
384 | + var li_html=""; | ||
385 | + for(var i=1;i<=num;i++){ | ||
386 | + li_html +='<li class="on"></li>'; | ||
387 | + } | ||
388 | + for(var j=num;j<5;j++){ | ||
389 | + li_html += '<li class="off"></li>'; | ||
390 | + } | ||
391 | + | ||
392 | + $(".star").eq(index).find("ul").html(li_html); | ||
393 | + } | ||
394 | + | ||
395 | + $(".section").on("click","li",function(event){ | ||
396 | + event.stopPropagation(); | ||
397 | + var that=$(this); | ||
398 | + | ||
399 | + //console.log(that.attr("data-click")); | ||
400 | + if($(".tab .active").attr("data-index")==1){ | ||
401 | + if(that.attr("data-click")==0) | ||
402 | + getMenu(that.attr("data-id"),that); | ||
403 | + that.attr("data-click",1); | ||
404 | + } | ||
405 | + | ||
406 | + if(that.children('ul').length>0) | ||
407 | + that.children('ul').slideToggle(function(){ | ||
408 | + if(that.children('ul').css("display")=="block") | ||
409 | + that.children('img').attr("src","../static/images/reduce.png"); | ||
410 | + else | ||
411 | + that.children('img').attr("src","../static/images/add.png"); | ||
412 | + }); | ||
413 | + }); | ||
414 | + $(".book_box").children("ul").on("mouseover","li",function(event){ //教材版本交互 | ||
415 | + event.stopPropagation(); | ||
416 | + $(this).siblings().css("background","#fff"); | ||
417 | + $(this).css("background","#e9f0ff"); | ||
418 | + //$(".float_box").css("display","none"); | ||
419 | + $(this).children(".float_box").css("display","block"); | ||
420 | + }); | ||
421 | + $(".book_box").children("ul").on("mouseleave","li",function(event){ //教材版本交互 | ||
422 | + event.stopPropagation(); | ||
423 | + $(this).css("background","#fff"); | ||
424 | + //$(this).children(".float_box").css("display","none"); | ||
425 | + }); | ||
426 | + $(".float_box").on("mouseleave",function(event){ //教材版本交互 | ||
427 | + event.stopPropagation(); | ||
428 | + $(this).css("display","none"); | ||
429 | + }); | ||
430 | + $(".book").click(function(){ //教材版本下拉框交互 | ||
431 | + $(".book_box").slideToggle(); | ||
432 | + }) | ||
433 | + $(document).on("click",".check_box",function(){ //选中题目 | ||
434 | + if($(this).hasClass("checked")){ | ||
435 | + $(this).removeClass("checked"); | ||
436 | + }else{ | ||
437 | + $(this).addClass("checked"); | ||
438 | + } | ||
439 | + $("#all_que_num").html($(".checked").length); | ||
440 | + }); | ||
441 | + $(".clear_que").click(function(){ //清空 | ||
442 | + $(".checked").removeClass("checked"); | ||
443 | + $("#all_que_num").html($(".checked").length); | ||
444 | + }); | ||
445 | + $(".tab li").click(function(){ //教材与知识点选择 | ||
446 | + $(this).siblings().removeClass("active"); | ||
447 | + $(this).addClass("active"); | ||
448 | + if($(this).index()==0){ | ||
449 | + $(".choose_book").css("display","block"); | ||
450 | + getChapter(); | ||
451 | + }else{ | ||
452 | + $(".choose_book").css("display","none"); | ||
453 | + getPoint(); | ||
454 | + } | ||
455 | + }); | ||
456 | + $(".topic").click(function(){ | ||
457 | + if(parseInt($("#all_que_num").text())>0) | ||
458 | + $('#myModal').modal('show'); | ||
459 | + else | ||
460 | + alert("请先选择题目") | ||
461 | + }); | ||
462 | + $("#submit").click(function(){ | ||
463 | + var question_arry=[]; | ||
464 | + for(var i=0;i<$(".checked").length;i++){ | ||
465 | + question_arry[i]={ | ||
466 | + score: "0", | ||
467 | + part_score: "0", | ||
468 | + question_id: $(".checked").eq(i).closest("li").attr("data-id"), | ||
469 | + rank: i.toString(), | ||
470 | + no_name: i.toString() | ||
471 | + }; | ||
472 | + | ||
473 | + } | ||
474 | + var data={ | ||
475 | + title: $("#title").val(), | ||
476 | + exam_time: $("#time").val(), | ||
477 | + paper_type: "101", | ||
478 | + subject_id: "20", | ||
479 | + grade_id: "", | ||
480 | + class_id: "30378682ca9c4c648118afe55569aa97", | ||
481 | + user_id: "8dbef15bb6d043ec94b719ede583b033", | ||
482 | + score: "100", | ||
483 | + questions: question_arry | ||
484 | + }; | ||
485 | + //console.log(data); | ||
486 | + $.ajax({ | ||
487 | + url:url+"/SunvoteEducation/api/v1/publishpaper", | ||
488 | + async:false, | ||
489 | + type:"post", | ||
490 | + dataType: "json", | ||
491 | + headers: {'Content-Type': 'application/json'}, | ||
492 | + data:JSON.stringify(data), | ||
493 | + success:function(data){ | ||
494 | + alert("上传成功"); | ||
495 | + $('#myModal').modal('hide'); | ||
496 | + } | ||
497 | + }) | ||
498 | + | ||
499 | + }) | ||
500 | + </script> | ||
501 | +</html> | ||
0 | \ No newline at end of file | 502 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/sunvote/teacher/teach_paper.jsp
0 → 100644
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | ||
3 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | ||
4 | +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> | ||
5 | +<% | ||
6 | + String path = request.getContextPath(); | ||
7 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
8 | +%> | ||
9 | +<!DOCTYPE html> | ||
10 | +<html lang="zh-CN"> | ||
11 | + <head> | ||
12 | + <meta charset="utf-8"> | ||
13 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
14 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
15 | + <title>即时测</title> | ||
16 | + | ||
17 | + <!-- Bootstrap --> | ||
18 | + <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | ||
19 | + <link href="../static/css/teach.css" rel="stylesheet"> | ||
20 | + <link href="../static/css/paper.css" rel="stylesheet"> | ||
21 | + </head> | ||
22 | + <body> | ||
23 | + <div class="container"> | ||
24 | + <div class="page-header"> | ||
25 | + <h3 class="col-md-6">布置练习</h3> | ||
26 | + <a href="set_question" class="btn btn-info">出题</a> | ||
27 | + <div class="clearfix"></div> | ||
28 | + </div> | ||
29 | + <div class="choose_class"> | ||
30 | + <div class="col-md-2"><h4>选择班级</h4></div> | ||
31 | + <div class="col-md-10"> | ||
32 | + <ul> | ||
33 | + <li>一年级1501班</li> | ||
34 | + <li class="active">一年级1502班</li> | ||
35 | + <li>一年级1503班</li> | ||
36 | + <li>一年级1504班</li> | ||
37 | + <li>一年级1505班</li> | ||
38 | + </ul> | ||
39 | + </div> | ||
40 | + <div class="clearfix"></div> | ||
41 | + </div> | ||
42 | + <div class="screen"> | ||
43 | + <div class="col-md-2">按条件筛选</div> | ||
44 | + <div class="col-md-10"> | ||
45 | + <ul> | ||
46 | + <li> | ||
47 | + <div class="form-group"> | ||
48 | + <div class="col-sm-3"> | ||
49 | + <select name="dealer_id_1" id="dealer_id_1" class="selectpicker show-tick form-control" data-width="98%" data-first-option="false" title='请选择经销商(必选)' required data-live-search="true"> | ||
50 | + <option value="0">现在</option> | ||
51 | + <option value="0">6月</option> | ||
52 | + <option value="0">7月</option> | ||
53 | + </select> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | + </li> | ||
57 | + <li> | ||
58 | + <div class="form-group"> | ||
59 | + <div class="col-sm-3"> | ||
60 | + <select name="dealer_id_2" id="dealer_id_2" class="selectpicker show-tick form-control" data-width="98%" data-first-option="false" title='请选择经销商(必选)' required data-live-search="true"> | ||
61 | + <option value="0">初一1501班</option> | ||
62 | + <option value="0">初一1502班</option> | ||
63 | + <option value="0">初一1503班</option> | ||
64 | + <option value="0">初一1504班</option> | ||
65 | + <option value="0">初一1505班</option> | ||
66 | + </select> | ||
67 | + </div> | ||
68 | + </div> | ||
69 | + </li> | ||
70 | + <li> | ||
71 | + <button type="button" class="btn btn-info">搜索</button> | ||
72 | + </li> | ||
73 | + </ul> | ||
74 | + </div> | ||
75 | + <div class="clearfix"></div> | ||
76 | + </div> | ||
77 | + <div class="result"> | ||
78 | + <table class="table table-striped"> | ||
79 | + <thead> | ||
80 | + <tr> | ||
81 | + <th>序号</th> | ||
82 | + <th>创建时间</th> | ||
83 | + <th>班级</th> | ||
84 | + <th>科目</th> | ||
85 | + <th>完成情况</th> | ||
86 | + <th>试卷名称</th> | ||
87 | + <th>考试时长</th> | ||
88 | + <th>状态</th> | ||
89 | + <th>查看</th> | ||
90 | + </tr> | ||
91 | + </thead> | ||
92 | + <tbody id="tab_body"> | ||
93 | + <tr> | ||
94 | + <td>1</td> | ||
95 | + <td>2018/7/31</td> | ||
96 | + <td>一年级1502班</td> | ||
97 | + <td>小学数学</td> | ||
98 | + <td>0/2</td> | ||
99 | + <td>数一数</td> | ||
100 | + <td>2018/08/05 08:00</td> | ||
101 | + <td>已截止</td> | ||
102 | + <td>查看</td> | ||
103 | + </tr> | ||
104 | + <tr> | ||
105 | + <td>2</td> | ||
106 | + <td>2018/6/21</td> | ||
107 | + <td>一年级1502班</td> | ||
108 | + <td>小学数学</td> | ||
109 | + <td>0/2</td> | ||
110 | + <td>1.1 认识平面图形</td> | ||
111 | + <td>2018/06/24 08:00</td> | ||
112 | + <td>已截止</td> | ||
113 | + <td>查看</td> | ||
114 | + </tr> | ||
115 | + </tbody> | ||
116 | + </table> | ||
117 | + </div> | ||
118 | + </div> | ||
119 | + <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> | ||
120 | + <script> | ||
121 | + var url="http://127.0.0.1:8080/SunvoteEducation"; | ||
122 | + var tab_html=""; | ||
123 | + var user_id= "8dbef15bb6d043ec94b719ede583b033", | ||
124 | + subject_id="", | ||
125 | + class_id=""; | ||
126 | + $(document).ready(function(){ | ||
127 | + $.ajax({ | ||
128 | + url:url+"/api/v1/paper", | ||
129 | + async:false, | ||
130 | + type:"post", | ||
131 | + data:{ | ||
132 | + paper_type:"101", | ||
133 | + user_id:user_id, | ||
134 | + subject_id:subject_id, | ||
135 | + class_id:class_id, | ||
136 | + currentpage:"", | ||
137 | + showcount:"10" | ||
138 | + }, | ||
139 | + success:function(data){ | ||
140 | + for(var i=0;i<data.data.length;i++){ | ||
141 | + tab_html += '<tr><td>'+(i+1)+'</td><td>'+data.data[i].CREATE_DATE+'</td><td>一年级1502班</td><td>小学数学</td><td>0/2</td><td>'+data.data[i].TITLE+'</td><td>'+data.data[i].EXAM_TIME+'分钟</td><td>已截止</td><td><a onclick="jump($(this));" data-id="'+data.data[i].PAPER_ID+'" >查看</a></td></tr>' | ||
142 | + } | ||
143 | + $("#tab_body").html(tab_html); | ||
144 | + } | ||
145 | + }) | ||
146 | + }) | ||
147 | + function jump(obj){ | ||
148 | + var id=obj.attr("data-id"); | ||
149 | + location.href="paper_view.do?PAPER_ID="+id; | ||
150 | + } | ||
151 | + | ||
152 | + </script> | ||
153 | +</html> | ||
0 | \ No newline at end of file | 154 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp
@@ -56,29 +56,65 @@ | @@ -56,29 +56,65 @@ | ||
56 | <p> | 56 | <p> |
57 | 班级管理<span class="right jiao"></span> | 57 | 班级管理<span class="right jiao"></span> |
58 | </p> | 58 | </p> |
59 | - <ul> | 59 | + <ul class="menu_1"> |
60 | <c:forEach items="${pd.TEACHER}" var="var" varStatus="vs"> | 60 | <c:forEach items="${pd.TEACHER}" var="var" varStatus="vs"> |
61 | - <li onclick="event.stopPropagation();chooseClass('${var.CLASS_ID}','${var.TERM_ID}')">${var.GRADE_NAME}${var.SUBJECT_NAME} | ||
62 | - <span>${var.CLASS_NAME}</span> | 61 | + <li onclick="event.stopPropagation();chooseClass('${var.CLASS_ID}','${var.TERM_ID}')"><p>${var.GRADE_NAME}${var.SUBJECT_NAME} |
62 | + <span>${var.CLASS_NAME}</span></p> | ||
63 | </li> | 63 | </li> |
64 | </c:forEach> | 64 | </c:forEach> |
65 | 65 | ||
66 | </ul> | 66 | </ul> |
67 | </div> | 67 | </div> |
68 | <div class="testpaper tab1"> | 68 | <div class="testpaper tab1"> |
69 | - <p> | ||
70 | - 试卷管理<span class="right jiao"></span> | ||
71 | - </p> | 69 | + <p>试卷管理<span class="right jiao"></span></p> |
70 | + <ul class="menu_1"> | ||
71 | + <li > | ||
72 | + <p id="qingsongkao_paper">轻松考试卷管理</p> | ||
73 | + <!-- <ul class="menu_2"> | ||
74 | + <li><p>高一数学 202班</p></li> | ||
75 | + <li><p>高一数学 203班</p></li> | ||
76 | + </ul> --> | ||
77 | + </li> | ||
78 | + <li> | ||
79 | + <p id="jishice_paper">即时测试卷管理</p> | ||
80 | + | ||
81 | + <!-- <ul class="menu_2"> | ||
82 | + <li><p>高一数学 202班</p></li> | ||
83 | + <li><p>高一数学 203班</p></li> | ||
84 | + </ul> --> | ||
85 | + </li> | ||
86 | + </ul> | ||
87 | + | ||
72 | </div> | 88 | </div> |
73 | <div class="analyse tab1"> | 89 | <div class="analyse tab1"> |
74 | <p> | 90 | <p> |
75 | 测验分析<span class="right jiao"></span> | 91 | 测验分析<span class="right jiao"></span> |
76 | </p> | 92 | </p> |
77 | - <ul> | 93 | + |
94 | + <ul class="menu_1"> | ||
95 | + <li > | ||
96 | + <p>轻松考测验分析</p> | ||
97 | + <ul class="menu_2"> | ||
98 | + <c:forEach items="${pd.TEACHER}" var="var" varStatus="vs"> | ||
99 | + <li onclick="event.stopPropagation();report('${var.CLASS_ID}')"><p>${var.CLASS_NAME} 成绩</p></li> | ||
100 | + </c:forEach> | ||
101 | + </ul> | ||
102 | + </li> | ||
103 | + <li> | ||
104 | + <p>云测验测验分析</p> | ||
105 | + <ul class="menu_2"> | ||
106 | + <c:forEach items="${pd.TEACHER}" var="var" varStatus="vs"> | ||
107 | + <li onclick="event.stopPropagation();report('${var.CLASS_ID}')"><p>${var.CLASS_NAME} 成绩</p></li> | ||
108 | + </c:forEach> | ||
109 | + </ul> | ||
110 | + </li> | ||
111 | + </ul> | ||
112 | + | ||
113 | + <%-- <ul class="menu_1"> | ||
78 | <c:forEach items="${pd.TEACHER}" var="var" varStatus="vs"> | 114 | <c:forEach items="${pd.TEACHER}" var="var" varStatus="vs"> |
79 | - <li onclick="event.stopPropagation();report('${var.CLASS_ID}')">${var.CLASS_NAME} 成绩</li> | 115 | + <li onclick="event.stopPropagation();report('${var.CLASS_ID}')"><p>${var.CLASS_NAME} 成绩</p></li> |
80 | </c:forEach> | 116 | </c:forEach> |
81 | - </ul> | 117 | + </ul> --%> |
82 | </div> | 118 | </div> |
83 | </div> | 119 | </div> |
84 | <div class="content_r"> | 120 | <div class="content_r"> |
@@ -156,7 +192,7 @@ | @@ -156,7 +192,7 @@ | ||
156 | } | 192 | } |
157 | }); | 193 | }); |
158 | 194 | ||
159 | - $(".testpaper").click(function (){ | 195 | + $("#qingsongkao_paper").click(function (){ |
160 | var path = "../paper/list2.do?" ; | 196 | var path = "../paper/list2.do?" ; |
161 | //$(".content_r").html('<iframe name="mainFrame" id="mainFrame" frameborder="0" style="width:100%;height:'+$(".content_l").height()+'px;" src=' + path + '></iframe>'); | 197 | //$(".content_r").html('<iframe name="mainFrame" id="mainFrame" frameborder="0" style="width:100%;height:'+$(".content_l").height()+'px;" src=' + path + '></iframe>'); |
162 | if($("#mainFrame").attr('src') != (path)){ | 198 | if($("#mainFrame").attr('src') != (path)){ |
@@ -164,6 +200,14 @@ | @@ -164,6 +200,14 @@ | ||
164 | window.top.loading.show(); | 200 | window.top.loading.show(); |
165 | } | 201 | } |
166 | }); | 202 | }); |
203 | + | ||
204 | + $("#jishice_paper").click(function (){ | ||
205 | + var path = "../teacher/teach_paper.do?" ; | ||
206 | + //if($("#mainFrame").attr('src') != (path)){ | ||
207 | + $("#mainFrame").attr('src',path); | ||
208 | + //window.top.loading.show(); | ||
209 | + //} | ||
210 | + }); | ||
167 | </script> | 211 | </script> |
168 | </body> | 212 | </body> |
169 | </html> | 213 | </html> |
170 | \ No newline at end of file | 214 | \ No newline at end of file |
WebRoot/static/css/paper.css
0 → 100644
1 | +li{list-style:none;} | ||
2 | +.choose_class{border-bottom:1px solid #eee;padding:2% 0 5% 0;} | ||
3 | +.choose_class li{width:20%;margin:0 2.5%;margin-top:2%;float:left;border:1px solid #3c7ae3;text-align:center;border-radius:3px;line-height:50px;font-size:16px;} | ||
4 | +.choose_class li.active{color:#fff;background:#3c7ae3;} | ||
5 | +.screen{border-bottom:1px dashed #eee;padding:3% 0;} | ||
0 | \ No newline at end of file | 6 | \ No newline at end of file |
WebRoot/static/css/paper_view.css
0 → 100644
1 | +li{list-style:none;} | ||
2 | +.left_menu li{line-height:50px;border-bottom:1px solid #ccc;text-align:center;} | ||
3 | +.left_menu .active{background:#6691de;color:#fff;} | ||
4 | +.report_info{padding-bottom:30px;border-bottom:1px solid #ccc;} | ||
5 | +.report_info li{width:20%;float:left;margin:0 2.5%;line-height:50px;background:#e7effd;text-align:center;border-radius:25px;} | ||
6 | +.option{padding-bottom:20px;} | ||
7 | +.option li{width:100%;} | ||
8 | +.option li span{vertical-align:middle;margin-right:5px;} | ||
9 | +.resolve_box{padding:20px 0;border-top:1px dashed #ccc;} | ||
10 | +.star_box{border-top:1px dashed #ccc;border-bottom:1px solid #ccc;padding:10px 0;} | ||
11 | +.star li{width:16px;height:16px;float:left;margin-left:5px;} | ||
12 | +.star ul{float:left;padding-left:0;margin-right:20px;} | ||
13 | +.star .off{background:url(../images/off.png) no-repeat;background-size:100%;} | ||
14 | +.star .on{background:url(../images/on.png) no-repeat;background-size:100%;} | ||
15 | +.tab_report_box{padding:20px 0;border-top:1px dashed #ccc;} | ||
16 | +.tab_report_box p{text-align:center;} | ||
17 | +.resolve{display:none;} | ||
18 | +.tab_report_box .round_w_orange{width:100px;height:100px;background:#ffdeb5;position:relative;overflow:hidden;border-radius:50px;margin:0 auto;} | ||
19 | +.tab_report_box .round_n_orange{width:70px;height:70px;background:#ffac47;position:absolute;top:15px;left:15px;overflow:hidden;border-radius:35px;} | ||
20 | +.tab_report_box .round_n_orange span{color:#fff;line-height:70px;text-align:center;display:inline-block;width:100%;} | ||
21 | +.tab_report_box .round_w_red{width:100px;height:100px;background:#ffd0c6;position:relative;overflow:hidden;border-radius:50px;margin:0 auto;} | ||
22 | +.tab_report_box .round_n_red{width:70px;height:70px;background:#ff8a71;position:absolute;top:15px;left:15px;overflow:hidden;border-radius:35px;} | ||
23 | +.tab_report_box .round_n_red span{color:#fff;line-height:70px;text-align:center;display:inline-block;width:100%;} | ||
0 | \ No newline at end of file | 24 | \ No newline at end of file |
WebRoot/static/css/set_quetion.css
0 → 100644
1 | +body{width:100%;min-height:100%;height:auto;padding-bottom:80px;box-sizing:border-box;} | ||
2 | +li{list-style:none;} | ||
3 | +.choose_class{height:150px;padding:20px;background:#fff;box-shadow:0 0 10px #ccc;} | ||
4 | +.choose_class .col-md-10 li{width:15%;margin:0 2.5%;float:left;border:1px solid #3c7ae3;text-align:center;border-radius:3px;line-height:50px;font-size:16px;color:#fff;background:#3c7ae3;} | ||
5 | +.left_menu{box-shadow:0 0 10px #ccc;margin-top:10px;} | ||
6 | +.left_menu .tab{border-bottom:1px solid #ccc;} | ||
7 | +.left_menu .tab ul{padding:0;margin:0;} | ||
8 | +.left_menu .tab li{width:50%;box-sizing:border-box;float:left;font-size:26px;text-align:center;padding:10px 0;} | ||
9 | +.left_menu .tab li p{margin:0;} | ||
10 | +.left_menu .tab .active{border-bottom: 2px solid #3c7ae3;} | ||
11 | +.left_menu .tab .active p{color:#3c7ae3;} | ||
12 | +.left_menu .tab li:first-child{border-right:1px solid #ccc;} | ||
13 | +.left_menu .choose_book .book{background:#e9f0ff;padding:0 6px;} | ||
14 | +.left_menu .choose_book .book p{float:left;line-height:34px;margin-bottom:0;} | ||
15 | +.left_menu .choose_book .book img{float:right;width:20px;height:20px;margin-top:4.5px;} | ||
16 | +.left_menu .choose_book .book_box{display:none;} | ||
17 | +.left_menu .choose_book .book_box ul{padding:0;margin:0;} | ||
18 | +.left_menu .choose_book .book_box ul li{border-bottom:1px solid #ccc;position:relative;} | ||
19 | +.left_menu .choose_book .book_box p{float:left;line-height:34px;margin-bottom:0;font-size:14px;} | ||
20 | +.left_menu .choose_book .book_box img{float:right;width:20px;height:20px;margin-top:4.5px;} | ||
21 | +.left_menu .choose_book .gary{width:100%;height:15px;background:#eee;} | ||
22 | +.left_menu .section{padding:20px 0;} | ||
23 | +.left_menu .section ul{padding:0;margin:0;} | ||
24 | +.left_menu .section ul li{padding:10px 0;border-bottom:1px solid #ccc;} | ||
25 | +.left_menu .section ul li img{width:20px;height:20px;margin-right:10px;} | ||
26 | +.left_menu .section ul li ul{padding-left:25px;display:none;} | ||
27 | +.left_menu .section ul li ul li{border:0;} | ||
28 | +.float_box{position:absolute;top:0;background:#e9f0ff;left:100%;width:400px;height:200px;display:none;z-index:99;} | ||
29 | +.float_box li{width:27%;margin:0 2.5%;margin-top:10px;padding:5px 0px;text-align:center;border-radius:3px;border:1px solid #ccc;overflow:hidden;float:left;} | ||
30 | +.screen{width:100%;height:150px;background:#fff;box-shadow: 0 0 10px #ccc;margin-top:10px;padding:10px;} | ||
31 | +.tag dt,dd{display:inline-block;} | ||
32 | + | ||
33 | +.option{padding:10px 0;} | ||
34 | +.option ul{padding:0;} | ||
35 | +.option li{width:100%;padding:10px 0;} | ||
36 | +.option li span{vertical-align:middle;margin-right:5px;} | ||
37 | +.resolve{display:none;} | ||
38 | +.resolve_box{padding:20px 0;border-top:1px dashed #ccc;} | ||
39 | +.star_box{border-top:1px dashed #ccc;border-bottom:1px solid #ccc;padding:10px 0;} | ||
40 | +.star_box .col-md-6{float:right;} | ||
41 | +.star li{width:16px;height:16px;float:left;margin-left:5px;} | ||
42 | +.star ul{float:left;padding-left:0;margin-right:20px;} | ||
43 | +.star .off{background:url(../images/off.png) no-repeat;background-size:100%;} | ||
44 | +.star .on{background:url(../images/on.png) no-repeat;background-size:100%;} | ||
45 | +.check_box{float:right;width:22px;height:22px;border:2px solid #6a9cf0;border-radius:6px;} | ||
46 | +.checked{background:url(../images/checked.png) no-repeat;background-size:100%;border:0;} | ||
47 | + | ||
48 | +.basket{width:100%;height:80px;position:fixed;bottom:0;background:#e9f0ff;} | ||
49 | +.basket .basket_box{width:1200px;margin:0 auto;} | ||
50 | +.basket .basket_box p{display:inline-block;line-height:80px;font-size:25px;text-align:center;} | ||
51 | +.basket .basket_box .btn{font-size:20px;} | ||
52 | +.basket .basket_box .clear_que{margin-right:5%;} |
WebRoot/static/css/teach.css
@@ -29,10 +29,14 @@ input[type="checkbox"]{margin-right:10px;} | @@ -29,10 +29,14 @@ input[type="checkbox"]{margin-right:10px;} | ||
29 | .content .content_l .name p:first-child{font-size:14px;} | 29 | .content .content_l .name p:first-child{font-size:14px;} |
30 | .content .content_l .name p:nth-child(2){font-size:20px;} | 30 | .content .content_l .name p:nth-child(2){font-size:20px;} |
31 | .content .content_l .name p:nth-child(3){font-size:14px;} | 31 | .content .content_l .name p:nth-child(3){font-size:14px;} |
32 | -.content .content_l .tab1{border-bottom:1px solid #80afb4;} | 32 | +.content .content_l .tab1{border-bottom:1px solid #80afb4;cursor:pointer} |
33 | .content .content_l .tab1 p{width:100%;height:77px;line-height:77px;margin-bottom:0;font-size:24px;color:#fff;padding-left:10%;} | 33 | .content .content_l .tab1 p{width:100%;height:77px;line-height:77px;margin-bottom:0;font-size:24px;color:#fff;padding-left:10%;} |
34 | -.content .content_l .tab1 ul{margin-bottom:0;padding:12px 0;padding-left:15%;background:#0b535b;font-size:18px;line-height:64px;display:none;} | 34 | +.content .content_l .tab1 ul{margin-bottom:0;padding:0;font-size:18px;line-height:64px;display:none;} |
35 | .content .content_l .tab1 ul li{list-style:none;color:#fff;cursor:pointer;} | 35 | .content .content_l .tab1 ul li{list-style:none;color:#fff;cursor:pointer;} |
36 | +.menu_1 li{background:#1b535b;border-bottom: 1px solid #80afb4;} | ||
37 | +.menu_2 li{background:#333333;border-bottom: 1px dashed #80afb4;} | ||
38 | +.content .content_l .tab1 ul li:last-child{border:0;} | ||
39 | +.content .content_l .tab1 ul li p{padding-left:15%;font-size:18px;} | ||
36 | .content .content_r{margin-left:18%;height:100%;overflow-y:hidden;} | 40 | .content .content_r{margin-left:18%;height:100%;overflow-y:hidden;} |
37 | 41 | ||
38 | 42 |
WebRoot/static/images/add.png
0 → 100644
15.7 KB
WebRoot/static/images/arrow_right.png
0 → 100644
340 Bytes
WebRoot/static/images/checked.png
0 → 100644
355 Bytes
WebRoot/static/images/down_arrow.png
0 → 100644
391 Bytes
WebRoot/static/images/off.png
0 → 100644
2.4 KB
WebRoot/static/images/on.png
0 → 100644
1.03 KB
WebRoot/static/images/option_1.png
0 → 100644
5.82 KB
WebRoot/static/images/option_2.png
0 → 100644
5.79 KB
WebRoot/static/images/option_3.png
0 → 100644
5.78 KB
WebRoot/static/images/option_4.png
0 → 100644
5.71 KB
WebRoot/static/images/reduce.png
0 → 100644
1.07 KB
WebRoot/static/images/title.png
0 → 100644
12.7 KB
WebRoot/static/images/up_arrow.png
0 → 100644
587 Bytes
WebRoot/static/js/model.js
1 | $(".tab1").click(function(){ | 1 | $(".tab1").click(function(){ |
2 | var _this=$(this); | 2 | var _this=$(this); |
3 | - _this.find("ul").slideToggle(function(){ | ||
4 | - if(_this.find("ul").css("display")=="block") | 3 | + _this.children("ul").slideToggle(function(){ |
4 | + if(_this.children("ul").css("display")=="block") | ||
5 | + _this.find(".right").attr("class","down jiao"); | ||
6 | + else | ||
7 | + _this.find(".down").attr("class","right jiao"); | ||
8 | + }); | ||
9 | +}) | ||
10 | +$(".menu_1 li").click(function(event){ | ||
11 | + event.stopPropagation(); | ||
12 | + var _this=$(this); | ||
13 | + _this.children("ul").slideToggle(function(){ | ||
14 | + if(_this.children("ul").css("display")=="block") | ||
5 | _this.find(".right").attr("class","down jiao"); | 15 | _this.find(".right").attr("class","down jiao"); |
6 | else | 16 | else |
7 | _this.find(".down").attr("class","right jiao"); | 17 | _this.find(".down").attr("class","right jiao"); |
resources/mybatis1/sunvote/ChapterMapper.xml
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | NAME, | 12 | NAME, |
13 | CDESCRIPTION, | 13 | CDESCRIPTION, |
14 | REMARK, | 14 | REMARK, |
15 | - TEACHINGMATERIAL_ID, | 15 | + TEXTBOOK_ID, |
16 | ID | 16 | ID |
17 | </sql> | 17 | </sql> |
18 | 18 | ||
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | #{NAME}, | 21 | #{NAME}, |
22 | #{CDESCRIPTION}, | 22 | #{CDESCRIPTION}, |
23 | #{REMARK}, | 23 | #{REMARK}, |
24 | - #{TEACHINGMATERIAL_ID}, | 24 | + #{TEXTBOOK_ID}, |
25 | #{ID} | 25 | #{ID} |
26 | </sql> | 26 | </sql> |
27 | 27 | ||
@@ -33,12 +33,12 @@ | @@ -33,12 +33,12 @@ | ||
33 | NAME, | 33 | NAME, |
34 | CDESCRIPTION, | 34 | CDESCRIPTION, |
35 | REMARK, | 35 | REMARK, |
36 | - TEACHINGMATERIAL_ID | 36 | + TEXTBOOK_ID |
37 | ) values ( | 37 | ) values ( |
38 | #{NAME}, | 38 | #{NAME}, |
39 | #{CDESCRIPTION}, | 39 | #{CDESCRIPTION}, |
40 | #{REMARK}, | 40 | #{REMARK}, |
41 | - #{TEACHINGMATERIAL_ID} | 41 | + #{TEXTBOOK_ID} |
42 | ) | 42 | ) |
43 | </insert> | 43 | </insert> |
44 | 44 | ||
@@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
58 | NAME = #{NAME}, | 58 | NAME = #{NAME}, |
59 | CDESCRIPTION = #{CDESCRIPTION}, | 59 | CDESCRIPTION = #{CDESCRIPTION}, |
60 | REMARK = #{REMARK}, | 60 | REMARK = #{REMARK}, |
61 | - TEACHINGMATERIAL_ID = #{TEACHINGMATERIAL_ID}, | 61 | + TEXTBOOK_ID = #{TEXTBOOK_ID}, |
62 | ID = #{ID} | 62 | ID = #{ID} |
63 | where | 63 | where |
64 | ID = #{ID} | 64 | ID = #{ID} |
@@ -119,8 +119,8 @@ | @@ -119,8 +119,8 @@ | ||
119 | </if> | 119 | </if> |
120 | 120 | ||
121 | 121 | ||
122 | - <if test="TEACHINGMATERIAL_ID != null and TEACHINGMATERIAL_ID != ''"> | ||
123 | - and TEACHINGMATERIAL_ID = #{TEACHINGMATERIAL_ID} | 122 | + <if test="TEXTBOOK_ID != null and TEXTBOOK_ID != ''"> |
123 | + and TEXTBOOK_ID = #{TEXTBOOK_ID} | ||
124 | </if> | 124 | </if> |
125 | 125 | ||
126 | order by RANK | 126 | order by RANK |
resources/mybatis1/sunvote/KnowledgeMapper.xml
resources/mybatis1/sunvote/PaperMapper.xml
@@ -135,6 +135,10 @@ | @@ -135,6 +135,10 @@ | ||
135 | and CLASS_ID = #{pd.CLASS_ID} | 135 | and CLASS_ID = #{pd.CLASS_ID} |
136 | </if> | 136 | </if> |
137 | 137 | ||
138 | + <if test="pd.PAPER_TYPE != null and pd.PAPER_TYPE != ''"><!-- 关键词检索 --> | ||
139 | + and PAPER_TYPE = #{pd.PAPER_TYPE} | ||
140 | + </if> | ||
141 | + | ||
138 | order by CREATE_DATE DESC | 142 | order by CREATE_DATE DESC |
139 | </select> | 143 | </select> |
140 | 144 |
resources/mybatis1/sunvote/QuestionMapper.xml
@@ -229,6 +229,9 @@ | @@ -229,6 +229,9 @@ | ||
229 | <if test="COUNT != null and COUNT != ''"> | 229 | <if test="COUNT != null and COUNT != ''"> |
230 | limit ${COUNT} | 230 | limit ${COUNT} |
231 | </if> | 231 | </if> |
232 | + <if test="COUNT == null or COUNT == ''"> | ||
233 | + limit 30 | ||
234 | + </if> | ||
232 | 235 | ||
233 | 236 | ||
234 | </select> | 237 | </select> |
resources/mybatis1/sunvote/TeachingMaterialMapper.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | -<mapper namespace="TeachingMaterialMapper"> | 3 | +<mapper namespace="TextbookMapper"> |
4 | 4 | ||
5 | <!--表名 --> | 5 | <!--表名 --> |
6 | <sql id="tableName"> | 6 | <sql id="tableName"> |
7 | - SV_TEACHINGMATERIAL | 7 | + SV_TEXTBOOK |
8 | </sql> | 8 | </sql> |
9 | 9 | ||
10 | <!-- 字段 --> | 10 | <!-- 字段 --> |
11 | <sql id="Field"> | 11 | <sql id="Field"> |
12 | - NAME, | ||
13 | - SUBJECT_ID, | ||
14 | - GRADE_ID, | ||
15 | - VERSION_CODE, | ||
16 | - VERSION_NAME, | ||
17 | - ID | 12 | + ID, |
13 | + NAME, | ||
14 | + SUBJECT_ID, | ||
15 | + GRADEID, | ||
16 | + REMARK, | ||
17 | + TEACHING_MATERIAL_ID | ||
18 | </sql> | 18 | </sql> |
19 | 19 | ||
20 | <!-- 字段值 --> | 20 | <!-- 字段值 --> |
21 | <sql id="FieldValue"> | 21 | <sql id="FieldValue"> |
22 | + #{ID}, | ||
22 | #{NAME}, | 23 | #{NAME}, |
23 | #{SUBJECT_ID}, | 24 | #{SUBJECT_ID}, |
24 | #{GRADE_ID}, | 25 | #{GRADE_ID}, |
25 | - #{VERSION_CODE}, | ||
26 | #{VERSION_NAME}, | 26 | #{VERSION_NAME}, |
27 | - #{ID} | 27 | + #{REMARK}, |
28 | + #{TEACHING_MATERIAL_ID} | ||
28 | </sql> | 29 | </sql> |
29 | 30 | ||
30 | <!-- 新增--> | 31 | <!-- 新增--> |
@@ -55,9 +56,9 @@ | @@ -55,9 +56,9 @@ | ||
55 | NAME = #{NAME}, | 56 | NAME = #{NAME}, |
56 | SUBJECT_ID = #{SUBJECT_ID}, | 57 | SUBJECT_ID = #{SUBJECT_ID}, |
57 | GRADE_ID = #{GRADE_ID}, | 58 | GRADE_ID = #{GRADE_ID}, |
58 | - VERSION_CODE = #{VERSION_CODE}, | ||
59 | - VERSION_NAME = #{VERSION_NAME}, | ||
60 | - ID = #{ID} | 59 | + REMARK = #{REMARK}, |
60 | + TEACHING_MATERIAL_ID = #{TEACHING_MATERIAL_ID}, | ||
61 | + ID = #{ID} | ||
61 | where | 62 | where |
62 | ID = #{ID} | 63 | ID = #{ID} |
63 | </update> | 64 | </update> |
resources/mybatis1/sunvote/TestPaperInfoMapper.xml
@@ -194,6 +194,53 @@ | @@ -194,6 +194,53 @@ | ||
194 | </if> | 194 | </if> |
195 | </select> | 195 | </select> |
196 | 196 | ||
197 | + <!-- 测验,题目列表 --> | ||
198 | + <select id="listTestPaperQuestionIDs" parameterType="pd" resultType="pd"> | ||
199 | + select | ||
200 | + QUESTION_ID | ||
201 | + from | ||
202 | + <include refid="tableName"></include> | ||
203 | + where 1 =1 | ||
204 | + <if test="TEST_ID != null and TEST_ID != ''"> | ||
205 | + and TEST_ID = #{TEST_ID} | ||
206 | + </if> | ||
207 | + <if test="STUDENT_ID != null and STUDENT_ID != ''"> | ||
208 | + and STUDENT_ID = #{STUDENT_ID} | ||
209 | + </if> | ||
210 | + <if test="PAPER_ID != null and PAPER_ID != ''"> | ||
211 | + and PAPER_ID = #{PAPER_ID} | ||
212 | + </if> | ||
213 | + <if test="QUESTION_ID != null and QUESTION_ID != ''"> | ||
214 | + and QUESTION_ID = #{QUESTION_ID} | ||
215 | + </if> | ||
216 | + | ||
217 | + group by QUESTION_ID | ||
218 | + </select> | ||
219 | + | ||
220 | + | ||
221 | + <!-- 根据测验id,试题id,查询答题情况 --> | ||
222 | + <select id="listTestPaperQuestionIDinfo" parameterType="pd" resultType="pd"> | ||
223 | + select | ||
224 | + STUDENT_ID, ANSWER, `RIGHT`, SCORE | ||
225 | + from | ||
226 | + <include refid="tableName"></include> | ||
227 | + where 1 =1 | ||
228 | + <if test="TEST_ID != null and TEST_ID != ''"> | ||
229 | + and TEST_ID = #{TEST_ID} | ||
230 | + </if> | ||
231 | + <if test="STUDENT_ID != null and STUDENT_ID != ''"> | ||
232 | + and STUDENT_ID = #{STUDENT_ID} | ||
233 | + </if> | ||
234 | + <if test="PAPER_ID != null and PAPER_ID != ''"> | ||
235 | + and PAPER_ID = #{PAPER_ID} | ||
236 | + </if> | ||
237 | + <if test="QUESTION_ID != null and QUESTION_ID != ''"> | ||
238 | + and QUESTION_ID = #{QUESTION_ID} | ||
239 | + </if> | ||
240 | + | ||
241 | + ORDER BY ANSWER | ||
242 | + </select> | ||
243 | + | ||
197 | <!-- 列表(全部) --> | 244 | <!-- 列表(全部) --> |
198 | <select id="reportPaperDetail" parameterType="pd" resultType="pd"> | 245 | <select id="reportPaperDetail" parameterType="pd" resultType="pd"> |
199 | SELECT | 246 | SELECT |
resources/mybatis1/sunvote/TextbookMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="TeachingMaterialMapper"> | ||
4 | + | ||
5 | + <!--表名 --> | ||
6 | + <sql id="tableName"> | ||
7 | + SV_TEACHINGMATERIAL | ||
8 | + </sql> | ||
9 | + | ||
10 | + <!-- 字段 --> | ||
11 | + <sql id="Field"> | ||
12 | + NAME, | ||
13 | + SUBJECT_ID, | ||
14 | + GRADE_ID, | ||
15 | + VERSION_CODE, | ||
16 | + VERSION_NAME, | ||
17 | + ID | ||
18 | + </sql> | ||
19 | + | ||
20 | + <!-- 字段值 --> | ||
21 | + <sql id="FieldValue"> | ||
22 | + #{NAME}, | ||
23 | + #{SUBJECT_ID}, | ||
24 | + #{GRADE_ID}, | ||
25 | + #{VERSION_CODE}, | ||
26 | + #{VERSION_NAME}, | ||
27 | + #{ID} | ||
28 | + </sql> | ||
29 | + | ||
30 | + <!-- 新增--> | ||
31 | + <insert id="save" parameterType="pd"> | ||
32 | + insert into | ||
33 | + <include refid="tableName"></include> | ||
34 | + ( | ||
35 | + <include refid="Field"></include> | ||
36 | + | ||
37 | + ) values ( | ||
38 | + <include refid="FieldValue"></include> | ||
39 | + ) | ||
40 | + </insert> | ||
41 | + | ||
42 | + <!-- 删除--> | ||
43 | + <delete id="delete" parameterType="pd"> | ||
44 | + delete from | ||
45 | + <include refid="tableName"></include> | ||
46 | + where | ||
47 | + ID = #{ID} | ||
48 | + </delete> | ||
49 | + | ||
50 | + <!-- 修改 --> | ||
51 | + <update id="edit" parameterType="pd"> | ||
52 | + update | ||
53 | + <include refid="tableName"></include> | ||
54 | + set | ||
55 | + NAME = #{NAME}, | ||
56 | + SUBJECT_ID = #{SUBJECT_ID}, | ||
57 | + GRADE_ID = #{GRADE_ID}, | ||
58 | + VERSION_CODE = #{VERSION_CODE}, | ||
59 | + VERSION_NAME = #{VERSION_NAME}, | ||
60 | + ID = #{ID} | ||
61 | + where | ||
62 | + ID = #{ID} | ||
63 | + </update> | ||
64 | + | ||
65 | + <!-- 通过ID获取数据 --> | ||
66 | + <select id="findById" parameterType="pd" resultType="pd"> | ||
67 | + select | ||
68 | + <include refid="Field"></include> | ||
69 | + from | ||
70 | + <include refid="tableName"></include> | ||
71 | + where | ||
72 | + ID = #{ID} | ||
73 | + </select> | ||
74 | + | ||
75 | + <!-- 列表 --> | ||
76 | + <select id="datalistPage" parameterType="page" resultType="pd"> | ||
77 | + select | ||
78 | + <include refid="Field"></include> | ||
79 | + from | ||
80 | + <include refid="tableName"></include> | ||
81 | + where 1=1 | ||
82 | + <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 --> | ||
83 | + and | ||
84 | + ( | ||
85 | + <!-- 根据需求自己加检索条件 | ||
86 | + 字段1 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
87 | + or | ||
88 | + 字段2 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
89 | + --> | ||
90 | + ) | ||
91 | + </if> | ||
92 | + </select> | ||
93 | + | ||
94 | + <!-- 列表(全部) --> | ||
95 | + <select id="listAll" parameterType="pd" resultType="pd"> | ||
96 | + select | ||
97 | + <include refid="Field"></include> | ||
98 | + from | ||
99 | + <include refid="tableName"></include> | ||
100 | + | ||
101 | + where 1 = 1 | ||
102 | + | ||
103 | + <if test="TEACHING_MATERIAL_ID != null and TEACHING_MATERIAL_ID != ''"> | ||
104 | + and TEACHING_MATERIAL_ID = #{TEACHING_MATERIAL_ID} | ||
105 | + </if> | ||
106 | + <if test="SUBJECT_ID != null and SUBJECT_ID != ''"> | ||
107 | + and SUBJECT_ID = #{SUBJECT_ID} | ||
108 | + </if> | ||
109 | + <if test="GRADE_ID != null and GRADE_ID != ''"> | ||
110 | + and GRADE_ID = #{GRADE_ID} | ||
111 | + </if> | ||
112 | + | ||
113 | + </select> | ||
114 | + | ||
115 | + <!-- 批量删除 --> | ||
116 | + <delete id="deleteAll" parameterType="String"> | ||
117 | + delete from | ||
118 | + <include refid="tableName"></include> | ||
119 | + where | ||
120 | + ID in | ||
121 | + <foreach item="item" index="index" collection="array" open="(" separator="," close=")"> | ||
122 | + #{item} | ||
123 | + </foreach> | ||
124 | + </delete> | ||
125 | + | ||
126 | + <!-- fh313596790qq(青苔) --> | ||
127 | +</mapper> | ||
0 | \ No newline at end of file | 128 | \ No newline at end of file |
src/com/fh/Main.java
0 → 100644
1 | +package com.fh; | ||
2 | + | ||
3 | +import java.io.BufferedReader; | ||
4 | +import java.io.InputStreamReader; | ||
5 | +import java.net.HttpURLConnection; | ||
6 | +import java.net.URL; | ||
7 | + | ||
8 | +public class Main { | ||
9 | + | ||
10 | + public static void main(String[] args) { | ||
11 | + | ||
12 | + String username = "pressure_test" ; | ||
13 | + String password = "123456" ; | ||
14 | + String trueName = "" ; | ||
15 | + | ||
16 | + String url = "http://127.0.0.1:8080/SunvoteEducation/api/v1/tempcreateUser" ; | ||
17 | + for(int i = 2 ; i <= 100 ; i++){ | ||
18 | + trueName = username + i ; | ||
19 | + String keypadid = "0000" ; | ||
20 | + if(i >= 100){ | ||
21 | + keypadid = keypadid + i ; | ||
22 | + }else if(i > 9){ | ||
23 | + keypadid = keypadid + "0" + i ; | ||
24 | + }else{ | ||
25 | + keypadid = keypadid + "00" + i ; | ||
26 | + } | ||
27 | + post(url + "?ACCOUT=" + trueName + "&password=" + password + "&SCHOOL_ID=4" + "&SEX=1" + "&NAME=" + trueName + "&KEYPAD_ID=" + keypadid); | ||
28 | + } | ||
29 | + | ||
30 | + } | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + static void post(String url){ | ||
35 | + try { | ||
36 | + //请求地址 | ||
37 | + URL urlHttp = new URL(url); | ||
38 | + | ||
39 | + // 将url 以 open方法返回的urlConnection 连接强转为HttpURLConnection连接 (标识一个url所引用的远程对象连接) | ||
40 | + HttpURLConnection connection = (HttpURLConnection) urlHttp.openConnection();// 此时cnnection只是为一个连接对象,待连接中 | ||
41 | + // 设置连接输出流为true,默认false (post 请求是以流的方式隐式的传递参数) | ||
42 | + connection.setDoOutput(true); | ||
43 | + | ||
44 | + // 设置连接输入流为true | ||
45 | + connection.setDoInput(true); | ||
46 | + | ||
47 | + // 设置请求方式为post | ||
48 | + connection.setRequestMethod("POST"); | ||
49 | + | ||
50 | + // post请求缓存设为false | ||
51 | + connection.setUseCaches(false); | ||
52 | + | ||
53 | + // 设置该HttpURLConnection实例是否自动执行重定向 | ||
54 | + connection.setInstanceFollowRedirects(true); | ||
55 | + | ||
56 | + // 设置请求头里面的各个属性 (以下为设置内容的类型,设置为经过urlEncoded编码过的from参数) | ||
57 | + // application/x-javascript text/xml->xml数据 application/x-javascript->json对象 application/x-www-form-urlencoded->表单数据 | ||
58 | + // ;charset=utf-8 必须要,不然妙兜那边会出现乱码【★★★★★】 | ||
59 | + connection.setRequestProperty("Content-Type", "application/x-javascript;charset=utf-8"); | ||
60 | + | ||
61 | + connection.connect(); | ||
62 | + | ||
63 | + | ||
64 | + // 连接发起请求,处理服务器响应 (从连接获取到输入流并包装为bufferedReader) | ||
65 | + BufferedReader bf = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); | ||
66 | + String line; | ||
67 | + StringBuilder sb = new StringBuilder(); // 用来存储响应数据 | ||
68 | + | ||
69 | + // 循环读取流,若不到结尾处 | ||
70 | + while ((line = bf.readLine()) != null) { | ||
71 | + sb.append(line).append(System.getProperty("line.separator")); | ||
72 | + } | ||
73 | + bf.close(); // 重要且易忽略步骤 (关闭流,切记!) | ||
74 | + connection.disconnect(); // 销毁连接 | ||
75 | + | ||
76 | + | ||
77 | + } catch (Exception e) { | ||
78 | + e.printStackTrace(); | ||
79 | + } | ||
80 | + } | ||
81 | +} |
src/com/fh/controller/api/V1.java
@@ -52,15 +52,19 @@ import com.fh.service.sunvote.questiontype.QuestionTypeManager; | @@ -52,15 +52,19 @@ import com.fh.service.sunvote.questiontype.QuestionTypeManager; | ||
52 | import com.fh.service.sunvote.school.SchoolManager; | 52 | import com.fh.service.sunvote.school.SchoolManager; |
53 | import com.fh.service.sunvote.schoolgradesubject.SchoolGradeSubjectManager; | 53 | import com.fh.service.sunvote.schoolgradesubject.SchoolGradeSubjectManager; |
54 | import com.fh.service.sunvote.sclass.SClassManager; | 54 | import com.fh.service.sunvote.sclass.SClassManager; |
55 | +import com.fh.service.sunvote.sclass.impl.SClassService; | ||
55 | import com.fh.service.sunvote.student.StudentManager; | 56 | import com.fh.service.sunvote.student.StudentManager; |
56 | import com.fh.service.sunvote.studenttest.StudentTestManager; | 57 | import com.fh.service.sunvote.studenttest.StudentTestManager; |
57 | import com.fh.service.sunvote.subject.SubjectManager; | 58 | import com.fh.service.sunvote.subject.SubjectManager; |
59 | +import com.fh.service.sunvote.subject.impl.SubjectService; | ||
58 | import com.fh.service.sunvote.teacher.TeacherManager; | 60 | import com.fh.service.sunvote.teacher.TeacherManager; |
59 | import com.fh.service.sunvote.teachingmaterial.TeachingMaterialManager; | 61 | import com.fh.service.sunvote.teachingmaterial.TeachingMaterialManager; |
60 | import com.fh.service.sunvote.testpaper.TestPaperManager; | 62 | import com.fh.service.sunvote.testpaper.TestPaperManager; |
61 | import com.fh.service.sunvote.testpaperinfo.TestPaperInfoManager; | 63 | import com.fh.service.sunvote.testpaperinfo.TestPaperInfoManager; |
64 | +import com.fh.service.sunvote.textbook.TextbookManager; | ||
62 | import com.fh.service.system.user.UserManager; | 65 | import com.fh.service.system.user.UserManager; |
63 | import com.fh.util.PageData; | 66 | import com.fh.util.PageData; |
67 | +import com.fh.util.SpringBeanFactoryUtils; | ||
64 | import com.fh.util.Tools; | 68 | import com.fh.util.Tools; |
65 | 69 | ||
66 | @Controller | 70 | @Controller |
@@ -83,7 +87,7 @@ public class V1 extends BaseController { | @@ -83,7 +87,7 @@ public class V1 extends BaseController { | ||
83 | private ClassRosterManager classrosterService; | 87 | private ClassRosterManager classrosterService; |
84 | 88 | ||
85 | @Resource(name = "classtypeService") | 89 | @Resource(name = "classtypeService") |
86 | - private ClassTypeManager classtypeService; | 90 | + private ClassTypeManager classtypeService; |
87 | 91 | ||
88 | @Resource(name = "gradeService") | 92 | @Resource(name = "gradeService") |
89 | private GradeManager gradeService; | 93 | private GradeManager gradeService; |
@@ -171,6 +175,9 @@ public class V1 extends BaseController { | @@ -171,6 +175,9 @@ public class V1 extends BaseController { | ||
171 | 175 | ||
172 | @Resource(name = "teachingmaterialService") | 176 | @Resource(name = "teachingmaterialService") |
173 | private TeachingMaterialManager teachingmaterialService; | 177 | private TeachingMaterialManager teachingmaterialService; |
178 | + | ||
179 | + @Resource(name = "textbookService") | ||
180 | + private TextbookManager textbookService; | ||
174 | 181 | ||
175 | @Resource(name = "cacheService") | 182 | @Resource(name = "cacheService") |
176 | private CacheManager cacheService; | 183 | private CacheManager cacheService; |
@@ -237,6 +244,60 @@ public class V1 extends BaseController { | @@ -237,6 +244,60 @@ public class V1 extends BaseController { | ||
237 | 244 | ||
238 | return res.toJson(); | 245 | return res.toJson(); |
239 | } | 246 | } |
247 | + | ||
248 | + /** | ||
249 | + * 登录 | ||
250 | + * 可以通过账号密码登录、 | ||
251 | + * 可以通过教师卡登录 | ||
252 | + * @return | ||
253 | + * @throws Exception | ||
254 | + */ | ||
255 | + @RequestMapping(value = "/userinfo", produces = "application/json;charset=UTF-8") | ||
256 | + @ResponseBody | ||
257 | + public Object userinfo() throws Exception { | ||
258 | + event("userinfo"); | ||
259 | + PageData pd = this.getPageData(); | ||
260 | + ResponseGson<PageData> res = new ResponseGson(); | ||
261 | + PageData pageData = teacherService.findById(pd); | ||
262 | + if (pageData != null && pageData.getString("ID") != null) { | ||
263 | + pageData.put("PASSWORD", "");// 返回参数中不返回密码 | ||
264 | + PageData pt = new PageData(); | ||
265 | + pt.put("TEACHER_ID", pageData.get("ID")); | ||
266 | + // 在任课表中查找老师教哪些班级,然后查出班级信息 | ||
267 | + List<PageData> classInfoList = v1Service | ||
268 | + .getTeacherClassInfo(pt); | ||
269 | + | ||
270 | + pageData.put("classInfoList", classInfoList); | ||
271 | + // 在认可表中查找老师教哪些科目,然后查出科目信息 | ||
272 | + List<PageData> subjectList = v1Service | ||
273 | + .getTeacherSubjectInfo(pt); | ||
274 | + // 一个sql语句完成。 | ||
275 | + pageData.put("subjectList", subjectList); | ||
276 | + | ||
277 | + pageData.remove("SUBJECT_IDS"); | ||
278 | + | ||
279 | + PageData eventPd = new PageData(); | ||
280 | + eventPd.put("EVENT_ID", get32UUID()); | ||
281 | + eventPd.put("EVENT_NAME", "login"); | ||
282 | + eventPd.put("EVENT_USER", pageData.getString("ID")); | ||
283 | + eventPd.put("EVENT_TYPE", "0"); | ||
284 | + eventPd.put("EVENT_START_TIME", Tools.date2Str(new Date())); | ||
285 | + if (pd.getString("CLIENT_ID") != null) { | ||
286 | + eventPd.put("CLIENT_ID", pd.getString("CLIENT_ID")); | ||
287 | + } else { | ||
288 | + eventPd.put("CLIENT_ID", "CLIENT"); | ||
289 | + } | ||
290 | + eventPd.put("EVENT_IP", getRemoteIp()); | ||
291 | + eventService.save(eventPd); | ||
292 | + | ||
293 | + res.setData(pageData); | ||
294 | + // 填充数据到返回数据中 | ||
295 | + } else { | ||
296 | + res.set1Error(); | ||
297 | + } | ||
298 | + | ||
299 | + return res.toJson(); | ||
300 | + } | ||
240 | 301 | ||
241 | /** | 302 | /** |
242 | * 查询班级 | 303 | * 查询班级 |
@@ -363,6 +424,29 @@ public class V1 extends BaseController { | @@ -363,6 +424,29 @@ public class V1 extends BaseController { | ||
363 | logger.info("subject cost time : " + (System.currentTimeMillis() - cur)); | 424 | logger.info("subject cost time : " + (System.currentTimeMillis() - cur)); |
364 | return res.toJson(); | 425 | return res.toJson(); |
365 | } | 426 | } |
427 | + | ||
428 | + /** | ||
429 | + * 科目 | ||
430 | + * @return | ||
431 | + * @throws Exception | ||
432 | + */ | ||
433 | + @RequestMapping(value = "/subjectname", produces = "application/json;charset=UTF-8") | ||
434 | + @ResponseBody | ||
435 | + public Object subjectName() throws Exception { | ||
436 | + event("subject"); | ||
437 | + long cur = System.currentTimeMillis(); | ||
438 | + PageData pd = this.getPageData(); | ||
439 | + ResponseGson<List<PageData>> res = new ResponseGson(); | ||
440 | + if (!pd.containsKey("SCHOOL_ID")) { | ||
441 | + List<PageData> list = subjectService.listAll(pd); | ||
442 | + res.setData(list); | ||
443 | + } else { | ||
444 | + List<PageData> list = schoolgradesubjectService.listAllSubject(pd); | ||
445 | + res.setData(list); | ||
446 | + } | ||
447 | + logger.info("subject cost time : " + (System.currentTimeMillis() - cur)); | ||
448 | + return res.toJson(); | ||
449 | + } | ||
366 | 450 | ||
367 | /** | 451 | /** |
368 | * 键盘扫描 | 452 | * 键盘扫描 |
@@ -546,6 +630,181 @@ public class V1 extends BaseController { | @@ -546,6 +630,181 @@ public class V1 extends BaseController { | ||
546 | + (System.currentTimeMillis() - cur)); | 630 | + (System.currentTimeMillis() - cur)); |
547 | return res.toJson(); | 631 | return res.toJson(); |
548 | } | 632 | } |
633 | + | ||
634 | + /** | ||
635 | + * 试卷详细信息 | ||
636 | + * @return | ||
637 | + * @throws Exception | ||
638 | + */ | ||
639 | + @RequestMapping(value = "/testpaperinfo", produces = "application/json;charset=UTF-8") | ||
640 | + @ResponseBody | ||
641 | + public Object testpaperinfo() throws Exception { | ||
642 | + event("testpaperinfo"); | ||
643 | + long cur = System.currentTimeMillis(); | ||
644 | + PageData pd = this.getPageData(); | ||
645 | + ResponseGson<PageData> res = new ResponseGson(); | ||
646 | + String paperId = pd.getString("ID"); | ||
647 | + if (!StringUtils.isEmpty(paperId)) { | ||
648 | + try { | ||
649 | + pd.put("TESTPAPER_ID", paperId); | ||
650 | + PageData testPd = testpaperService.findById(pd); | ||
651 | + if (testPd != null) { | ||
652 | + PageData testInfof = new PageData(); | ||
653 | + testInfof.put("PAPER_ID", testPd.getString("PAPER_ID")); | ||
654 | + testInfof.put("TEST_ID", paperId); | ||
655 | + List<PageData> list = testpaperinfoService.listTestPaperQuestionIDs(testInfof); | ||
656 | + for(PageData pad:list){ | ||
657 | + String optionContent = pad.getString("OPTION_CONTENT"); | ||
658 | + if(optionContent != null && optionContent.startsWith("[") && optionContent.endsWith("]")){ | ||
659 | + String[] options = optionContent.substring(1, optionContent.length() -1).split(","); | ||
660 | + pad.put("OPTION_CONTENT", options); | ||
661 | + }else{ | ||
662 | + pad.put("OPTION_CONTENT", new String[]{optionContent}); | ||
663 | + } | ||
664 | + } | ||
665 | + for(PageData pqd : list){ | ||
666 | + PageData tpqd = questionService.findById(pqd); | ||
667 | + pqd.putAll(tpqd); | ||
668 | + pqd.remove("P_ID"); | ||
669 | + pqd.remove("SUBJECT_ID"); | ||
670 | + pqd.remove("PROBLEM_TYPE_ID"); | ||
671 | + pqd.remove("CHAPTER_ID"); | ||
672 | + pqd.remove("TEACHER_ID"); | ||
673 | + pqd.remove("SCHOOL_ID"); | ||
674 | + pqd.remove("SUG_SCORE"); | ||
675 | + pqd.remove("SUG_PART_SCORE"); | ||
676 | + pqd.remove("USER_ID"); | ||
677 | + pqd.remove("CREATE_DATE"); | ||
678 | + pqd.remove("QUESTION_FROM"); | ||
679 | + pqd.remove("REMARK"); | ||
680 | + pqd.put("TEST_ID", paperId); | ||
681 | + List<PageData> listinfo = testpaperinfoService.listTestPaperQuestionIDinfo(pqd); | ||
682 | + List<PageData> answerInfos = new ArrayList<PageData>(); | ||
683 | + for(PageData pid : listinfo){ | ||
684 | + String answer = pid.getString("ANSWER"); | ||
685 | + PageData answerPd = null; | ||
686 | + if(answerInfos.size() > 0){ | ||
687 | + answerPd = answerInfos.get(answerInfos.size() -1); | ||
688 | + if(!answer.equals(answerPd.getString("ANSWER"))){ | ||
689 | + answerPd = new PageData(); | ||
690 | + answerPd.put("ANSWER", answer); | ||
691 | + answerPd.put("ISRIGHT", pid.getString("RIGHT")); | ||
692 | + answerInfos.add(answerPd); | ||
693 | + } | ||
694 | + }else{ | ||
695 | + answerPd = new PageData(); | ||
696 | + answerPd.put("ANSWER", answer); | ||
697 | + answerPd.put("ISRIGHT", pid.getString("RIGHT")); | ||
698 | + answerInfos.add(answerPd); | ||
699 | + } | ||
700 | + String strCount = answerPd.getString("COUNT"); | ||
701 | + int count = 0 ; | ||
702 | + if(strCount != null){ | ||
703 | + try{ | ||
704 | + count = Integer.parseInt(strCount); | ||
705 | + }catch(NumberFormatException ex){} | ||
706 | + } | ||
707 | + count ++ ; | ||
708 | + answerPd.put("COUNT", count); | ||
709 | + } | ||
710 | + pqd.put("ANSWERINFO", answerInfos); | ||
711 | + pqd.remove("TEST_ID"); | ||
712 | + } | ||
713 | + testPd.put("QUESTIONS", list); | ||
714 | + | ||
715 | + } | ||
716 | + | ||
717 | + res.setData(testPd); | ||
718 | + } catch (Exception e) { | ||
719 | + e.printStackTrace(); | ||
720 | + res.setError(); | ||
721 | + } | ||
722 | + } | ||
723 | + logger.info("testpaperinfo cost time:" | ||
724 | + + (System.currentTimeMillis() - cur)); | ||
725 | + return res.toJson(); | ||
726 | + } | ||
727 | + | ||
728 | + /** | ||
729 | + * 试卷详细信息 | ||
730 | + * @return | ||
731 | + * @throws Exception | ||
732 | + */ | ||
733 | + @RequestMapping(value = "/questionintestreportinfo", produces = "application/json;charset=UTF-8") | ||
734 | + @ResponseBody | ||
735 | + public Object questionInTestReportInfo() throws Exception { | ||
736 | + event("testpaperinfo"); | ||
737 | + long cur = System.currentTimeMillis(); | ||
738 | + PageData pd = this.getPageData(); | ||
739 | + ResponseGson<PageData> res = new ResponseGson(); | ||
740 | + if (pd.getString("QUESTION_ID") != null) { | ||
741 | + String questionId = pd.getString("QUESTION_ID"); | ||
742 | + PageData pqd = new PageData(); | ||
743 | + pqd.put("QUESTION_ID", questionId); | ||
744 | + PageData tpqd = questionService.findById(pqd); | ||
745 | + pqd.putAll(tpqd); | ||
746 | + pqd.remove("P_ID"); | ||
747 | + pqd.remove("SUBJECT_ID"); | ||
748 | + pqd.remove("PROBLEM_TYPE_ID"); | ||
749 | + pqd.remove("CHAPTER_ID"); | ||
750 | + pqd.remove("TEACHER_ID"); | ||
751 | + pqd.remove("SCHOOL_ID"); | ||
752 | + pqd.remove("SUG_SCORE"); | ||
753 | + pqd.remove("SUG_PART_SCORE"); | ||
754 | + pqd.remove("USER_ID"); | ||
755 | + pqd.remove("CREATE_DATE"); | ||
756 | + pqd.remove("QUESTION_FROM"); | ||
757 | + pqd.remove("REMARK"); | ||
758 | + String optionContent = pqd.getString("OPTION_CONTENT"); | ||
759 | + if(optionContent != null && optionContent.startsWith("[") && optionContent.endsWith("]")){ | ||
760 | + String[] options = optionContent.substring(1, optionContent.length() -1).split(","); | ||
761 | + pqd.put("OPTION_CONTENT", options); | ||
762 | + }else{ | ||
763 | + pqd.put("OPTION_CONTENT", new String[]{optionContent}); | ||
764 | + } | ||
765 | + if(pd.getString("TEST_ID") != null){ | ||
766 | + pqd.put("TEST_ID", pd.getString("TEST_ID")); | ||
767 | + } | ||
768 | + List<PageData> listinfo = testpaperinfoService | ||
769 | + .listTestPaperQuestionIDinfo(pqd); | ||
770 | + List<PageData> answerInfos = new ArrayList<PageData>(); | ||
771 | + for (PageData pid : listinfo) { | ||
772 | + String answer = pid.getString("ANSWER"); | ||
773 | + PageData answerPd = null; | ||
774 | + if (answerInfos.size() > 0) { | ||
775 | + answerPd = answerInfos.get(answerInfos.size() - 1); | ||
776 | + if (!answer.equals(answerPd.getString("ANSWER"))) { | ||
777 | + answerPd = new PageData(); | ||
778 | + answerPd.put("ANSWER", answer); | ||
779 | + answerPd.put("ISRIGHT", pid.getString("RIGHT")); | ||
780 | + answerInfos.add(answerPd); | ||
781 | + } | ||
782 | + } else { | ||
783 | + answerPd = new PageData(); | ||
784 | + answerPd.put("ANSWER", answer); | ||
785 | + answerPd.put("ISRIGHT", pid.getString("RIGHT")); | ||
786 | + answerInfos.add(answerPd); | ||
787 | + } | ||
788 | + String strCount = answerPd.getString("COUNT"); | ||
789 | + int count = 0; | ||
790 | + if (strCount != null) { | ||
791 | + try { | ||
792 | + count = Integer.parseInt(strCount); | ||
793 | + } catch (NumberFormatException ex) { | ||
794 | + } | ||
795 | + } | ||
796 | + count++; | ||
797 | + answerPd.put("COUNT", count); | ||
798 | + } | ||
799 | + pqd.put("ANSWERINFO", answerInfos); | ||
800 | + res.setData(pqd); | ||
801 | + }else{ | ||
802 | + res.setDataError(); | ||
803 | + } | ||
804 | + logger.info("testpaperinfo cost time:" | ||
805 | + + (System.currentTimeMillis() - cur)); | ||
806 | + return res.toJson(); | ||
807 | + } | ||
549 | 808 | ||
550 | /** | 809 | /** |
551 | * 试卷简要信息 | 810 | * 试卷简要信息 |
@@ -655,6 +914,13 @@ public class V1 extends BaseController { | @@ -655,6 +914,13 @@ public class V1 extends BaseController { | ||
655 | for (String i : id) { | 914 | for (String i : id) { |
656 | pd.put("QUESTION_ID", i); | 915 | pd.put("QUESTION_ID", i); |
657 | PageData data = questionService.findById(pd); | 916 | PageData data = questionService.findById(pd); |
917 | + String optionContent = data.getString("OPTION_CONTENT"); | ||
918 | + if(optionContent != null && optionContent.startsWith("[") && optionContent.endsWith("]")){ | ||
919 | + String[] options = optionContent.substring(1, optionContent.length() -1).split(","); | ||
920 | + data.put("OPTION_CONTENT", options); | ||
921 | + }else{ | ||
922 | + data.put("OPTION_CONTENT", new String[]{optionContent}); | ||
923 | + } | ||
658 | if (data != null) { | 924 | if (data != null) { |
659 | list.add(data); | 925 | list.add(data); |
660 | } | 926 | } |
@@ -929,6 +1195,7 @@ public class V1 extends BaseController { | @@ -929,6 +1195,7 @@ public class V1 extends BaseController { | ||
929 | pqPd.put("RANK", question.getRank()); | 1195 | pqPd.put("RANK", question.getRank()); |
930 | pqPd.put("NO_NAME", question.getNo_name()); | 1196 | pqPd.put("NO_NAME", question.getNo_name()); |
931 | pqPd.put("PAPERQUESTION_ID", this.get32UUID()); | 1197 | pqPd.put("PAPERQUESTION_ID", this.get32UUID()); |
1198 | + pqPd.put("P_ID", "0"); | ||
932 | paperquestionService.save(pqPd); | 1199 | paperquestionService.save(pqPd); |
933 | 1200 | ||
934 | } | 1201 | } |
@@ -1596,6 +1863,16 @@ public class V1 extends BaseController { | @@ -1596,6 +1863,16 @@ public class V1 extends BaseController { | ||
1596 | ret.setData(lpd); | 1863 | ret.setData(lpd); |
1597 | return ret.toJson(); | 1864 | return ret.toJson(); |
1598 | } | 1865 | } |
1866 | + | ||
1867 | + @RequestMapping(value = "/textbook", produces = "application/json;charset=UTF-8") | ||
1868 | + @ResponseBody | ||
1869 | + public Object textbook() throws Exception { | ||
1870 | + PageData pd = getPageData(); | ||
1871 | + ResponseGson<List<PageData>> ret = new ResponseGson<List<PageData>>(); | ||
1872 | + List<PageData> list = textbookService.listAll(pd); | ||
1873 | + ret.setData(list); | ||
1874 | + return ret.toJson(); | ||
1875 | + } | ||
1599 | 1876 | ||
1600 | /** | 1877 | /** |
1601 | * 获取教材版本 | 1878 | * 获取教材版本 |
@@ -1677,6 +1954,15 @@ public class V1 extends BaseController { | @@ -1677,6 +1954,15 @@ public class V1 extends BaseController { | ||
1677 | pd.remove("KNOWLEDGE_ID"); | 1954 | pd.remove("KNOWLEDGE_ID"); |
1678 | } | 1955 | } |
1679 | List<PageData> list = questionService.listAllquestion(pd); | 1956 | List<PageData> list = questionService.listAllquestion(pd); |
1957 | + for(PageData pad:list){ | ||
1958 | + String optionContent = pad.getString("OPTION_CONTENT"); | ||
1959 | + if(optionContent != null && optionContent.startsWith("[") && optionContent.endsWith("]")){ | ||
1960 | + String[] options = optionContent.substring(1, optionContent.length() -1).split(","); | ||
1961 | + pad.put("OPTION_CONTENT", options); | ||
1962 | + }else{ | ||
1963 | + pad.put("OPTION_CONTENT", new String[]{optionContent}); | ||
1964 | + } | ||
1965 | + } | ||
1680 | res.setData(list); | 1966 | res.setData(list); |
1681 | return res.toJson(); | 1967 | return res.toJson(); |
1682 | } | 1968 | } |
@@ -1723,6 +2009,15 @@ public class V1 extends BaseController { | @@ -1723,6 +2009,15 @@ public class V1 extends BaseController { | ||
1723 | pd.remove("KNOWLEDGE_ID"); | 2009 | pd.remove("KNOWLEDGE_ID"); |
1724 | } | 2010 | } |
1725 | List<PageData> list = questionService.listAllRandquestion(pd); | 2011 | List<PageData> list = questionService.listAllRandquestion(pd); |
2012 | + for(PageData pad:list){ | ||
2013 | + String optionContent = pad.getString("OPTION_CONTENT"); | ||
2014 | + if(optionContent != null && optionContent.startsWith("[") && optionContent.endsWith("]")){ | ||
2015 | + String[] options = optionContent.substring(1, optionContent.length() -1).split(","); | ||
2016 | + pad.put("OPTION_CONTENT", options); | ||
2017 | + }else{ | ||
2018 | + pad.put("OPTION_CONTENT", new String[]{optionContent}); | ||
2019 | + } | ||
2020 | + } | ||
1726 | res.setData(list); | 2021 | res.setData(list); |
1727 | return res.toJson(); | 2022 | return res.toJson(); |
1728 | } | 2023 | } |
@@ -1891,7 +2186,6 @@ public class V1 extends BaseController { | @@ -1891,7 +2186,6 @@ public class V1 extends BaseController { | ||
1891 | try { | 2186 | try { |
1892 | teachingmaterialService.save(pd); | 2187 | teachingmaterialService.save(pd); |
1893 | } catch (Exception e) { | 2188 | } catch (Exception e) { |
1894 | - // TODO Auto-generated catch block | ||
1895 | e.printStackTrace(); | 2189 | e.printStackTrace(); |
1896 | } | 2190 | } |
1897 | } | 2191 | } |
@@ -2055,4 +2349,82 @@ public class V1 extends BaseController { | @@ -2055,4 +2349,82 @@ public class V1 extends BaseController { | ||
2055 | 2349 | ||
2056 | return key.toString(); | 2350 | return key.toString(); |
2057 | } | 2351 | } |
2352 | + | ||
2353 | + | ||
2354 | + /** | ||
2355 | + * 根据ID,获取科目中文名称 | ||
2356 | + * @param type | ||
2357 | + * @return | ||
2358 | + * @throws Exception | ||
2359 | + */ | ||
2360 | + @RequestMapping(value = "/subjectename", produces = "application/json;charset=UTF-8") | ||
2361 | + @ResponseBody | ||
2362 | + public String findSubjectEName() throws Exception{ | ||
2363 | + PageData pageData = this.getPageData(); | ||
2364 | + ResponseGson<String> res = new ResponseGson<String>(); | ||
2365 | + pageData = subjectService.findById(pageData); | ||
2366 | + if(pageData != null){ | ||
2367 | + res.setData(pageData.getString("ENAME")); | ||
2368 | + }else{ | ||
2369 | + res.setDataError(); | ||
2370 | + } | ||
2371 | + return res.toJson(); | ||
2372 | + } | ||
2373 | + | ||
2374 | + /** | ||
2375 | + * 根据ID或者科目英文名称 | ||
2376 | + * @param type | ||
2377 | + * @return | ||
2378 | + * @throws Exception | ||
2379 | + */ | ||
2380 | + @RequestMapping(value = "/subjectcname", produces = "application/json;charset=UTF-8") | ||
2381 | + @ResponseBody | ||
2382 | + public String findSubjectCName() throws Exception{ | ||
2383 | + ResponseGson<String> res = new ResponseGson<String>(); | ||
2384 | + PageData pageData = new PageData(); | ||
2385 | + StringBuilder sb = new StringBuilder(); | ||
2386 | + String type = this.getPageData().getString("ID"); | ||
2387 | + if(type.contains(",")){ | ||
2388 | + String[] types = type.split(","); | ||
2389 | + for (String t : types) { | ||
2390 | + pageData.put("ID", t); | ||
2391 | + pageData = subjectService.findById(pageData); | ||
2392 | + if (pageData != null) { | ||
2393 | + sb.append(pageData.getString("CNAME") + "; "); | ||
2394 | + } | ||
2395 | + } | ||
2396 | + sb.delete(sb.length() -3, sb.length()); | ||
2397 | + }else{ | ||
2398 | + pageData.put("ID", type); | ||
2399 | + pageData = subjectService.findById(pageData); | ||
2400 | + if (pageData != null) { | ||
2401 | + sb.append(pageData.getString("CNAME")); | ||
2402 | + } | ||
2403 | + } | ||
2404 | + res.setData(sb.toString()); | ||
2405 | + return res.toJson(); | ||
2406 | + } | ||
2407 | + | ||
2408 | + /** | ||
2409 | + * 根据ID班级名称 | ||
2410 | + * @param id | ||
2411 | + * @return | ||
2412 | + * @throws Exception | ||
2413 | + */ | ||
2414 | + @RequestMapping(value = "/classname", produces = "application/json;charset=UTF-8") | ||
2415 | + @ResponseBody | ||
2416 | + public String findClassName() throws Exception { | ||
2417 | + ResponseGson<String> res = new ResponseGson<String>(); | ||
2418 | + PageData pageData = this.getPageData(); | ||
2419 | + pageData = sclassService.findById(pageData); | ||
2420 | + String className = "" ; | ||
2421 | + if(pageData != null){ | ||
2422 | + className = pageData.getString("CLASS_NAME"); | ||
2423 | + }else{ | ||
2424 | + res.setDataError(); | ||
2425 | + } | ||
2426 | + res.setData(className); | ||
2427 | + return res.toJson(); | ||
2428 | + | ||
2429 | + } | ||
2058 | } | 2430 | } |
src/com/fh/controller/base/BaseController.java
@@ -91,6 +91,15 @@ public class BaseController { | @@ -91,6 +91,15 @@ public class BaseController { | ||
91 | return "ERROR"; | 91 | return "ERROR"; |
92 | } | 92 | } |
93 | 93 | ||
94 | + public String geTeacherID(){ | ||
95 | + Session session = Jurisdiction.getSession(); | ||
96 | + User user = (User)session.getAttribute(Const.SESSION_USER); | ||
97 | + if(user != null){ | ||
98 | + return user.getTeacherID(); | ||
99 | + } | ||
100 | + return "ERROR"; | ||
101 | + } | ||
102 | + | ||
94 | 103 | ||
95 | public String getSchoolID(){ | 104 | public String getSchoolID(){ |
96 | Session session = Jurisdiction.getSession(); | 105 | Session session = Jurisdiction.getSession(); |
src/com/fh/controller/sunvote/paper/PaperController.java
@@ -271,6 +271,64 @@ public class PaperController extends BaseController { | @@ -271,6 +271,64 @@ public class PaperController extends BaseController { | ||
271 | } | 271 | } |
272 | String userID = getUserID(); | 272 | String userID = getUserID(); |
273 | pd.put("USER_ID", userID); | 273 | pd.put("USER_ID", userID); |
274 | + pd.put("PAPER_TYPE","1"); | ||
275 | + page.setPd(pd); | ||
276 | + List<PageData> varList = paperService.list(page); //列出Paper列表 | ||
277 | + mv.setViewName("sunvote/paper/paper_list2"); | ||
278 | + | ||
279 | + for(PageData p:varList){ | ||
280 | + String examTime = p.getString("EXAM_TIME"); | ||
281 | + if(examTime != null){ | ||
282 | + try{ | ||
283 | + int et = Integer.parseInt(examTime); | ||
284 | + String min = (et / 60 ) + "" ; | ||
285 | + if(min.length() < 2){ | ||
286 | + min = "0" + min ; | ||
287 | + } | ||
288 | + String sec = (et % 60 ) + "" ; | ||
289 | + if(sec.length() < 2){ | ||
290 | + sec = "0" + sec ; | ||
291 | + } | ||
292 | + if(et > 60){ | ||
293 | + examTime = min + ":" + sec; | ||
294 | + }else{ | ||
295 | + examTime = "00:" + sec; | ||
296 | + } | ||
297 | + }catch(Exception e){ | ||
298 | + e.printStackTrace(); | ||
299 | + } | ||
300 | + } | ||
301 | + if(examTime == null){ | ||
302 | + examTime = "00:00"; | ||
303 | + } | ||
304 | + p.put("EXAM_TIME", examTime); | ||
305 | + } | ||
306 | + | ||
307 | + mv.addObject("varList", varList); | ||
308 | + mv.addObject("pd", pd); | ||
309 | + mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 | ||
310 | + return mv; | ||
311 | + } | ||
312 | + | ||
313 | + | ||
314 | + /**列表 | ||
315 | + * @param page | ||
316 | + * @throws Exception | ||
317 | + */ | ||
318 | + @RequestMapping(value="/list3") | ||
319 | + public ModelAndView list3(Page page) throws Exception{ | ||
320 | + logBefore(logger, Jurisdiction.getUsername()+"列表Paper"); | ||
321 | + //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | ||
322 | + ModelAndView mv = this.getModelAndView(); | ||
323 | + PageData pd = new PageData(); | ||
324 | + pd = this.getPageData(); | ||
325 | + String keywords = pd.getString("keywords"); //关键词检索条件 | ||
326 | + if(null != keywords && !"".equals(keywords)){ | ||
327 | + pd.put("keywords", keywords.trim()); | ||
328 | + } | ||
329 | + String userID = getUserID(); | ||
330 | + pd.put("USER_ID", userID); | ||
331 | + pd.put("PAPER_TYPE","101"); | ||
274 | page.setPd(pd); | 332 | page.setPd(pd); |
275 | List<PageData> varList = paperService.list(page); //列出Paper列表 | 333 | List<PageData> varList = paperService.list(page); //列出Paper列表 |
276 | mv.setViewName("sunvote/paper/paper_list2"); | 334 | mv.setViewName("sunvote/paper/paper_list2"); |
src/com/fh/controller/sunvote/teacher/TeacherController.java
@@ -20,8 +20,10 @@ import org.springframework.web.bind.annotation.RequestMapping; | @@ -20,8 +20,10 @@ import org.springframework.web.bind.annotation.RequestMapping; | ||
20 | import org.springframework.web.bind.annotation.ResponseBody; | 20 | import org.springframework.web.bind.annotation.ResponseBody; |
21 | import org.springframework.web.servlet.ModelAndView; | 21 | import org.springframework.web.servlet.ModelAndView; |
22 | 22 | ||
23 | +import com.fh.controller.api.ResponseGson; | ||
23 | import com.fh.controller.base.BaseController; | 24 | import com.fh.controller.base.BaseController; |
24 | import com.fh.entity.Page; | 25 | import com.fh.entity.Page; |
26 | +import com.fh.service.api.V1Manager; | ||
25 | import com.fh.service.sunvote.school.SchoolManager; | 27 | import com.fh.service.sunvote.school.SchoolManager; |
26 | import com.fh.service.sunvote.teacher.TeacherManager; | 28 | import com.fh.service.sunvote.teacher.TeacherManager; |
27 | import com.fh.service.system.fhlog.FHlogManager; | 29 | import com.fh.service.system.fhlog.FHlogManager; |
@@ -30,72 +32,84 @@ import com.fh.util.AppUtil; | @@ -30,72 +32,84 @@ import com.fh.util.AppUtil; | ||
30 | import com.fh.util.Jurisdiction; | 32 | import com.fh.util.Jurisdiction; |
31 | import com.fh.util.ObjectExcelView; | 33 | import com.fh.util.ObjectExcelView; |
32 | import com.fh.util.PageData; | 34 | import com.fh.util.PageData; |
35 | +import com.fh.util.Tools; | ||
33 | 36 | ||
34 | -/** | ||
35 | - * 说明:教师 | ||
36 | - * 创建人:Elvis | ||
37 | - * 创建时间:2018-04-26 | 37 | +/** |
38 | + * 说明:教师 创建人:Elvis 创建时间:2018-04-26 | ||
38 | */ | 39 | */ |
39 | @Controller | 40 | @Controller |
40 | -@RequestMapping(value="/teacher") | 41 | +@RequestMapping(value = "/teacher") |
41 | public class TeacherController extends BaseController { | 42 | public class TeacherController extends BaseController { |
42 | - | ||
43 | - String menuUrl = "teacher/list.do"; //菜单地址(权限用) | ||
44 | - @Resource(name="teacherService") | 43 | + |
44 | + String menuUrl = "teacher/list.do"; // 菜单地址(权限用) | ||
45 | + @Resource(name = "teacherService") | ||
45 | private TeacherManager teacherService; | 46 | private TeacherManager teacherService; |
46 | - | ||
47 | - @Resource(name="schoolService") | 47 | + |
48 | + @Resource(name = "schoolService") | ||
48 | private SchoolManager schoolService; | 49 | private SchoolManager schoolService; |
49 | - | ||
50 | - | ||
51 | - @Resource(name="userService") | 50 | + |
51 | + @Resource(name = "userService") | ||
52 | private UserManager userService; | 52 | private UserManager userService; |
53 | - | ||
54 | - @Resource(name="fhlogService") | 53 | + |
54 | + @Resource(name = "fhlogService") | ||
55 | private FHlogManager FHLOG; | 55 | private FHlogManager FHLOG; |
56 | 56 | ||
57 | - /**保存 | 57 | + @Resource(name = "v1Service") |
58 | + private V1Manager v1Service; | ||
59 | + | ||
60 | + /** | ||
61 | + * 保存 | ||
62 | + * | ||
58 | * @param | 63 | * @param |
59 | * @throws Exception | 64 | * @throws Exception |
60 | */ | 65 | */ |
61 | - @RequestMapping(value="/save") | ||
62 | - public ModelAndView save() throws Exception{ | ||
63 | - logBefore(logger, Jurisdiction.getUsername()+"新增Teacher"); | ||
64 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限 | 66 | + @RequestMapping(value = "/save") |
67 | + public ModelAndView save() throws Exception { | ||
68 | + logBefore(logger, Jurisdiction.getUsername() + "新增Teacher"); | ||
69 | + if (!Jurisdiction.buttonJurisdiction(menuUrl, "add")) { | ||
70 | + return null; | ||
71 | + } // 校验权限 | ||
65 | ModelAndView mv = this.getModelAndView(); | 72 | ModelAndView mv = this.getModelAndView(); |
66 | PageData pd = new PageData(); | 73 | PageData pd = new PageData(); |
67 | pd = this.getPageData(); | 74 | pd = this.getPageData(); |
68 | pd.put("ID", this.get32UUID()); | 75 | pd.put("ID", this.get32UUID()); |
69 | teacherService.save(pd); | 76 | teacherService.save(pd); |
70 | - | ||
71 | - pd.put("USER_ID", pd.getString("ID")); //ID 主键 | ||
72 | - pd.put("LAST_LOGIN", ""); //最后登录时间 | ||
73 | - pd.put("IP", ""); //IP | ||
74 | - pd.put("STATUS", "0"); //状态 | 77 | + |
78 | + pd.put("USER_ID", pd.getString("ID")); // ID 主键 | ||
79 | + pd.put("LAST_LOGIN", ""); // 最后登录时间 | ||
80 | + pd.put("IP", ""); // IP | ||
81 | + pd.put("STATUS", "0"); // 状态 | ||
75 | pd.put("SKIN", "default"); | 82 | pd.put("SKIN", "default"); |
76 | - pd.put("RIGHTS", ""); | 83 | + pd.put("RIGHTS", ""); |
77 | pd.put("USERNAME", pd.getString("ACCOUT")); | 84 | pd.put("USERNAME", pd.getString("ACCOUT")); |
78 | - pd.put("ROLE_ID", "57bb1e6f138247a0b05cc721a5da1b64"); | ||
79 | - pd.put("PASSWORD", new SimpleHash("SHA-1", pd.getString("ACCOUT"), pd.getString("PASSWORD")).toString()); //密码加密 | ||
80 | - | ||
81 | - if(null == userService.findByUsername(pd)){ //判断用户名是否存在 | ||
82 | - userService.saveU(pd); //执行保存 | ||
83 | - FHLOG.save(Jurisdiction.getUsername(), "新增系统用户:"+pd.getString("USERNAME")); | 85 | + pd.put("ROLE_ID", "57bb1e6f138247a0b05cc721a5da1b64"); |
86 | + pd.put("PASSWORD", | ||
87 | + new SimpleHash("SHA-1", pd.getString("ACCOUT"), pd | ||
88 | + .getString("PASSWORD")).toString()); // 密码加密 | ||
89 | + | ||
90 | + if (null == userService.findByUsername(pd)) { // 判断用户名是否存在 | ||
91 | + userService.saveU(pd); // 执行保存 | ||
92 | + FHLOG.save(Jurisdiction.getUsername(), | ||
93 | + "新增系统用户:" + pd.getString("USERNAME")); | ||
84 | } | 94 | } |
85 | - | ||
86 | - mv.addObject("msg","success"); | 95 | + |
96 | + mv.addObject("msg", "success"); | ||
87 | mv.setViewName("save_result"); | 97 | mv.setViewName("save_result"); |
88 | return mv; | 98 | return mv; |
89 | } | 99 | } |
90 | - | ||
91 | - /**删除 | 100 | + |
101 | + /** | ||
102 | + * 删除 | ||
103 | + * | ||
92 | * @param out | 104 | * @param out |
93 | * @throws Exception | 105 | * @throws Exception |
94 | */ | 106 | */ |
95 | - @RequestMapping(value="/delete") | ||
96 | - public void delete(PrintWriter out) throws Exception{ | ||
97 | - logBefore(logger, Jurisdiction.getUsername()+"删除Teacher"); | ||
98 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return;} //校验权限 | 107 | + @RequestMapping(value = "/delete") |
108 | + public void delete(PrintWriter out) throws Exception { | ||
109 | + logBefore(logger, Jurisdiction.getUsername() + "删除Teacher"); | ||
110 | + if (!Jurisdiction.buttonJurisdiction(menuUrl, "del")) { | ||
111 | + return; | ||
112 | + } // 校验权限 | ||
99 | PageData pd = new PageData(); | 113 | PageData pd = new PageData(); |
100 | pd = this.getPageData(); | 114 | pd = this.getPageData(); |
101 | pd.put("USER_ID", pd.get("ID")); | 115 | pd.put("USER_ID", pd.get("ID")); |
@@ -104,177 +118,301 @@ public class TeacherController extends BaseController { | @@ -104,177 +118,301 @@ public class TeacherController extends BaseController { | ||
104 | out.write("success"); | 118 | out.write("success"); |
105 | out.close(); | 119 | out.close(); |
106 | } | 120 | } |
107 | - | ||
108 | - /**修改 | 121 | + |
122 | + /** | ||
123 | + * 修改 | ||
124 | + * | ||
109 | * @param | 125 | * @param |
110 | * @throws Exception | 126 | * @throws Exception |
111 | */ | 127 | */ |
112 | - @RequestMapping(value="/edit") | ||
113 | - public ModelAndView edit() throws Exception{ | ||
114 | - logBefore(logger, Jurisdiction.getUsername()+"修改Teacher"); | ||
115 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限 | 128 | + @RequestMapping(value = "/edit") |
129 | + public ModelAndView edit() throws Exception { | ||
130 | + logBefore(logger, Jurisdiction.getUsername() + "修改Teacher"); | ||
131 | + if (!Jurisdiction.buttonJurisdiction(menuUrl, "edit")) { | ||
132 | + return null; | ||
133 | + } // 校验权限 | ||
116 | ModelAndView mv = this.getModelAndView(); | 134 | ModelAndView mv = this.getModelAndView(); |
117 | PageData pd = new PageData(); | 135 | PageData pd = new PageData(); |
118 | pd = this.getPageData(); | 136 | pd = this.getPageData(); |
119 | teacherService.edit(pd); | 137 | teacherService.edit(pd); |
120 | - | ||
121 | - /*pd.put("USER_ID", pd.getString("ID")); //ID 主键 | ||
122 | - pd.put("LAST_LOGIN", ""); //最后登录时间 | ||
123 | - pd.put("IP", ""); //IP | ||
124 | - pd.put("STATUS", "0"); //状态 | ||
125 | - pd.put("SKIN", "default"); | ||
126 | - pd.put("RIGHTS", ""); | ||
127 | - pd.put("USERNAME", pd.getString("ACCOUT")); | ||
128 | - pd.put("ROLE_ID", "57bb1e6f138247a0b05cc721a5da1b64"); | ||
129 | - pd.put("PASSWORD", new SimpleHash("SHA-1", pd.getString("ACCOUT"), pd.getString("PASSWORD")).toString()); //密码加密 | ||
130 | - | ||
131 | - userService.saveU(pd);*/ | ||
132 | - | ||
133 | - mv.addObject("msg","success"); | 138 | + |
139 | + /* | ||
140 | + * pd.put("USER_ID", pd.getString("ID")); //ID 主键 pd.put("LAST_LOGIN", | ||
141 | + * ""); //最后登录时间 pd.put("IP", ""); //IP pd.put("STATUS", "0"); //状态 | ||
142 | + * pd.put("SKIN", "default"); pd.put("RIGHTS", ""); pd.put("USERNAME", | ||
143 | + * pd.getString("ACCOUT")); pd.put("ROLE_ID", | ||
144 | + * "57bb1e6f138247a0b05cc721a5da1b64"); pd.put("PASSWORD", new | ||
145 | + * SimpleHash("SHA-1", pd.getString("ACCOUT"), | ||
146 | + * pd.getString("PASSWORD")).toString()); //密码加密 | ||
147 | + * | ||
148 | + * userService.saveU(pd); | ||
149 | + */ | ||
150 | + | ||
151 | + mv.addObject("msg", "success"); | ||
134 | mv.setViewName("save_result"); | 152 | mv.setViewName("save_result"); |
135 | return mv; | 153 | return mv; |
136 | } | 154 | } |
155 | + | ||
156 | + /** | ||
157 | + * 列表 | ||
158 | + * | ||
159 | + * @param page | ||
160 | + * @throws Exception | ||
161 | + */ | ||
162 | + @RequestMapping(value = "/teach_paper") | ||
163 | + public ModelAndView teach_paper(Page page) throws Exception { | ||
164 | + logBefore(logger, Jurisdiction.getUsername() + "列表Paper"); | ||
165 | + String userId = this.getUserID(); | ||
166 | + ModelAndView mv = this.getModelAndView(); | ||
167 | + PageData pd = new PageData(); | ||
168 | + pd = this.getPageData(); | ||
169 | + mv.setViewName("sunvote/teacher/teach_paper"); | ||
170 | + mv.addObject("pd", pd); | ||
171 | + return mv; | ||
172 | + } | ||
137 | 173 | ||
138 | - /**列表 | 174 | + /** |
175 | + * 列表 | ||
176 | + * | ||
177 | + * @param page | ||
178 | + * @throws Exception | ||
179 | + */ | ||
180 | + @RequestMapping(value = "/paper_view") | ||
181 | + public ModelAndView paper_view(Page page) throws Exception { | ||
182 | + logBefore(logger, Jurisdiction.getUsername() + "列表Paper"); | ||
183 | + String userId = this.getUserID(); | ||
184 | + ModelAndView mv = this.getModelAndView(); | ||
185 | + PageData pd = new PageData(); | ||
186 | + pd = this.getPageData(); | ||
187 | + mv.setViewName("sunvote/teacher/paper_view"); | ||
188 | + mv.addObject("pd", pd); | ||
189 | + return mv; | ||
190 | + } | ||
191 | + | ||
192 | + /** | ||
193 | + * 列表 | ||
194 | + * | ||
195 | + * @param page | ||
196 | + * @throws Exception | ||
197 | + */ | ||
198 | + @RequestMapping(value = "/set_question") | ||
199 | + public ModelAndView set_question(Page page) throws Exception { | ||
200 | + logBefore(logger, Jurisdiction.getUsername() + "列表Paper"); | ||
201 | + ModelAndView mv = this.getModelAndView(); | ||
202 | + PageData pd = new PageData(); | ||
203 | + pd = this.getPageData(); | ||
204 | + mv.setViewName("sunvote/teacher/set_question"); | ||
205 | + mv.addObject("pd", pd); | ||
206 | + return mv; | ||
207 | + } | ||
208 | + | ||
209 | + /** | ||
210 | + * 列表 | ||
211 | + * | ||
139 | * @param page | 212 | * @param page |
140 | * @throws Exception | 213 | * @throws Exception |
141 | */ | 214 | */ |
142 | - @RequestMapping(value="/list") | ||
143 | - public ModelAndView list(Page page) throws Exception{ | ||
144 | - logBefore(logger, Jurisdiction.getUsername()+"列表Teacher"); | ||
145 | - //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | 215 | + @RequestMapping(value = "/list") |
216 | + public ModelAndView list(Page page) throws Exception { | ||
217 | + logBefore(logger, Jurisdiction.getUsername() + "列表Teacher"); | ||
218 | + // if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} | ||
219 | + // //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | ||
146 | ModelAndView mv = this.getModelAndView(); | 220 | ModelAndView mv = this.getModelAndView(); |
147 | PageData pd = new PageData(); | 221 | PageData pd = new PageData(); |
148 | pd = this.getPageData(); | 222 | pd = this.getPageData(); |
149 | - String keywords = pd.getString("keywords"); //关键词检索条件 | ||
150 | - if(null != keywords && !"".equals(keywords)){ | 223 | + String keywords = pd.getString("keywords"); // 关键词检索条件 |
224 | + if (null != keywords && !"".equals(keywords)) { | ||
151 | pd.put("keywords", keywords.trim()); | 225 | pd.put("keywords", keywords.trim()); |
152 | } | 226 | } |
153 | page.setPd(pd); | 227 | page.setPd(pd); |
154 | - List<PageData> varList = teacherService.list(page); //列出Teacher列表 | 228 | + List<PageData> varList = teacherService.list(page); // 列出Teacher列表 |
155 | mv.setViewName("sunvote/teacher/teacher_list"); | 229 | mv.setViewName("sunvote/teacher/teacher_list"); |
156 | mv.addObject("varList", varList); | 230 | mv.addObject("varList", varList); |
157 | - | 231 | + |
158 | List<PageData> schools = schoolService.listAll(pd); | 232 | List<PageData> schools = schoolService.listAll(pd); |
159 | - mv.addObject("schools",schools); | ||
160 | - | 233 | + mv.addObject("schools", schools); |
234 | + | ||
161 | mv.addObject("pd", pd); | 235 | mv.addObject("pd", pd); |
162 | - mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 | 236 | + mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限 |
163 | return mv; | 237 | return mv; |
164 | } | 238 | } |
165 | - | ||
166 | - /**去新增页面 | 239 | + |
240 | + /** | ||
241 | + * 去新增页面 | ||
242 | + * | ||
167 | * @param | 243 | * @param |
168 | * @throws Exception | 244 | * @throws Exception |
169 | */ | 245 | */ |
170 | - @RequestMapping(value="/goAdd") | ||
171 | - public ModelAndView goAdd()throws Exception{ | 246 | + @RequestMapping(value = "/goAdd") |
247 | + public ModelAndView goAdd() throws Exception { | ||
172 | ModelAndView mv = this.getModelAndView(); | 248 | ModelAndView mv = this.getModelAndView(); |
173 | PageData pd = new PageData(); | 249 | PageData pd = new PageData(); |
174 | pd = this.getPageData(); | 250 | pd = this.getPageData(); |
175 | mv.setViewName("sunvote/teacher/teacher_edit"); | 251 | mv.setViewName("sunvote/teacher/teacher_edit"); |
176 | - | 252 | + |
177 | List<PageData> schools = schoolService.listAll(pd); | 253 | List<PageData> schools = schoolService.listAll(pd); |
178 | - mv.addObject("schools",schools); | ||
179 | - | 254 | + mv.addObject("schools", schools); |
255 | + | ||
180 | mv.addObject("msg", "save"); | 256 | mv.addObject("msg", "save"); |
181 | mv.addObject("pd", pd); | 257 | mv.addObject("pd", pd); |
182 | return mv; | 258 | return mv; |
183 | - } | ||
184 | - | ||
185 | - /**去修改页面 | 259 | + } |
260 | + | ||
261 | + /** | ||
262 | + * 去修改页面 | ||
263 | + * | ||
186 | * @param | 264 | * @param |
187 | * @throws Exception | 265 | * @throws Exception |
188 | */ | 266 | */ |
189 | - @RequestMapping(value="/goEdit") | ||
190 | - public ModelAndView goEdit()throws Exception{ | 267 | + @RequestMapping(value = "/goEdit") |
268 | + public ModelAndView goEdit() throws Exception { | ||
191 | ModelAndView mv = this.getModelAndView(); | 269 | ModelAndView mv = this.getModelAndView(); |
192 | PageData pd = new PageData(); | 270 | PageData pd = new PageData(); |
193 | pd = this.getPageData(); | 271 | pd = this.getPageData(); |
194 | - pd = teacherService.findById(pd); //根据ID读取 | 272 | + pd = teacherService.findById(pd); // 根据ID读取 |
195 | mv.setViewName("sunvote/teacher/teacher_edit"); | 273 | mv.setViewName("sunvote/teacher/teacher_edit"); |
196 | List<PageData> schools = schoolService.listAll(pd); | 274 | List<PageData> schools = schoolService.listAll(pd); |
197 | - mv.addObject("schools",schools); | 275 | + mv.addObject("schools", schools); |
198 | mv.addObject("msg", "edit"); | 276 | mv.addObject("msg", "edit"); |
199 | mv.addObject("pd", pd); | 277 | mv.addObject("pd", pd); |
200 | return mv; | 278 | return mv; |
201 | - } | ||
202 | - | ||
203 | - /**批量删除 | 279 | + } |
280 | + | ||
281 | + /** | ||
282 | + * 批量删除 | ||
283 | + * | ||
204 | * @param | 284 | * @param |
205 | * @throws Exception | 285 | * @throws Exception |
206 | */ | 286 | */ |
207 | - @RequestMapping(value="/deleteAll") | 287 | + @RequestMapping(value = "/deleteAll") |
208 | @ResponseBody | 288 | @ResponseBody |
209 | - public Object deleteAll() throws Exception{ | ||
210 | - logBefore(logger, Jurisdiction.getUsername()+"批量删除Teacher"); | ||
211 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;} //校验权限 | ||
212 | - PageData pd = new PageData(); | ||
213 | - Map<String,Object> map = new HashMap<String,Object>(); | 289 | + public Object deleteAll() throws Exception { |
290 | + logBefore(logger, Jurisdiction.getUsername() + "批量删除Teacher"); | ||
291 | + if (!Jurisdiction.buttonJurisdiction(menuUrl, "del")) { | ||
292 | + return null; | ||
293 | + } // 校验权限 | ||
294 | + PageData pd = new PageData(); | ||
295 | + Map<String, Object> map = new HashMap<String, Object>(); | ||
214 | pd = this.getPageData(); | 296 | pd = this.getPageData(); |
215 | List<PageData> pdList = new ArrayList<PageData>(); | 297 | List<PageData> pdList = new ArrayList<PageData>(); |
216 | String DATA_IDS = pd.getString("DATA_IDS"); | 298 | String DATA_IDS = pd.getString("DATA_IDS"); |
217 | - if(null != DATA_IDS && !"".equals(DATA_IDS)){ | 299 | + if (null != DATA_IDS && !"".equals(DATA_IDS)) { |
218 | String ArrayDATA_IDS[] = DATA_IDS.split(","); | 300 | String ArrayDATA_IDS[] = DATA_IDS.split(","); |
219 | teacherService.deleteAll(ArrayDATA_IDS); | 301 | teacherService.deleteAll(ArrayDATA_IDS); |
220 | pd.put("msg", "ok"); | 302 | pd.put("msg", "ok"); |
221 | - }else{ | 303 | + } else { |
222 | pd.put("msg", "no"); | 304 | pd.put("msg", "no"); |
223 | } | 305 | } |
224 | pdList.add(pd); | 306 | pdList.add(pd); |
225 | map.put("list", pdList); | 307 | map.put("list", pdList); |
226 | return AppUtil.returnObject(pd, map); | 308 | return AppUtil.returnObject(pd, map); |
227 | } | 309 | } |
228 | - | ||
229 | - /**导出到excel | 310 | + |
311 | + /** | ||
312 | + * 导出到excel | ||
313 | + * | ||
230 | * @param | 314 | * @param |
231 | * @throws Exception | 315 | * @throws Exception |
232 | */ | 316 | */ |
233 | - @RequestMapping(value="/excel") | ||
234 | - public ModelAndView exportExcel() throws Exception{ | ||
235 | - logBefore(logger, Jurisdiction.getUsername()+"导出Teacher到excel"); | ||
236 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} | 317 | + @RequestMapping(value = "/excel") |
318 | + public ModelAndView exportExcel() throws Exception { | ||
319 | + logBefore(logger, Jurisdiction.getUsername() + "导出Teacher到excel"); | ||
320 | + if (!Jurisdiction.buttonJurisdiction(menuUrl, "cha")) { | ||
321 | + return null; | ||
322 | + } | ||
237 | ModelAndView mv = new ModelAndView(); | 323 | ModelAndView mv = new ModelAndView(); |
238 | PageData pd = new PageData(); | 324 | PageData pd = new PageData(); |
239 | pd = this.getPageData(); | 325 | pd = this.getPageData(); |
240 | - Map<String,Object> dataMap = new HashMap<String,Object>(); | 326 | + Map<String, Object> dataMap = new HashMap<String, Object>(); |
241 | List<String> titles = new ArrayList<String>(); | 327 | List<String> titles = new ArrayList<String>(); |
242 | - titles.add("所在学校"); //1 | ||
243 | - titles.add("姓名"); //2 | ||
244 | - titles.add("电话"); //3 | ||
245 | - titles.add("座机电话"); //4 | ||
246 | - titles.add("证件号"); //5 | ||
247 | - titles.add("账号"); //6 | ||
248 | - titles.add("密码"); //7 | ||
249 | - titles.add("性别"); //8 | ||
250 | - titles.add("科目列表"); //9 | ||
251 | - titles.add("教师卡编号"); //10 | 328 | + titles.add("所在学校"); // 1 |
329 | + titles.add("姓名"); // 2 | ||
330 | + titles.add("电话"); // 3 | ||
331 | + titles.add("座机电话"); // 4 | ||
332 | + titles.add("证件号"); // 5 | ||
333 | + titles.add("账号"); // 6 | ||
334 | + titles.add("密码"); // 7 | ||
335 | + titles.add("性别"); // 8 | ||
336 | + titles.add("科目列表"); // 9 | ||
337 | + titles.add("教师卡编号"); // 10 | ||
252 | dataMap.put("titles", titles); | 338 | dataMap.put("titles", titles); |
253 | List<PageData> varOList = teacherService.listAll(pd); | 339 | List<PageData> varOList = teacherService.listAll(pd); |
254 | List<PageData> varList = new ArrayList<PageData>(); | 340 | List<PageData> varList = new ArrayList<PageData>(); |
255 | - for(int i=0;i<varOList.size();i++){ | 341 | + for (int i = 0; i < varOList.size(); i++) { |
256 | PageData vpd = new PageData(); | 342 | PageData vpd = new PageData(); |
257 | - vpd.put("var1", varOList.get(i).get("SCHOOL_ID").toString()); //1 | ||
258 | - vpd.put("var2", varOList.get(i).getString("NAME")); //2 | ||
259 | - vpd.put("var3", varOList.get(i).getString("PHONE")); //3 | ||
260 | - vpd.put("var4", varOList.get(i).getString("SEAT_PHONE")); //4 | ||
261 | - vpd.put("var5", varOList.get(i).getString("CARD_NO")); //5 | ||
262 | - vpd.put("var6", varOList.get(i).getString("ACCOUT")); //6 | ||
263 | - vpd.put("var7", varOList.get(i).getString("PASSWORD")); //7 | ||
264 | - vpd.put("var8", varOList.get(i).get("SEX").toString()); //8 | ||
265 | - vpd.put("var9", varOList.get(i).getString("SUBJECT_IDS")); //9 | ||
266 | - vpd.put("var10", varOList.get(i).getString("KEYPAD_ID")); //10 | 343 | + vpd.put("var1", varOList.get(i).get("SCHOOL_ID").toString()); // 1 |
344 | + vpd.put("var2", varOList.get(i).getString("NAME")); // 2 | ||
345 | + vpd.put("var3", varOList.get(i).getString("PHONE")); // 3 | ||
346 | + vpd.put("var4", varOList.get(i).getString("SEAT_PHONE")); // 4 | ||
347 | + vpd.put("var5", varOList.get(i).getString("CARD_NO")); // 5 | ||
348 | + vpd.put("var6", varOList.get(i).getString("ACCOUT")); // 6 | ||
349 | + vpd.put("var7", varOList.get(i).getString("PASSWORD")); // 7 | ||
350 | + vpd.put("var8", varOList.get(i).get("SEX").toString()); // 8 | ||
351 | + vpd.put("var9", varOList.get(i).getString("SUBJECT_IDS")); // 9 | ||
352 | + vpd.put("var10", varOList.get(i).getString("KEYPAD_ID")); // 10 | ||
267 | varList.add(vpd); | 353 | varList.add(vpd); |
268 | } | 354 | } |
269 | dataMap.put("varList", varList); | 355 | dataMap.put("varList", varList); |
270 | ObjectExcelView erv = new ObjectExcelView(); | 356 | ObjectExcelView erv = new ObjectExcelView(); |
271 | - mv = new ModelAndView(erv,dataMap); | 357 | + mv = new ModelAndView(erv, dataMap); |
272 | return mv; | 358 | return mv; |
273 | } | 359 | } |
274 | - | 360 | + |
275 | @InitBinder | 361 | @InitBinder |
276 | - public void initBinder(WebDataBinder binder){ | 362 | + public void initBinder(WebDataBinder binder) { |
277 | DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | 363 | DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
278 | - binder.registerCustomEditor(Date.class, new CustomDateEditor(format,true)); | 364 | + binder.registerCustomEditor(Date.class, new CustomDateEditor(format, |
365 | + true)); | ||
279 | } | 366 | } |
367 | + | ||
368 | + /** | ||
369 | + * 批量删除 | ||
370 | + * | ||
371 | + * @param | ||
372 | + * @throws Exception | ||
373 | + */ | ||
374 | + @RequestMapping(value = "/info", produces = "application/json;charset=UTF-8") | ||
375 | + @ResponseBody | ||
376 | + public Object info() throws Exception { | ||
377 | + PageData pd = this.getPageData(); | ||
378 | + ResponseGson<PageData> res = new ResponseGson(); | ||
379 | + pd.put("ID", this.geTeacherID()); | ||
380 | + PageData pageData = teacherService.findById(pd); | ||
381 | + if (pageData != null && pageData.getString("ID") != null) { | ||
382 | + pageData.put("PASSWORD", "");// 返回参数中不返回密码 | ||
383 | + PageData pt = new PageData(); | ||
384 | + pt.put("TEACHER_ID", pageData.get("ID")); | ||
385 | + // 在任课表中查找老师教哪些班级,然后查出班级信息 | ||
386 | + List<PageData> classInfoList = v1Service | ||
387 | + .getTeacherClassInfo(pt); | ||
388 | + | ||
389 | + pageData.put("classInfoList", classInfoList); | ||
390 | + // 在认可表中查找老师教哪些科目,然后查出科目信息 | ||
391 | + List<PageData> subjectList = v1Service | ||
392 | + .getTeacherSubjectInfo(pt); | ||
393 | + // 一个sql语句完成。 | ||
394 | + pageData.put("subjectList", subjectList); | ||
395 | + | ||
396 | + pageData.remove("SUBJECT_IDS"); | ||
397 | + | ||
398 | + PageData eventPd = new PageData(); | ||
399 | + eventPd.put("EVENT_ID", get32UUID()); | ||
400 | + eventPd.put("EVENT_NAME", "login"); | ||
401 | + eventPd.put("EVENT_USER", pageData.getString("ID")); | ||
402 | + eventPd.put("EVENT_TYPE", "0"); | ||
403 | + eventPd.put("EVENT_START_TIME", Tools.date2Str(new Date())); | ||
404 | + if (pd.getString("CLIENT_ID") != null) { | ||
405 | + eventPd.put("CLIENT_ID", pd.getString("CLIENT_ID")); | ||
406 | + } else { | ||
407 | + eventPd.put("CLIENT_ID", "CLIENT"); | ||
408 | + } | ||
409 | + res.setData(pageData); | ||
410 | + // 填充数据到返回数据中 | ||
411 | + } else { | ||
412 | + res.set1Error(); | ||
413 | + } | ||
414 | + | ||
415 | + return res.toJson(); | ||
416 | + } | ||
417 | + | ||
280 | } | 418 | } |
src/com/fh/controller/system/login/LoginController.java
@@ -153,6 +153,13 @@ public class LoginController extends BaseController { | @@ -153,6 +153,13 @@ public class LoginController extends BaseController { | ||
153 | if ("57bb1e6f138247a0b05cc721a5da1b64".equals(pd | 153 | if ("57bb1e6f138247a0b05cc721a5da1b64".equals(pd |
154 | .getString("ROLE_ID"))) { | 154 | .getString("ROLE_ID"))) { |
155 | map.put("teacher", pd.getString("RIGHTS")); | 155 | map.put("teacher", pd.getString("RIGHTS")); |
156 | + PageData tpd = new PageData(); | ||
157 | + tpd.put("ACCOUT", pd.get("USERNAME")); | ||
158 | + tpd.put("PASSWORD", PASSWORD); | ||
159 | + PageData pageData = teacherService.getUserInfo(tpd); | ||
160 | + if(pageData != null){ | ||
161 | + user.setTeacherID(pageData.getString("ID")); | ||
162 | + } | ||
156 | } | 163 | } |
157 | user.setLAST_LOGIN(pd.getString("LAST_LOGIN")); | 164 | user.setLAST_LOGIN(pd.getString("LAST_LOGIN")); |
158 | user.setIP(pd.getString("IP")); | 165 | user.setIP(pd.getString("IP")); |
src/com/fh/entity/system/User.java
@@ -17,6 +17,7 @@ public class User { | @@ -17,6 +17,7 @@ public class User { | ||
17 | private Role role; //角色对象 | 17 | private Role role; //角色对象 |
18 | private Page page; //分页对象 | 18 | private Page page; //分页对象 |
19 | private String SKIN; //皮肤 | 19 | private String SKIN; //皮肤 |
20 | + private String teacherID ; // 教师ID | ||
20 | 21 | ||
21 | public String getSKIN() { | 22 | public String getSKIN() { |
22 | return SKIN; | 23 | return SKIN; |
@@ -100,5 +101,13 @@ public class User { | @@ -100,5 +101,13 @@ public class User { | ||
100 | public void setPage(Page page) { | 101 | public void setPage(Page page) { |
101 | this.page = page; | 102 | this.page = page; |
102 | } | 103 | } |
104 | + public String getTeacherID() { | ||
105 | + return teacherID; | ||
106 | + } | ||
107 | + public void setTeacherID(String teacherID) { | ||
108 | + this.teacherID = teacherID; | ||
109 | + } | ||
110 | + | ||
111 | + | ||
103 | 112 | ||
104 | } | 113 | } |
src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java
@@ -66,5 +66,25 @@ public interface TestPaperInfoManager{ | @@ -66,5 +66,25 @@ public interface TestPaperInfoManager{ | ||
66 | */ | 66 | */ |
67 | public void deleteAll(String[] ArrayDATA_IDS)throws Exception; | 67 | public void deleteAll(String[] ArrayDATA_IDS)throws Exception; |
68 | 68 | ||
69 | + | ||
70 | + /** | ||
71 | + * 根据测验id,试题id,查询该问题,在该答卷的答题情况 | ||
72 | + * 可以根据试卷id,试题id,查询试卷在所有测验中答题情况 | ||
73 | + * 可以根据学生id,试题id,查询试题在学生下面的答题情况 | ||
74 | + * @param pd | ||
75 | + * @return | ||
76 | + * @throws Exception | ||
77 | + */ | ||
78 | + public List<PageData> listTestPaperQuestionIDinfo(PageData pd)throws Exception; | ||
79 | + | ||
80 | + | ||
81 | + /** | ||
82 | + * 查询测验下面的所有试题ID列表 | ||
83 | + * @param pd | ||
84 | + * @return | ||
85 | + * @throws Exception | ||
86 | + */ | ||
87 | + public List<PageData> listTestPaperQuestionIDs(PageData pd)throws Exception; | ||
88 | + | ||
69 | } | 89 | } |
70 | 90 |
src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java
@@ -73,6 +73,22 @@ public class TestPaperInfoService implements TestPaperInfoManager{ | @@ -73,6 +73,22 @@ public class TestPaperInfoService implements TestPaperInfoManager{ | ||
73 | * @throws Exception | 73 | * @throws Exception |
74 | */ | 74 | */ |
75 | @SuppressWarnings("unchecked") | 75 | @SuppressWarnings("unchecked") |
76 | + public List<PageData> listTestPaperQuestionIDinfo(PageData pd)throws Exception{ | ||
77 | + return (List<PageData>)dao.findForList("TestPaperInfoMapper.listTestPaperQuestionIDinfo", pd); | ||
78 | + } | ||
79 | + /**列表(全部) | ||
80 | + * @param pd | ||
81 | + * @throws Exception | ||
82 | + */ | ||
83 | + @SuppressWarnings("unchecked") | ||
84 | + public List<PageData> listTestPaperQuestionIDs(PageData pd)throws Exception{ | ||
85 | + return (List<PageData>)dao.findForList("TestPaperInfoMapper.listTestPaperQuestionIDs", pd); | ||
86 | + } | ||
87 | + /**列表(全部) | ||
88 | + * @param pd | ||
89 | + * @throws Exception | ||
90 | + */ | ||
91 | + @SuppressWarnings("unchecked") | ||
76 | public List<PageData> reportPaperDetail(PageData pd)throws Exception{ | 92 | public List<PageData> reportPaperDetail(PageData pd)throws Exception{ |
77 | return (List<PageData>)dao.findForList("TestPaperInfoMapper.reportPaperDetail", pd); | 93 | return (List<PageData>)dao.findForList("TestPaperInfoMapper.reportPaperDetail", pd); |
78 | } | 94 | } |
src/com/fh/service/sunvote/textbook/TextbookManager.java
0 → 100644
1 | +package com.fh.service.sunvote.textbook; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import com.fh.entity.Page; | ||
6 | +import com.fh.util.PageData; | ||
7 | + | ||
8 | +public interface TextbookManager { | ||
9 | + | ||
10 | + /**新增 | ||
11 | + * @param pd | ||
12 | + * @throws Exception | ||
13 | + */ | ||
14 | + public void save(PageData pd)throws Exception; | ||
15 | + | ||
16 | + /**删除 | ||
17 | + * @param pd | ||
18 | + * @throws Exception | ||
19 | + */ | ||
20 | + public void delete(PageData pd)throws Exception; | ||
21 | + | ||
22 | + /**修改 | ||
23 | + * @param pd | ||
24 | + * @throws Exception | ||
25 | + */ | ||
26 | + public void edit(PageData pd)throws Exception; | ||
27 | + | ||
28 | + /**列表 | ||
29 | + * @param page | ||
30 | + * @throws Exception | ||
31 | + */ | ||
32 | + public List<PageData> list(Page page)throws Exception; | ||
33 | + | ||
34 | + /**列表(全部) | ||
35 | + * @param pd | ||
36 | + * @throws Exception | ||
37 | + */ | ||
38 | + public List<PageData> listAll(PageData pd)throws Exception; | ||
39 | + | ||
40 | + /**通过id获取数据 | ||
41 | + * @param pd | ||
42 | + * @throws Exception | ||
43 | + */ | ||
44 | + public PageData findById(PageData pd)throws Exception; | ||
45 | + | ||
46 | + /**批量删除 | ||
47 | + * @param ArrayDATA_IDS | ||
48 | + * @throws Exception | ||
49 | + */ | ||
50 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; | ||
51 | + | ||
52 | +} |
src/com/fh/service/sunvote/textbook/impl/TextbookService.java
0 → 100644
1 | +package com.fh.service.sunvote.textbook.impl; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import javax.annotation.Resource; | ||
6 | + | ||
7 | +import org.springframework.stereotype.Service; | ||
8 | + | ||
9 | +import com.fh.dao.DaoSupport; | ||
10 | +import com.fh.entity.Page; | ||
11 | +import com.fh.service.sunvote.textbook.TextbookManager; | ||
12 | +import com.fh.util.PageData; | ||
13 | + | ||
14 | +@Service("textbookService") | ||
15 | +public class TextbookService implements TextbookManager { | ||
16 | + | ||
17 | + @Resource(name = "daoSupport") | ||
18 | + private DaoSupport dao; | ||
19 | + | ||
20 | + /**新增 | ||
21 | + * @param pd | ||
22 | + * @throws Exception | ||
23 | + */ | ||
24 | + public void save(PageData pd)throws Exception{ | ||
25 | + dao.save("TextbookMapper.save", pd); | ||
26 | + } | ||
27 | + | ||
28 | + /**删除 | ||
29 | + * @param pd | ||
30 | + * @throws Exception | ||
31 | + */ | ||
32 | + public void delete(PageData pd)throws Exception{ | ||
33 | + dao.delete("TextbookMapper.delete", pd); | ||
34 | + } | ||
35 | + | ||
36 | + /**修改 | ||
37 | + * @param pd | ||
38 | + * @throws Exception | ||
39 | + */ | ||
40 | + public void edit(PageData pd)throws Exception{ | ||
41 | + dao.update("TextbookMapper.edit", pd); | ||
42 | + } | ||
43 | + | ||
44 | + /**列表 | ||
45 | + * @param page | ||
46 | + * @throws Exception | ||
47 | + */ | ||
48 | + @SuppressWarnings("unchecked") | ||
49 | + public List<PageData> list(Page page)throws Exception{ | ||
50 | + return (List<PageData>)dao.findForList("TextbookMapper.datalistPage", page); | ||
51 | + } | ||
52 | + | ||
53 | + /**列表(全部) | ||
54 | + * @param pd | ||
55 | + * @throws Exception | ||
56 | + */ | ||
57 | + @SuppressWarnings("unchecked") | ||
58 | + public List<PageData> listAll(PageData pd)throws Exception{ | ||
59 | + return (List<PageData>)dao.findForList("TextbookMapper.listAll", pd); | ||
60 | + } | ||
61 | + | ||
62 | + /**通过id获取数据 | ||
63 | + * @param pd | ||
64 | + * @throws Exception | ||
65 | + */ | ||
66 | + public PageData findById(PageData pd)throws Exception{ | ||
67 | + return (PageData)dao.findForObject("TextbookMapper.findById", pd); | ||
68 | + } | ||
69 | + | ||
70 | + /**批量删除 | ||
71 | + * @param ArrayDATA_IDS | ||
72 | + * @throws Exception | ||
73 | + */ | ||
74 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ | ||
75 | + dao.delete("TextbookMapper.deleteAll", ArrayDATA_IDS); | ||
76 | + } | ||
77 | + | ||
78 | +} |