From 498c30c51423108c2c7f12451fded73041132baa Mon Sep 17 00:00:00 2001 From: MaoJiuWei <3628761@qq.com> Date: Tue, 30 Jun 2020 19:14:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9Bjs=E6=96=B9=E6=B3=95=E5=9C=A8tableOperation.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/demo/exam/examManagementList.json | 147 +++++- .../js/demo/exam/testQuestionsListTest.json | 297 +++++------- static/public/exam/tableOperation.js | 175 ++++++- templates/exam/examManagementList.html | 420 +++++++++++------ templates/exam/paperManagementList.html | 34 +- templates/user/stuList.html | 433 ++++++++++-------- 6 files changed, 966 insertions(+), 540 deletions(-) diff --git a/static/js/demo/exam/examManagementList.json b/static/js/demo/exam/examManagementList.json index be50656..b0b9b61 100644 --- a/static/js/demo/exam/examManagementList.json +++ b/static/js/demo/exam/examManagementList.json @@ -1,17 +1,158 @@ [ { + "id": 1, "name":"张三", "examinee": "zhangsan", "examineeGroup": "扬州公司", "idNumber": "2011001", "startTime": "2020-06-08 14:18:00", "endTime": "2020-06-08 14:18:08", - "examTime": 0, - "correctingState": true, + "examTime": 120, + "correctingState": "true", "score": 57, "source": "116.236.48.13", "testTime": "120", "passMark": 60, - "totalPoints": 120 + "totalPoints": 120, + "canTestTimes": 3, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "中级开发工程师", + "state": "正常", + "registrationTime": "2019-09-08 08:18:08" + }, + { + "id": 2, + "name":"李四", + "examinee": "lisi", + "examineeGroup": "扬州公司", + "idNumber": "2011001", + "startTime": "2020-06-08 14:18:00", + "endTime": "2020-06-08 14:18:08", + "examTime": 120, + "correctingState": "false", + "score": 57, + "source": "116.236.48.13", + "testTime": "120", + "passMark": 60, + "totalPoints": 120, + "canTestTimes": 3, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "中级开发工程师", + "state": "待审核", + "registrationTime": "2019-09-08 08:18:08" + }, + { + "id": 3, + "name":"王五", + "examinee": "wangwu", + "examineeGroup": "扬州公司", + "idNumber": "2011001", + "startTime": "2020-06-08 14:18:00", + "endTime": "2020-06-08 14:18:08", + "examTime": 120, + "correctingState": "true", + "score": 57, + "source": "116.236.48.13", + "testTime": "120", + "passMark": 60, + "totalPoints": 120, + "canTestTimes": 3, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "中级开发工程师", + "state": "正常", + "registrationTime": "2019-09-08 08:18:08" + }, + { + "id": 4, + "name":"赵六", + "examinee": "zhaoliu", + "examineeGroup": "无锡分公司", + "idNumber": "2011001", + "startTime": "2020-06-08 14:18:00", + "endTime": "2020-06-08 14:18:08", + "examTime": 120, + "correctingState": "true", + "score": 57, + "source": "116.236.48.13", + "testTime": "120", + "passMark": 60, + "totalPoints": 120, + "canTestTimes": 3, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "初级开发工程师", + "state": "待审核", + "registrationTime": "2019-09-08 08:18:08" + }, + { + "id": 5, + "name":"洪七", + "examinee": "洪七", + "examineeGroup": "无锡分公司", + "idNumber": "2011001", + "startTime": "2020-06-08 14:18:00", + "endTime": "2020-06-08 14:18:08", + "examTime": 120, + "correctingState": "false", + "score": 57, + "source": "116.236.48.13", + "testTime": "120", + "passMark": 60, + "totalPoints": 120, + "canTestTimes": 3, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "初级开发工程师", + "state": "待审核", + "registrationTime": "2019-09-08 08:18:08" + }, + { + "id": 6, + "name":"赵六", + "examinee": "zhaoliu", + "examineeGroup": "无锡分公司", + "idNumber": "2011001", + "startTime": "2020-06-08 14:18:00", + "endTime": "2020-06-08 14:18:08", + "examTime": 120, + "correctingState": "true", + "score": 57, + "source": "116.236.48.13", + "testTime": "120", + "passMark": 60, + "totalPoints": 120, + "canTestTimes": 3, + "testInstructions": "智商140,情商80", + "releaseTime": "2020-06-08 14:18:08", + "submitLimit": 5, + "toLimit": 30, + "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", + "checkDetails": "不允许 考生查看历史答卷详情", + "position": "初级开发工程师", + "state": "待审核", + "registrationTime": "2019-09-08 08:18:08" } ] \ No newline at end of file diff --git a/static/js/demo/exam/testQuestionsListTest.json b/static/js/demo/exam/testQuestionsListTest.json index 599c9ec..cd8a7dd 100644 --- a/static/js/demo/exam/testQuestionsListTest.json +++ b/static/js/demo/exam/testQuestionsListTest.json @@ -1,7 +1,7 @@ [ { "id": "1", - "testPaperName":"英语4级考试", + "testPaperName": "英语4级考试", "testSubjects": "数学模拟考", "trySorting": "随机排序", "paperShow": "整卷展示", @@ -14,11 +14,11 @@ "titleNumber": "10", "singleTopicScore": "60.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "68.00", - "adminPermissions": "0", + "adminPermissions": "完全私有", "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", @@ -26,7 +26,7 @@ }, { "id": "2", - "testPaperName":"三年高考,六年模拟", + "testPaperName": "三年高考,六年模拟", "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", @@ -39,19 +39,19 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "3", - "testPaperName":"C语言基础测试", + "testPaperName": "C语言基础测试", "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", @@ -66,21 +66,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "4", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -92,23 +89,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "88.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "5", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -120,23 +114,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "100.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "6", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -150,21 +141,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "7", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -176,23 +164,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "100.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "8", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -204,23 +189,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "9", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -234,21 +216,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "10", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -260,23 +239,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "100.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "11", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -288,23 +264,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "12", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -318,21 +291,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "13", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -344,23 +314,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "100.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "14", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -372,23 +339,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "15", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -402,21 +366,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "16", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -428,23 +389,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "100.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "17", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -456,11 +414,11 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "100.00", - "adminPermissions": "0", + "adminPermissions": "完全私有", "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", @@ -468,11 +426,8 @@ }, { "id": "18", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -484,23 +439,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "19", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -514,21 +466,18 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" }, { "id": "20", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -540,23 +489,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "0", - "classification":"统考", + "classification": "统考", "totalScore": "78.00", - "adminPermissions": "0", - "modifier": "admin3", + "adminPermissions": "完全私有", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 09:13:15" }, { "id": "21", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -568,23 +514,20 @@ "titleNumber": "5", "singleTopicScore": "50.00", "citations": "1", - "state": "正常", + "state": "启用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "80.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 17:13:15" }, { "id": "22", - "testPaperName":"三年高考,六年模拟", - - - - "testSubjects": "数学模拟考", + "testPaperName": "三年高考,六年模拟", + "testSubjects": "数学模拟考", "trySorting": "固定排序", "paperShow": "整卷展示", "announcedAnswer": "公布答案(公布成绩后,同时公布正确答案)", @@ -598,10 +541,10 @@ "citations": "1", "state": "禁用", "type": "1", - "classification":"个人能力考试", + "classification": "个人能力考试", "totalScore": "10.00", - "adminPermissions": "1", - "modifier": "admin3", + "adminPermissions": "只读共享", + "modifier": "admin3", "startTime": "2020-06-08 09:00:00", "endTime": "2020-06-08 11:00:00", "lastModifiedTime": "2020-06-08 13:13:15" diff --git a/static/public/exam/tableOperation.js b/static/public/exam/tableOperation.js index f5cb095..567872b 100644 --- a/static/public/exam/tableOperation.js +++ b/static/public/exam/tableOperation.js @@ -1,7 +1,7 @@ /*预览试卷的方法(该方法只能在考试管理中试卷管理和考试汇总这两个页面使用 * e,value,row,index->bootstrap-table列中参数 * */ -function detailedTestPaper(e,value,row,index){ +function detailedTestPaper(e, value, row, index) { $('#modal_1 .testPaperName_1').val(row.testPaperName); row.state == "禁用" ? $('#modal_1 .state_1').attr("class", 'form-control state_1 text-danger') : $('#modal_1 .state_1').attr('class', 'form-control state_1 text-success'); @@ -21,12 +21,13 @@ function detailedTestPaper(e,value,row,index){ $('#modal_1').modal() } + /*删除一条记录的方法(通用,使用案例在考试汇总中表删除操作) * e,value,row,index->bootstrap-table列中参数 * url->ajax请求路径 * event->页面选择器 * */ -function deleteRecord( e,value,row,index,url,event) { +function deleteRecord(e, value, row, index, url, event) { swal({ title: '您确定要删除该信息吗?', type: "warning", @@ -61,22 +62,23 @@ function deleteRecord( e,value,row,index,url,event) { swal("删除成功!", "您已经永久删除信息", "success"); }); } + /*删除多条记录的方法(通用,使用案例在用户管理中表删除操作) * url->ajax请求路径 * event->页面选择器 * */ -function deleteAllRecords(url,event){ +function deleteAllRecords(url, event) { let rows = $(event).bootstrapTable('getAllSelections'); - if (rows.length == 0){ + if (rows.length == 0) { swal("至少选中一行!", "", "error"); return false; } let delete_data = []; - for (let i=0;iajax请求路径 * title->提示信息 * format->转出文件名后缀名(可不填) * */ -function exportRecord(url,title,format) { - format==null?format="EXCEL表格":format; +function exportRecord(url, title, format) { + format == null ? format = "EXCEL表格" : format; swal({ - title: "确定要导出"+title+"吗?", - text: "该操作将导出"+title+format+",如果数据较多可能需要较长的时间。", + title: "确定要导出" + title + "吗?", + text: "该操作将导出" + title + format + ",如果数据较多可能需要较长的时间。", type: "warning", showCancelButton: true, confirmButtonColor: "#1E90FF", @@ -133,8 +136,63 @@ function exportRecord(url,title,format) { swal("导出成功!", "您已经永久导出信息", "success"); }); } + +/*普通弹框方法*/ +function promptMessage(url,title,text,btnText) { + swal({ + title: title, + text: text, + type: "warning", + showCancelButton: true, + confirmButtonColor: "#1E90FF", + confirmButtonText: "导出", + closeOnConfirm: false + }, function () { + //ajax请求 + swal("操作成功!","", "success"); + }); +} + +/*查询记录操作*/ +function queryRecords(eventParentName,dataList,sunccess) { + let judge = false; + let queryList =dataList; + let queryMap = new Map(); + queryList.forEach(function (item, index) { + let event = $(''+eventParentName+' input[name='+item+']'); + console.log(event); + event.val() == "" ? judge = true : queryMap.set(event.attr('name'), event.val()); + }) + //封装json数据 + let query_data = '{'; + queryMap.forEach(function (value, key, map) { + query_data += '"' + key + '":"' + value + '",'; + }) + query_data = query_data.substr(0, query_data.length - 1); + query_data = query_data + '}'; + alert(query_data); + /* //发送ajax 查询 + $.ajax({ + url: appName+"/book/deleteSelect.do", + method: "post", + async: true, + data: query_data, + dataType: "text", //期望服务端返回的数据类型 + contentType: "application/json", + success: function (data) { + console.log(data.toString()); + //重新加载页面 + $('#tb_departments').bootstrapTable('load', data); + }, + error: function (jqXHR) { + swal("搜索失败!", "未知错误", "error"); + } + });*/ + !judge ? swal("搜索成功!", "已为你重新加载数据", "success") : + swal("搜索失败", "搜索数据不允许为空", "error"); +} /*创建最基本的bootstrap-table表格(通用,使用案例在考试汇总中表创建操作)*/ -function createTable(event,url,toolbar,search,data,method) { +function createTable(event, url, toolbar, search, data, method) { $(event).bootstrapTable({ url: url, //请求后台的URL(*) method: method, //请求方式(*) @@ -143,19 +201,92 @@ function createTable(event,url,toolbar,search,data,method) { cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) pagination: true, //是否显示分页(*) sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*) - pageNumber:1, //初始化加载第一页,默认第一页 - pageSize: 10, //每页的记录行数(*) - pageList: [10, 25, 50, 100], //可供选择的每页的行数(*) + pageNumber: 1, //初始化加载第一页,默认第一页 + pageSize: 5, //每页的记录行数(*) + pageList: [5, 10, 15, 20], //可供选择的每页的行数(*) search: search, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端 showSearchButton: true, - searchAlign:"left", - toolbarAlign: "right", + searchAlign: "left", + toolbarAlign: "left", searchFields: "customerBelongs", minimumCountColumns: 2, //最少允许的列数 - clickToSelect: true, //是否启用点击选中行 - height: 500, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 - uniqueId: "id", //每一行的唯一标识,一般为主键列 - columns: data + columns: data, + uniqueId: "id", }); } -/*回显表单中的数据(通用)*/ \ No newline at end of file + +/*回显表单中的数据(通用) +* eventParentName->父级控件名 +* echoDataList->数据集合 数据格式为 +* let echoDataList = new Array(["testPaperName_1","testPaperName"],[switchery_NoTable,"state","true"],"classification") +* echoDataList参数一为该input的name,参数二为json对应的字段名,参数三是否是滑动按钮(只有时滑动按钮时,参数3才可以选择) +* 在input的name和json对应的字段名对应一致时,只需参数1 +* 在input的name和json对应的字段名对应不一致时,则需要填写参数1和2 +* 使用按钮详见exam->paperManagementList页面 +* */ +function echoDataForm(eventParentName, echoDataList, row) { + function value(item, row) { + let value = ""; + for (let i in row) { + i == item ? value = row[i] : ""; + } + value==""?value = item:""; + return value; + } + + echoDataList.forEach(function (item, index) { + (typeof item) == "object" ? + Object.keys(item).length == "3" ? + (value(item[1], row) == '启用' && !item[0].isChecked()) || (value(item[1], row) == '禁用' && item[0].isChecked()) ? + item[0].setPosition(true) : "" + : $(eventParentName + ' input[name=\"' + item[0] + '\"]').val(value(item[1], row)) : + $(eventParentName + ' input[name=\"' + item + '\"]').val(value(item, row)); + }) +} + +/*获取json数据的方法,通过同步请求*/ +function getAjaxSynchronousData(url,type) { + let pageData = ""; + $.ajax({ + url: url, //json文件位置 + type: type, //请求方式为get/post + dataType: "json", //返回数据格式为json + async:false, + success:function(data) { //请求成功完成后要执行的方法 + console.log("获取json数据的方法成功") + pageData = data; + }, + error:function (data) { + console.log("获取json数据的方法失败") + } + }) + return pageData; +} + +/*获取json数据的方法,通过异步请求*/ +function getAjaxAsynchronousData(url,type) { + let pageData = ""; + (function () { + getPageData(function (callbackData) { + console.log("已经回调方法") + pageData = callbackData; + }); + })(); + + function getPageData(callbackData) { + $.ajax({ + url: url, + type: type, + dataType: "json", + async:false, + success:function(data) { + console.log("获取json数据的方法成功") + callbackData(data); + }, + error:function () { + console.log("获取json数据的方法失败") + } + }) + } + return pageData; +} \ No newline at end of file diff --git a/templates/exam/examManagementList.html b/templates/exam/examManagementList.html index 555c351..30229c1 100644 --- a/templates/exam/examManagementList.html +++ b/templates/exam/examManagementList.html @@ -40,12 +40,12 @@ } - #isTestRecords #testRecords_form .col-md-2,#examManagementForm .col-md-2,#examManagementForm .col-md-4{ + #isTestRecords #testRecords_form .col-md-2,#lackTestRecords_form .col-md-2, #examManagementForm .col-md-2, #examManagementForm .col-md-4 { padding-left: 0px; padding-right: 8px; } - #isTestRecords .col-md-5{ + #isTestRecords .col-md-5 { padding: 0; } @@ -81,7 +81,7 @@ 填写考试基本信息
-
+
-
+
@@ -99,7 +99,7 @@
+ placeholder="分类" style="border-color:#f8ac59">
@@ -256,7 +256,7 @@
+ name="testTime"> 分钟
@@ -351,63 +351,70 @@
-
-
- -
- - +
+
+ +
+ + +
-
-
-
-
- -
- - + +
+
+
+ +
+ + +
-
-
-
-
- -
- - +
+ +
+
+
+ +
+ + +
-
+
-
-
- - - +
+
+ + + +
-
+
@@ -453,14 +460,15 @@
-
- +
+
- +
- +
- -
+ +
@@ -531,14 +540,15 @@
-
-
- 进度: +
+ 进度:
@@ -631,8 +641,81 @@
- + + @@ -679,13 +762,14 @@ }); let checked_notable = false; + let switchery_notable; /* 初始化非表单滑动按钮状态*/ function switchForNoTable() { let elems = Array.prototype.slice.call($('.js-switch-notable')); elems.forEach(function (html) { /* size: 'normal' 控制大小*/ - let switchery = new Switchery(html); + switchery_notable = new Switchery(html); html.onchange = function () { checked_notable = html.checked; } @@ -776,7 +860,8 @@ } else { $("#createTestPaper form")[0].reset(); $("#createTestPaper form")[1].reset(); - $('#createTestPaper form .form-group').attr('class', 'form-group') + $('#createTestPaper form .form-control').css('border-color',"") + switchery_notable.setPosition(false); } //如果是更新,则去掉按钮颜色 addOrUpdate == "update" ? $('#tab-1 button[title="创建考试"]').attr('class', 'btn btn-white dropdown-toggle') : ""; @@ -805,20 +890,22 @@ $("#createTestPaper form")[0].reset(); $("#createTestPaper form")[1].reset(); //回显数据 - if (arrayForValue.size > 1) { + if (arrayForValue.size > 0) { arrayForValue.forEach(function (value, key) { - key.parents('.form-group').attr('class') == "form-group has-error" ? key.parents('.form-group').attr('class', 'form-group') : ""; + key.css('border-color') == "#f8ac59" ? key.css('border-color','') : ""; key.val(value); }); } - if (arrayIsNull.length > 1) { + if (arrayIsNull.length > 0) { arrayIsNull.forEach(function (item, index) { - item.parents('.form-group').attr({'class': "form-group has-error"}); + item.css('border-color',"#f8ac59") ; + }) } //清空集合 arrayForValue.clear(); arrayIsNull.splice(0, arrayIsNull.length); + console.log("回显成功"); } let parameters = new Array() @@ -859,7 +946,7 @@ }); query_data = query_data + '"+startUsing":' + startUsing; query_data = query_data + "}"; - console.log(query_data); + console.log(query_data) if (addOrUpdate == "add") { //发送添加操作 } else { @@ -894,7 +981,6 @@ function pageJudgment(addOrUpdate) { addOrUpdate == "add" ? testPaper("add") : testPaper("update"); } - $('#createTestPaper .add').click(function () { if ($('#tab-1 button[title="创建考试"]').attr('class') != 'btn btn-white dropdown-toggle') { testProcessing("add"); @@ -906,7 +992,8 @@ $('#createTestPaper .reset').click(function () { $("#createTestPaper form")[0].reset(); $("#createTestPaper form")[1].reset(); - $('#createTestPaper form .form-group').attr('class', 'form-group') + $('#createTestPaper form .form-control').css('border-color',"") + switchery_notable.setPosition(false); }); /********************************************END---表单********************************************/ @@ -914,6 +1001,7 @@ @@ -1124,65 +1235,111 @@ columns: [{ checkbox: true - },{ - title:"考生", - formatter:examinee - },{ - title:"考生组", - field:"examineeGroup" - },{ - title:"证件号", + }, { + title: "考生", + formatter: examinee + }, { + title: "考生组", + field: "examineeGroup" + }, { + title: "证件号", field: "idNumber" - },{ - title:"考试时间", - formatter:testTime - },{ - title:"考试用时", - formatter:examTime - },{ - title:"批改状态", - formatter:correctingState - },{ - title:"得分", - formatter:score - },{ - title:"来源", - formatter:source - },{ - title:"操作", - formatter:operation_1 + }, { + title: "考试时间", + formatter: testTime + }, { + title: "考试用时", + formatter: examTime + }, { + title: "批改状态", + formatter: correctingState + }, { + title: "得分", + formatter: score + }, { + title: "来源", + formatter: source + }, { + title: "操作", + formatter: operation_1, + events:{ + /*删除*/ + 'click button[title=删除]': function (e, value, row, index) { + deleteRecord(e, value, row, index, "", '#tb_departments_1'); + }, /*END--删除*/ + } }] }); + let lackTestRecordsData = [ + { + title: "用户名", + field: "examinee" + }, { + title: "真实姓名", + field: "name" + }, { + title: "证件编号", + field: "idNumber" + }, { + title: "考生组", + field: "examineeGroup" + }, { + title: "职务", + field: "position" + }, { + title: "状态", + formatter:lackTestState + }, { + title: "注册时间", + field: "registrationTime" + }, { + title: "最后登陆时间", + field: "releaseTime" + } + ]; + createTable('#tb_departments_2',"../../static/js/demo/exam/examManagementList.json","",false,lackTestRecordsData,"get"); /***********************************************参数个性化********************************************/ //考生 - function examinee(value,row,index) { + function examinee(value, row, index) { return '

' + row.examinee + '

' + row.name + '

'; } + //考试用时 - function examTime(value,row,index) { + function examTime(value, row, index) { return '' + row.score + '分钟'; } + //批改状态 function correctingState(value, row, index) { - return row.state == 'true' ? ' ' : + return row.correctingState == 'true' ? ' ' : ' ' } + //得分 function score(value, row, index) { return row.score >= 80 ? '' + row.score + '' : row.score >= 60 ? '' + row.score + '' : '' + row.score + ''; } + //来源 - function source(value,row,index) { + function source(value, row, index) { return '  ' + row.source + ''; } - //操作 + + //缺考状态 + function lackTestState(value, row, index) { + return row.state == "正常" ? '' + row.state + '' : + '' + row.state + '' ; + + } + //操作 function operation_1(value, row, index) { return '' + ''; } + //初始化滑动按钮状态 function switchForTable_1() { let elems = Array.prototype.slice.call($('.js-switch-table-state_1')); @@ -1194,30 +1351,33 @@ } }); } + /******************************************END---参数个性化********************************************/ \ No newline at end of file diff --git a/templates/exam/paperManagementList.html b/templates/exam/paperManagementList.html index 8a02ee1..3824c86 100644 --- a/templates/exam/paperManagementList.html +++ b/templates/exam/paperManagementList.html @@ -541,12 +541,13 @@ switchForNoTable(); }); let checked_notable = false; + let switchery_NoTable; /* 初始化非表格中的滑动按钮状态*/ function switchForNoTable() { let elems = Array.prototype.slice.call($('.js-switch-notable')); elems.forEach(function (html) { /* size: 'normal' 控制大小*/ - let switchery = new Switchery(html); + switchery_NoTable = new Switchery(html); html.onchange = function () { checked_notable = html.checked; } @@ -690,7 +691,8 @@ echoData(parameters); }else { $("#createTestPaper form")[0].reset(); - $('#createTestPaper form .form-group').attr('class','form-group') + $('#createTestPaper form input').css('border-color',"") + switchery_NoTable.setPosition(false); } //如果是更新,则去掉按钮颜色 addOrUpdate=="update"? $('#tab-1 button[title="创建试卷"]').attr('class', 'btn btn-white dropdown-toggle'):""; @@ -772,15 +774,17 @@ //刷新页面 $("#createTestPaper form")[0].reset(); //回显数据 - if (arrayForValue.size>1){ - arrayForValue.forEach(function(value,key){ - key.parents('.form-group').attr('class')=="form-group has-error"?key.parents('.form-group').attr('class','form-group'):""; + if (arrayForValue.size > 0) { + arrayForValue.forEach(function (value, key) { + key.css('border-color') == "#f8ac59" ? key.css('border-color','') : ""; key.val(value); }); } - if (arrayIsNull.length>1){ - arrayIsNull.forEach(function (item,index) { - item.parents('.form-group').attr({'class':"form-group has-error"}); + if (arrayIsNull.length > 0) { + arrayIsNull.forEach(function (item, index) { + console.log("已到回显") + item.css('border-color',"#f8ac59") ; + }) } //清空集合 @@ -803,7 +807,8 @@ $('#createTestPaper .reset').click(function () { $("#createTestPaper form")[0].reset(); - $('#createTestPaper form .form-group').attr('class','form-group') + $('#createTestPaper form input').css('border-color',"") + switchery_NoTable.setPosition(false); }); /********************************************END---表单********************************************/ @@ -872,8 +877,9 @@ }else { testPaper(2,"update"); } - let echoDataMap = new Map(); - //key->选择器 value->数据 + let echoDataList = new Array(); + echoDataList.push(["testPaperName_1","testPaperName"],[switchery_NoTable,"state","true"],"classification","adminPermissions"); + echoDataForm('.createTestPaper',echoDataList,row); judging = false; }, /*END--修改*/ /*删除*/ @@ -1002,13 +1008,13 @@ //状态(我的试卷) function state(value, row, index) { - return row.state == '正常' ? ' ' : + return row.state == '启用' ? ' ' : ' ' } //状态(共享试卷) function state_1(value, row, index) { - return row.state == '正常' ? ' ' : + return row.state == '启用' ? ' ' : ' ' } @@ -1026,7 +1032,7 @@ //管理权限 function adminPermissions(value, row, index) { - return row.adminPermissions == '0' ? '  完全私有' : + return row.adminPermissions == '完全私有' ? '  完全私有' : '  只读共享'; } diff --git a/templates/user/stuList.html b/templates/user/stuList.html index 15cc2ce..8a1b8ac 100644 --- a/templates/user/stuList.html +++ b/templates/user/stuList.html @@ -17,9 +17,11 @@ - - @@ -51,23 +54,28 @@
-
-
- -
+
+ +
+
+
- +
-
-
-
- -
-
- -
- - +
+
+
+
+ +
+ + +
+
-
-
-
- -
-
- -
- - +
+
+
+ +
+ + +
+
-
-
-
- -
-
- -
- - +
+
+
+ +
+ + +
+
-
-
-
- -
-
- - - -
+
+
+
+ + + +
+
+
+
+
+ +
+
+
+ + + +
-
- - - - - +
+
-
+
- +
@@ -163,11 +189,12 @@
-