Commit ddbc622f1596a83a9c3ef0b522294e64a210e992

Authored by 孙向锦
1 parent 9f7ad69b

0829版本

WebRoot/WEB-INF/jsp/sunvote/teacher/paper_view.jsp
... ... @@ -46,230 +46,18 @@
46 46  
47 47 <div class="col-md-12 analysis">
48 48 <ul>
49   - <!--<li>
50   - <div class="stem">
51   - <p>1.如图,检测4个足球,其中超过标准质量的克数记为正数,不足标准质量的克数记为负数.从轻重的角度看,最接近标准的是(  )</p>
52   - </div>
53   - <div class="option">
54   - <ul>
55   - <li><span>A.</span><img src="images/option_1.png" /></li>
56   - <li><span>B.</span><img src="images/option_2.png" /></li>
57   - <li><span>C.</span><img src="images/option_3.png" /></li>
58   - <li><span>D.</span><img src="images/option_4.png" /></li>
59   - </ul>
60   - <div class="clearfix"></div>
61   - </div>
62   - <div class="resolve">
63   - <div class="resolve_box">
64   - <p>【答案】 A</p>
65   - <p>【解析】由图数一数,可知总共有7位小同学,其中扎小辫的女孩有2人,男孩有5人。
66   - 故选A。</p>
67   -
68   - <p>【考点】 10以内数的认识</p>
69   - </div>
70   - <div class="clearfix"></div>
71   - </div>
72   -
73   - <div class="star_box">
74   - <div class="col-md-6"><img src="../static/images/up_ico.png"/><img src="../static/images/down_ico.png"/></div>
75   - <div class="col-md-6">
76   - <div class="star">
77   - <span style="float:left;">难度</span>
78   - <ul>
79   - <li class="on"></li>
80   - <li class="on"></li>
81   - <li class="off"></li>
82   - <li class="off"></li>
83   - <li class="off"></li>
84   - </ul>
85   - </div>
86   - <div class="resolve_click">
87   - <a onclick="slide($(this))">查看解析</a>
88   - </div>
89   - </div>
90   - <div class="clearfix"></div>
91   - </div>
92   - </li> -->
  49 + <!--试题列表-->
93 50 </ul>
94 51 </div>
95 52 <div class="clearfix"></div>
96 53 </div>
97 54 <div class="save_box">
98   - <input type="button" value="保存" class="btn btn-primary btn-lg topic save" disabled="disabled"/>
  55 + <input type="button" value="保存" class="btn btn-primary btn-lg topic save" />
99 56 </div>
100 57 </div>
101 58 <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
102 59 <script src="../static/js/echars.js"></script>
103   - <script src="../static/js/loading.js"></script>
104   - <script>
105   - var url="";
106   - var question_box=[];
107   - function slide(obj){ //查看解析
108   - obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
109   - if($(".resolve").css("display") == "none")
110   - obj.text("查看解析");
111   - else
112   - obj.text("收起解析");
113   - });
114   - }
115   -
116   -function getQueryString(name) {
117   - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
118   - var r = window.location.search.substr(1).match(reg);
119   - if (r != null) return unescape(r[2]); return null;
120   - }
121   - var PAPER_ID=getQueryString("PAPER_ID");
122   - var classId=getQueryString("classId");
123   - var userid=getQueryString("userid");
124   -
125   - var _html="";
126   - var question_id_arry="";
127   - $(document).ready(function(){
128   - window.top.loading.remove();
129   - var data=JSON.parse(sessionStorage.getItem("data"));
130   - console.log(data);
131   - $("#paper_title").html(data.title);
132   - $("#time").html(data.exam_time);
133   - if(data.questions.length>0){
134   - for(var i=0;i<data.questions.length;i++){
135   - question_id_arry+=data.questions[i].question_id+',';
136   - }
137   - getQuestionInfo(question_id_arry);
138   - }
139   -
140   - })
141   - function getQuestionInfo(id){
142   - $.ajax({
143   - url:url+"/SunvoteEducation/api/v1/question",
144   - async:true,
145   - type:"post",
146   - data:{ID:id},
147   - success:function(data){
148   - console.log(data);
149   - if(data.data.length>0){
150   - for(var i=0;i<data.data.length;i++){
151   - _html += '<li class="question_li" data-id="'+data.data[i].QUESTION_ID+'"><div class="stem"></div><div class="option"><ul></ul><div class="clearfix"></div></div><div class="resolve"><div class="resolve_box"><p>【答案】 '+data.data[i].ANSWER+'</p><p><span>【解析】</span>'+data.data[i].ANALYSIS+'</p></div><div class="clearfix"></div></div><div class="star_box"><div class="col-md-6 move"><img src="../static/images/up_ico.png" class="up"/><img src="../static/images/down_ico.png" class="down"/></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>';
152   - }
153   - console.log(_html);
154   - $(".analysis ul").html(_html);
155   - for(var j=0;j<data.data.length;j++){
156   - var option_html="";
157   - var sum=0;
158   - var right_num=0;
159   - var data1=[];
160   - var data2=[];
161   - var answer="";
162   - var color=[];
163   - $(".analysis li .stem").eq(j).append('<span class="li_index">'+(j+1)+'</span>、'+data.data[j].CONTENT);
164   - var arry_option=data.data[j].OPTION_CONTENT;
165   - //arry_option=arry_option.replace("[","");
166   - //arry_option=arry_option.replace("]","");
167   - //arry_option=arry_option.split(",");
168   -
169   - for(var x=0;x<arry_option.length;x++){
170   - option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>';
171   - }
172   - $(".option").eq(j).html(option_html);
173   - star(j,parseInt(data.data[j].DIFFICULTY));
174   - }
175   - }
176   - }
177   - })
178   -
179   - }
180   - function star(index,num){ //难度星级
181   - $(".star").eq(index).append('<ul></ul>');
182   - var li_html="";
183   - for(var i=1;i<=num;i++){
184   - li_html +='<li class="on"></li>';
185   - }
186   - for(var j=num;j<5;j++){
187   - li_html += '<li class="off"></li>';
188   - }
189   -
190   - $(".star").eq(index).find("ul").html(li_html);
191   - }
192   - $(document).on('click', '.move img', function(event) {
193   - event.preventDefault();
194   - $(".save").removeAttr('disabled');
195   - var parent=$(this).closest("li");
196   - var this_index=parent.children(".stem").find(".li_index").html();
197   - var up_index=parent.prev().children(".stem").find(".li_index").html()
198   - console.log(this_index);
199   - console.log(up_index);
200   - var parents=$(this).closest(".analysis").children("ul");
201   - var len=parents.children().length;
202   - if(($(this).is(".up") || $(this).is(".top")) && parent.index()==0){
203   - alert("已经置顶!");
204   - return false;
205   - }else if(($(this).is(".down") || $(this).is(".bottom")) && parent.index()==len-1){
206   - alert("已经置底!");
207   - return false;
208   - }
209   - switch (true) {
210   - case $(this).is(".up"):
211   - var prev = parent.prev();
212   - var this_index=parent.children(".stem").find(".li_index").html();
213   - var up_index=prev.children(".stem").find(".li_index").html();
214   - prev.children(".stem").find(".li_index").html(this_index);
215   - parent.children(".stem").find(".li_index").html(up_index);
216   - parent.insertBefore(prev);
217   - break;
218   - case $(this).is(".down"):
219   - var next = parent.next();
220   - var this_index=parent.children(".stem").find(".li_index").html();
221   - var up_index=next.children(".stem").find(".li_index").html();
222   - next.children(".stem").find(".li_index").html(this_index);
223   - parent.children(".stem").find(".li_index").html(up_index);
224   - parent.insertAfter(next);
225   - break;
226   - case $(this).is(".top"):
227   - parents.prepend(parent);
228   - break;
229   - case $(this).is(".bottom"):
230   - parents.append(parent);
231   - break;
232   - }
233   - // alert("操作完成!!");
234   - });
235   - $(".save").click(function(){
236   - var question_arry=[];
237   - for(var i=0;i<$(".question_li").length;i++){
238   - question_arry[i]={
239   - score: "0",
240   - part_score: "0",
241   - question_id: $(".question_li").eq(i).attr("data-id"),
242   - rank: i.toString(),
243   - no_name: i.toString()
244   - };
245   -
246   - }
247   - var data={
248   - title: $("#paper_title").html(),
249   - exam_time: $("#time").html(),
250   - paper_type: "101",
251   - subject_id: "20",
252   - grade_id: "",
253   - class_id: classId,
254   - user_id: userid,
255   - score: "100",
256   - questions: question_arry
257   - };
258   - //console.log(data);
259   - $.ajax({
260   - url:url+"/SunvoteEducation/api/v1/publishpaper",
261   - async:false,
262   - type:"post",
263   - dataType: "json",
264   - headers: {'Content-Type': 'application/json'},
265   - data:JSON.stringify(data),
266   - success:function(data){
267   - alert("上传成功");
268   - window.history.go(-1);
269   - }
270   - })
271   - })
272   - </script>
  60 + <script src="../static/js/paper_view.js"></script>
273 61  
274 62 </html>
275 63  
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/paper_view1.jsp
... ... @@ -17,7 +17,7 @@
17 17 <!-- Bootstrap -->
18 18 <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
19 19 <link href="../static/css/teach.css" rel="stylesheet">
20   - <link href="../static/css/paper_view.css?t=1" rel="stylesheet">
  20 + <link href="../static/css/paper_view.css?t=2" rel="stylesheet">
21 21  
22 22 <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 -->
23 23 <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 -->
... ... @@ -115,7 +115,7 @@
115 115 <div class="modal-content">
116 116 <div class="modal-header">
117 117 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
118   - <h4 class="modal-title">完成选题</h4>
  118 + <h4 class="modal-title">错误名单</h4>
119 119 </div>
120 120 <div class="modal-body">
121 121 <table class="table table-bordered">
... ... @@ -143,182 +143,7 @@
143 143 <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
144 144 <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
145 145 <script src="../static/js/echars.js"></script>
146   - <script src="../static/js/loading.js"></script>
147   - <script>
148   - var url="";
149   - function slide(obj){ //查看详情
150   - obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
151   - if($(".resolve").css("display") == "none")
152   - obj.text("查看详情");
153   - else
154   - obj.text("收起详情");
155   - });
156   - }
157   -
158   -
159   - function bar(index,data1,data2,answer,color){
160   - var myChart = echarts.init(document.getElementById('main'+index));
161   - myChart.setOption({
162   - color: ['#3398DB'],
163   - tooltip : {
164   - trigger: 'axis',
165   - axisPointer : { // 坐标轴指示器,坐标轴触发有效
166   - type : 'line' // 默认为直线,可选为:'line' | 'shadow'
167   - }
168   - },
169   - grid: {
170   - top: 15,
171   - left: '0%',
172   - right: '0%',
173   - bottom: '0%',
174   - containLabel: true
175   - },
176   - xAxis : [
177   - {
178   - type : 'category',
179   - data : data2,
180   - axisTick: {
181   - alignWithLabel: true
182   - },
183   - axisLabel: {
184   - show:true,
185   - textStyle:{
186   - color: function (value){
187   - console.log(value);
188   - return value == answer ? '#75b3ff' : '#fcb35b';
189   - }
190   - }
191   - }
192   - }
193   -
194   -
195   - ],
196   - yAxis : [
197   - {
198   - type : 'value'
199   - }
200   - ],
201   - series : [
202   - {
203   - name:'选项人数',
204   - type:'bar',
205   - barWidth: '60%',
206   - data:data1,
207   - itemStyle: {
208   - //通常情况下:
209   - normal:{
210   - //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
211   - color: function (params){
212   - var colorList = color;
213   - return colorList[params.dataIndex];
214   - },
215   - label : {show: true,position:'top',distance:-4}
216   - }
217   - }
218   - }
219   - ]
220   - });
221   - }
222   -
223   -function getQueryString(name) {
224   - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
225   - var r = window.location.search.substr(1).match(reg);
226   - if (r != null) return unescape(r[2]); return null;
227   - }
228   - var testpaperId=getQueryString("testpaperId");
229   -
230   - var _html="";
231   - $(document).ready(function(){
232   - window.top.loading.remove();
233   - $.ajax({
234   - url:url+"/SunvoteEducation/api/v1/testpaperinfo",
235   - async:false,
236   - type:"post",
237   - data:{ID:testpaperId},
238   - success:function(data){
239   - console.log(data);
240   - $("#paper_title").html(data.data.name);
241   - $("#time").html(data.data.CREATE_DATE);
242   - if(data.data.QUESTIONS.length>0){
243   - for(var i=0;i<data.data.QUESTIONS.length;i++){
244   - _html += '<li class="question_li" data-id="'+data.data.QUESTIONS[i].QUESTION_ID+'"><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">错误学生:<span class="erro_num">0/0</span></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>';
245   - }
246   - console.log(_html);
247   - $(".analysis ul").html(_html);
248   - for(var j=0;j<data.data.QUESTIONS.length;j++){
249   - var option_html="";
250   - var sum=0;
251   - var right_num=0;
252   - var data1=[];
253   - var data2=[];
254   - var answer="";
255   - var color=[];
256   - $(".analysis li .stem").eq(j).append('<span>'+(j+1)+'、</span>'+data.data.QUESTIONS[j].CONTENT);
257   - var arry_option=data.data.QUESTIONS[j].OPTION_CONTENT;
258   - var answerinfo=data.data.QUESTIONS[j].ANSWERINFO;
259   -
260   - for(var x=0;x<arry_option.length;x++){
261   - option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>';
262   - }
263   - for(k=0;k<answerinfo.length;k++){
264   - data1[k]=parseInt(answerinfo[k].COUNT);
265   - data2[k]=answerinfo[k].ANSWER;
266   - color[k]="#fcb35b";
267   - if(answerinfo[k].ISRIGHT==1){
268   - right_num=answerinfo[k].COUNT;
269   - answer=answerinfo[k].ANSWER;
270   - color[k]="#75b3ff";
271   - }
272   - sum += parseInt(answerinfo[k].COUNT);
273   - }
274   - $(".round_n_orange span").eq(j).text((sum-right_num)+"/"+sum);
275   - $(".erro_num").eq(j).text((sum-right_num)+"/"+sum);
276   - $(".round_n_red span").eq(j).text(((sum-right_num)/sum).toFixed(2)*100+"%");
277   - $(".option").eq(j).find("ul").html(option_html);
278   -
279   - star(j,parseInt(data.data.QUESTIONS[j].DIFFICULTY));
280   - console.log(data1,data2);
281   - bar(j,data1,data2,answer,color);
282   - if(data.data.QUESTIONS[j].RANDOM=="1")
283   - $(".analysis ul").children("li").eq(j).append('<div class="chou">抽</div>');
284   - }
285   - }
286   - }
287   - })
288   - })
289   - function star(index,num){ //难度星级
290   - $(".star").eq(index).append('<ul></ul>');
291   - var li_html="";
292   - for(var i=1;i<=num;i++){
293   - li_html +='<li class="on"></li>';
294   - }
295   - for(var j=num;j<5;j++){
296   - li_html += '<li class="off"></li>';
297   - }
298   -
299   - $(".star").eq(index).find("ul").html(li_html);
300   - }
301   - $(document).on("click",".round_n_orange",function(){
302   - var question_id = $(this).closest("li").attr("data-id");
303   - var student_html="";
304   - $.ajax({
305   - url:url+"/SunvoteEducation/api/v1/qstudentinfo",
306   - async:false,
307   - type:"post",
308   - data:{question_id:question_id,test_id:testpaperId},
309   - success:function(data){
310   - console.log(data);
311   - for(var i=0;i<data.data.length;i++){
312   - student_html+='<tr><td>'+(i+1)+'</td><td>'+data.data[i].NAME+'</td><td>'+data.data[i].ANSWER+'</td><td>'+data.data[i].PRESS_TIME+'秒</td></tr>';
313   - }
314   - $(".student_list").html(student_html);
315   - }
316   - });
317   - $('#myModal').modal('show');
318   - })
319   -
320   -
321   - </script>
  146 + <script src="../static/js/paper_view1.js?a=1"></script>
