+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebRoot/WEB-INF/jsp/sunvote/paper/en_paper_list2.jsp b/WebRoot/WEB-INF/jsp/sunvote/paper/en_paper_list2.jsp
new file mode 100644
index 0000000..babb74d
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/paper/en_paper_list2.jsp
@@ -0,0 +1,223 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme() + "://"
+ + request.getServerName() + ":" + request.getServerPort() + path + "/";
+%>
+
+
+
+
+
+<%@ include file="../../system/index/foot2.jsp"%>
+
+
+
\ No newline at end of file
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/en_creat_question.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_creat_question.jsp
new file mode 100644
index 0000000..8c889d0
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_creat_question.jsp
@@ -0,0 +1,218 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme() + "://"
+ + request.getServerName() + ":" + request.getServerPort()
+ + path + "/";
+%>
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/en_paper_view.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_paper_view.jsp
new file mode 100644
index 0000000..2c2fd81
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_paper_view.jsp
@@ -0,0 +1,70 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/en_paper_view2.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_paper_view2.jsp
new file mode 100644
index 0000000..e2ffee2
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_paper_view2.jsp
@@ -0,0 +1,110 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/en_set_question.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_set_question.jsp
new file mode 100644
index 0000000..e4124e3
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_set_question.jsp
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/en_stduent_report.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_stduent_report.jsp
new file mode 100644
index 0000000..6d54abd
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_stduent_report.jsp
@@ -0,0 +1,156 @@
+
+
+
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme() + "://"
+ + request.getServerName() + ":" + request.getServerPort()
+ + path + "/";
+%>
+
+
+
+
+
+
+
+
+
+
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teach_paper.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teach_paper.jsp
new file mode 100644
index 0000000..a348f0f
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teach_paper.jsp
@@ -0,0 +1,151 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teacher_main.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teacher_main.jsp
new file mode 100644
index 0000000..c246c26
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teacher_main.jsp
@@ -0,0 +1,239 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme() + "://"
+ + request.getServerName() + ":" + request.getServerPort()
+ + path + "/";
+%>
+
+
+
+
+
+
+
+

