Commit 78353cf9a21c8c7cc61545144bea9a03dc8eaad4

Authored by jack
1 parent 8791e5b3

1.增加老师端可以看到年级卷

2.考试情况中显示出班级所有学生
3.年级分析报表中增加班级筛选
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list2.jsp
... ... @@ -33,8 +33,7 @@
33 33 <![endif]-->
34 34 </head>
35 35 <body>
36   -
37   - <form action="../paper/list2.do" method="post" name="Form" id="Form">
  36 + <form action="../paper/list2.do?SCHOOL_ID=${pd.SCHOOL_ID }" method="post" name="Form" id="Form">
38 37 <div class="head_box">
39 38 <div class="box_header">
40 39 <div class="head_box_l">
... ... @@ -58,9 +57,7 @@
58 57 <col style="width: 10%" />
59 58 <col style="width: 10%" />
60 59 <col style="width: 10%" />
61   - <col style="width: 10%" />
62   - <col style="width: 10%" />
63   - <col style="width: 10%" />
  60 + <col style="width: 17%" />
64 61 <thead>
65 62 <tr>
66 63 <th><input type="checkbox" name='ids' id="ids" />序号</th>
... ... @@ -84,23 +81,24 @@
84 81 <col style="width: 10%" />
85 82 <col style="width: 10%" />
86 83 <col style="width: 10%" />
87   - <col style="width: 10%" />
88   - <col style="width: 10%" />
89   - <col style="width: 10%" />
  84 + <col style="width: 17%" />
90 85 <tbody>
91 86 <c:choose>
92 87 <c:when test="${not empty varList}">
93 88 <c:forEach items="${varList}" var="var" varStatus="vs">
94 89 <tr>
95 90 <td><input type="checkbox" name='ids' id="ids" value="${var.PAPER_ID}"/>${vs.index+1}</td>
96   - <td ><a target="_blank" href="<%=basePath%>paper/iteminfo.do?paper_id=${var.PAPER_ID}">${var.TITLE}</a></td>
  91 + <td ><a target="_blank" style="display: inline-block;width: 100px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap" href="<%=basePath%>paper/iteminfo.do?paper_id=${var.PAPER_ID}" title="${var.TITLE}">${var.TITLE}</a></td>
97 92 <td >${var.CREATE_DATE}</td>
98 93 <td >${var.EXAM_TIME}</td>
99 94 <td >${var.TEST_NUM}</td>
100 95 <td >${var.SCORE}</td>
101 96 <td>
102 97 <a <c:if test="${var.TEST_NUM == 0}" >disabled style="pointer-events:none;color:#ccc" </c:if> href="<%=basePath%>paper/paperRep.do?paper_id=${var.PAPER_ID}">查看成绩</a>
103   - <a href="#" onclick="del('${var.PAPER_ID}');"><img src="../static/images/remove.png" /></a>
  98 + <c:if test="${var.PAPER_TYPE ==2 }">
  99 + <a <c:if test="${var.TEST_NUM == 0}" >disabled style="pointer-events:none;color:#ccc" </c:if> href="<%=basePath%>paper/paperRep3.do?MB1=${pd.MB1 }&PAPER_ID=${var.PAPER_ID}">年级分析</a>
  100 + </c:if>
  101 + <a href="#" onclick="del('${var.PAPER_ID}');" style="float:right"><img src="../static/images/remove.png" /></a>
104 102 </td>
105 103 </tr>
106 104  
... ...
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list5.jsp
... ... @@ -108,7 +108,7 @@
108 108 <td >${var.SCORE}</td>
109 109 <td>
110 110 <a <c:if test="${var.TEST_NUM == 0}" >disabled style="pointer-events:none;color:#ccc" </c:if> href="<%=basePath%>paper/paperRep.do?MB1=nj&paper_id=${var.PAPER_ID}">查看成绩</a>
111   - <a href="<%=basePath%>paper/paperRep3.do?MB1=${pd.MB1 }&PAPER_ID=${var.PAPER_ID}">年级分析</a>
  111 + <a <c:if test="${var.TEST_NUM == 0}" >disabled style="pointer-events:none;color:#ccc" </c:if> href="<%=basePath%>paper/paperRep3.do?MB1=${pd.MB1 }&PAPER_ID=${var.PAPER_ID}">年级分析</a>