322 147  
323 148 </html>
324 149  
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/paper_view2.jsp
... ... @@ -33,6 +33,7 @@
33 33 .save_box{width:100%;height:80px;background:#fff;text-align:center;position:fixed;bottom:0;left:0;}
34 34 .container{height:100%;}
35 35 .content_report{padding-bottom:80px;min-height:calc(100% - 126px);}
  36 + .star_box .col-md-6{float:right;}
36 37 </style>
37 38 </head>
38 39 <body>
... ... @@ -94,169 +95,12 @@
94 95 </div>
95 96 <div class="clearfix"></div>
96 97 </div>
97   - <div class="save_box">
98   - <input type="button" value="保存" class="btn btn-primary btn-lg topic save" disabled="disabled"/>
99   - </div>
  98 +
100 99 </div>
101 100 <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
102 101 <script src="../static/js/echars.js"></script>
103 102 <script src="../static/js/loading.js"></script>
104   - <script>
105   - var url="http://127.0.0.1:8080/SunvoteEducation";
106   - var question_box=[];
107   - function slide(obj){ //查看解析
108   - obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
109   - if($(".resolve").css("display") == "none")
110   - obj.text("查看解析");
111   - else
112   - obj.text("收起解析");
113   - });
114   - }
115   -
116   -function getQueryString(name) {
117   - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
118   - var r = window.location.search.substr(1).match(reg);
119   - if (r != null) return unescape(r[2]); return null;
120   - }
121   - var PAPER_ID=getQueryString("PAPER_ID");
122   - var classId=getQueryString("classId");
123   - var userid=getQueryString("userid");
124   -
125   - var _html="";
126   - $(document).ready(function(){
127   - window.top.loading.remove();
128   - $.ajax({
129   - url:url+"/api/v1/paperinfo",
130   - async:false,
131   - type:"post",
132   - data:{PAPER_ID:PAPER_ID},
133   - success:function(data){
134   - console.log(data);
135   - $("#paper_title").html(data.data.title);
136   - $("#time").html(data.data.exam_time);
137   - if(data.data.questions.length>0){
138   - for(var i=0;i<data.data.questions.length;i++){
139   - _html += '<li class="question_li" data-id="'+data.data.questions[i].question_id+'"><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><div class="star_box"><div class="col-md-6 move"><img src="../static/images/up_ico.png" class="up"/><img src="../static/images/down_ico.png" class="down"/></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>';
140   - }
141   - console.log(_html);
142   - $(".analysis ul").html(_html);
143   - for(var j=0;j<data.data.questions.length;j++){
144   - var option_html="";
145   - var sum=0;
146   - var right_num=0;
147   - var data1=[];
148   - var data2=[];
149   - var answer="";
150   - var color=[];
151   - $(".analysis li .stem").eq(j).append('<span class="li_index">'+(j+1)+'</span>、'+data.data.questions[j].content);
152   - var arry_option=data.data.questions[j].option_content;
153   - arry_option=arry_option.replace("[","");
154   - arry_option=arry_option.replace("]","");
155   - arry_option=arry_option.split(",");
156   -
157   - for(var x=0;x<arry_option.length;x++){
158   - option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>';
159   - }
160   - $(".option").eq(j).html(option_html);
161   - star(j,parseInt(data.data.questions[j].difficulty));
162   - }
163   - }
164   - }
165   - })
166   - })
167   - function star(index,num){ //难度星级
168   - $(".star").eq(index).append('<ul></ul>');
169   - var li_html="";
170   - for(var i=1;i<=num;i++){
171   - li_html +='<li class="on"></li>';
172   - }
173   - for(var j=num;j<5;j++){
174   - li_html += '<li class="off"></li>';
175   - }
176   -
177   - $(".star").eq(index).find("ul").html(li_html);
178   - }
179   - $(document).on('click', '.move img', function(event) {
180   - event.preventDefault();
181   - $(".save").removeAttr('disabled');
182   - var parent=$(this).closest("li");
183   - var this_index=parent.children(".stem").find(".li_index").html();
184   - var up_index=parent.prev().children(".stem").find(".li_index").html()
185   - console.log(this_index);
186   - console.log(up_index);
187   - var parents=$(this).closest(".analysis").children("ul");
188   - var len=parents.children().length;
189   - if(($(this).is(".up") || $(this).is(".top")) && parent.index()==0){
190   - alert("已经置顶!");
191   - return false;
192   - }else if(($(this).is(".down") || $(this).is(".bottom")) && parent.index()==len-1){
193   - alert("已经置底!");
194   - return false;
195   - }
196   - switch (true) {
197   - case $(this).is(".up"):
198   - var prev = parent.prev();
199   - var this_index=parent.children(".stem").find(".li_index").html();
200   - var up_index=prev.children(".stem").find(".li_index").html();
201   - prev.children(".stem").find(".li_index").html(this_index);
202   - parent.children(".stem").find(".li_index").html(up_index);
203   - parent.insertBefore(prev);
204   - break;
205   - case $(this).is(".down"):
206   - var next = parent.next();
207   - var this_index=parent.children(".stem").find(".li_index").html();
208   - var up_index=next.children(".stem").find(".li_index").html();
209   - next.children(".stem").find(".li_index").html(this_index);
210   - parent.children(".stem").find(".li_index").html(up_index);
211   - parent.insertAfter(next);
212   - break;
213   - case $(this).is(".top"):
214   - parents.prepend(parent);
215   - break;
216   - case $(this).is(".bottom"):
217   - parents.append(parent);
218   - break;
219   - }
220   - // alert("操作完成!!");
221   - });
222   - $(".save").click(function(){
223   - var question_arry=[];
224   - for(var i=0;i<$(".question_li").length;i++){
225   - question_arry[i]={
226   - score: "0",
227   - part_score: "0",
228   - question_id: $(".question_li").eq(i).attr("data-id"),
229   - rank: i.toString(),
230   - no_name: i.toString()
231   - };
232   -
233   - }
234   - var data={
235   - title: $("#paper_title").html(),
236   - exam_time: $("#time").html(),
237   - paper_type: "101",
238   - subject_id: "20",
239   - grade_id: "",
240   - class_id: classId,
241   - user_id: userid,
242   - score: "100",
243   - questions: question_arry
244   - };
245   - //console.log(data);
246   - $.ajax({
247   - url:url+"/api/v1/publishpaper",
248   - async:false,
249   - type:"post",
250   - dataType: "json",
251   - headers: {'Content-Type': 'application/json'},
252   - data:JSON.stringify(data),
253   - success:function(data){
254   - alert("上传成功");
255   - window.history.go(-1);
256   - }
257   - })
258   - })
259   - </script>
  103 + <script src="../static/js/paper_view2.js"></script>
260 104  
261 105 </html>
262 106  
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/set_question.jsp
... ... @@ -24,17 +24,6 @@
24 24 </head>
25 25 <body>
26 26 <div class="col-md-12">
27   - <!--<div class="choose_class">
28   - <div class="col-md-2">
29   - <p>选择班级</p>
30   - </div>
31   - <div class="col-md-10 classList">
32   - <ul>
33   - <li>一年级1502班</li>
34   - </ul>
35   - </div>
36   - <div class="clearfix"></div>
37   - </div>-->
38 27 <div class="col-md-3 left_menu">
39 28 <div class="tab">
40 29 <ul>
... ... @@ -47,98 +36,22 @@
47 36 <div class="book"><p><span id="book_name">西师大版/一年级上</span></p><img src="../static/images/down_arrow.png" /><div class="clearfix"></div></div>
48 37 <div class="book_box">
49 38 <ul>
50   -
  39 + <!--教材版本列表-->
51 40 </ul>
52 41  
53 42 </div>
54   - <!-- <div class="gary"></div> -->
55 43 </div>
56 44 <div class="section">
57 45 <ul>
58   - <!-- <li>
59   - <img src="../static/images/add.png" /><span>1 准备课</span>
60   - <ul>
61   - <li>
62   - <span>●</span>
63   - <span>1.1 数一数</span>
64   - </li>
65   - <li>
66   - <span>●</span>
67   - <span>1.1 数一数</span>
68   - </li>
69   - </ul>
70   - </li>
71   - <li><img src="../static/images/reduce.png" />期中</li> -->
  46 + <!--左侧菜单列表-->
72 47 </ul>
73 48 </div>
74 49 </div>
75 50 <div class="col-md-9 right_content">
76   - <!-- <div class="screen">
77   - <div class="tag">
78   - <dl>
79   - <dt>题目难度:</dt>
80   - <dd>基础题</dd>
81   - <dd>中档题</dd>
82   - <dd>难题</dd>
83   - </dl>
84   - </div>
85   - <div class="tag">
86   - <dl>
87   - <dt>题目来源:</dt>
88   - <dd>云题库</dd>
89   - <dd>个人题库</dd>
90   - </dl>
91   - </div>
92   - </div> -->
93   - <div class="question_box">
94   - <ul>
95   - <!-- <li>
96   - <div class="content">
97   - <span>1、</span>
98   - <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,成立的个数有(  )
99   - </div>
100   - <div class="option">
101   - <ul>
102   - <li><span>A.</span>1个</li>
103   - <li><span>B.</span>2个</li>
104   - <li><span>C.</span>3个</li>
105   - <li><span>D.</span>4个</li>
106   - <div class="clearfix"></div>
107   - </ul>
108   - </div>
109   - <div class="resolve">
110   - <div class="resolve_box">
111   - <p><span>【答案】</span> A</p>
112   - <p><span>【解析】</span><img src="http://image.yuncelian.com/1/analysis/00ca500f-224f-584e-b92f-d7863238e2a8.png"></p>
113 51  
114   - <p>【考点】 10以内数的认识</p>
115   - </div>
116   - <div class="clearfix"></div>
117   - </div>
118   - <div class="star_box">
119   - <div class="col-md-6">
120   - <div class="star">
121   - <span style="float:left;">难度</span>
122   - <ul data-num="4">
123   - <li class="on"></li>
124   - <li class="on"></li>
125   - <li class="off"></li>
126   - <li class="off"></li>
127   - <li class="off"></li>
128   - </ul>
129   - </div>
130   - <div class="resolve_click">
131   - <a onclick="slide($(this))">查看解析</a>
132   - <div class="check_box"></div>
133   - </div>
134   -
135   -
136   -
137   - </div>
138   - <div class="clearfix"></div>
139   - </div>
140   - </li> -->
141   -
  52 + <div class="question_box">
  53 + <ul>
  54 + <!--题目列表-->