+
+
+
Welcome!
+
${pd.TEACHER[0].TEACHER_NAME }
+
${pd.TEACHER[0].SCHOOL_NAME }
+
+
+
+
+ Class Management
+
+
+
+
+
+
+ Exam Analysis
+
+
+
+
+ <%-- --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teacher_report_1.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teacher_report_1.jsp
new file mode 100644
index 0000000..8667170
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teacher_report_1.jsp
@@ -0,0 +1,317 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme() + "://"
+ + request.getServerName() + ":" + request.getServerPort()
+ + path + "/";
+%>
+
+
+
+
+
+
+
${info.CLASS_NAME} Test Paper Score Report
+
+
+
+
+
+<%@ include file="../../system/index/top.jsp"%>
+
+
+
+
+
+
+
+
+ <%@ include file="../../system/index/foot.jsp"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teacher_report_test.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teacher_report_test.jsp
new file mode 100644
index 0000000..2375216
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_teacher_report_test.jsp
@@ -0,0 +1,226 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme() + "://"
+ + request.getServerName() + ":" + request.getServerPort()
+ + path + "/";
+%>
+
+
+
+
+
+
+
Test Paper Score Report
+
+
+
+
+
+<%@ include file="../../system/index/top.jsp"%>
+
+
+
+
+
+
+
+
+ <%@ include file="../../system/index/foot.jsp"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WebRoot/WEB-INF/jsp/sunvote/teacher/en_test_list.jsp b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_test_list.jsp
new file mode 100644
index 0000000..4799fd3
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/sunvote/teacher/en_test_list.jsp
@@ -0,0 +1,87 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+%>
+
+
+
+
+
+
+
SunVote Class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Serial No. |
+ Test Paper Title |
+ Class |
+ Create Time |
+ Operate |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebRoot/WEB-INF/jsp/system/index/en_login.jsp b/WebRoot/WEB-INF/jsp/system/index/en_login.jsp
new file mode 100644
index 0000000..d7abb92
--- /dev/null
+++ b/WebRoot/WEB-INF/jsp/system/index/en_login.jsp
@@ -0,0 +1,206 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%
+ String path = request.getContextPath();
+ String basePath = request.getScheme() + "://"
+ + request.getServerName() + ":" + request.getServerPort()
+ + path + "/";
+%>
+
+
+
+
+
+
+
SunVote-Education Management System
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebRoot/static/images/en_logo.png b/WebRoot/static/images/en_logo.png
new file mode 100644
index 0000000..36edd64
--- /dev/null
+++ b/WebRoot/static/images/en_logo.png
diff --git a/WebRoot/static/images/en_title.png b/WebRoot/static/images/en_title.png
new file mode 100644
index 0000000..b0e1c92
--- /dev/null
+++ b/WebRoot/static/images/en_title.png
diff --git a/WebRoot/static/js/en_control-604.js b/WebRoot/static/js/en_control-604.js
new file mode 100644
index 0000000..6d0eab2
--- /dev/null
+++ b/WebRoot/static/js/en_control-604.js
@@ -0,0 +1,684 @@
+var questionNUm = 0;
+/*数字转汉字数字*/
+var chnNumChar = [ "零", "一", "二", "三", "四", "五", "六", "七", "八", "九" ];
+var chnUnitSection = [ "", "万", "亿", "万亿", "亿亿" ];
+var chnUnitChar = [ "", "十", "百", "千" ];
+/* 快速创建答案列表 */
+var score = 0;
+var total_score = 0;
+var answerLen = 0;
+
+
+$(function() {
+
+
+ function creat(str_ans, a_num, fraction) {
+ // $(".section").remove();
+ answer_index_b = $(".section").length + 1;
+ /*
+ * $(".content").append('
')
+ */
+ var str = str_ans.split('');
+ console.log(str);
+ for (i = 0; i < str.length; i++) {
+ if (str[i] == " ") {
+ str.splice(i, 1);
+ i = i - 1;
+ }
+ }
+ q_num = str.length;
+ $(".content").append('
Total score of question number ' + answer_index_b+ '(single choice) :'
+ + q_num + ' X ' + fraction + ' = ' + (q_num * fraction)
+ + ' 分
');
+ for (var i = 0; i < q_num; i++) {
+ str_temp = str[i];
+ str_temp = str_temp.toUpperCase()
+ code = str_temp.charCodeAt();
+ on_index = code - 65;
+ questionNUm++;
+ if (code < (65 + a_num)) {
+ console.log(str_temp);
+ $(".section-" + answer_index_b + " .question_list").append(
+ '
');
+ for (var j = 0; j < a_num; j++) {
+ option = String.fromCharCode(0x41 + j);
+ if (on_index == j) {
+ console.log(on_index + "---" + j);
+ $(".question" + (questionNUm) + ' ul').append(
+ '
' + option
+ + '');
+ } else
+ $(".question" + (questionNUm) + ' ul').append(
+ '
' + option
+ + '');
+ }
+ } else {
+ alert("Wrong answer of Question " + (i + 1) + ":" + String.fromCharCode(code)
+ + ", exceed option number");
+ // return;
+ }
+ }
+ $(".section-" + answer_index_b).attr("data-score",
+ q_num * fraction);
+ total_score += q_num * fraction;
+ $("#score_all").text(total_score);
+ }
+
+ /***************************************************************************
+ * 1、单选题 2、完形填空 3、阅读理解 4、判断题 5、多选题
+ **************************************************************************/
+
+ function addQuestion(type, a_num, index_s_2, index_e_2, fraction2) {
+ console.log(type);
+ answer_index_b = $(".section").length + 1;
+ var question_num = SectionToChinese($(".section").length + 1);
+ switch (type) {
+ case 1: // 单选题
+ // alert(typeof(index_s_2));
+ $(".content")
+ .append(
+ '
');
+ for (i = index_s_2; i <= index_e_2; i++) {
+ $(".section-" + answer_index_b + " .question_list").append(
+ '
');
+ for (var j = 0; j < a_num; j++) {
+ option = String.fromCharCode(0x41 + j);
+ $(".section-" + answer_index_b + " .question" + i + ' ul')
+ .append(
+ '
' + option
+ + '');
+ }
+ }
+ break;
+ case 2: // 完形填空
+ $(".content")
+ .append(
+ '
');
+ for (var i = index_s_2; i <= index_e_2; i++) {
+ $(".section-" + answer_index_b + " .question_list").append(
+ '
');
+ for (var j = 0; j < a_num; j++) {
+ option = String.fromCharCode(0x41 + j);
+ $(".section-" + answer_index_b + " .question" + i + ' ul')
+ .append(
+ '
' + option
+ + '');
+ }
+ }
+ break;
+ case 3: // 阅读理解
+ $(".content")
+ .append(
+ '
');
+ for (var i = index_s_2; i <= index_e_2; i++) {
+ $(".section-" + answer_index_b + " .question_list").append(
+ '
');
+ for (var j = 0; j < a_num; j++) {
+ option = String.fromCharCode(0x41 + j);
+ $(".section-" + answer_index_b + " .question" + i + ' ul')
+ .append(
+ '
' + option
+ + '');
+ }
+ }
+ break;
+ case 4: // 判断题
+ $(".content")
+ .append(
+ '
');
+ for (var i = index_s_2; i <= index_e_2; i++) {
+ $(".section-" + answer_index_b + " .question_list").append(
+ '
');
+ for (var j = 0; j < a_num; j++) {
+ if (j % 2 == 0)
+ option = "√";
+ else
+ option = "×";
+ $(".section-" + answer_index_b + " .question" + i + ' ul')
+ .append(
+ '
' + option
+ + '');
+ }
+ }
+ break;
+ /*
+ * case 5: //多选题 $(".content").append('
');
+ * for(var i=index_s_2;i<=index_e_2;i++){
+ * $(".section-"+answer_index_b+" .question_list").append('
');
+ * for(var j=0;j
'+option+''); } }
+ */
+ case 5: // 多选题
+ // $(".content").html("");
+ $(".content")
+ .append(
+ ' Total score of question number '
+ + answer_index_b
+ + '(multiple choice): '
+ + (index_e_2 - index_s_2 + 1)
+ + ' X '
+ + fraction2
+ + ' = '
+ + ((index_e_2 - index_s_2 + 1) * fraction2)
+ + ' 分
');
+ for (var i = index_s_2; i <= index_e_2; i++) {
+ questionNUm++;
+ $(".section-" + answer_index_b + " .question_list").append(
+ '');
+ for (var j = 0; j < a_num; j++) {
+ option = String.fromCharCode(0x41 + j);
+ $(
+ ".section-" + answer_index_b + " .question"
+ + questionNUm + ' ul').append(
+ '' + option + '');
+ }
+ }
+ total_score += ((index_e_2 - index_s_2 + 1) * fraction2);
+ $("#score_all").text(total_score);
+ break;
+ }
+ // $(".section-"+answer_index_b).attr("data-score",$(".section-"+answer_index_b).find(".question").length*fraction2);
+ $(".section0").attr("data-score",
+ $(".section0").find(".question").length * fraction2);
+ }
+
+ $(document).on('click', '.remove', function() { // 删除按钮
+ $(this).parent().parent(".section").remove();
+ })
+
+ $("#fast_submit").click(function() { // 点击确定,创建答案列表
+ // $("#addQuestion").attr("disabled","disabled");
+ var answer = $("#answer").val();
+ var num_ans = $("#num_ans").val();
+ var fraction = $("#fraction").val();
+ if (answer == '') {
+ alert("Please input answer of question");
+ return;
+ } else if (fraction == '') {
+ alert("Pleae input score of question");
+ return;
+ }
+ var frac = parseFloat(fraction);
+ if (frac > 0) {
+ // score += parseInt(fraction)*answer.split(",").length;
+ creat(answer, num_ans, fraction);
+ $('.fast').modal('hide');
+ } else {
+ alert("Please input correct score");
+ return;
+ }
+ })
+
+ /* 添加试题的确定按钮 */
+ $("#addQuestion_submit").click(function() {
+ // $("#fast").attr("disabled","disabled");
+ var type_2 = 5;// parseInt($("#type").val())
+ var index_s_2 = 1;// parseInt($("#index_s_2").val())
+ var index_e_2 = parseInt($("#index_s_2").val());
+ // var answer_2=$("#answer_2").val();
+ var num_ans_2 = $("#num_ans_2").val();
+ var fraction2 = parseFloat($("#fraction2").val());
+ if (isNaN(index_s_2)) {
+ alert("Please input question start number");
+ return;
+ } else if (isNaN(index_e_2)) {
+ alert("Please input number of questions");// alert("请输入题目结束序号");
+ return;
+ } else if (isNaN(fraction2)) {
+ alert("Please input score of question");
+ return;
+ }
+ var iindex_e_2 = parseInt(index_e_2);
+ if (iindex_e_2 < 1 || iindex_e_2 > 100) {
+ alert("Illigal number of question");
+ return;
+ }
+ // console.log(typeof(type_2));
+ addQuestion(type_2, num_ans_2, index_s_2, index_e_2, fraction2);
+ $('.addQuestion').modal('hide');
+ })
+ $("#type").change(function() {
+ if ($("#type").val() == 4) {
+ $("#num_ans_2").val(2);
+ $("#num_ans_2").attr("disabled", "disabled");
+ } else {
+ $("#num_ans_2").removeAttr("disabled");
+ $("#num_ans_2").val(4);
+
+ }
+ })
+ /* 更改考试时长 */
+ $("#time_submit").click(function() {
+ var test_time = $("#enter_time").val();
+ if (test_time == '') {
+ alert("Please input exam time");
+ return;
+ }
+ $("#time").html(test_time);
+ $('.test_time').modal('hide');
+ })
+ /* 更改单选答案 */
+ $(document).on('click', '.single li', function() {
+ $(this).siblings().removeClass("on");
+ $(this).addClass("on");
+ })
+ /* 更改多选答案 */
+ $(document).on('click', '.check li', function() {
+ // $(this).siblings().removeClass("on");
+ if ($(this).hasClass('on')) {
+ $(this).removeClass("on");
+ } else {
+ $(this).addClass("on");
+ }
+ })
+ /* 提交保存数据 */
+ $("#save").click(function() {
+ var url = URL;
+
+ var data = {
+ title : $(".header_box h1").text(),
+ exam_time : parseInt($("#time").text()),
+ paper_type : testData.paper_type,
+ subject_id : testData.subject_id,
+ grade_id : testData.grade_id,
+ user_id : testData.user_id,
+ school_id : testData.school_id,
+ score : total_score,
+ questions : []
+ }
+
+ if ($(".section").length > 0) {
+ var rank = 0
+ for (i = 0; i < $(".section").length; i++) {
+ // rank++;
+ data.questions[i] = {
+ chapter_id : "0",
+ problem_type_id : "0",
+ knowledge_id : "0",
+ // content:
+ // $(".section").eq(i).find(".que_name").text(),
+ option_num : "",
+ option_content : "",
+ answer : "",
+ difficulty : "",
+ analysis : "",
+ question_from : "",
+ score : parseFloat($(".section").eq(i)
+ .attr("data-score")),
+ part_score : "",
+ remark : "",
+ rank : rank,
+ no_name : $(".section").eq(i).find(
+ ".que_num").text(),
+ questions : []
+ }
+ for (j = 0; j < $(".section").eq(i).find(
+ ".question_list").children(".question").length; j++) {
+ rank++;
+ var on_num = $(".section").eq(i).find(
+ ".question").eq(j).find(".on").length;
+ var answer = "";
+ for (k = 0; k < on_num; k++) {
+ answer += $(".section").eq(i).find(
+ ".question").eq(j).find(".on")
+ .eq(k).text();
+ // console.log(answer);
+ }
+ if (answer == '') {
+ alert("Some question answers not edited yet。");
+ return;
+ }
+ data.questions[i].questions[j] = {
+ chapter_id : "0",
+ problem_type_id : "0",
+ knowledge_id : "0",
+ content : "",
+ option_num : $(".section").eq(i).find(
+ ".question").eq(j).find("li").length,
+ option_content : "",
+ answer : answer,
+ difficulty : "0",
+ analysis : "",
+ question_from : "1",
+ score : parseFloat($(".section").eq(i)
+ .attr("data-fraction")),
+ part_score : "0",
+ remark : "",
+ rank : rank,
+ no_name : rank,
+ }
+ }
+ }
+ }
+
+ if (data.questions.length > 0) {
+ data = JSON.stringify(data);
+ dataJson = {
+ "json" : data
+ };
+ console.log(data);
+ ajax_submit(url, dataJson);
+ } else
+ alert("Please add questions");
+ });
+
+ /* ajax封装函数 */
+ function ajax_submit(url, data) {
+ $(".loading").css("display", "block");
+ console.log(data);
+ $.ajax({
+ url : url,
+ type : "POST",
+ data : data,
+ dataType : "json",
+ contentType : "application/x-www-form-urlencoded; charset=utf-8",
+ success : function(data) {
+ $(".loading").css("display", "none");
+ if(testData.paper_type == '1'){
+ window.location.href = JUMP_URL + "?a=1&defaulturl=../paper/list2.do";
+ }else{
+ window.location.href = JUMP_URL + "?a=1&defaulturl=../paper/list4.do?school_id=" + testData.school_id ;
+ }
+ }
+ })
+ }
+ function fastSort(array, head, tail) {
+ // 考虑到给每个分区操作的时候都是在原有的数组中进行操作的,所以这里head,tail来确定分片的位置
+ /* 生成随机项 */
+ var randomnum = parseInt((head + tail) / 2);
+ var random = array[randomnum];
+ /* 将小于random的项放置在其左边 策略就是通过一个临时的数组来储存分好区的结果,再到原数组中替换 */
+ var arrayTemp = [];
+ var unshiftHead = 0;
+ for (var i = head; i <= tail; i++) {
+ if (parseInt(array[i].rank) < parseInt(random.rank)) {
+ arrayTemp.unshift(array[i]);
+ unshiftHead++;
+ } else if (parseInt(array[i].rank) > parseInt(random.rank)) {
+ arrayTemp.push(array[i]);
+ }
+ /* 当它等于的时候放哪,这里我想选择放到队列的前面,也就是从unshift后的第一个位置放置 */
+ if (parseInt(array[i].rank) === parseInt(random.rank)) {
+ arrayTemp.splice(unshiftHead, 0, array[i]);
+ }
+ }
+ /* 将对应项覆盖原来的记录 */
+ for (var j = head, u = 0; j <= tail; j++, u++) {
+ array.splice(j, 1, arrayTemp[u]);
+ }
+ /* 寻找中间项所在的index */
+ var nowIndex = array.indexOf(random);
+
+ /* 设置出口,当要放进去的片段只有2项的时候就可以收工了 */
+ if (arrayTemp.length <= 2) {
+ return;
+ }
+ /* 递归,同时应用其左右两个区域 */
+ fastSort(array, head, nowIndex);
+ fastSort(array, nowIndex + 1, tail);
+ }
+ function creatHtml(data) {
+ console.log(data);
+ $(".header_box h1").html(data.title);
+ $("#time").html(data.exam_time);
+ if(data.score != null && data.score > 0 && data.score != ''){
+ $("#score_all").html(data.score);
+ }
+
+ if (data.questions.length > 0) {
+ $(".time").removeAttr("data-target");
+ $(".remove").remove();
+ $(".btn_box").remove();
+ }
+
+ for (var i = 0; i < data.questions.length; i++) {
+ if (data.questions[i].questions) {
+ $(".content")
+ .append(
+ ' '
+ + 'Total score of question number '
+ + (i + 1)
+ + ':'
+ + data.questions[i].questions.length
+ + " X "
+ + (parseFloat(data.questions[i].sug_score) / data.questions[i].questions.length)
+ + " = "
+ + data.questions[i].sug_score
+ + ''
+ + ''
+ + data.questions[i].content
+ + '
');
+ } else {
+ if (i == 0) {
+ $(".content")
+ .append(
+ '');
+ }
+ $(".section0").find(".question_list").append(
+ ''
+ + (++questionNUm) + '、 ');
+ for (var k = 0; k < parseInt(data.questions[i].option_num); k++) {
+ str_temp = data.questions[i].answer;
+ $(".section0").find(".question" + (i + 1) + ' ul').append(
+ ''
+ + String.fromCharCode(0x41 + k) + '');
+ for (var l = 0; l < str_temp.length; l++) {
+ str_temp_arry = str_temp.split('');
+ code = str_temp_arry[l].charCodeAt();
+ on_index = code - 65;
+ if (on_index == k) {
+ $(".section0").find(
+ ".question" + (i + 1) + ' ul li').eq(
+ on_index).attr("class",
+ "btn btn-default on");
+ }
+ }
+ }
+ }
+
+ if (data.questions[i].questions) {
+ for (var j = 0; j < data.questions[i].questions.length; j++) {
+ $(".section-" + i).find(".question_list").append(
+ '' + (++questionNUm)
+ + '、 ');
+ if ($(".section-" + i).find(".que_name").text() == "判断题") {
+ for (var k = 0; k < parseInt(data.questions[i].questions[j].option_num); k++) {
+ str_temp = data.questions[i].questions[j].answer;
+ if (k % 2 == 0) {
+ $(".section-" + i).find(
+ ".question" + (j + 1) + ' ul').append(
+ '√');
+ } else if (k % 2 == 1) {
+ $(".section-" + i).find(
+ ".question" + (j + 1) + ' ul').append(
+ '×');
+ }
+
+ if (str_temp == "√")
+ $(".section-" + i).find(
+ ".question" + (j + 1) + ' ul li').eq(0)
+ .attr("class", "btn btn-default on");
+ else
+ $(".section-" + i).find(
+ ".question" + (j + 1) + ' ul li').eq(1)
+ .attr("class", "btn btn-default on");
+ }
+ } else {
+ for (var k = 0; k < parseInt(data.questions[i].questions[j].option_num); k++) {
+ str_temp = data.questions[i].questions[j].answer;
+ $(".section-" + i).find(
+ ".question" + (j + 1) + ' ul').append(
+ ''
+ + String.fromCharCode(0x41 + k)
+ + '');
+ for (var l = 0; l < str_temp.length; l++) {
+ str_temp_arry = str_temp.split('');
+ code = str_temp_arry[l].charCodeAt();
+ on_index = code - 65;
+ if (on_index == k) {
+ $(".section-" + i).find(
+ ".question" + (j + 1) + ' ul li')
+ .eq(on_index).attr("class",
+ "btn btn-default on");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ /*快速建题中,每输入五个答案就加一个空格*/
+ $("#answer").on("input propertychange", function(event) {
+ var answerStr = "";
+ answerStr = $("#answer").val();
+ var result = "";
+ if (answerStr.length > 5) {
+ answerStr = answerStr.replace(new RegExp(" ", "gm"), "");
+ for (var i = 0; i < answerStr.length; i++) {
+ result += answerStr[i];
+ if (i % 5 == 4 && i != answerStr.length - 1) {
+ result += " ";
+ }
+ }
+ } else {
+ result = answerStr;
+ }
+ $("#answer").val(result);
+ if (answerStr.length > 0) {
+ $(".tips").text("Total number of questions" + answerStr.length + " ");
+ } else {
+ $(".tips").text("");
+ }
+ })
+
+
+
+ function SectionToChinese(section) {
+ var strIns = '', chnStr = '';
+ var unitPos = 0;
+ var zero = true;
+ while (section > 0) {
+ var v = section % 10;
+ if (v === 0) {
+ if (!zero) {
+ zero = true;
+ chnStr = chnNumChar[v] + chnStr;
+ }
+ } else {
+ zero = false;
+ strIns = chnNumChar[v];
+ strIns += chnUnitChar[unitPos];
+ chnStr = strIns + chnStr;
+ }
+ unitPos++;
+ section = Math.floor(section / 10);
+ }
+ return chnStr;
+ }
+
+
+ if (template != null && template.length > 0) {
+
+ $("#addQuestion").attr("disabled", "disabled");
+ $("#fast").attr("disabled", "disabled");
+ for (var i = 0; i < template.length; i++) {
+ if (template[i].type == 1) {
+ var answer = "";
+ for (var j = 0; j < template[i].questionNum; j++) {
+ answer += "1";
+ }
+ creat(answer, template[i].optionNum, template[i].score);
+ }
+ if (template[i].type == 2) {
+ addQuestion(5, template[i].optionNum, 1,
+ template[i].questionNum, template[i].score);
+ }
+ }
+ if(testData != null){
+ $(".header_box h1").html(testData.title);
+ $("#time").html(testData.exam_time);
+ if(testData.score != null && testData.score > 0 && testData.score != ''){
+ $("#score_all").html(testData.score);
+ }
+ }
+
+ }else if (testData != null && testData.questions != null
+ && testData.questions.length > 0) {
+ fastSort(testData.questions, 0, testData.questions.length - 1);
+ for (var i = 0; i < testData.questions.length; i++) {
+
+ if (testData.questions[0].questions
+ && testData.questions[0].questions.length > 1) {
+ fastSort(testData.questions[i].questions, 0,
+ testData.questions[i].questions.length - 1);
+ }
+ }
+ creatHtml(testData);
+ }else{
+ if(testData != null){
+ $(".header_box h1").html(testData.title);
+ $("#time").html(testData.exam_time);
+ if(testData.score != null && testData.score > 0 && testData.score != ''){
+ $("#score_all").html(testData.score);
+ }
+ }
+ }
+})
diff --git a/WebRoot/static/js/en_control1.js b/WebRoot/static/js/en_control1.js
new file mode 100644
index 0000000..ead7db5
--- /dev/null
+++ b/WebRoot/static/js/en_control1.js
@@ -0,0 +1,235 @@
+
+ var data0=[],data1=[],data2=[],data3=[];
+ var startDate,endDate;
+ var studentid;
+ var data_temp,_index=0;
+ function getQueryString(name) {
+ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+ var r = window.location.search.substr(1).match(reg);
+ if (r != null) return unescape(r[2]); return null;
+ }
+ function getData(startDate,endDate){
+ var attend = "" ;
+ if(startDate != null && endDate != null){
+ attend = "&start_Date="+startDate+"&end_Date="+endDate;
+ }
+ $.ajax({
+ url:URL+ attend,
+ type:"get",
+ dataType:"json",
+ success:function(data){
+ data_temp=data;
+ console.log(data);
+ var _html='';
+ for(var i=0;i'+data.data.studentList[i].NAME+'
';
+ if(studentid==data.data.studentList[i].ID)
+ _index=i;
+ }
+ $(".content_l ul").html(_html);
+ console.log(_index);
+ dataMethod(_index,data_temp);
+ $(".content_l li").eq(_index).siblings().removeClass("on");
+ $(".content_l li").eq(_index).addClass("on");
+ window.top.loading.remove();
+ }
+
+ });
+
+ }
+ $( document ).ready(function() {
+ //alert($("input[type=radio][checked]").val());
+
+ studentid=getQueryString("studentid");
+
+ startDate = $("#starDate").val();
+ endDate = $("#endDate").val();
+ getData(startDate,endDate);
+
+ //$('#myStathalf').circliful();
+ //$('#myStathalf1').circliful();
+ $(document).on("click",".content_l li",function(){
+ $(this).siblings().removeClass("on");
+ $(this).addClass("on");
+ _index=$(this).index();
+ dataMethod(_index,data_temp);
+ studentid = 0;
+ })
+ $("input[type=radio]").change(function(){
+ //alert($("input[type='radio']:checked").val());
+ dataMethod(_index,data_temp);
+ })
+
+ $("#search").click(function(){
+// var date_string=$("#test6").val();
+// var date_arry=date_string.split(' - ');
+// startDate=date_arry[0];
+// endDate=date_arry[1];
+ window.top.loading.show();
+ startDate = $("#starDate").val();
+ endDate = $("#endDate").val();
+ getData(startDate,endDate);
+
+ })
+
+ $(".prev").click(function(){
+ _index-=1;
+ if(_index<0){
+ _index=data_temp.data.studentList.length-1;
+ }
+ $(".content_l li").eq(_index).siblings().removeClass("on");
+ $(".content_l li").eq(_index).addClass("on");
+ dataMethod(_index,data_temp);
+ })
+ $(".next").click(function(){
+ _index+=1;
+ if(_index>(data_temp.data.studentList.length-1)){
+ _index=0;
+ }
+ $(".content_l li").eq(_index).siblings().removeClass("on");
+ $(".content_l li").eq(_index).addClass("on");
+ dataMethod(_index,data_temp);
+ })
+ });
+
+
+ function dataMethod(index,data){
+ console.log(data);
+ //data0=[];data1=[];data2=[];data3=[];
+ var GETSCORE = parseFloat(data.data.studentList[index].GETSCORE);
+ var TOTALSCORE = parseFloat(data.data.TOTAL_SCORE);
+ var ratio=(GETSCORE/TOTALSCORE*100).toFixed(2);
+ var class_avg= (parseFloat(data.data.AVG_SCORE)/ parseFloat(data.data.TOTAL_SCORE)*100).toFixed(2);
+ var class_max=(parseFloat(data.data.MAX_SCORE)/ parseFloat(data.data.TOTAL_SCORE)*100).toFixed(2);
+
+ var test_num=data.data.studentList[index].testList.length;
+ var part_num=test_num;
+
+ data0=[];
+ data1=[];
+ data2=[];
+ data3=[];
+
+ //console.log(data.data.studentList[index].testList[2].SCORE);
+ if($("input[type='radio']:checked").val()==1){
+ for(var i=0;i0){
+ data0[i]=data.data.studentList[index].testList[i].NAME + "\n" + data.data.studentList[index].testList[i].CREATE_DATE;
+ data1[i]=(data.data.studentList[index].testList[i].AVG_SCORE/data.data.studentList[index].testList[i].TOTAL_SCORE*100).toFixed(2);
+ data2[i]=(data.data.studentList[index].testList[i].SCORE/data.data.studentList[index].testList[i].TOTAL_SCORE*100).toFixed(2);
+ data3[i]=(data.data.studentList[index].testList[i].MAX_SCORE/data.data.studentList[index].testList[i].TOTAL_SCORE*100).toFixed(2);
+ }else{
+ data1[i]=0;
+ data2[i]=0;
+ data3[i]=0;
+ }
+
+ if(data.data.studentList[index].testList[i].SCORE=="0")
+ part_num--;
+ }
+ }else if($("input[type='radio']:checked").val()==2){
+ for(var i=0;i');
+ $(".circle .col-md-6").eq(0).html('
');
+ $('#myStathalf1').circliful();
+ $('#myStathalf').circliful();
+ myChart.setOption({
+ tooltip:{
+ trigger: 'axis'
+ },
+ xAxis: {
+ type: 'category',
+ data: data0
+ /*,
+ axisLabel:{interval: 0}*/
+ },
+ yAxis: {
+ type: 'value',
+ splitArea: {show: true}
+ },
+ series: [{
+ name:"Avg Score",
+ data: data1,
+ type: 'line',
+ symbol: 'circle',
+ symbolSize: 5,
+ lineStyle: {
+ normal: {
+ color: '#93D150',
+ width: 2,
+ type: 'dashed'
+ }
+ },
+ itemStyle: {
+ normal: {
+ borderWidth: 2,
+ borderColor: '#93D150',
+ color: '#93D150'
+ }
+ }
+ },{
+ name:"Highest",
+ data: data3,
+ type: 'line',
+ symbol: 'circle',
+ symbolSize: 5,
+ lineStyle: {
+ normal: {
+ color: '#FFC004',
+ width: 2,
+ type: 'dashed',
+ }
+ },
+ itemStyle: {
+ normal: {
+ borderWidth: 2,
+ borderColor: '#FFC004',
+ color: '#FFC004'
+ }
+ }
+ },{
+ name:"Personal",
+ data: data2,
+ type: 'line',
+ symbol: 'circle',
+ symbolSize: 10,
+ lineStyle: {
+ normal: {
+ color: '#45a6f3',
+ width: 4,
+ type: 'solid'
+ }
+ },
+ itemStyle: {
+ normal: {
+ borderWidth: 3,
+ borderColor: '#45a6f3',
+ color: '#45a6f3',
+ label : {show: true,color:'#000'}
+ }
+ }
+ }]
+ });
+ }
+
+
+ var myChart = echarts.init(document.getElementById('main'));
diff --git a/WebRoot/static/js/en_paper_view.js b/WebRoot/static/js/en_paper_view.js
new file mode 100644
index 0000000..81f94ec
--- /dev/null
+++ b/WebRoot/static/js/en_paper_view.js
@@ -0,0 +1,185 @@
+var url="";
+ var question_box=[];
+ function slide(obj){ //查看解析
+ obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
+ if($(".resolve").css("display") == "none")
+ obj.text("View Analysis");
+ else
+ obj.text("Fold analysis");
+ });
+ }
+
+function getQueryString(name) {
+ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+ var r = window.location.search.substr(1).match(reg);
+ if (r != null) return unescape(r[2]); return null;
+ }
+ var PAPER_ID=getQueryString("PAPER_ID");
+ var classId=getQueryString("classId");
+ var userid=getQueryString("userid");
+
+ var gradleId = getQueryString("gradleid");
+
+ var _html="";
+ var question_id_arry="";
+ $(document).ready(function(){
+ window.top.loading.remove();
+ var data=JSON.parse(sessionStorage.getItem("data"));
+ console.log(data);
+ $("#paper_title").html(data.title);
+ $("#time").html(data.exam_time);
+ if(data.questions.length>0){
+ for(var i=0;i
0){
+ for(var i=0;i【Answer】 '+data.data[i].ANSWER+'
【Analysis】'+data.data[i].ANALYSIS+'
';
+ }
+ console.log(_html);
+ $(".analysis ul").html(_html);
+ for(var j=0;j'+(j+1)+'、'+data.data[j].CONTENT);
+ var arry_option=data.data[j].OPTION_CONTENT;
+
+ for(var x=0;x'+String.fromCharCode(64 + parseInt(x+1))+'.'+arry_option[x]+'';
+ }
+ $(".option").eq(j).html(option_html);
+ star(j,parseInt(data.data[j].DIFFICULTY));
+ }
+ }
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 错误信息
+ alert("Status code:"+XMLHttpRequest.status+"Status:"+XMLHttpRequest.readyState+"Wrong massage:"+textStatus+"");
+ window.top.loading.remove();
+ }
+ })
+
+ }
+
+ function getknowledgeid(question_id,knowledge_ids){
+ for(var i = 0 ; i < knowledge_ids.length; i++){
+ if(knowledge_ids[i].question_id == question_id){
+ return knowledge_ids[i].knowledge_id;
+ }
+ }
+ return '';
+
+ }
+ function star(index,num){ //难度星级
+ $(".star").eq(index).append('');
+ var li_html="";
+ for(var i=1;i<=num;i++){
+ li_html +='';
+ }
+ for(var j=num;j<5;j++){
+ li_html += '';
+ }
+
+ $(".star").eq(index).find("ul").html(li_html);
+ }
+ $(document).on('click', '.move img', function(event) { //上移、下移
+ event.preventDefault();
+ var parent=$(this).closest("li");
+ var this_index=parent.children(".stem").find(".li_index").html();
+ var up_index=parent.prev().children(".stem").find(".li_index").html()
+ console.log(this_index);
+ console.log(up_index);
+ var parents=$(this).closest(".analysis").children("ul");
+ var len=parents.children().length;
+ if(($(this).is(".up") || $(this).is(".top")) && parent.index()==0){
+ alert("Stikied!!");
+ return false;
+ }else if(($(this).is(".down") || $(this).is(".bottom")) && parent.index()==len-1){
+ alert("Bottomed!");
+ return false;
+ }
+ switch (true) {
+ case $(this).is(".up"):
+ var prev = parent.prev();
+ var this_index=parent.children(".stem").find(".li_index").html();
+ var up_index=prev.children(".stem").find(".li_index").html();
+ prev.children(".stem").find(".li_index").html(this_index);
+ parent.children(".stem").find(".li_index").html(up_index);
+ parent.insertBefore(prev);
+ break;
+ case $(this).is(".down"):
+ var next = parent.next();
+ var this_index=parent.children(".stem").find(".li_index").html();
+ var up_index=next.children(".stem").find(".li_index").html();
+ next.children(".stem").find(".li_index").html(this_index);
+ parent.children(".stem").find(".li_index").html(up_index);
+ parent.insertAfter(next);
+ break;
+ case $(this).is(".top"):
+ parents.prepend(parent);
+ break;
+ case $(this).is(".bottom"):
+ parents.append(parent);
+ break;
+ }
+ });
+ $(".save").click(function(){ //保存,提交试卷
+ var question_arry=[];
+ for(var i=0;i<$(".question_li").length;i++){
+ question_arry[i]={
+ score: "0",
+ part_score: "0",
+ question_id: $(".question_li").eq(i).attr("data-id"),
+ knowledge_id: $(".question_li").eq(i).attr("data-knowledge"),
+ rank: i.toString(),
+ no_name: i.toString()
+ };
+
+ }
+ var data={
+ title: $("#paper_title").html(),
+ exam_time: $("#time").html(),
+ paper_type: "101",
+ subject_id: subjectId,
+ grade_id: gradleId,
+ class_id: classId,
+ user_id: userid,
+ score: "100",
+ questions: question_arry
+ };
+
+ $.ajax({
+ url:url+"/SunvoteEducation/api/v1/publishpaper",
+ async:false,
+ type:"post",
+ dataType: "json",
+ headers: {'Content-Type': 'application/json'},
+ data:JSON.stringify(data),
+ success:function(data){
+ alert("Success");
+ window.history.go(-2);
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 错误信息
+ alert("Status code:"+XMLHttpRequest.status+"Status:"+XMLHttpRequest.readyState+"Wrong massage:"+textStatus+"");
+ window.top.loading.remove();
+ }
+ })
+ })
\ No newline at end of file
diff --git a/WebRoot/static/js/en_paper_view2.js b/WebRoot/static/js/en_paper_view2.js
new file mode 100644
index 0000000..aa0a8a2
--- /dev/null
+++ b/WebRoot/static/js/en_paper_view2.js
@@ -0,0 +1,78 @@
+var url="";
+ var question_box=[];
+ function slide(obj){ //查看解析
+ obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
+ if($(".resolve").css("display") == "none")
+ obj.text("View Analysis ");
+ else
+ obj.text("Fold analysis");
+ });
+ }
+
+function getQueryString(name) {
+ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+ var r = window.location.search.substr(1).match(reg);
+ if (r != null) return unescape(r[2]); return null;
+ }
+ var PAPER_ID=getQueryString("PAPER_ID");
+ var classId=getQueryString("classId");
+ var userid=getQueryString("userid");
+
+ var _html="";
+ $(document).ready(function(){
+ window.top.loading.remove();
+ $.ajax({
+ url:url+"/SunvoteEducation/api/v1/paperinfo",
+ async:false,
+ type:"post",
+ data:{PAPER_ID:PAPER_ID},
+ success:function(data){
+ console.log(data);
+ $("#paper_title").html(data.data.title);
+ $("#time").html(data.data.exam_time);
+ if(data.data.questions.length>0){
+ for(var i=0;i【Answer】 '+data.data.questions[i].answer+'
【Analysis】'+data.data.questions[i].analysis+'
';
+ }
+ console.log(_html);
+ $(".analysis ul").html(_html);
+ for(var j=0;j'+(j+1)+'、'+data.data.questions[j].content);
+ var arry_option=data.data.questions[j].option_content;
+ arry_option=arry_option.replace("[","");
+ arry_option=arry_option.replace("]","");
+ arry_option=arry_option.split(",");
+
+ for(var x=0;x'+String.fromCharCode(64 + parseInt(x+1))+'.'+arry_option[x]+'';
+ }
+ $(".option").eq(j).html(option_html);
+ star(j,parseInt(data.data.questions[j].difficulty));
+ }
+ }
+ window.top.loading.remove();
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 错误信息
+ alert("Code State:"+XMLHttpRequest.status+"State:"+XMLHttpRequest.readyState+"wrong message:"+textStatus+"");
+ window.top.loading.remove();
+ }
+ })
+ })
+ function star(index,num){ //难度星级
+ $(".star").eq(index).append('');
+ var li_html="";
+ for(var i=1;i<=num;i++){
+ li_html +='';
+ }
+ for(var j=num;j<5;j++){
+ li_html += '';
+ }
+
+ $(".star").eq(index).find("ul").html(li_html);
+ }
+
\ No newline at end of file
diff --git a/WebRoot/static/js/en_set_question.js b/WebRoot/static/js/en_set_question.js
new file mode 100644
index 0000000..4168f68
--- /dev/null
+++ b/WebRoot/static/js/en_set_question.js
@@ -0,0 +1,448 @@
+var url="";
+ var temp_tag;
+ var temp_data;
+ var TEXTBOOK_ID="";
+ var question_box=[];
+ var question_num=0;
+ var pageNum=1;
+ var end=0;
+ var flag=0;
+ var paper_title = "" ;
+ var paper_time = "0" ;
+
+
+ $(document).ready(function(){
+ getPoint();
+ });
+
+ function getQueryString(name) {
+ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+ var r = window.location.search.substr(1).match(reg);
+ if (r != null) return unescape(r[2]); return null;
+ }
+
+ var subject_id=getQueryString("subject_id");
+ var class_id=getQueryString("class_id");
+ var user_id=getQueryString("user_id");
+
+
+ function getPoint(){ //获取知识点
+ $.ajax({
+ url:url+"/SunvoteEducation/api/v1/point",
+ async:false,
+ type:"post",
+ data:{depth:"",subject_id:subject_id,p_id:"",knowledge_from:101},
+ success:function(data){
+ var point_html="";
+ for(var i=0;i
'+(i+1)+data.data[i].NAME+'';
+ }
+ if(data.data.length > 0){
+ paper_title = data.data[0].NAME;
+ }
+ $(".section").children("ul").html(point_html);
+ getQuestion($(".section li").eq(0));
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 错误信息
+ alert("Code State:"+XMLHttpRequest.status+"State:"+XMLHttpRequest.readyState+"Wrong message:"+textStatus+"");
+ window.top.loading.remove();
+ }
+ })
+ }
+ function getChapter(TEXTBOOK_ID){ //获取章节
+ $(".section").children("ul").html("");
+ $.ajax({
+ url:url+"/SunvoteEducation/api/v1/chapter",
+ async:false,
+ type:"post",
+ data:{TEXTBOOK_ID:TEXTBOOK_ID},
+ success:function(data){
+ for(var i=0;i
'+data.data[i].NAME+'');
+ if(data.data[i].CHILDREN.length>0){
+ $(".section").children("ul").children("li").eq(i).append("");
+ for(var j=0;j●'+data.data[i].CHILDREN[j].NAME+'');
+ }
+ }
+ }
+ getQuestion($(".section li").eq(0));
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 错误信息
+ alert("Code State"+XMLHttpRequest.status+"State"+XMLHttpRequest.readyState+"Wrong message:"+textStatus+"");
+ window.top.loading.remove();
+ }
+ })
+ }
+ function getMenu(id,obj){ //获取知识点下级内容
+ var _html="";
+ $.ajax({
+ url:url+"/SunvoteEducation/api/v1/point",
+ async:false,
+ type:"post",
+ data:{depth:"",subject_id:subject_id,p_id:id,knowledge_from:101},
+ success:function(data){
+ obj.append('');
+ for(var i=0;i●'+(i+1)+data.data[i].NAME+'';
+ else
+ _html +='
'+(i+1)+data.data[i].NAME+'';
+ }
+ obj.children('ul').html(_html);
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 错误信息
+ alert("Code State"+XMLHttpRequest.status+"State"+XMLHttpRequest.readyState+"Wrong message:"+textStatus+"");
+ window.top.loading.remove();
+ }
+ })
+ }
+ function slide(obj){ //查看解析
+ obj.closest(".star_box").siblings(".resolve").slideToggle(function(){
+ if($(".resolve").css("display") == "none")
+ obj.text("View Analysis");
+ else
+ obj.text("Fold analysis");
+ });
+
+ }
+ function getQuestion(obj){ //获取题目
+
+ var knowledge_id="",chapter_id="";
+ if($(".tab .active").attr("data-index")==1){
+ knowledge_id=obj.attr("data-id");
+ }else{
+ chapter_id=obj.attr("data-id");
+ }
+
+ var _html="";
+
+ $.ajax({
+ url:url+"/SunvoteEducation/api/v1/questions",
+ async:true,
+ type:"post",
+ 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},
+ success:function(data){
+ window.top.loading.remove();
+ console.log(data);
+ if(data.data.length>0){
+ for(var i=0;i【Answer】 '+data.data[i].ANSWER+'
【Analysis】'+data.data[i].ANALYSIS+'
';
+ }
+ $(".question_box").children("ul").append(_html);
+ console.log(5*(pageNum-1));
+ for(var j=5*(pageNum-1);j<(data.data.length+5*(pageNum-1));j++){
+ var option_html="";
+ data.data[j-5*(pageNum-1)].CONTENT = data.data[j-5*(pageNum-1)].CONTENT.replace('','______');
+ $(".question_box li .content").eq(j).append(''+(j+1)+'、'+data.data[j-5*(pageNum-1)].CONTENT);
+ var arry_option=data.data[j-5*(pageNum-1)].OPTION_CONTENT;
+ if(question_box.indexOf(data.data[j-5*(pageNum-1)].QUESTION_ID)>=0){
+ $(".check_box").eq(j).addClass("checked");
+ }
+ for(var x=0;x'+String.fromCharCode(64 + parseInt(x+1))+'.'+arry_option[x]+'';
+ }
+ $(".option").eq(j).find("ul").html(option_html);
+
+ star(j,parseInt(data.data[j-5*(pageNum-1)].DIFFICULTY));
+
+ }
+ $(".view_more").css("display","block");
+ end=0;
+ }else{
+ $(".view_more").css("display","none");
+ // $(".question_box").children("ul").html("");
+ pageNum-=1;
+ if(pageNum<1)
+ pageNum=1;
+ end=1;
+ }
+ flag=0;
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 状态码
+ console.log(XMLHttpRequest.status);
+ // 状态
+ console.log(XMLHttpRequest.readyState);
+ // 错误信息
+ alert(textStatus);
+ flag=0;
+ pageNum-=1;
+ if(pageNum<1)
+ pageNum=1;
+ window.top.loading.remove();
+ }
+ })
+ }
+ function getTeachingMaterial(){ //获取教材版本
+
+ $.ajax({
+ url:url+"/SunvoteEducation/api/v1/teachingmaterial",
+ async:true,
+ type:"post",
+ data:{subject_id:subject_id},
+ success:function(data){
+ console.log(data);
+ if (data.data.length > 0) {
+ var teach_html = "";
+ for (var i = 0; i < data.data.length; i++) {
+ teach_html += ''
+ + data.data[i].NAME
+ + '
';
+ }
+ $(".book_box ul").html(teach_html);
+ var li_length = $(".book_box ul li").length;
+ for (var k = 0; k < li_length; k++) {
+ var books = [];
+ var book_html = "";
+ var book_id = $(".book_box ul").children("li")
+ .eq(k).attr("data-id");
+
+ if (textBook(book_id).length > 0) {
+
+ books = textBook($(".book_box ul li").eq(k)
+ .attr("data-id"));
+ $(".book_box ul li").eq(k).append('');
+
+ for (var j = 0; j < books.length; j++) {
+ console.log("j:" + j);
+ book_html += '' + books[j].name + '';
+ }
+ $(".float_box").eq(k).children("ul").find(
+ ".clearfix").before(book_html);
+ TEXTBOOK_ID = books[0].id;
+ }
+
+ }
+ getChapter(TEXTBOOK_ID);
+ $("#book_name").text(
+ $(".name").eq(0).text()
+ + "/"
+ + $(".float_box").eq(0).find('li')
+ .eq(0).text());
+ }else{
+ window.top.loading.remove();
+ }
+
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 错误信息
+ alert("Code State"+XMLHttpRequest.status+"State"+XMLHttpRequest.readyState+"Wrong message:"+textStatus+"");
+ window.top.loading.remove();
+ }
+ })
+
+ }
+ function textBook(id){ //获取教材
+ var textBookName=[];
+ $.ajax({
+ url:url+"/SunvoteEducation/api/v1/textbook",
+ async:false,
+ type:"post",
+ data:{teaching_material_id:id,subject_id:subject_id,grade_id:""},
+ success:function(data){
+ if(data.data.length>0){
+ for(var i=0;i');
+ var li_html="";
+ for(var i=1;i<=num;i++){
+ li_html +='';
+ }
+ for(var j=num;j<5;j++){
+ li_html += '';
+ }
+
+ $(".star").eq(index).find("ul").html(li_html);
+ }
+
+ $(".section").on("click",".add",function(event){ //展开菜单
+ event.stopPropagation();
+ var that=$(this).closest("li");
+ if($(".tab .active").attr("data-index")==1){
+ if(that.attr("data-img-click")==0){
+ getMenu(that.attr("data-id"),that);
+ }
+ that.attr("data-img-click",1);
+ }else{
+ that.attr("data-img-click",1);
+ }
+
+ if(that.children('ul').length>0)
+ that.children('ul').slideToggle(function(){
+ if(that.children('ul').css("display")=="block")
+ that.children('img').attr("src","../static/images/reduce.png");
+ else
+ that.children('img').attr("src","../static/images/add.png");
+ });
+ });
+ $(".section").on("click","span",function(event){ //点击菜单获取题目
+ window.top.loading.show();
+ event.stopPropagation();
+ pageNum=1;
+ $(".question_box ul").html("");
+ var that=$(this).closest("li");
+ if($(".tab .active").attr("data-index")==1){
+ paper_title = this.textContent;
+ getQuestion(that);
+ $(".menu_active").removeClass();
+ that.addClass("menu_active");
+ }else{
+ paper_title = this.textContent;
+ getQuestion(that);
+ $(".menu_active").removeClass();
+ that.addClass("menu_active");
+ }
+
+ });
+ $(".book_box").children("ul").on("mouseover","li",function(event){ //教材版本交互
+ event.stopPropagation();
+ $(this).children(".float_box").css("display","block");
+ });
+ $(".book_box").children("ul").on("mouseleave","li",function(event){ //教材版本交互
+ event.stopPropagation();
+ $(this).children(".float_box").css("display","none");
+ });
+ $(".float_box").on("mouseleave",function(event){ //教材版本交互
+ event.stopPropagation();
+ $(this).css("display","none");
+ });
+ $(document).on("click",".float_box li",function(event){ //教材版本交互
+ event.stopPropagation();
+ var id=$(this).attr("data-id");
+ $("#book_name").text($(this).closest(".li_name").children(".name").text()+"/"+$(this).text());
+ $(".float_box").css("display","none");
+ $(".book_box").slideToggle();
+ getChapter(id);
+ });
+ $(".book").click(function(){ //教材版本下拉框交互
+ $(".book_box").slideToggle();
+ })
+ $(document).on("click",".check_box",function(){ //选中题目
+
+ if($(this).hasClass("checked")){
+ var id=$(this).closest("li").attr("data-id");
+ var que_index= -1 ;
+ for(var tp = 0 ; tp < question_box.length; tp++){
+ if(question_box[tp].id == id){
+ que_index = tp;
+ }
+ }
+ $(this).removeClass("checked");
+ question_box.splice(que_index,1);
+ question_num--;
+ }else{
+ //question_box[question_num].id =$(this).closest("li").attr("data-id");
+ //question_box[question_num].knowledge_id =$(this).closest("li").attr("data-knowledge");
+ question_box[question_num] = {id:$(this).closest("li").attr("data-id"),knowledge_id:$(this).closest("li").attr("data-knowledge")};
+ question_num++;
+ $(this).addClass("checked");
+ }
+ $("#all_que_num").html(question_num);
+ });
+ $(".clear_que").click(function(){ //清空
+ question_num=0;
+ question_box=[];
+ $(".checked").removeClass("checked");
+ $("#all_que_num").html(question_num);
+ });
+ $(".tab li").click(function(){ //教材与知识点选择
+ window.top.loading.show();
+ pageNum=1;
+ $(this).siblings().removeClass("active");
+ $(this).addClass("active");
+ if($(this).index()==0){
+ getTeachingMaterial();
+ $(".choose_book").css("display","block");
+ //getChapter(TEXTBOOK_ID);
+ }else{
+ $(".choose_book").css("display","none");
+ getPoint();
+ }
+ });
+ $(".topic").click(function(){
+ if(parseInt($("#all_que_num").text())>0){
+ paper_time = parseInt($("#all_que_num").text()) > 75 ? "150" : (parseInt($("#all_que_num").text()) * 2);
+ $("#title").val(paper_title);
+ $("#time").val(paper_time);
+ $('#myModal').modal('show');
+ }else{
+ alert("Please select question first")
+ }
+ });
+ $(".view_more").click(function(){ //加载更多
+ flag++;
+ if(end>0){
+ $(".view_more p").html("No more");
+ return;
+ }
+ if(flag==1){
+ window.top.loading.show();
+ pageNum++;
+ getQuestion($(".menu_active"));
+ }
+ })
+ $("#submit").click(function(){
+ var question_arry=[];
+ for(var i=0;i 0) {
+ for (var i = 0; i < data.data.classInfoList.length; i++) {
+ option_html += ''
+ }
+ $("#dealer_id_2").html(option_html);
+ }
+ getList();
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 错误信息
+ alert("Status code:"+XMLHttpRequest.status+"Status:"+XMLHttpRequest.readyState+"wrong massage:"+textStatus+"");
+ window.top.loading.remove();
+ }
+ })
+ // 日期框
+ $('.date-picker').datepicker({
+ autoclose : true,
+ todayHighlight : true
+ });
+ window.top.loading.remove();
+ })
+function getList(start_date, end_date, class_id) { // 获取测验列表
+ var tab_html = "";
+ if(class_id == null){
+ class_id = getQueryString("classid");
+ }
+ $.ajax({
+ url : url + "/api/v1/testpaper",
+ async : false,
+ type : "post",
+ data : {
+ test_type : "101",
+ user_id : user_id,
+ subject_id : subject_id,
+ class_id : class_id,
+ currentpage : "1",
+ showcount : "",
+ start_date : start_date,
+ end_date : end_date
+ },
+ success : function(data) {
+ console.log(data);
+ for (var i = 0; i < data.data.length; i++) {
+ tab_html += ''
+ + (i + 1)
+ + ' | '
+ + data.data[i].name
+ + ' | '
+ + getClassName(data.data[i].classId)
+ + ' | '
+ + data.data[i].createDate
+ + ' | View |
'
+ }
+ $("#tab_body").html(tab_html);
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 错误信息
+ alert("Status code:"+XMLHttpRequest.status+"Status:"+XMLHttpRequest.readyState+"wrong massage:"+textStatus+"");
+ window.top.loading.remove();
+ }
+ });
+}
+function jump(obj) { // 预览测验详情
+ var id = obj.attr("data-id");
+ location.href = "paper_view1.do?testpaperId=" + id;
+}
+
+function ansync(obj){
+ // 班级分析
+ var id = obj.attr("data-id");
+ location.href = "classansync.do?testpaperId=" + id;
+}
+
+function getSubjectName(id) { // 获取科目中文名
+ var subjectName = "";
+ $.ajax({
+ url : url + " /api/v1/subjectcname",
+ async : false,
+ type : "post",
+ data : {
+ id : id
+ },
+ success : function(data) {
+ subjectName = data.data;
+ }
+ })
+ return subjectName;
+}
+function getClassName(id) { // 获取班级中文名
+ var className = "";
+ $.ajax({
+ url : url + "/api/v1/classname",
+ async : false,
+ type : "post",
+ data : {
+ id : id
+ },
+ success : function(data) {
+ className = data.data;
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ // 错误信息
+ alert("Status code:"+XMLHttpRequest.status+"Status:"+XMLHttpRequest.readyState+"wrong massage:"+textStatus+"");
+ window.top.loading.remove();
+ }
+ })
+ return className;
+}
+function tosearch() { //搜索
+ var start_date = $("#lastStart").val();
+ var end_date = $("#lastEnd").val();
+ var class_id = $("#dealer_id_2").val();
+ getList(start_date, end_date, class_id);
+}
\ No newline at end of file
diff --git a/WebRoot/static/js/lang.js b/WebRoot/static/js/lang.js
new file mode 100644
index 0000000..2f51b19
--- /dev/null
+++ b/WebRoot/static/js/lang.js
@@ -0,0 +1,49 @@
+function SetCookie(name, value) {
+ var key = '';
+ var Days = 2;
+ var exp = new Date();
+ var domain = "";
+ exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
+ if (key == null || key == "") {
+ document.cookie = name + "=" + encodeURI(value) + ";expires=" + exp.toGMTString() + ";path=/;domain=" + domain + ";";
+ }
+ else {
+ var nameValue = GetCookie(name);
+ if (nameValue == "") {
+ document.cookie = name + "=" + key + "=" + encodeURI(value) + ";expires=" + exp.toGMTString() + ";path=/;domain=" + domain + ";";
+ }
+ else {
+ var keyValue = getCookie(name, key);
+ if (keyValue != "") {
+ nameValue = nameValue.replace(key + "=" + keyValue, key + "=" + encodeURI(value));
+ document.cookie = name + "=" + nameValue + ";expires=" + exp.toGMTString() + ";path=/;domain=" + domain + ";";
+ }
+ else {
+ document.cookie = name + "=" + nameValue + "&" + key + "=" + encodeURI(value) + ";expires=" + exp.toGMTString() + ";path=/;" + domain + ";";
+ }
+ }
+ }
+ }
+ function GetCookie(name) {
+ var nameValue = "";
+ var key = "";
+ var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
+ if (arr = document.cookie.match(reg)) {
+ nameValue = decodeURI(arr[2]);
+ }
+ if (key != null && key != "") {
+ reg = new RegExp("(^| |&)" + key + "=([^(;|&|=)]*)(&|$)");
+ if (arr = nameValue.match(reg)) {
+ return decodeURI(arr[2]);
+ }
+ else return null;
+ }
+ else {
+ return nameValue;
+ }
+ }
+
+ function lang(){
+ var language = (GetCookie("lang") || navigator.browserLanguage || navigator.language).toLowerCase();
+ return language.substring(0,2) ;
+ }
diff --git a/WebRoot/static/login/en_logo.png b/WebRoot/static/login/en_logo.png
new file mode 100644
index 0000000..36edd64
--- /dev/null
+++ b/WebRoot/static/login/en_logo.png
diff --git a/WebRoot/static/login/en_title.png b/WebRoot/static/login/en_title.png
new file mode 100644
index 0000000..b0e1c92
--- /dev/null
+++ b/WebRoot/static/login/en_title.png