112 112 <a href="#" onclick="del('${var.PAPER_ID}');"><img src="../static/images/remove.png" /></a>
113 113 </td>
114 114 </tr>
... ...
WebRoot/WEB-INF/jsp/sunvote/paper/test_list3.jsp
... ... @@ -37,7 +37,7 @@
37 37 </head>
38 38 <body>
39 39  
40   - <form action="../paper/list4.do" method="post" name="Form" id="Form">
  40 + <form action="../paper/paperRep3.do" method="post" name="Form" id="Form">
41 41 <div class="head_box">
42 42 <div class="box_header">
43 43 <div class="head_box_l">
... ... @@ -57,13 +57,24 @@
57 57 </div>
58 58 <div class="table_box" style="padding:0 5%;background:#fff;">
59 59 <div style="padding:15px 0;background:#fff;" class="paper_title">
60   -
  60 + <input type="hidden" name="PAPER_ID" id="PAPER_ID" valu="${pd.PAPER_ID }" />
61 61 ${pd.MB1=="nj"?"年级卷":"个人卷"} > 班级对比 > 答题分析
62 62 <br/>
63 63 <br/>
64 64 <br/>
65 65 &nbsp;
66   - <b>试卷名称:</b>${pd.PAPER_NAME}
  66 + <b>试卷名称:</b>${pd.PAPER_NAME}
  67 + <div style="float:right">
  68 + <b>班级名称:</b>
  69 + <select class="chosen-select form-control" style="width:120px; display:inline-block" name="CLASS_ID" id="CLASS_ID" data-placeholder="选择班级">
  70 + <option value="">全部</option>
  71 + <c:forEach var="item" items="${sclass}">
  72 + <option value="${item.CLASS_ID}" <c:if test="${pd.CLASS_ID==item.CLASS_ID}">selected="true"</c:if>>${item.CLASS_NAME}</option>
  73 + </c:forEach>
  74 + </select>
  75 + <a href="#" onclick="tosearch();"><img
  76 + src="../static/images/search.png" /></a>
  77 + </div>
67 78 <br>
68 79 <br>&nbsp;
69 80 <b>试卷总分:</b>${pd.SCORE}
... ... @@ -161,14 +172,15 @@
161 172 removeOriginal: true
162 173 };
163 174  
164   - $("#simple-table").tablescroller(options);
  175 + //$("#simple-table").tablescroller(options);