142 55 </ul>
143 56 <div class="view_more">
144 57 <p>点击查看更多<span>︾</span></p>
... ... @@ -186,407 +99,5 @@
186 99 </div><!-- /.modal -->
187 100 <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
188 101 <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
189   - <script>
190   - //http://192.168.0.113:8080/SunvoteEducation/api/v1/point 所有知识点
191   - var url="http://127.0.0.1:8080";
192   - var temp_tag;
193   - var temp_data;
194   - var TEXTBOOK_ID="";
195   - var question_box=[];
196   - var question_num=0;
197   - var pageNum=0;
198   - var end=0;
199   -
200   -
201   - $(document).ready(function(){
202   - //getClassName();
203   -
204   - getPoint();
205   -
206   - });
207   -
208   - function getQueryString(name) {
209   - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
210   - var r = window.location.search.substr(1).match(reg);
211   - if (r != null) return unescape(r[2]); return null;
212   - }
213   -
214   - var subject_id=getQueryString("subject_id");
215   - var class_id=getQueryString("class_id");
216   - var user_id=getQueryString("user_id");
217   -
218   - //alert(subject_id+";"+class_id);
219   -
220   - function getPoint(){ //获取知识点
221   - $.ajax({
222   - url:url+"/SunvoteEducation/api/v1/point",
223   - async:false,
224   - type:"post",
225   - data:{depth:"",subject_id:subject_id,p_id:"",knowledge_from:101},
226   - success:function(data){
227   - console.log(data);
228   - var point_html="";
229   - for(var i=0;i<data.data.length;i++){
230   - point_html +='<li data-id="'+data.data[i].KNOWLEDGE_ID+'" data-img-click=0 data-span-click=0><img src="../static/images/add.png" class="add" /><span>'+(i+1)+data.data[i].NAME+'</span></li>';
231   - }
232   - $(".section").children("ul").html(point_html);
233   - getQuestion($(".section li").eq(0));
234   - }
235   - })
236   - }
237   - function getChapter(TEXTBOOK_ID){ //获取章节
238   - $(".section").children("ul").html("");
239   - $.ajax({
240   - url:url+"/SunvoteEducation/api/v1/chapter",
241   - async:false,
242   - type:"post",
243   - data:{TEXTBOOK_ID:TEXTBOOK_ID},
244   - success:function(data){
245   - console.log(data);
246   - for(var i=0;i<data.data.length;i++){
247   - $(".section").children("ul").append('<li data-id="'+data.data[i].ID+'" data-img-click=0 data-span-click=0><img src="../static/images/add.png" class="add"/><span>'+data.data[i].NAME+'</span></li>');
248   - if(data.data[i].CHILDREN.length>0){
249   - $(".section").children("ul").children("li").eq(i).append("<ul></ul>");
250   - for(var j=0;j<data.data[i].CHILDREN.length;j++){
251   - $(".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>');
252   - }
253   - }
254   - }
255   -
256   - }
257   - })
258   - }
259   - function getMenu(id,obj){ //获取知识点下级内容
260   - var _html="";
261   - $.ajax({
262   - url:url+"/SunvoteEducation/api/v1/point",
263   - async:false,
264   - type:"post",
265   - data:{depth:"",subject_id:subject_id,p_id:id,knowledge_from:101},
266   - success:function(data){
267   - console.log(data);
268   - obj.append('<ul></ul>');
269   - for(var i=0;i<data.data.length;i++){
270   - console.log(typeof(data.data[i].CHILDREN));
271   - if(data.data[i].CHILDREN===undefined)
272   - _html +='<li data-id="'+data.data[i].KNOWLEDGE_ID+'" data-span-click=0 "><span>●</span><span>'+(i+1)+data.data[i].NAME+'</span></li>';
273   - else
274   - _html +='<li data-id="'+data.data[i].KNOWLEDGE_ID+'" data-img-click=0 data-span-click=0 ><img src="../static/images/add.png" class="add"/><span>'+(i+1)+data.data[i].NAME+'</span></li>';
275   - }
276   - obj.children('ul').html(_html);
277   - }
278   - })
279   - }
280   - function slide(obj){ //查看解析
281   - obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
282   - if($(".resolve").css("display") == "none")
283   - obj.text("查看解析");
284   - else
285   - obj.text("收起解析");
286   - });
287   -
288   - }
289   - function getQuestion(obj){ //获取题目
290   -
291   - var knowledge_id="",chapter_id="";
292   - if($(".tab .active").attr("data-index")==1){
293   - knowledge_id=obj.attr("data-id");
294   - }else{
295   - chapter_id=obj.attr("data-id");
296   - }
297   -
298   - var _html="";
299   -
300   - $.ajax({
301   - url:url+"/SunvoteEducation/api/v1/questions",
302   - async:true,
303   - type:"post",
304   - data:{chapter_id:chapter_id,teachingmaterial_id:"",knowledge_id:knowledge_id,question_from:101,user_id:"",problem_type:"",subject_id:subject_id,count:"5",pageNum:pageNum},
305   - success:function(data){
306   - window.top.loading.remove();
307   - console.log(data);
308   - if(data.data.length>0){
309   - for(var i=0;i<data.data.length;i++){
310   - _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>';
311   - }
312   - $(".question_box").children("ul").append(_html);
313   - console.log(5*pageNum);
314   - for(var j=5*pageNum;j<(data.data.length+5*pageNum);j++){
315   - var option_html="";
316   - //console.log(data.data[j-5*pageNum].CONTENT);
317   - $(".question_box li .content").eq(j).append('<span>'+(j+1)+'、</span>'+data.data[j-5*pageNum].CONTENT);
318   - var arry_option=data.data[j-5*pageNum].OPTION_CONTENT;
319   - if(question_box.indexOf(data.data[j-5*pageNum].QUESTION_ID)>=0){
320   - $(".check_box").eq(j).addClass("checked");
321   - }
322   - //arry_option=arry_option.replace("[","");
323   - //arry_option=arry_option.replace("]","");
324   - //arry_option=arry_option.split(",");
325   - for(var x=0;x<arry_option.length;x++){
326   - option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>';
327   - }
328   - $(".option").eq(j).find("ul").html(option_html);
329   -
330   - star(j,parseInt(data.data[j-5*pageNum].DIFFICULTY));
331   -
332   - }
333   - }else{
334   - $(".question_box").children("ul").html("");
335   - pageNum-=1;
336   - end=1;
337   - }
338   -
339   - }
340   - })
341   - }
342   - function getTeachingMaterial(){ //获取教材版本
343   -
344   - $.ajax({
345   - url:url+"/SunvoteEducation/api/v1/teachingmaterial",
346   - async:true,
347   - type:"post",
348   - data:{subject_id:subject_id},
349   - success:function(data){
350   - console.log(data);
351   - if(data.data.length>0){
352   - var teach_html="";
353   -
354   -
355   - for(var i=0;i<data.data.length;i++){
356   - teach_html += '<li data-id="'+data.data[i].ID+'" class="li_name"><p class="name">'+data.data[i].NAME+'</p><img src="../static/images/arrow_right.png" /><div class="clearfix"></div></li>';
357   - }
358   - $(".book_box ul").html(teach_html);
359   - var li_length=$(".book_box ul li").length;
360   - for(var k=0;k<li_length;k++){
361   - var books=[];
362   - var book_html="";
363   - var book_id=$(".book_box ul").children("li").eq(k).attr("data-id");
364   -
365   - if(textBook(book_id).length>0){
366   -
367   - books=textBook($(".book_box ul li").eq(k).attr("data-id"));
368   - $(".book_box ul li").eq(k).append('<div class="float_box"><ul><div class="clearfix"></div></ul></div>');
369   -
370   - for(var j=0;j<books.length;j++){
371   - console.log("j:"+j);
372   - book_html += '<li data-id='+books[j].id+'>'+books[j].name+'</li>';
373   - }
374   - $(".float_box").eq(k).children("ul").find(".clearfix").before(book_html);
375   - TEXTBOOK_ID=books[0].id;
376   - }
377   -
378   - }
379   - getChapter(TEXTBOOK_ID);
380   - $("#book_name").text($(".name").eq(0).text()+"/"+$(".float_box").eq(0).find('li').eq(0).text());
381   - }
382   -
383   - }
384   - })
385   -
386   - }
387   - function textBook(id){
388   - var textBookName=[];
389   - $.ajax({
390   - url:url+"/SunvoteEducation/api/v1/textbook",
391   - async:false,
392   - type:"post",
393   - data:{teaching_material_id:id,subject_id:subject_id,grade_id:""},
394   - success:function(data){
395   - //alert(data.data);
396   - if(data.data.length>0){
397   - for(var i=0;i<data.data.length;i++){
398   - textBookName[i]={"name":data.data[i].NAME,"id":data.data[i].ID};
399   - }
400   - }
401   - }
402   - })
403   - return textBookName;
404   - }
405   - function getClassName(){
406   - //var className="";
407   - $.ajax({
408   - url:url+"/SunvoteEducation/api/v1/classname",
409   - async:false,
410   - type:"post",
411   - data:{id:class_id},
412   - success:function(data){
413   - //alert(data.data);
414   - $(".classList li").html(data.data);
415   - }
416   - })
417   - }
418   - function star(index,num){ //难度星级
419   - $(".star").eq(index).append('<ul></ul>');
420   - var li_html="";
421   - for(var i=1;i<=num;i++){
422   - li_html +='<li class="on"></li>';
423   - }
424   - for(var j=num;j<5;j++){
425   - li_html += '<li class="off"></li>';
426   - }
427   -
428   - $(".star").eq(index).find("ul").html(li_html);
429   - }
430   -
431   - $(".section").on("click",".add",function(event){ //展开菜单
432   - event.stopPropagation();
433   -
434   - var that=$(this).closest("li");
435   - //alert(that.attr("data-img-click"));
436   -
437   - //console.log(that.attr("data-click"));
438   - if($(".tab .active").attr("data-index")==1){
439   - if(that.attr("data-img-click")==0){
440   - getMenu(that.attr("data-id"),that);
441   - //getQuestion(that);
442   - }
443   - that.attr("data-img-click",1);
444   - }else{
445   - if(that.attr("data-img-click")==0){
446   - //getQuestion(that);
447   - }
448   - that.attr("data-img-click",1);
449   - }
450   -
451   - if(that.children('ul').length>0)
452   - that.children('ul').slideToggle(function(){
453   - if(that.children('ul').css("display")=="block")
454   - that.children('img').attr("src","../static/images/reduce.png");
455   - else
456   - that.children('img').attr("src","../static/images/add.png");
457   - });
458   - });
459   - $(".section").on("click","span",function(event){ //点击菜单获取题目
460   - window.top.loading.show();
461   - event.stopPropagation();
462   - $(".question_box ul").html("");
463   - var that=$(this).closest("li");
464   - if($(".tab .active").attr("data-index")==1){
465   - getQuestion(that);
466   - $(".menu_active").removeClass();
467   - that.addClass("menu_active");
468   - }else{
469   - getQuestion(that);
470   - $(".menu_active").removeClass();
471   - that.addClass("menu_active");
472   - }
473   -
474   - });
475   - $(".book_box").children("ul").on("mouseover","li",function(event){ //教材版本交互
476   - event.stopPropagation();
477   - //$(this).siblings("li").css("background","#fff");
478   - //$(this).css("background","#e9f0ff");
479   - //$(".float_box").css("display","none");
480   - $(this).children(".float_box").css("display","block");
481   - });
482   - $(".book_box").children("ul").on("mouseleave","li",function(event){ //教材版本交互
483   - event.stopPropagation();
484   - //$(this).css("background","#fff");
485   - $(this).children(".float_box").css("display","none");
486   - });
487   - $(".float_box").on("mouseleave",function(event){ //教材版本交互
488   - event.stopPropagation();
489   - $(this).css("display","none");
490   - });
491   - $(document).on("click",".float_box li",function(event){ //教材版本交互
492   - //alert($(this).index());
493   - event.stopPropagation();
494   - var id=$(this).attr("data-id");
495   - $("#book_name").text($(this).closest(".li_name").children(".name").text()+"/"+$(this).text());
496   - $(".float_box").css("display","none");
497   - $(".book_box").slideToggle();
498   - getChapter(id);
499   - });
500   - $(".book").click(function(){ //教材版本下拉框交互
501   - $(".book_box").slideToggle();
502   - })
503   - $(document).on("click",".check_box",function(){ //选中题目
504   -
505   - if($(this).hasClass("checked")){
506   - var id=$(this).closest("li").attr("data-id");
507   - var que_index=question_box.indexOf(id);
508   - $(this).removeClass("checked");
509   - question_box.splice(que_index,1);
510   - question_num--;
511   - }else{
512   - question_box[question_num]=$(this).closest("li").attr("data-id");
513   - question_num++;
514   - $(this).addClass("checked");
515   - }
516   - $("#all_que_num").html(question_num);
517   - });
518   - $(".clear_que").click(function(){ //清空
519   - question_num=0;
520   - question_box=[];
521   - $(".checked").removeClass("checked");
522   - $("#all_que_num").html(question_num);
523   - });
524   - $(".tab li").click(function(){ //教材与知识点选择
525   - $(this).siblings().removeClass("active");
526   - $(this).addClass("active");
527   - if($(this).index()==0){
528   - getTeachingMaterial();
529   - $(".choose_book").css("display","block");
530   - getChapter(TEXTBOOK_ID);
531   - }else{
532   - $(".choose_book").css("display","none");
533   - getPoint();
534   - }
535   - });
536   - $(".topic").click(function(){
537   - if(parseInt($("#all_que_num").text())>0)
538   - $('#myModal').modal('show');
539   - else
540   - alert("请先选择题目")
541   - });
542   - $(".view_more").click(function(){
543   - pageNum++;
544   - if(end>0){
545   - $(".view_more p").html("没有更多了");
546   - return;
547   - }
548   - getQuestion($(".menu_active"));
549   - })
550   - $("#submit").click(function(){
551   - var question_arry=[];
552   - for(var i=0;i<question_num;i++){
553   - question_arry[i]={
554   - score: "0",
555   - part_score: "0",
556   - question_id: question_box[i],
557   - rank: i.toString(),
558   - no_name: i.toString()
559   - };
560   -
561   - }
562   - var data={
563   - title: $("#title").val(),
564   - exam_time: $("#time").val(),
565   - paper_type: "101",
566   - subject_id: subject_id,
567   - grade_id: "",
568   - class_id: class_id,
569   - user_id: user_id,
570   - score: "100",
571   - questions: question_arry
572   - };
573   - //console.log(data);
574   - sessionStorage.setItem("data",JSON.stringify(data));
575   - location.href="paper_view.do?classID="+class_id+"&userid="+user_id;
576   - /* $.ajax({
577   - url:url+"/SunvoteEducation/api/v1/publishpaper",
578   - async:false,
579   - type:"post",
580   - dataType: "json",
581   - headers: {'Content-Type': 'application/json'},
582   - data:JSON.stringify(data),
583   - success:function(data){
584   - alert("上传成功");
585   - $('#myModal').modal('hide');
586   - window.history.go(-1);
587   - }
588   - }) */
589   -
590   - })
591   - </script>
  102 + <script src="../static/js/set_question.js?a=1"></script>
592 103 </html>
593 104 \ No newline at end of file
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/teach_paper.jsp
... ... @@ -34,11 +34,7 @@
34 34 <input class="date-picker" type="text" placeholder="开始日期" name="lastStart" id="lastStart" data-date-format="yyyy-mm-dd" readonly="readonly" value=""/>
35 35 <input type="text" class="date-picker" placeholder="结束日期" name="lastEnd" id="lastEnd" data-date-format="yyyy-mm-dd" readonly="readonly" value=""/>
36 36 <select name="dealer_id_2" id="dealer_id_2" class="selectpicker show-tick form-control" data-width="98%" data-first-option="false" required data-live-search="true">
37   - <!--<option value="0">初一1501班</option>
38   - <option value="0">初一1502班</option>
39   - <option value="0">初一1503班</option>
40   - <option value="0">初一1504班</option>
41   - <option value="0">初一1505班</option>-->
  37 + <!--班级列表-->
42 38 </select>
43 39 <a onclick="tosearch();"><img
44 40 src="../static/images/search.png" /></a>
... ... @@ -128,228 +124,5 @@
128 124 <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
129 125 <script src="../static/ace/js/date-time/bootstrap-datepicker.js"></script>
130 126 <script src="../static/ace/js/bootbox.js"></script>
131   -
132   - <script>
133   - var url="/SunvoteEducation";
134   -
135   - var class_html="",option_html="";
136   - var user_id= "",
137   - subject_id="",
138   - class_id="";
139   - $(document).ready(function(){
140   - getList();
141   - timeList();
142   - $.ajax({
143   - url:url+"/teacher/info",
144   - async:false,
145   - type:"post",
146   - success:function(data){
147   - console.log(data);
148   - subject_id=data.data.subjectList[0].SUBJECT_ID;
149   - user_id=data.data.ID;
150   -
151   - if(data.data.classInfoList.length>0){
152   - for(var i=0;i<data.data.classInfoList.length;i++){
153   - class_html += '<li data-classId="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</li>';
154   - option_html += '<option value="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</option>'
155   - }
156   - $(".classList").html(class_html+'<div class="clearfix"></div>');
157   - $("#dealer_id_2").html(option_html);
158   - }
159   - }
160   - })
161   -
162   - //日期框
163   - $('.date-picker').datepicker({
164   - autoclose: true,
165   - todayHighlight: true
166   - });
167   - window.top.loading.remove();
168   - })
169   -
170   - function getList(start_date,end_date,class_id){
171   - var tab_html="";
172   - $.ajax({
173   - url:url+"/api/v1/paper",
174   - async:false,
175   - type:"post",
176   - data:{
177   - paper_type:"101",
178   - user_id:user_id,
179   - subject_id:subject_id,
180   - class_id:class_id,
181   - currentpage:"1",
182   - showcount:"",
183   - start_date:start_date,
184   - end_date:end_date
185   - },
186   - success:function(data){
187   - console.log(data);
188   - for(var i=0;i<data.data.length;i++){
189   - tab_html += '<tr data-id="'+data.data[i].PAPER_ID+'" data-classid="'+data.data[i].CLASS_ID+'"><td><input type="checkbox" name="ids" id="ids" value="'+data.data[i].PAPER_ID+'"/>'+(i+1)+'</td><td>'+data.data[i].TITLE+'</td><td>'+getClassName(data.data[i].CLASS_ID)+'</td><td>'+getSubjectName(data.data[i].SUBJECT_ID)+'</td><td>'+data.data[i].EXAM_TIME+'分钟</td><td>'+data.data[i].CREATE_DATE+'</td><td><a onclick="jump($(this))">查看</a></td><td><a href="#" onclick="del($(this));"><img src="../static/images/remove.png" /></a></td></tr>';
190   - }
191   - $("#tab_body").html(tab_html);
192   - window.top.loading.remove();
193   - }
194   - });
195   - }
196   - $('#ids').on('click', function(){
197   - var th_checked = $("#ids").prop('checked');//checkbox inside "TH" table header
198   -
199   - $(".table_box .table").find('tbody > tr').each(function(){
200   - var row = this;
201   - if(th_checked) $(row).find('input[type=checkbox]').eq(0).prop('checked', true);
202   - else $(row).find('input[type=checkbox]').eq(0).prop('checked', false);
203   - });
204   - });
205   - function jump(obj){
206   - var id=obj.closest("tr").attr("data-id");
207   - var classid=obj.closest("tr").attr("data-classid");
208   - location.href="paper_view.do?PAPER_ID="+id+"&classID="+classid+"&userid="+user_id;
209   - }
210   - $(".classList").on("click","li",function(){
211   - $(this).siblings().removeClass("active");
212   - $(this).addClass("active");
213   - class_id=$(this).attr("data-classid");
214   - });
215   - $("#creatPaper").click(function(){
216   - $('#myModal').modal('show');
217   - });
218   - function setQUestion(){
219   - if($(".classList .active").length>0){
220   - location.href="set_question.do?subject_id="+subject_id+"&class_id="+class_id+"&user_id="+user_id;
221   - }else{
222   - alert("请先选择班级");
223   - }
224   - window.top.loading.show();
225   - console.log($(".classList .active").length);
226   - //location.href="";
227   - }
228   - function getSubjectName(id){
229   - var subjectName="";
230   - $.ajax({
231   - url:url+"/api/v1/subjectcname",
232   - async:false,
233   - type:"post",
234   - data:{id:id},
235   - success:function(data){
236   - subjectName=data.data;
237   - }
238   - })
239   - return subjectName;
240   - }
241   - function getClassName(id){
242   - var className="";
243   - $.ajax({
244   - url:url+"/api/v1/classname",
245   - async:false,
246   - type:"post",
247   - data:{id:id},
248   - success:function(data){
249   - className=data.data;
250   - }
251   - })
252   - return className;
253   - }
254   - function getday(month){
255   - var time=[];
256   - var d= new Date();
257   - d.setMonth(month-1);
258   - d.setDate(1);
259   - var day=d.getDate();
260   - var month=d.getMonth()+1;
261   - if((d.getMonth()+1)<10){
262   - var month="0"+(d.getMonth()+1);
263   - }
264   - var year=d.getFullYear();
265   - var startTime=year+"-"+month+"-"+day;
266   - d.setMonth(month);
267   - var end_day=d.getDate();
268   - var end_month=d.getMonth()+1;
269   - if((d.getMonth()+1)<10){
270   - var end_month="0"+(d.getMonth()+1);
271   - }
272   - var end_year=d.getFullYear();
273   - var endTime=end_year+"-"+end_month+"-"+end_day;
274   - time[0]=startTime;
275   - time[1]=endTime;
276   - return time;
277   - }
278   - function timeList(){
279   - var time = new Date();
280   - var now_month=time.getMonth()+1;
281   - time.setMonth(now_month-1)
282   - if(time.getMonth()!= 0 ){
283   - var preceding_month = time.getMonth();
284   - }else
285   - var preceding_month = 12;
286   - time.setMonth(now_month-2)
287   - if(time.getMonth()!= 0 ){
288   - var last_month = time.getMonth();
289   - }else
290   - var last_month = 12;
291   - var option_html="";
292   - option_html += '<option value="'+now_month+'">'+now_month+'月</option><option value="'+preceding_month+'">'+preceding_month+'月</option><option value="'+last_month+'">'+last_month+'月</option>';
293   - $("#dealer_id_1").html(option_html);
294   - }
295   - function tosearch(){
296   - //var timeBox=getday($("#dealer_id_1").val());
297   - var start_date=$("#lastStart").val();
298   - var end_date=$("#lastEnd").val();
299   - var class_id=$("#dealer_id_2").val();
300   - getList(start_date,end_date,class_id);
301   - }
302   -
303   - function del(obj){
304   - //var remove = new remove();
305   - var id=obj.closest("tr").attr("data-id");
306   - window.top.remove.init({"title":"删除","func":function(success){
307   - if(success){
308   - var url = "<%=basePath%>paper/delete.do?PAPER_ID="+id+"&tm="+new Date().getTime();
309   - window.top.loading.show();
310   - $.get(url,function(data){
311   - tosearch();
312   - });
313   - }
314   - else{
315   - console.log("false");
316   - }
317   - }});
318   - window.top.remove.show();
319   - }
320   - function deleteAll(){
321   - window.top.remove.init({"title":"删除","func":function(success){
322   - if(success){
323   - var str = '';
324   - for(var i=0;i < document.getElementsByName('ids').length;i++){
325   - if(document.getElementsByName('ids')[i].checked){
326   - if(str=='') str += document.getElementsByName('ids')[i].value;
327   - else str += ',' + document.getElementsByName('ids')[i].value;
328   - }
329   - }
330   - if(str==''){
331   -
332   - }else{
333   - $.ajax({
334   - type: "POST",
335   - url: '<%=basePath%>paper/deleteAll.do?tm='+new Date().getTime(),
336   - data: {DATA_IDS:str},
337   - dataType:'json',
338   - //beforeSend: validateData,
339   - cache: false,
340   - success: function(data){
341   - $.each(data.list, function(i, list){
342   - tosearch();
343   - });
344   - }
345   - });
346   - }
347   - }
348   - else{
349   - console.log("false");
350   - }
351   - }});
352   - window.top.remove.show();
353   - }
354   - </script>
  127 + <script src="../static/js/teach_paper.js?a=1"></script>
355 128 </html>
356 129 \ No newline at end of file
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_report_1.jsp
... ... @@ -265,12 +265,15 @@
265 265 removeOriginal: true
266 266 };
267 267  
268   - $("#simple-table").tablescroller(options);
269   -
270   -
271   - var name_height = $(".kc").last().parent().height()-18.5;
272   - console.log(name_height);
273   - $(".th_name").height(name_height);
  268 + var sour = ${testpaperList};
  269 +
  270 + if(sour != null && sour.length > 0){
  271 + $("#simple-table").tablescroller(options);
  272 + var name_height = $(".kc").last().parent().height()-18.5;
  273 + console.log(name_height);
  274 + $(".th_name").height(name_height);
  275 + }
  276 +
274 277 });
275 278  
276 279  
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/test_list.jsp
... ... @@ -64,207 +64,20 @@
64 64 <col style="width: 20%" />
65 65 <col style="width: 10%" />
66 66 <tbody id="tab_body">
67   -
  67 + <!--测验列表-->
68 68 </tbody>
69 69 </table>
70 70  
71 71  
72 72 <div class="footer">
73   - <!--<div class="creat">
74   - <input type="button" id="creatPaper" value="新建试卷" />
75   - </div>
76   - <div class="removeAll">
77   - <input type="button" onclick="deleteAll()" value="批量删除" />
78   - </div>-->
79 73 <div class="page_box">
80   -
81 74 <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div>
82 75 </div>
83 76 </div>
84 77 </div>
85   - <!--<div class="container">
86   - <div class="screen">
87   - <div class="col-md-2">按条件筛选</div>
88   - <div class="col-md-10">
89   - <ul>
90   - <li>
91   - <div class="form-group">
92   - <div class="col-sm-3">
93   - <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">
94   - <option value="0">现在</option>
95   - <option value="0">6月</option>
96   - <option value="0">7月</option>
97   - </select>
98   - </div>
99   - </div>
100   - </li>
101   - <li>
102   - <div class="form-group">
103   - <div class="col-sm-3">
104   - <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">
105   - <option value="0">初一1501班</option>
106   - <option value="0">初一1502班</option>
107   - <option value="0">初一1503班</option>
108   - <option value="0">初一1504班</option>
109   - <option value="0">初一1505班</option>
110   - </select>
111   - </div>
112   - </div>
113   - </li>
114   - <li>
115   - <button type="button" class="btn btn-info" onclick="search()">搜索</button>
116   - </li>
117   - </ul>
118   - </div>
119   - <div class="clearfix"></div>
120   - </div>
121   - <div class="result">
122   - <table class="table table-striped">
123   - <thead>
124   - <tr>
125   - <th>序号</th>
126   - <th>创建时间</th>
127   - <th>班级</th>
128   - <th>科目</th>
129   - <th>试卷名称</th>
130   - <th>考试时长</th>
131   - <th>查看</th>
132   - </tr>
133   - </thead>
134   - <tbody id="tab_body">
135   - <tr>
136   - <td>1</td>
137   - <td>2018/7/31</td>
138   - <td>一年级1502班</td>
139   - <td>小学数学</td>
140   - <td>0/2</td>
141   - <td>数一数</td>
142   - <td>2018/08/05 08:00</td>
143   - <td>已截止</td>
144   - <td>查看</td>
145   - </tr>
146   - <tr>
147   - <td>2</td>
148   - <td>2018/6/21</td>
149   - <td>一年级1502班</td>
150   - <td>小学数学</td>
151   - <td>0/2</td>
152   - <td>1.1 认识平面图形</td>
153   - <td>2018/06/24 08:00</td>
154   - <td>已截止</td>
155   - <td>查看</td>
156   - </tr>
157   - </tbody>
158   - </table>
159   - </div>
160   - </div> -->
  78 +