165 176 });
166 177  
167 178  
168 179  
169 180 function tosearch(){
170 181 window.top.loading.remove();
171   - $("#Form").submit();
  182 + location.href="<%=basePath%>paper/paperRep3.do?PAPER_ID=${pd.PAPER_ID}&CLASS_ID="+$("#CLASS_ID option:selected").val();
  183 + //$("#Form").submit();
172 184 }
173 185  
174 186 $('#ids').on('click', function(){
... ... @@ -243,7 +255,7 @@
243 255 window.top.remove.show();
244 256 }
245 257 function export3(){
246   - window.open("<%=basePath%>paper/export3?PAPER_ID=${pd.PAPER_ID}","_blank");
  258 + window.open('<%=basePath%>paper/export3?PAPER_ID=${pd.PAPER_ID}&CLASS_ID='+$("#CLASS_ID option:selected").val(),"_blank");
247 259 }
248 260  
249 261 </script>
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp
... ... @@ -269,7 +269,7 @@
269 269 });
270 270  
271 271 $("#qingsongkao_paper").click(function() {
272   - var path = "../paper/list2.do?";
  272 + var path = "../paper/list2.do?SCHOOL_ID=${pd.TEACHER.SCHOOL_ID}";
273 273 //$(".content_r").html('<iframe name="mainFrame" id="mainFrame" frameborder="0" style="width:100%;height:'+$(".content_l").height()+'px;" src=' + path + '></iframe>');
274 274 if ($("#mainFrame").attr('src') != (path)) {
275 275 $("#mainFrame").attr('src', path);
... ... @@ -285,7 +285,7 @@
285 285 //}
286 286 });
287 287  
288   - var defaultUrl = '${pd.DEFAULTURL}';
  288 + var defaultUrl = '${pd.DEFAULTURL}?SCHOOL_ID=${pd.TEACHER.SCHOOL_ID}';
289 289 if (defaultUrl != '' && defaultUrl != '') {
290 290 $("#mainFrame").attr('src', defaultUrl);
291 291 }
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_report_1.jsp
... ... @@ -126,13 +126,29 @@
126 126 ${var.NAME}
127 127 </div>
128 128 </td>
129   - <td class="center"><div style="width:150px;"><fmt:formatNumber type="number"
  129 + <td class="center"><div style="width:150px;">
  130 + <c:if test="${not empty var.GETSCORE}">
  131 + <fmt:formatNumber type="number"
130 132 value="${var.TOTALSCORE == 0 ? 0: (var.GETSCORE / var.TOTALSCORE * 100)}"
131   - maxFractionDigits="2" />%</div></td>
132   - <td class="center"><div style="width:80px;margin:0 auto;">${var.GETSCORE }</div></td>
  133 + maxFractionDigits="2" />%
  134 + </c:if>
  135 + <c:if test="${empty var.GETSCORE }">--</c:if>
  136 + </div></td>
  137 + <td class="center"><div style="width:80px;margin:0 auto;">
  138 + <c:if test="${not empty var.GETSCORE}">
  139 + ${var.GETSCORE }
  140 + </c:if>
  141 + <c:if test="${empty var.GETSCORE}">
  142 + --
  143 + </c:if>
  144 + </div></td>
133 145 <c:forEach items="${testpaperList}" var="var1" varStatus="vs1">
134 146 <td class="center"><div style="width:180px;margin:0 auto;"><c:set var="TEST_ID"
135   - value="${var1.TESTPAPER_ID}" /> ${var[TEST_ID] }</div></td>
  147 + value="${var1.TESTPAPER_ID}" />
  148 +
  149 + ${empty var[TEST_ID]?"--":var[TEST_ID]}
  150 +
  151 + </div></td>
136 152 </c:forEach>
137 153 </tr>
138 154 </c:forEach>
... ...
WebRoot/static/js/control_template.js
... ... @@ -202,8 +202,11 @@ $(function() {
202 202 score: $(".section").eq(i).attr("data-fraction")
203 203 };
204 204 }
  205 + self.location.href = URL + JSON.stringify(content) + "&page_score=" + total_score;
  206 + }
  207 + else{
  208 + alert("模板内容不能为空");
205 209 }
206   - self.location.href = URL + JSON.stringify(content) + "&page_score=" + total_score;
207 210 });
208 211  
209 212 /* ajax封装函数 */
... ...
resources/mybatis1/sunvote/PaperMapper.xml
... ... @@ -249,6 +249,29 @@
249 249 </choose>
250 250 </select>
251 251  
  252 + <!-- 查找指定老师卷和年级卷 -->
  253 + <select id="listAllBySidAndTid" parameterType="pd" resultType="pd">
  254 + select
  255 + <include refid="Field"></include>
  256 + from
  257 + <include refid="tableName"></include>
  258 + where 1 = 1
  259 + AND
  260 + (SCHOOL_ID = #{SCHOOL_ID} AND PAPER_TYPE = '2') OR
  261 + (USER_ID = #{USER_ID} AND PAPER_TYPE = #{PAPER_TYPE})
  262 +
  263 + order by CREATE_DATE DESC
  264 +
  265 + <choose>
  266 + <when test="CURRENTPAGE != null and CURRENTPAGE != '' and SHOWCOUNT != null and SHOWCOUNT != ''">
  267 + limit ${CURRENTPAGE}, ${SHOWCOUNT}
  268 + </when>
  269 + <otherwise>
  270 + limit 0,30
  271 + </otherwise>
  272 + </choose>
  273 + </select>
  274 +
252 275 <!-- 批量删除 -->
253 276 <delete id="deleteAll" parameterType="String">
254 277 delete from
... ...
resources/mybatis1/sunvote/StudentTestMapper.xml
... ... @@ -108,6 +108,9 @@
108 108 LEFT JOIN sv_student on sv_studenttest.STUDENT_ID = sv_student.ID
109 109 where
110 110 sv_studenttest.PAPER_ID = #{PAPER_ID}
  111 + <if test="CLASS_ID != null and CLASS_ID != ''">
  112 + and sv_studenttest.CLASS_ID=#{CLASS_ID}
  113 + </if>
111 114 </select>
112 115  
113 116 <!-- 列表 -->
... ...
src/com/fh/controller/sunvote/paper/PaperController.java
... ... @@ -734,7 +734,9 @@ public class PaperController extends BaseController {
734 734 public ModelAndView paperRep3() throws Exception {
735 735 ModelAndView mv = this.getModelAndView();
736 736 PageData pd = new PageData();
  737 + pd=this.getPageData();
737 738 List<PageData> temp = new ArrayList<PageData>();
  739 + List<PageData> sclass_list = new ArrayList<PageData>();
738 740 PageData saveData = new PageData();
739 741  
740 742 ResponseGson<PageData> res = new ResponseGson();
... ... @@ -750,9 +752,13 @@ public class PaperController extends BaseController {
750 752 List<String> sid = new ArrayList<String>();
751 753 Integer test_num = 0;
752 754 Integer lost_num = 0;
  755 + List<String> classId = new ArrayList();
  756 + PageData sclass = new PageData();
753 757 for (PageData item : list) {
754 758  
755 759 PageData p = new PageData();
  760 +
  761 +
756 762 p.put("ID", item.getString("STUDENT_ID"));
757 763 PageData student = stundentService.findById(p);
758 764 if (student != null) {
... ... @@ -793,6 +799,13 @@ public class PaperController extends BaseController {
793 799 PageData stu = new PageData();
794 800 stu.put("STUDENT_NAME", item.get("STUDENT_NAME"));
795 801 stu.put("CLASS_NAME", item.get("CLASS_NAME"));
  802 + if(!classId.contains(item.getString("CLASS_ID"))){
  803 + classId.add(item.getString("CLASS_ID"));
  804 + sclass.put("CLASS_ID", item.get("CLASS_ID"));
  805 + sclass.put("CLASS_NAME", item.get("CLASS_NAME"));
  806 + sclass_list.add(sclass);
  807 + }
  808 +
796 809 List<PageData> testList = new ArrayList<PageData>();
797 810 PageData test = new PageData();
798 811 test.put("CREATE_DATE", item.get("CREATE_DATE"));
... ... @@ -810,6 +823,7 @@ public class PaperController extends BaseController {
810 823 stu.put("LOST_NUM", lost_num);
811 824 sid.add(item.getString("STUDENT_ID"));
812 825 temp.add(stu);
  826 +
813 827 }
814 828 }
815 829 }
... ... @@ -829,7 +843,9 @@ public class PaperController extends BaseController {
829 843 }
830 844  
831 845 });
  846 +
832 847 mv.setViewName("sunvote/paper/test_list3");
  848 + mv.addObject("sclass", sclass_list);
833 849 mv.addObject("varList", temp);
834 850 mv.addObject("pd", pd);
835 851 res.setData(saveData);
... ... @@ -1171,7 +1187,7 @@ public class PaperController extends BaseController {
1171 1187 pd.put("USER_ID", userID);
1172 1188 pd.put("PAPER_TYPE", "1");
1173 1189 page.setPd(pd);
1174   - List<PageData> varList = paperService.list(page); // 列出Paper列表
  1190 + List<PageData> varList = paperService.listAllBySidAndTid(pd); // 列出Paper列表
1175 1191 page.setLangIsChina(isChineseLanguageClient());
1176 1192 if (isChineseLanguageClient()) {
1177 1193 mv.setViewName("sunvote/paper/paper_list2");
... ...
src/com/fh/controller/sunvote/report/ReportController.java
... ... @@ -90,6 +90,7 @@ public class ReportController extends BaseController {
90 90 List<PageData> reportData = v1Service.classReport(pd);
91 91 List<PageData> testpaperList = new ArrayList();
92 92 List<PageData> studentList = new ArrayList();
  93 + List<String> studentId = new ArrayList();
93 94 PageData studentPd = null;
94 95 double totalScore = 0 ;
95 96 double getScore = 0 ;
... ... @@ -128,6 +129,7 @@ public class ReportController extends BaseController {
128 129 studentPd.put("TOTALSCORE", totalScore);
129 130 studentPd.put("GETSCORE", getScore);
130 131 studentList.add(studentPd);
  132 + studentId.add(studentPd.getString("STUDENT_ID"));
131 133 totalScore = 0 ;
132 134 getScore = 0 ;
133 135 }
... ... @@ -173,6 +175,7 @@ public class ReportController extends BaseController {
173 175 studentPd.put("TOTALSCORE", totalScore);
174 176 studentPd.put("GETSCORE", getScore);
175 177 studentList.add(studentPd);
  178 + studentId.add(studentPd.getString("STUDENT_ID"));
176 179 totalScore = 0 ;
177 180 getScore = 0 ;
178 181 }
... ... @@ -190,7 +193,14 @@ public class ReportController extends BaseController {
190 193  
191 194 mv.addObject("testpaperList", testpaperList);
192 195 info.put("testsize", testpaperList != null ? testpaperList.size() : 0);
193   -
  196 + List<PageData> student_class = studentService.findByClassId(pd);
  197 + for(int x = 0;x<student_class.size();x++){
  198 + if(studentId.contains(student_class.get(x).getString("ID"))){
  199 + continue;
  200 + }else{
  201 + studentList.add(student_class.get(x));
  202 + }
  203 + }
194 204 mv.addObject("studentList", studentList);
195 205 info.put("STUDENT_NUM", studentList != null ? studentList.size() : 0);
196 206 mv.addObject("info", info);
... ...
src/com/fh/service/sunvote/paper/PaperManager.java
... ... @@ -39,6 +39,9 @@ public interface PaperManager{
39 39  
40 40 public List<PageData> listAllByType(PageData pd)throws Exception;
41 41  
  42 + public List<PageData> listAllBySidAndTid(PageData pd)throws Exception;
  43 +
  44 +
42 45 /**列表(全部)
43 46 * @param pd
44 47 * @throws Exception
... ...
src/com/fh/service/sunvote/paper/impl/PaperService.java
1 1 package com.fh.service.sunvote.paper.impl;
2 2  
3 3 import java.util.List;
  4 +
4 5 import javax.annotation.Resource;
  6 +
5 7 import org.springframework.stereotype.Service;
  8 +
6 9 import com.fh.dao.DaoSupport;
7 10 import com.fh.entity.Page;
8   -import com.fh.util.PageData;
9 11 import com.fh.service.sunvote.paper.PaperManager;
  12 +import com.fh.util.PageData;
10 13  
11 14 /**
12 15 * 说明: 试卷
... ... @@ -70,6 +73,17 @@ public class PaperService implements PaperManager{
70 73 return (List<PageData>)dao.findForList("PaperMapper.listAllByTypelistPage", pd);//.*listPage.*
71 74 }
72 75  
  76 +
  77 + /**列表(全部)
  78 + * @param pd
  79 + * @throws Exception
  80 + */
  81 + @SuppressWarnings("unchecked")
  82 + public List<PageData> listAllBySidAndTid(PageData pd)throws Exception{
  83 + return (List<PageData>)dao.findForList("PaperMapper.listAllBySidAndTid", pd);//.*listPage.*
  84 + }
  85 +
  86 +
73 87 /**列表(全部)
74 88 * @param pd
75 89 * @throws Exception
... ...