161 79 <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
162 80 <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
163 81 <script src="../static/ace/js/date-time/bootstrap-datepicker.js"></script>
164   -
165   - <script>
166   - var url="http://127.0.0.1:8080/SunvoteEducation";
167   -
168   - var option_html="";
169   - var user_id= "8dbef15bb6d043ec94b719ede583b033",
170   - subject_id="";
171   -
172   - function getQueryString(name) {
173   - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
174   - var r = window.location.search.substr(1).match(reg);
175   - if (r != null) return unescape(r[2]); return null;
176   - }
177   - var class_id=getQueryString("classid");
178   - $(document).ready(function(){
179   - getList();
180   - //timeList();
181   - $.ajax({
182   - url:url+"/teacher/info",
183   - async:false,
184   - type:"post",
185   - success:function(data){
186   - subject_id=data.data.subjectList[0].SUBJECT_ID;
187   - user_id=data.data.ID;
188   - if(data.data.classInfoList.length>0){
189   - for(var i=0;i<data.data.classInfoList.length;i++){
190   - option_html += '<option value="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</option>'
191   - }
192   - $("#dealer_id_2").html(option_html);
193   - }
194   - }
195   - })
196   - //日期框
197   - $('.date-picker').datepicker({
198   - autoclose: true,
199   - todayHighlight: true
200   - });
201   - window.top.loading.remove();
202   - })
203   - function getList(start_date,end_date,class_id){
204   - var tab_html="";
205   - $.ajax({
206   - url:url+"/api/v1/testpaper",
207   - async:false,
208   - type:"post",
209   - data:{
210   - paper_type:"101",
211   - user_id:user_id,
212   - subject_id:subject_id,
213   - class_id:class_id,
214   - currentpage:"1",
215   - showcount:"",
216   - start_date:start_date,
217   - end_date:end_date
218   - },
219   - success:function(data){
220   - console.log(data);
221   - for(var i=0;i<data.data.length;i++){
222   - tab_html += '<tr><td>'+(i+1)+'</td><td>'+data.data[i].createDate+'</td><td>'+getClassName(data.data[i].classId)+'</td><td>'+data.data[i].name+'</td><td><a onclick="window.top.loading.show();jump($(this));" data-id="'+data.data[i].testpaperId+'" >查看</a></td></tr>'
223   - }
224   - $("#tab_body").html(tab_html);
225   - }
226   - });
227   - }
228   - function jump(obj){
229   - var id=obj.attr("data-id");
230   - location.href="paper_view1.do?testpaperId="+id;
231   - }
232   - $(".classList").on("click","li",function(){
233   - $(this).siblings().removeClass("active");
234   - $(this).addClass("active");
235   - })
236   - function getSubjectName(id){
237   - var subjectName="";
238   - $.ajax({
239   - url:url+"/api/v1/subjectcname",
240   - async:false,
241   - type:"post",
242   - data:{id:id},
243   - success:function(data){
244   - subjectName=data.data;
245   - }
246   - })
247   - return subjectName;
248   - }
249   - function getClassName(id){
250   - var className="";
251   - $.ajax({
252   - url:url+"/api/v1/classname",
253   - async:false,
254   - type:"post",
255   - data:{id:id},
256   - success:function(data){
257   - className=data.data;
258   - }
259   - })
260   - return className;
261   - }
262   - function tosearch(){
263   - var start_date=$("#lastStart").val();
264   - var end_date=$("#lastEnd").val();
265   - var class_id=$("#dealer_id_2").val();
266   - getList(start_date,end_date,class_id);
267   - }
268   -
269   - </script>
  82 + <script src="../static/js/test_list.js"></script>
270 83 </html>
271 84 \ No newline at end of file
... ...
WebRoot/static/css/paper_view.css
1   -li{list-style:none;}
  1 +li{list-style:none;}
2 2 .left_menu li{line-height:50px;border-bottom:1px solid #ccc;text-align:center;}
3 3 .left_menu .active{background:#6691de;color:#fff;}
4 4 .report_info{padding-bottom:30px;border-bottom:1px solid #ccc;}
5 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;}
  6 +.option{padding-bottom:20px;margin-top:20px;}
7 7 .option li{width:100%;}
8 8 .option li span{vertical-align:middle;margin-right:5px;}
9 9 .resolve_box{padding:20px 0;border-top:1px dashed #ccc;}
... ... @@ -22,4 +22,5 @@
22 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 23 .tab_report_box .round_n_red span{color:#fff;line-height:70px;text-align:center;display:inline-block;width:100%;}
24 24 .analysis .question_li{position:relative;padding-top:15px;}
25   -.chou{width:24px;height:24px;text-align:center;line-height:24px;border-radius:12px;border:1px solid #f00;color:#f00;position:absolute;top:15px;right:0;opacity:0.5}
26 25 \ No newline at end of file
  26 +.chou{width:24px;height:24px;text-align:center;line-height:24px;border-radius:12px;border:1px solid #f00;color:#f00;position:absolute;top:15px;right:0;opacity:0.5}
  27 +.stem{font-size:16px;}
... ...
WebRoot/static/css/set_quetion.css
... ... @@ -5,7 +5,7 @@ li{list-style:none;}
5 5 .left_menu{box-shadow:0 0 10px #ccc;margin-top:10px;}
6 6 .left_menu .tab{border-bottom:1px solid #ccc;}
7 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;}
  8 +.left_menu .tab li{width:50%;box-sizing:border-box;float:left;font-size:26px;text-align:center;padding:10px 0;cursor:pointer;}
9 9 .left_menu .tab li p{margin:0;}
10 10 .left_menu .tab .active{border-bottom: 2px solid #3c7ae3;}
11 11 .left_menu .tab .active p{color:#3c7ae3;}
... ... @@ -35,7 +35,8 @@ li{list-style:none;}
35 35 .tag dt,dd{display:inline-block;}
36 36  
37 37 .right_content{box-sizing:border-box;padding-bottom:80px;}
38   -.view_more p{font-size: 18px;width: 100%;text-align: center;background: #ccc;color: #fff;line-height:40px;}
  38 +.view_more{display:none;}
  39 +.view_more p{font-size: 18px;width: 100%;text-align: center;background: #ccc;color: #fff;line-height:40px;cursor:pointer; }
39 40 .view_more p span{vertical-align:sub;margin-left:8px;}
40 41  
41 42 .option{padding:10px 0;}
... ...
WebRoot/static/js/paper_view.js 0 → 100644
  1 +var url="";
  2 + var question_box=[];
  3 + function slide(obj){ //查看解析
  4 + obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
  5 + if($(".resolve").css("display") == "none")
  6 + obj.text("查看解析");
  7 + else
  8 + obj.text("收起解析");
  9 + });
  10 + }
  11 +
  12 +function getQueryString(name) {
  13 + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  14 + var r = window.location.search.substr(1).match(reg);
  15 + if (r != null) return unescape(r[2]); return null;
  16 + }
  17 + var PAPER_ID=getQueryString("PAPER_ID");
  18 + var classId=getQueryString("classId");
  19 + var userid=getQueryString("userid");
  20 +
  21 + var _html="";
  22 + var question_id_arry="";
  23 + $(document).ready(function(){
  24 + window.top.loading.remove();
  25 + var data=JSON.parse(sessionStorage.getItem("data"));
  26 + console.log(data);
  27 + $("#paper_title").html(data.title);
  28 + $("#time").html(data.exam_time);
  29 + if(data.questions.length>0){
  30 + for(var i=0;i<data.questions.length;i++){
  31 + question_id_arry+=data.questions[i].question_id+',';
  32 + }
  33 + getQuestionInfo(question_id_arry);
  34 + }
  35 +
  36 + })
  37 + function getQuestionInfo(id){ //获取试题详情
  38 + $.ajax({
  39 + url:url+"/SunvoteEducation/api/v1/question",
  40 + async:true,
  41 + type:"post",
  42 + data:{ID:id},
  43 + success:function(data){
  44 + console.log(data);
  45 + if(data.data.length>0){
  46 + for(var i=0;i<data.data.length;i++){
  47 + _html += '<li class="question_li" data-id="'+data.data[i].QUESTION_ID+'"><div class="stem"></div><div class="option"><ul></ul><div class="clearfix"></div></div><div class="resolve"><div class="resolve_box"><p>【答案】 '+data.data[i].ANSWER+'</p><p><span>【解析】</span>'+data.data[i].ANALYSIS+'</p></div><div class="clearfix"></div></div><div class="star_box"><div class="col-md-6 move"><img src="../static/images/up_ico.png" class="up"/><img src="../static/images/down_ico.png" class="down"/></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>';
  48 + }
  49 + console.log(_html);
  50 + $(".analysis ul").html(_html);
  51 + for(var j=0;j<data.data.length;j++){
  52 + var option_html="";
  53 + var sum=0;
  54 + var right_num=0;
  55 + var data1=[];
  56 + var data2=[];
  57 + var answer="";
  58 + var color=[];
  59 + $(".analysis li .stem").eq(j).append('<span class="li_index">'+(j+1)+'</span>、'+data.data[j].CONTENT);
  60 + var arry_option=data.data[j].OPTION_CONTENT;
  61 +
  62 + for(var x=0;x<arry_option.length;x++){
  63 + option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>';
  64 + }
  65 + $(".option").eq(j).html(option_html);
  66 + star(j,parseInt(data.data[j].DIFFICULTY));
  67 + }
  68 + }
  69 + }
  70 + })
  71 +
  72 + }
  73 + function star(index,num){ //难度星级
  74 + $(".star").eq(index).append('<ul></ul>');
  75 + var li_html="";
  76 + for(var i=1;i<=num;i++){
  77 + li_html +='<li class="on"></li>';
  78 + }
  79 + for(var j=num;j<5;j++){
  80 + li_html += '<li class="off"></li>';
  81 + }
  82 +
  83 + $(".star").eq(index).find("ul").html(li_html);
  84 + }
  85 + $(document).on('click', '.move img', function(event) { //上移、下移
  86 + event.preventDefault();
  87 + var parent=$(this).closest("li");
  88 + var this_index=parent.children(".stem").find(".li_index").html();
  89 + var up_index=parent.prev().children(".stem").find(".li_index").html()
  90 + console.log(this_index);
  91 + console.log(up_index);
  92 + var parents=$(this).closest(".analysis").children("ul");
  93 + var len=parents.children().length;
  94 + if(($(this).is(".up") || $(this).is(".top")) && parent.index()==0){
  95 + alert("已经置顶!");
  96 + return false;
  97 + }else if(($(this).is(".down") || $(this).is(".bottom")) && parent.index()==len-1){
  98 + alert("已经置底!");
  99 + return false;
  100 + }
  101 + switch (true) {
  102 + case $(this).is(".up"):
  103 + var prev = parent.prev();
  104 + var this_index=parent.children(".stem").find(".li_index").html();
  105 + var up_index=prev.children(".stem").find(".li_index").html();
  106 + prev.children(".stem").find(".li_index").html(this_index);
  107 + parent.children(".stem").find(".li_index").html(up_index);
  108 + parent.insertBefore(prev);
  109 + break;
  110 + case $(this).is(".down"):
  111 + var next = parent.next();
  112 + var this_index=parent.children(".stem").find(".li_index").html();
  113 + var up_index=next.children(".stem").find(".li_index").html();
  114 + next.children(".stem").find(".li_index").html(this_index);
  115 + parent.children(".stem").find(".li_index").html(up_index);
  116 + parent.insertAfter(next);
  117 + break;
  118 + case $(this).is(".top"):
  119 + parents.prepend(parent);
  120 + break;
  121 + case $(this).is(".bottom"):
  122 + parents.append(parent);
  123 + break;
  124 + }
  125 + });
  126 + $(".save").click(function(){ //保存,提交试卷
  127 + var question_arry=[];
  128 + for(var i=0;i<$(".question_li").length;i++){
  129 + question_arry[i]={
  130 + score: "0",
  131 + part_score: "0",
  132 + question_id: $(".question_li").eq(i).attr("data-id"),
  133 + rank: i.toString(),
  134 + no_name: i.toString()
  135 + };
  136 +
  137 + }
  138 + var data={
  139 + title: $("#paper_title").html(),
  140 + exam_time: $("#time").html(),
  141 + paper_type: "101",
  142 + subject_id: "20",
  143 + grade_id: "",
  144 + class_id: classId,
  145 + user_id: userid,
  146 + score: "100",
  147 + questions: question_arry
  148 + };
  149 +
  150 + $.ajax({
  151 + url:url+"/SunvoteEducation/api/v1/publishpaper",
  152 + async:false,
  153 + type:"post",
  154 + dataType: "json",
  155 + headers: {'Content-Type': 'application/json'},
  156 + data:JSON.stringify(data),
  157 + success:function(data){
  158 + alert("上传成功");
  159 + window.history.go(-2);
  160 + }
  161 + })
  162 + })
0 163 \ No newline at end of file
... ...
WebRoot/static/js/paper_view1.js 0 → 100644
  1 + var url="";
  2 + function slide(obj){ //查看详情
  3 + obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
  4 + if($(".resolve").css("display") == "none")
  5 + obj.text("查看详情");
  6 + else
  7 + obj.text("收起详情");
  8 + });
  9 + }
  10 +
  11 +
  12 + function bar(index,data1,data2,answer,color,sum){ //柱状图
  13 + var myChart = echarts.init(document.getElementById('main'+index));
  14 + myChart.setOption({
  15 + color: ['#3398DB'],
  16 + tooltip : {
  17 + trigger: 'axis',
  18 + axisPointer : { // 坐标轴指示器,坐标轴触发有效
  19 + type : 'line' // 默认为直线,可选为:'line' | 'shadow'
  20 + },
  21 + formatter: function(params){
  22 + return params[0].name+"<br/><div style='display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:5px;background:"+params[0].color+"'></div>占比:"+((params[0].value/sum)*100).toFixed(2)+"%<br/><div style='display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:5px;background:"+params[0].color+"'></div>人数:"+params[0].value;
  23 + }
  24 + },
  25 + grid: {
  26 + top: 15,
  27 + left: '0%',
  28 + right: '0%',
  29 + bottom: '0%',
  30 + containLabel: true
  31 + },
  32 + xAxis : [
  33 + {
  34 + type : 'category',
  35 + data : data2,
  36 + axisTick: {
  37 + alignWithLabel: true
  38 + },
  39 + axisLabel: {
  40 + show:true,
  41 + textStyle:{
  42 + color: function (value){
  43 + console.log(value);
  44 + return value == answer ? '#75b3ff' : '#fcb35b';
  45 + }
  46 + }
  47 + }
  48 + }
  49 + ],
  50 + yAxis : [
  51 + {
  52 + type : 'value',
  53 + max: function(value) {
  54 + return sum;
  55 + }
  56 + }
  57 + ],
  58 + series : [
  59 + {
  60 + name:'选项人数',
  61 + type:'bar',
  62 + barWidth: '60%',
  63 + data:data1,
  64 + itemStyle: {
  65 + //通常情况下:
  66 + normal:{
  67 + //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  68 + color: function (params){
  69 + var colorList = color;
  70 + return colorList[params.dataIndex];
  71 + },
  72 + label : {show: true,position:'top',distance:-4}
  73 + }
  74 + }
  75 + }
  76 + ]
  77 + });
  78 + }
  79 +
  80 +function getQueryString(name) {
  81 + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  82 + var r = window.location.search.substr(1).match(reg);
  83 + if (r != null) return unescape(r[2]); return null;
  84 + }
  85 + var testpaperId=getQueryString("testpaperId");
  86 +
  87 + var _html="";
  88 + $(document).ready(function(){
  89 + window.top.loading.remove();
  90 + $.ajax({
  91 + url:url+"/SunvoteEducation/api/v1/testpaperinfo",
  92 + async:false,
  93 + type:"post",
  94 + data:{ID:testpaperId},
  95 + success:function(data){
  96 + console.log(data);
  97 + $("#paper_title").html(data.data.NAME);
  98 + $("#time").html(data.data.CREATE_DATE);
  99 + if(data.data.QUESTIONS.length>0){
  100 + for(var i=0;i<data.data.QUESTIONS.length;i++){
  101 + _html += '<li class="question_li" data-id="'+data.data.QUESTIONS[i].QUESTION_ID+'"><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">错误学生:<span class="erro_num">0/0</span></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>';
  102 + }
  103 + console.log(_html);
  104 + $(".analysis ul").html(_html);
  105 + for(var j=0;j<data.data.QUESTIONS.length;j++){
  106 + var option_html="";
  107 + var sum=0;
  108 + var right_num=0;
  109 + var data1=[];
  110 + var data2=[];
  111 + var answer="";
  112 + var color=[];
  113 + $(".analysis li .stem").eq(j).append('<span>'+(j+1)+'、</span>'+data.data.QUESTIONS[j].CONTENT);
  114 + var arry_option=data.data.QUESTIONS[j].OPTION_CONTENT;
  115 + var answerinfo=data.data.QUESTIONS[j].ANSWERINFO;
  116 +
  117 + for(var x=0;x<arry_option.length;x++){
  118 + option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>';
  119 + }
  120 + for(k=0;k<answerinfo.length;k++){
  121 + data1[k]=parseInt(answerinfo[k].COUNT);
  122 + data2[k]=answerinfo[k].ANSWER;
  123 + color[k]="#fcb35b";
  124 + if(answerinfo[k].ISRIGHT==1){
  125 + right_num=answerinfo[k].COUNT;
  126 + answer=answerinfo[k].ANSWER;
  127 + color[k]="#75b3ff";
  128 + }
  129 + sum += parseInt(answerinfo[k].COUNT);
  130 + }
  131 + $(".round_n_orange span").eq(j).text((sum-right_num)+"/"+sum);
  132 + $(".erro_num").eq(j).text((sum-right_num)+"/"+sum);
  133 + $(".round_n_red span").eq(j).text(((sum-right_num)/sum).toFixed(2)*100+"%");
  134 + $(".option").eq(j).find("ul").html(option_html);
  135 +
  136 + star(j,parseInt(data.data.QUESTIONS[j].DIFFICULTY));
  137 + console.log(data1,data2);
  138 + bar(j,data1,data2,answer,color,sum);
  139 + if(data.data.QUESTIONS[j].RANDOM=="1")
  140 + $(".analysis ul").children("li").eq(j).append('<div class="chou">抽</div>');
  141 + }
  142 + }
  143 + }
  144 + })
  145 + })
  146 + function star(index,num){ //难度星级
  147 + $(".star").eq(index).append('<ul></ul>');
  148 + var li_html="";
  149 + for(var i=1;i<=num;i++){
  150 + li_html +='<li class="on"></li>';
  151 + }
  152 + for(var j=num;j<5;j++){
  153 + li_html += '<li class="off"></li>';
  154 + }
  155 +
  156 + $(".star").eq(index).find("ul").html(li_html);
  157 + }
  158 + $(document).on("click",".round_n_orange",function(){ //显示错误学生名单
  159 + var question_id = $(this).closest("li").attr("data-id");
  160 + var student_html="";
  161 + $.ajax({
  162 + url:url+"/SunvoteEducation/api/v1/qstudentinfo",
  163 + async:false,
  164 + type:"post",
  165 + data:{question_id:question_id,test_id:testpaperId},
  166 + success:function(data){
  167 + console.log(data);
  168 + for(var i=0;i<data.data.length;i++){
  169 + student_html+='<tr><td>'+(i+1)+'</td><td>'+data.data[i].NAME+'</td><td>'+data.data[i].ANSWER+'</td><td>'+data.data[i].PRESS_TIME+'秒</td></tr>';
  170 + }
  171 + $(".student_list").html(student_html);
  172 + }
  173 + });
  174 + $('#myModal').modal('show');
  175 + })
0 176 \ No newline at end of file
... ...
WebRoot/static/js/paper_view2.js 0 → 100644
  1 +var url="";
  2 + var question_box=[];
  3 + function slide(obj){ //查看解析
  4 + obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
  5 + if($(".resolve").css("display") == "none")
  6 + obj.text("查看解析");
  7 + else
  8 + obj.text("收起解析");
  9 + });
  10 + }
  11 +
  12 +function getQueryString(name) {
  13 + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  14 + var r = window.location.search.substr(1).match(reg);
  15 + if (r != null) return unescape(r[2]); return null;
  16 + }
  17 + var PAPER_ID=getQueryString("PAPER_ID");
  18 + var classId=getQueryString("classId");
  19 + var userid=getQueryString("userid");
  20 +
  21 + var _html="";
  22 + $(document).ready(function(){
  23 + window.top.loading.remove();
  24 + $.ajax({
  25 + url:url+"/SunvoteEducation/api/v1/paperinfo",
  26 + async:false,
  27 + type:"post",
  28 + data:{PAPER_ID:PAPER_ID},
  29 + success:function(data){
  30 + console.log(data);
  31 + $("#paper_title").html(data.data.title);
  32 + $("#time").html(data.data.exam_time);
  33 + if(data.data.questions.length>0){
  34 + for(var i=0;i<data.data.questions.length;i++){
  35 + _html += '<li class="question_li" data-id="'+data.data.questions[i].question_id+'"><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><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></div><div class="clearfix"></div></div></li>';
  36 + }
  37 + console.log(_html);
  38 + $(".analysis ul").html(_html);
  39 + for(var j=0;j<data.data.questions.length;j++){
  40 + var option_html="";
  41 + var sum=0;
  42 + var right_num=0;
  43 + var answer="";
  44 + $(".analysis li .stem").eq(j).append('<span class="li_index">'+(j+1)+'</span>、'+data.data.questions[j].content);
  45 + var arry_option=data.data.questions[j].option_content;
  46 + arry_option=arry_option.replace("[","");
  47 + arry_option=arry_option.replace("]","");
  48 + arry_option=arry_option.split(",");
  49 +
  50 + for(var x=0;x<arry_option.length;x++){
  51 + option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>';
  52 + }
  53 + $(".option").eq(j).html(option_html);
  54 + star(j,parseInt(data.data.questions[j].difficulty));
  55 + }
  56 + }
  57 + window.top.loading.remove();
  58 + }
  59 + })
  60 + })
  61 + function star(index,num){ //难度星级
  62 + $(".star").eq(index).append('<ul></ul>');
  63 + var li_html="";
  64 + for(var i=1;i<=num;i++){
  65 + li_html +='<li class="on"></li>';
  66 + }
  67 + for(var j=num;j<5;j++){
  68 + li_html += '<li class="off"></li>';
  69 + }
  70 +
  71 + $(".star").eq(index).find("ul").html(li_html);
  72 + }
  73 +
0 74 \ No newline at end of file
... ...
WebRoot/static/js/set_question.js 0 → 100644
  1 +var url="";
  2 + var temp_tag;
  3 + var temp_data;
  4 + var TEXTBOOK_ID="";
  5 + var question_box=[];
  6 + var question_num=0;
  7 + var pageNum=1;
  8 + var end=0;
  9 + var flag=0;
  10 +
  11 +
  12 + $(document).ready(function(){
  13 + getPoint();
  14 + });
  15 +
  16 + function getQueryString(name) {
  17 + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  18 + var r = window.location.search.substr(1).match(reg);
  19 + if (r != null) return unescape(r[2]); return null;
  20 + }
  21 +
  22 + var subject_id=getQueryString("subject_id");
  23 + var class_id=getQueryString("class_id");
  24 + var user_id=getQueryString("user_id");
  25 +
  26 +
  27 + function getPoint(){ //获取知识点
  28 + $.ajax({
  29 + url:url+"/SunvoteEducation/api/v1/point",
  30 + async:false,
  31 + type:"post",
  32 + data:{depth:"",subject_id:subject_id,p_id:"",knowledge_from:101},
  33 + success:function(data){
  34 + var point_html="";
  35 + for(var i=0;i<data.data.length;i++){
  36 + point_html +='<li data-id="'+data.data[i].KNOWLEDGE_ID+'" data-img-click=0 data-span-click=0><img src="../static/images/add.png" class="add" /><span>'+(i+1)+data.data[i].NAME+'</span></li>';
  37 + }
  38 + $(".section").children("ul").html(point_html);
  39 + getQuestion($(".section li").eq(0));
  40 + }
  41 + })
  42 + }
  43 + function getChapter(TEXTBOOK_ID){ //获取章节
  44 + $(".section").children("ul").html("");
  45 + $.ajax({
  46 + url:url+"/SunvoteEducation/api/v1/chapter",
  47 + async:false,
  48 + type:"post",
  49 + data:{TEXTBOOK_ID:TEXTBOOK_ID},
  50 + success:function(data){
  51 + for(var i=0;i<data.data.length;i++){
  52 + $(".section").children("ul").append('<li data-id="'+data.data[i].ID+'" data-img-click=0 data-span-click=0><img src="../static/images/add.png" class="add"/><span>'+data.data[i].NAME+'</span></li>');
  53 + if(data.data[i].CHILDREN.length>0){
  54 + $(".section").children("ul").children("li").eq(i).append("<ul></ul>");
  55 + for(var j=0;j<data.data[i].CHILDREN.length;j++){
  56 + $(".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>');
  57 + }
  58 + }
  59 + }
  60 + getQuestion($(".section li").eq(0));
  61 + }
  62 + })
  63 + }
  64 + function getMenu(id,obj){ //获取知识点下级内容
  65 + var _html="";
  66 + $.ajax({
  67 + url:url+"/SunvoteEducation/api/v1/point",
  68 + async:false,
  69 + type:"post",
  70 + data:{depth:"",subject_id:subject_id,p_id:id,knowledge_from:101},
  71 + success:function(data){
  72 + obj.append('<ul></ul>');
  73 + for(var i=0;i<data.data.length;i++){
  74 + console.log(typeof(data.data[i].CHILDREN));
  75 + if(data.data[i].CHILDREN===undefined)
  76 + _html +='<li data-id="'+data.data[i].KNOWLEDGE_ID+'" data-span-click=0 "><span>●</span><span>'+(i+1)+data.data[i].NAME+'</span></li>';
  77 + else
  78 + _html +='<li data-id="'+data.data[i].KNOWLEDGE_ID+'" data-img-click=0 data-span-click=0 ><img src="../static/images/add.png" class="add"/><span>'+(i+1)+data.data[i].NAME+'</span></li>';
  79 + }
  80 + obj.children('ul').html(_html);
  81 + }
  82 + })
  83 + }
  84 + function slide(obj){ //查看解析
  85 + obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
  86 + if($(".resolve").css("display") == "none")
  87 + obj.text("查看解析");
  88 + else
  89 + obj.text("收起解析");
  90 + });
  91 +
  92 + }
  93 + function getQuestion(obj){ //获取题目
  94 +
  95 + var knowledge_id="",chapter_id="";
  96 + if($(".tab .active").attr("data-index")==1){
  97 + knowledge_id=obj.attr("data-id");
  98 + }else{
  99 + chapter_id=obj.attr("data-id");
  100 + }
  101 +
  102 + var _html="";
  103 +
  104 + $.ajax({
  105 + url:url+"/SunvoteEducation/api/v1/questions",
  106 + async:true,
  107 + type:"post",
  108 + data:{chapter_id:chapter_id,teachingmaterial_id:"",knowledge_id:knowledge_id,question_from:101,user_id:"",problem_type:"",subject_id:subject_id,count:"5",pageNum:pageNum},
  109 + success:function(data){
  110 + window.top.loading.remove();
  111 + console.log(data);
  112 + if(data.data.length>0){
  113 + for(var i=0;i<data.data.length;i++){
  114 + _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>';
  115 + }
  116 + $(".question_box").children("ul").append(_html);
  117 + console.log(5*(pageNum-1));
  118 + for(var j=5*(pageNum-1);j<(data.data.length+5*(pageNum-1));j++){
  119 + var option_html="";
  120 + $(".question_box li .content").eq(j).append('<span>'+(j+1)+'、</span>'+data.data[j-5*(pageNum-1)].CONTENT);
  121 + var arry_option=data.data[j-5*(pageNum-1)].OPTION_CONTENT;
  122 + if(question_box.indexOf(data.data[j-5*(pageNum-1)].QUESTION_ID)>=0){
  123 + $(".check_box").eq(j).addClass("checked");
  124 + }
  125 + for(var x=0;x<arry_option.length;x++){
  126 + option_html += '<li><span>'+String.fromCharCode(64 + parseInt(x+1))+'.</span>'+arry_option[x]+'</li>';
  127 + }
  128 + $(".option").eq(j).find("ul").html(option_html);
  129 +
  130 + star(j,parseInt(data.data[j-5*(pageNum-1)].DIFFICULTY));
  131 +
  132 + }
  133 + $(".view_more").css("display","block");
  134 + end=0;
  135 + }else{
  136 + $(".view_more").css("display","none");
  137 + // $(".question_box").children("ul").html("");
  138 + pageNum-=1;
  139 + if(pageNum<1)
  140 + pageNum=1;
  141 + end=1;
  142 + }
  143 + flag=0;
  144 + },
  145 + error: function (XMLHttpRequest, textStatus, errorThrown) {
  146 + // 状态码
  147 + console.log(XMLHttpRequest.status);
  148 + // 状态
  149 + console.log(XMLHttpRequest.readyState);
  150 + // 错误信息
  151 + console.log(textStatus);
  152 + flag=0;
  153 + pageNum-=1;
  154 + if(pageNum<1)
  155 + pageNum=1;
  156 + window.top.loading.remove();
  157 + }
  158 + })
  159 + }
  160 + function getTeachingMaterial(){ //获取教材版本
  161 +
  162 + $.ajax({
  163 + url:url+"/SunvoteEducation/api/v1/teachingmaterial",
  164 + async:true,
  165 + type:"post",
  166 + data:{subject_id:subject_id},
  167 + success:function(data){
  168 + console.log(data);
  169 + if(data.data.length>0){
  170 + var teach_html="";
  171 +
  172 +
  173 + for(var i=0;i<data.data.length;i++){
  174 + teach_html += '<li data-id="'+data.data[i].ID+'" class="li_name"><p class="name">'+data.data[i].NAME+'</p><img src="../static/images/arrow_right.png" /><div class="clearfix"></div></li>';
  175 + }
  176 + $(".book_box ul").html(teach_html);
  177 + var li_length=$(".book_box ul li").length;
  178 + for(var k=0;k<li_length;k++){
  179 + var books=[];
  180 + var book_html="";
  181 + var book_id=$(".book_box ul").children("li").eq(k).attr("data-id");
  182 +
  183 + if(textBook(book_id).length>0){
  184 +
  185 + books=textBook($(".book_box ul li").eq(k).attr("data-id"));
  186 + $(".book_box ul li").eq(k).append('<div class="float_box"><ul><div class="clearfix"></div></ul></div>');
  187 +
  188 + for(var j=0;j<books.length;j++){
  189 + console.log("j:"+j);
  190 + book_html += '<li data-id='+books[j].id+'>'+books[j].name+'</li>';
  191 + }
  192 + $(".float_box").eq(k).children("ul").find(".clearfix").before(book_html);
  193 + TEXTBOOK_ID=books[0].id;
  194 + }
  195 +
  196 + }
  197 + getChapter(TEXTBOOK_ID);
  198 + $("#book_name").text($(".name").eq(0).text()+"/"+$(".float_box").eq(0).find('li').eq(0).text());
  199 + }
  200 +
  201 + }
  202 + })
  203 +
  204 + }
  205 + function textBook(id){ //获取教材
  206 + var textBookName=[];
  207 + $.ajax({
  208 + url:url+"/SunvoteEducation/api/v1/textbook",
  209 + async:false,
  210 + type:"post",
  211 + data:{teaching_material_id:id,subject_id:subject_id,grade_id:""},
  212 + success:function(data){
  213 + if(data.data.length>0){
  214 + for(var i=0;i<data.data.length;i++){
  215 + textBookName[i]={"name":data.data[i].NAME,"id":data.data[i].ID};
  216 + }
  217 + }
  218 + }
  219 + })
  220 + return textBookName;
  221 + }
  222 + function getClassName(){ //获取中文班级名
  223 + $.ajax({
  224 + url:url+"/SunvoteEducation/api/v1/classname",
  225 + async:false,
  226 + type:"post",
  227 + data:{id:class_id},
  228 + success:function(data){
  229 + $(".classList li").html(data.data);
  230 + }
  231 + })
  232 + }
  233 + function star(index,num){ //难度星级
  234 + $(".star").eq(index).append('<ul></ul>');
  235 + var li_html="";
  236 + for(var i=1;i<=num;i++){
  237 + li_html +='<li class="on"></li>';
  238 + }
  239 + for(var j=num;j<5;j++){
  240 + li_html += '<li class="off"></li>';
  241 + }
  242 +
  243 + $(".star").eq(index).find("ul").html(li_html);
  244 + }
  245 +
  246 + $(".section").on("click",".add",function(event){ //展开菜单
  247 + event.stopPropagation();
  248 + var that=$(this).closest("li");
  249 + if($(".tab .active").attr("data-index")==1){
  250 + if(that.attr("data-img-click")==0){
  251 + getMenu(that.attr("data-id"),that);
  252 + }
  253 + that.attr("data-img-click",1);
  254 + }else{
  255 + that.attr("data-img-click",1);
  256 + }
  257 +
  258 + if(that.children('ul').length>0)
  259 + that.children('ul').slideToggle(function(){
  260 + if(that.children('ul').css("display")=="block")
  261 + that.children('img').attr("src","../static/images/reduce.png");
  262 + else
  263 + that.children('img').attr("src","../static/images/add.png");
  264 + });
  265 + });
  266 + $(".section").on("click","span",function(event){ //点击菜单获取题目
  267 + window.top.loading.show();
  268 + event.stopPropagation();
  269 + pageNum=1;
  270 + $(".question_box ul").html("");
  271 + var that=$(this).closest("li");
  272 + if($(".tab .active").attr("data-index")==1){
  273 + getQuestion(that);
  274 + $(".menu_active").removeClass();
  275 + that.addClass("menu_active");
  276 + }else{
  277 + getQuestion(that);
  278 + $(".menu_active").removeClass();
  279 + that.addClass("menu_active");
  280 + }
  281 +
  282 + });
  283 + $(".book_box").children("ul").on("mouseover","li",function(event){ //教材版本交互
  284 + event.stopPropagation();
  285 + $(this).children(".float_box").css("display","block");
  286 + });
  287 + $(".book_box").children("ul").on("mouseleave","li",function(event){ //教材版本交互
  288 + event.stopPropagation();
  289 + $(this).children(".float_box").css("display","none");
  290 + });
  291 + $(".float_box").on("mouseleave",function(event){ //教材版本交互
  292 + event.stopPropagation();
  293 + $(this).css("display","none");
  294 + });
  295 + $(document).on("click",".float_box li",function(event){ //教材版本交互
  296 + event.stopPropagation();
  297 + var id=$(this).attr("data-id");
  298 + $("#book_name").text($(this).closest(".li_name").children(".name").text()+"/"+$(this).text());
  299 + $(".float_box").css("display","none");
  300 + $(".book_box").slideToggle();
  301 + getChapter(id);
  302 + });
  303 + $(".book").click(function(){ //教材版本下拉框交互
  304 + $(".book_box").slideToggle();
  305 + })
  306 + $(document).on("click",".check_box",function(){ //选中题目
  307 +
  308 + if($(this).hasClass("checked")){
  309 + var id=$(this).closest("li").attr("data-id");
  310 + var que_index=question_box.indexOf(id);
  311 + $(this).removeClass("checked");
  312 + question_box.splice(que_index,1);
  313 + question_num--;
  314 + }else{
  315 + question_box[question_num]=$(this).closest("li").attr("data-id");
  316 + question_num++;
  317 + $(this).addClass("checked");
  318 + }
  319 + $("#all_que_num").html(question_num);
  320 + });
  321 + $(".clear_que").click(function(){ //清空
  322 + question_num=0;
  323 + question_box=[];
  324 + $(".checked").removeClass("checked");
  325 + $("#all_que_num").html(question_num);
  326 + });
  327 + $(".tab li").click(function(){ //教材与知识点选择
  328 + window.top.loading.show();
  329 + pageNum=1;
  330 + $(this).siblings().removeClass("active");
  331 + $(this).addClass("active");
  332 + if($(this).index()==0){
  333 + getTeachingMaterial();
  334 + $(".choose_book").css("display","block");
  335 + //getChapter(TEXTBOOK_ID);
  336 + }else{
  337 + $(".choose_book").css("display","none");
  338 + getPoint();
  339 + }
  340 + });
  341 + $(".topic").click(function(){
  342 + if(parseInt($("#all_que_num").text())>0)
  343 + $('#myModal').modal('show');
  344 + else
  345 + alert("请先选择题目")
  346 + });
  347 + $(".view_more").click(function(){ //加载更多
  348 + flag++;
  349 + if(end>0){
  350 + $(".view_more p").html("没有更多了");
  351 + return;
  352 + }
  353 + if(flag==1){
  354 + window.top.loading.show();
  355 + pageNum++;
  356 + getQuestion($(".menu_active"));
  357 + }
  358 + })
  359 + $("#submit").click(function(){
  360 + var question_arry=[];
  361 + for(var i=0;i<question_num;i++){
  362 + question_arry[i]={
  363 + score: "0",
  364 + part_score: "0",
  365 + question_id: question_box[i],
  366 + rank: i.toString(),
  367 + no_name: i.toString()
  368 + };
  369 +
  370 + }
  371 + var data={
  372 + title: $("#title").val(),
  373 + exam_time: $("#time").val(),
  374 + paper_type: "101",
  375 + subject_id: subject_id,
  376 + grade_id: "",
  377 + class_id: class_id,
  378 + user_id: user_id,
  379 + score: "100",
  380 + questions: question_arry
  381 + };
  382 + sessionStorage.setItem("data",JSON.stringify(data));
  383 + location.href="paper_view.do?classID="+class_id+"&userid="+user_id;
  384 +
  385 + })
0 386 \ No newline at end of file
... ...
WebRoot/static/js/teach_paper.js 0 → 100644
  1 + var url="";
  2 + var class_html="",
  3 + option_html="";
  4 + var user_id= "",
  5 + subject_id="",
  6 + class_id="";
  7 + $(document).ready(function(){
  8 + getList();
  9 + timeList();
  10 + $.ajax({
  11 + url:url+"/SunvoteEducation/teacher/info",
  12 + async:false,
  13 + type:"post",
  14 + success:function(data){
  15 + console.log(data);
  16 + subject_id=data.data.subjectList[0].SUBJECT_ID;
  17 + user_id=data.data.ID;
  18 +
  19 + if(data.data.classInfoList.length>0){
  20 + for(var i=0;i<data.data.classInfoList.length;i++){
  21 + class_html += '<li data-classId="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</li>';
  22 + option_html += '<option value="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</option>'
  23 + }
  24 + $(".classList").html(class_html+'<div class="clearfix"></div>');
  25 + $(".classList li").eq(0).addClass("active");
  26 + $("#dealer_id_2").html(option_html);
  27 + }
  28 + }
  29 + })
  30 +
  31 + //日期框
  32 + $('.date-picker').datepicker({
  33 + autoclose: true,
  34 + todayHighlight: true
  35 + });
  36 + window.top.loading.remove();
  37 + })
  38 +
  39 + function getList(start_date,end_date,class_id){ //获取试卷列表
  40 + var tab_html="";
  41 + $.ajax({
  42 + url:url+"/SunvoteEducation/api/v1/paper",
  43 + async:false,
  44 + type:"post",
  45 + data:{
  46 + paper_type:"101",
  47 + user_id:user_id,
  48 + subject_id:subject_id,
  49 + class_id:class_id,
  50 + currentpage:"1",
  51 + showcount:"",
  52 + start_date:start_date,
  53 + end_date:end_date
  54 + },
  55 + success:function(data){
  56 + console.log(data);
  57 + for(var i=0;i<data.data.length;i++){
  58 + tab_html += '<tr data-id="'+data.data[i].PAPER_ID+'" data-classid="'+data.data[i].CLASS_ID+'"><td><input type="checkbox" name="ids" id="ids" value="'+data.data[i].PAPER_ID+'"/>'+(i+1)+'</td><td>'+data.data[i].TITLE+'</td><td>'+getClassName(data.data[i].CLASS_ID)+'</td><td>'+getSubjectName(data.data[i].SUBJECT_ID)+'</td><td>'+data.data[i].EXAM_TIME+'分钟</td><td>'+data.data[i].CREATE_DATE+'</td><td><a onclick="jump($(this))">查看</a></td><td><a href="#" onclick="del($(this));"><img src="../static/images/remove.png" /></a></td></tr>';
  59 + }
  60 + $("#tab_body").html(tab_html);
  61 + window.top.loading.remove();
  62 + }
  63 + });
  64 + }
  65 + $('#ids').on('click', function(){
  66 + var th_checked = $("#ids").prop('checked');//checkbox inside "TH" table header
  67 +
  68 + $(".table_box .table").find('tbody > tr').each(function(){
  69 + var row = this;
  70 + if(th_checked) $(row).find('input[type=checkbox]').eq(0).prop('checked', true);
  71 + else $(row).find('input[type=checkbox]').eq(0).prop('checked', false);
  72 + });
  73 + });
  74 + function jump(obj){ //预览试卷
  75 + window.top.loading.show();
  76 + var id=obj.closest("tr").attr("data-id");
  77 + var classid=obj.closest("tr").attr("data-classid");
  78 + location.href="paper_view2.do?PAPER_ID="+id+"&classID="+classid+"&userid="+user_id;
  79 + }
  80 + $(".classList").on("click","li",function(){
  81 + $(this).siblings().removeClass("active");
  82 + $(this).addClass("active");
  83 +
  84 + });
  85 + $("#creatPaper").click(function(){ //新建试卷
  86 + $('#myModal').modal('show');
  87 + });
  88 + function setQUestion(){ //新建试卷-选择班级
  89 + if($(".classList .active").length>0){
  90 + class_id=$(".classList .active").attr("data-classid");
  91 + location.href="set_question.do?subject_id="+subject_id+"&class_id="+class_id+"&user_id="+user_id;
  92 + }else{
  93 + alert("请先选择班级");
  94 + }
  95 + window.top.loading.show();
  96 + console.log($(".classList .active").length);
  97 + //location.href="";
  98 + }
  99 + function getSubjectName(id){ //获取科目中文名
  100 + var subjectName="";
  101 + $.ajax({
  102 + url:url+"/SunvoteEducation/api/v1/subjectcname",
  103 + async:false,
  104 + type:"post",
  105 + data:{id:id},
  106 + success:function(data){
  107 + subjectName=data.data;
  108 + }
  109 + })
  110 + return subjectName;
  111 + }
  112 + function getClassName(id){ //获取班级中文名
  113 + var className="";
  114 + $.ajax({
  115 + url:url+"/SunvoteEducation/api/v1/classname",
  116 + async:false,
  117 + type:"post",
  118 + data:{id:id},
  119 + success:function(data){
  120 + className=data.data;
  121 + }
  122 + })
  123 + return className;
  124 + }
  125 + function getday(month){ //获取日期
  126 + var time=[];
  127 + var d= new Date();
  128 + d.setMonth(month-1);
  129 + d.setDate(1);
  130 + var day=d.getDate();
  131 + var month=d.getMonth()+1;
  132 + if((d.getMonth()+1)<10){
  133 + var month="0"+(d.getMonth()+1);
  134 + }
  135 + var year=d.getFullYear();
  136 + var startTime=year+"-"+month+"-"+day;
  137 + d.setMonth(month);
  138 + var end_day=d.getDate();
  139 + var end_month=d.getMonth()+1;
  140 + if((d.getMonth()+1)<10){
  141 + var end_month="0"+(d.getMonth()+1);
  142 + }
  143 + var end_year=d.getFullYear();
  144 + var endTime=end_year+"-"+end_month+"-"+end_day;
  145 + time[0]=startTime;
  146 + time[1]=endTime;
  147 + return time;
  148 + }
  149 + function timeList(){ //渲染时间列表
  150 + var time = new Date();
  151 + var now_month=time.getMonth()+1;
  152 + time.setMonth(now_month-1)
  153 + if(time.getMonth()!= 0 ){
  154 + var preceding_month = time.getMonth();
  155 + }else
  156 + var preceding_month = 12;
  157 + time.setMonth(now_month-2)
  158 + if(time.getMonth()!= 0 ){
  159 + var last_month = time.getMonth();
  160 + }else
  161 + var last_month = 12;
  162 + var option_html="";
  163 + option_html += '<option value="'+now_month+'">'+now_month+'月</option><option value="'+preceding_month+'">'+preceding_month+'月</option><option value="'+last_month+'">'+last_month+'月</option>';
  164 + $("#dealer_id_1").html(option_html);
  165 + }
  166 + function tosearch(){ //搜索
  167 + //var timeBox=getday($("#dealer_id_1").val());
  168 + var start_date=$("#lastStart").val();
  169 + var end_date=$("#lastEnd").val();
  170 + var class_id=$("#dealer_id_2").val();
  171 + getList(start_date,end_date,class_id);
  172 + }
  173 +
  174 + function del(obj){ //删除
  175 + //var remove = new remove();
  176 + var id=obj.closest("tr").attr("data-id");
  177 + window.top.remove.init({"title":"删除","func":function(success){
  178 + if(success){
  179 + var url = "/SunvoteEducation/paper/delete.do?PAPER_ID="+id+"&tm="+new Date().getTime();
  180 + window.top.loading.show();
  181 + $.get(url,function(data){
  182 + tosearch();
  183 + });
  184 + }
  185 + else{
  186 + console.log("false");
  187 + }
  188 + }});
  189 + window.top.remove.show();
  190 + }
  191 + function deleteAll(){ //批量删除
  192 + window.top.remove.init({"title":"删除","func":function(success){
  193 + if(success){
  194 + var str = '';
  195 + for(var i=0;i < document.getElementsByName('ids').length;i++){
  196 + if(document.getElementsByName('ids')[i].checked){
  197 + if(str=='') str += document.getElementsByName('ids')[i].value;
  198 + else str += ',' + document.getElementsByName('ids')[i].value;
  199 + }
  200 + }
  201 + if(str==''){
  202 +
  203 + }else{
  204 + $.ajax({
  205 + type: "POST",
  206 + url: '/SunvoteEducation/paper/deleteAll.do?tm='+new Date().getTime(),
  207 + data: {DATA_IDS:str},
  208 + dataType:'json',
  209 + //beforeSend: validateData,
  210 + cache: false,
  211 + success: function(data){
  212 + $.each(data.list, function(i, list){
  213 + tosearch();
  214 + });
  215 + }
  216 + });
  217 + }
  218 + }
  219 + else{
  220 + console.log("false");
  221 + }
  222 + }});
  223 + window.top.remove.show();
  224 + }
0 225 \ No newline at end of file
... ...
WebRoot/static/js/test_list.js 0 → 100644
  1 +var url="";
  2 +
  3 + var option_html="";
  4 + var user_id= "8dbef15bb6d043ec94b719ede583b033",
  5 + subject_id="";
  6 +
  7 + function getQueryString(name) {
  8 + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  9 + var r = window.location.search.substr(1).match(reg);
  10 + if (r != null) return unescape(r[2]); return null;
  11 + }
  12 + var class_id=getQueryString("classid");
  13 + $(document).ready(function(){
  14 + getList();
  15 + $.ajax({
  16 + url:url+"/SunvoteEducation/teacher/info",
  17 + async:false,
  18 + type:"post",
  19 + success:function(data){
  20 + subject_id=data.data.subjectList[0].SUBJECT_ID;
  21 + user_id=data.data.ID;
  22 + if(data.data.classInfoList.length>0){
  23 + for(var i=0;i<data.data.classInfoList.length;i++){
  24 + option_html += '<option value="'+data.data.classInfoList[i].CLASS_ID+'">'+data.data.classInfoList[i].CLASS_NAME+'</option>'
  25 + }
  26 + $("#dealer_id_2").html(option_html);
  27 + }
  28 + }
  29 + })
  30 + //日期框
  31 + $('.date-picker').datepicker({
  32 + autoclose: true,
  33 + todayHighlight: true
  34 + });
  35 + window.top.loading.remove();
  36 + })
  37 + function getList(start_date,end_date,class_id){ //获取测验列表
  38 + var tab_html="";
  39 + $.ajax({
  40 + url:url+"/SunvoteEducation/api/v1/testpaper",
  41 + async:false,
  42 + type:"post",
  43 + data:{
  44 + paper_type:"101",
  45 + user_id:user_id,
  46 + subject_id:subject_id,
  47 + class_id:class_id,
  48 + currentpage:"1",
  49 + showcount:"",
  50 + start_date:start_date,
  51 + end_date:end_date
  52 + },
  53 + success:function(data){
  54 + console.log(data);
  55 + for(var i=0;i<data.data.length;i++){
  56 + tab_html += '<tr><td>'+(i+1)+'</td><td>'+data.data[i].createDate+'</td><td>'+getClassName(data.data[i].classId)+'</td><td>'+data.data[i].name+'</td><td><a onclick="window.top.loading.show();jump($(this));" data-id="'+data.data[i].testpaperId+'" >查看</a></td></tr>'
  57 + }
  58 + $("#tab_body").html(tab_html);
  59 + }
  60 + });
  61 + }
  62 + function jump(obj){ //预览测验详情
  63 + var id=obj.attr("data-id");
  64 + location.href="paper_view1.do?testpaperId="+id;
  65 + }
  66 + function getSubjectName(id){ //获取科目中文名
  67 + var subjectName="";
  68 + $.ajax({
  69 + url:url+"/SunvoteEducation/api/v1/subjectcname",
  70 + async:false,
  71 + type:"post",
  72 + data:{id:id},
  73 + success:function(data){
  74 + subjectName=data.data;
  75 + }
  76 + })
  77 + return subjectName;
  78 + }
  79 + function getClassName(id){ //获取班级中文名
  80 + var className="";
  81 + $.ajax({
  82 + url:url+"/SunvoteEducation/api/v1/classname",
  83 + async:false,
  84 + type:"post",
  85 + data:{id:id},
  86 + success:function(data){
  87 + className=data.data;
  88 + }
  89 + })
  90 + return className;
  91 + }
  92 + function tosearch(){ //搜索
  93 + var start_date=$("#lastStart").val();
  94 + var end_date=$("#lastEnd").val();
  95 + var class_id=$("#dealer_id_2").val();
  96 + getList(start_date,end_date,class_id);
  97 + }
0 98 \ No newline at end of file
... ...
resources/mybatis1/sunvote/TestPaperMapper.xml
... ... @@ -143,10 +143,10 @@
143 143 <if test="NAME != null and NAME != ''"><!-- 关键词检索 -->
144 144 and (NAME = #{NAME})
145 145 </if>
146   - <if test="TEST_TYPE != null and TEST_TYPE == '1'"><!-- 关键词检索 -->
  146 + <if test="TEST_TYPE != null and TEST_TYPE == '1'.toString()"><!-- 关键词检索 -->
147 147 and (TEST_TYPE = #{TEST_TYPE} or TEST_TYPE IS NULL)
148 148 </if>
149   - <if test="TEST_TYPE != null and TEST_TYPE == '101'"><!-- 关键词检索 -->
  149 + <if test="TEST_TYPE != null and TEST_TYPE == '101'.toString()"><!-- 关键词检索 -->
150 150 and (TEST_TYPE = #{TEST_TYPE})
151 151 </if>
152 152 <if test="START_DATE != null and START_DATE != ''"><!-- 关键词检索 -->
... ...
src/com/fh/controller/api/V1.java
... ... @@ -496,7 +496,7 @@ public class V1 extends BaseController {
496 496 int currentPage = Integer.parseInt(CURRENTPAGE);
497 497 int showcount = Integer.parseInt(SHOWCOUNT);
498 498 currentPage = (currentPage > 0 ? currentPage -1 : 0) * showcount;
499   - pd.put("CURRENTPAGE", currentPage);
  499 + pd.put("CURRENTPAGE", "" + currentPage);
500 500 }
501 501 List<PageData> pageList = paperService.listAllByType(pd);
502 502 res.setData(pageList);
... ...
src/com/fh/controller/sunvote/report/ReportController.java
... ... @@ -60,6 +60,7 @@ public class ReportController extends BaseController {
60 60 pd.put("CLASS_ID", pd.get("CLASSID"));
61 61 List<PageData> studentList = studentService.listAllClass(pd);
62 62 // 2查询班级考试
  63 + pd.put("TEST_TYPE", "1");
63 64 List<PageData> testpaperList = testpaperService.listAll(pd);
64 65 mv.addObject("testpaperList", testpaperList);
65 66 info.put("testsize", testpaperList != null ? testpaperList.size() : 0);
... ...