Quellcode durchsuchen

增加mock data代理

Michael Wang vor 6 Jahren
Ursprung
Commit
d713f7a06f

+ 11 - 1
http-test/online-exam.http

@@ -7,7 +7,7 @@ Content-Type: application/json;charset=UTF-8
 "accountType":"STUDENT_CODE"}
 
 
-@token = 2d8084de57894655bef55cd9b6460cca
+@token = c6be55a5ae7f4dbbbd27c831947c034c
 @key = U_S_109_53286
 
 ###
@@ -53,9 +53,19 @@ GET https://ecs-dev.qmth.com.cn:8878/api/exam_control/heartbeat
 token: {{token}}
 key: {{key}}
 
+### exam_question
+GET https://ecs-dev.qmth.com.cn:8878/api/exam_question/?exam_record_id=101536
+token: {{token}}
+key: {{key}}
+
 ### question
 GET https://ecs-dev.qmth.com.cn:8878/api/exam_question/3086506
 token: {{token}}
 key: {{key}}
 
+### question
+GET https://ecs-dev.qmth.com.cn:8878/api/exam_question/question/?question_id=5b69024e0fe2d242219a191b
+token: {{token}}
+key: {{key}}
+
 

+ 948 - 0
mock/db.json

@@ -0,0 +1,948 @@
+{
+  "examQuestions": [
+    {
+      "id": 3088073,
+      "questionId": "5b712c150fe2d22c6301e5e7",
+      "orders": 1,
+      "mainNumber": 1,
+      "subNumber": 1,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 3.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088074,
+      "questionId": "5b712c150fe2d22c6301e5e8",
+      "orders": 2,
+      "mainNumber": 1,
+      "subNumber": 2,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 4.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088075,
+      "questionId": "5b712c150fe2d22c6301e5e9",
+      "orders": 3,
+      "mainNumber": 1,
+      "subNumber": 3,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 4.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088076,
+      "questionId": "5b712c150fe2d22c6301e5ea",
+      "orders": 4,
+      "mainNumber": 1,
+      "subNumber": 4,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 4.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088077,
+      "questionId": "5b712c150fe2d22c6301e5eb",
+      "orders": 5,
+      "mainNumber": 1,
+      "subNumber": 5,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 4.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088078,
+      "questionId": "5b712c150fe2d22c6301e5ed",
+      "orders": 6,
+      "mainNumber": 2,
+      "subNumber": 6,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088079,
+      "questionId": "5b712c150fe2d22c6301e5ee",
+      "orders": 7,
+      "mainNumber": 2,
+      "subNumber": 7,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088080,
+      "questionId": "5b712c150fe2d22c6301e5ef",
+      "orders": 8,
+      "mainNumber": 2,
+      "subNumber": 8,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088081,
+      "questionId": "5b712c150fe2d22c6301e5f0",
+      "orders": 9,
+      "mainNumber": 2,
+      "subNumber": 9,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088082,
+      "questionId": "5b712c150fe2d22c6301e5f2",
+      "orders": 10,
+      "mainNumber": 3,
+      "subNumber": 10,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 4.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088083,
+      "questionId": "5b712c150fe2d22c6301e5f3",
+      "orders": 11,
+      "mainNumber": 3,
+      "subNumber": 11,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 4.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088084,
+      "questionId": "5b712c150fe2d22c6301e5f4",
+      "orders": 12,
+      "mainNumber": 3,
+      "subNumber": 12,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 4.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088085,
+      "questionId": "5b712c150fe2d22c6301e5f5",
+      "orders": 13,
+      "mainNumber": 3,
+      "subNumber": 13,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 4.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088086,
+      "questionId": "5b712c150fe2d22c6301e5f6",
+      "orders": 14,
+      "mainNumber": 3,
+      "subNumber": 14,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 4.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088087,
+      "questionId": "5b712c150fe2d22c6301e5f8",
+      "orders": 15,
+      "mainNumber": 4,
+      "subNumber": 15,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088088,
+      "questionId": "5b712c150fe2d22c6301e5f9",
+      "orders": 16,
+      "mainNumber": 4,
+      "subNumber": 16,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088089,
+      "questionId": "5b712c150fe2d22c6301e5fa",
+      "orders": 17,
+      "mainNumber": 4,
+      "subNumber": 17,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088090,
+      "questionId": "5b712c150fe2d22c6301e5fb",
+      "orders": 18,
+      "mainNumber": 4,
+      "subNumber": 18,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088091,
+      "questionId": "5b712c150fe2d22c6301e5fd",
+      "orders": 19,
+      "mainNumber": 5,
+      "subNumber": 19,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 10.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088092,
+      "questionId": "5b712c150fe2d22c6301e5fe",
+      "orders": 20,
+      "mainNumber": 5,
+      "subNumber": 20,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 10.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088093,
+      "questionId": "5b712c150fe2d22c6301e600",
+      "orders": 21,
+      "mainNumber": 6,
+      "subNumber": 21,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 25.0,
+      "examRecordId": 101536,
+      "subQuestionList": [
+        {
+          "id": 3088094,
+          "questionId": null,
+          "orders": 21,
+          "mainNumber": 6,
+          "subNumber": 1,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 5.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        },
+        {
+          "id": 3088095,
+          "questionId": null,
+          "orders": 22,
+          "mainNumber": 6,
+          "subNumber": 2,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 5.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        },
+        {
+          "id": 3088096,
+          "questionId": null,
+          "orders": 23,
+          "mainNumber": 6,
+          "subNumber": 3,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 5.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        },
+        {
+          "id": 3088097,
+          "questionId": null,
+          "orders": 24,
+          "mainNumber": 6,
+          "subNumber": 4,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 10.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        }
+      ],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": true
+    },
+    {
+      "id": 3088094,
+      "questionId": null,
+      "orders": 21,
+      "mainNumber": 6,
+      "subNumber": 1,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088093,
+        "questionId": "5b712c150fe2d22c6301e600",
+        "orders": 21,
+        "mainNumber": 6,
+        "subNumber": 21,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 25.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088095,
+      "questionId": null,
+      "orders": 22,
+      "mainNumber": 6,
+      "subNumber": 2,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088093,
+        "questionId": "5b712c150fe2d22c6301e600",
+        "orders": 21,
+        "mainNumber": 6,
+        "subNumber": 21,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 25.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088096,
+      "questionId": null,
+      "orders": 23,
+      "mainNumber": 6,
+      "subNumber": 3,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088093,
+        "questionId": "5b712c150fe2d22c6301e600",
+        "orders": 21,
+        "mainNumber": 6,
+        "subNumber": 21,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 25.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088097,
+      "questionId": null,
+      "orders": 24,
+      "mainNumber": 6,
+      "subNumber": 4,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 10.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088093,
+        "questionId": "5b712c150fe2d22c6301e600",
+        "orders": 21,
+        "mainNumber": 6,
+        "subNumber": 21,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 25.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088098,
+      "questionId": "5b712c150fe2d22c6301e601",
+      "orders": 25,
+      "mainNumber": 6,
+      "subNumber": 22,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 25.0,
+      "examRecordId": 101536,
+      "subQuestionList": [
+        {
+          "id": 3088099,
+          "questionId": null,
+          "orders": 25,
+          "mainNumber": 6,
+          "subNumber": 1,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 5.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        },
+        {
+          "id": 3088100,
+          "questionId": null,
+          "orders": 26,
+          "mainNumber": 6,
+          "subNumber": 2,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 5.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        },
+        {
+          "id": 3088101,
+          "questionId": null,
+          "orders": 27,
+          "mainNumber": 6,
+          "subNumber": 3,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 5.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        },
+        {
+          "id": 3088102,
+          "questionId": null,
+          "orders": 28,
+          "mainNumber": 6,
+          "subNumber": 4,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 10.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        }
+      ],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": true
+    },
+    {
+      "id": 3088099,
+      "questionId": null,
+      "orders": 25,
+      "mainNumber": 6,
+      "subNumber": 1,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088098,
+        "questionId": "5b712c150fe2d22c6301e601",
+        "orders": 25,
+        "mainNumber": 6,
+        "subNumber": 22,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 25.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088100,
+      "questionId": null,
+      "orders": 26,
+      "mainNumber": 6,
+      "subNumber": 2,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088098,
+        "questionId": "5b712c150fe2d22c6301e601",
+        "orders": 25,
+        "mainNumber": 6,
+        "subNumber": 22,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 25.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088101,
+      "questionId": null,
+      "orders": 27,
+      "mainNumber": 6,
+      "subNumber": 3,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088098,
+        "questionId": "5b712c150fe2d22c6301e601",
+        "orders": 25,
+        "mainNumber": 6,
+        "subNumber": 22,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 25.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088102,
+      "questionId": null,
+      "orders": 28,
+      "mainNumber": 6,
+      "subNumber": 4,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 10.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088098,
+        "questionId": "5b712c150fe2d22c6301e601",
+        "orders": 25,
+        "mainNumber": 6,
+        "subNumber": 22,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 25.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088103,
+      "questionId": "5b712c150fe2d22c6301e603",
+      "orders": 29,
+      "mainNumber": 7,
+      "subNumber": 23,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 15.0,
+      "examRecordId": 101536,
+      "subQuestionList": [
+        {
+          "id": 3088104,
+          "questionId": null,
+          "orders": 29,
+          "mainNumber": 7,
+          "subNumber": 1,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 5.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        },
+        {
+          "id": 3088105,
+          "questionId": null,
+          "orders": 30,
+          "mainNumber": 7,
+          "subNumber": 2,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 5.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        },
+        {
+          "id": 3088106,
+          "questionId": null,
+          "orders": 31,
+          "mainNumber": 7,
+          "subNumber": 3,
+          "answer": null,
+          "stuAnswer": null,
+          "isSign": false,
+          "isAnswered": false,
+          "score": 5.0,
+          "examRecordId": 101536,
+          "subQuestionList": [],
+          "parentQuestion": null,
+          "isMultiple": null,
+          "nestedQuestion": false
+        }
+      ],
+      "parentQuestion": null,
+      "isMultiple": null,
+      "nestedQuestion": true
+    },
+    {
+      "id": 3088104,
+      "questionId": null,
+      "orders": 29,
+      "mainNumber": 7,
+      "subNumber": 1,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088103,
+        "questionId": "5b712c150fe2d22c6301e603",
+        "orders": 29,
+        "mainNumber": 7,
+        "subNumber": 23,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 15.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088105,
+      "questionId": null,
+      "orders": 30,
+      "mainNumber": 7,
+      "subNumber": 2,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088103,
+        "questionId": "5b712c150fe2d22c6301e603",
+        "orders": 29,
+        "mainNumber": 7,
+        "subNumber": 23,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 15.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    },
+    {
+      "id": 3088106,
+      "questionId": null,
+      "orders": 31,
+      "mainNumber": 7,
+      "subNumber": 3,
+      "answer": null,
+      "stuAnswer": null,
+      "isSign": false,
+      "isAnswered": false,
+      "score": 5.0,
+      "examRecordId": 101536,
+      "subQuestionList": [],
+      "parentQuestion": {
+        "id": 3088103,
+        "questionId": "5b712c150fe2d22c6301e603",
+        "orders": 29,
+        "mainNumber": 7,
+        "subNumber": 23,
+        "answer": null,
+        "stuAnswer": null,
+        "isSign": false,
+        "isAnswered": false,
+        "score": 15.0,
+        "examRecordId": 101536,
+        "subQuestionList": [],
+        "parentQuestion": null,
+        "isMultiple": null,
+        "nestedQuestion": true
+      },
+      "isMultiple": null,
+      "nestedQuestion": false
+    }
+  ]
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 243 - 131
package-lock.json


+ 2 - 0
package.json

@@ -5,6 +5,7 @@
   "scripts": {
     "start": "vue-cli-service serve",
     "serve": "vue-cli-service serve",
+    "mock": "json-server --watch mock/db.json",
     "build:staging": "vue-cli-service build --mode staging",
     "build:prod": "vue-cli-service build",
     "lint": "vue-cli-service lint",
@@ -13,6 +14,7 @@
   "dependencies": {
     "axios": "^0.18.0",
     "iview": "^2.14.3",
+    "json-server": "^0.14.0",
     "moment": "^2.22.2",
     "register-service-worker": "^1.0.0",
     "vue": "^2.5.17",

+ 29 - 1
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -47,8 +47,10 @@ export default {
     );
     this.paperStruct = paperStruct.data;
 
+    // FIXME: global API processing. mock or not
     const examQuestionList = await this.$http.get(
-      "/api/exam_question/?exam_record_id=" + this.$route.query.examRecordId
+      "/api/mock/exam_question/?exam_record_id=" +
+        this.$route.query.examRecordId
     );
     this.examQuestionList = examQuestionList.data;
     this.examQuestion = this.examQuestionList[0];
@@ -63,6 +65,18 @@ export default {
 </script>
 
 <style scoped>
+.container {
+  /* display: flex;
+  flex-direction: row; */
+  display: grid;
+  grid-template-areas:
+    "header header"
+    "main side";
+  grid-template-rows: 80px 1fr;
+  grid-template-columns: 1fr 300px;
+
+  height: 100vh;
+}
 .header {
   /* display: flex;
   flex-direction: row; */
@@ -70,6 +84,20 @@ export default {
   place-items: center;
   grid-template-columns: 200px 1fr 300px 100px;
 
+  grid-area: header;
+
   height: 80px;
 }
+
+.main {
+  display: grid;
+
+  grid-area: main;
+}
+
+.side {
+  display: grid;
+
+  grid-area: side;
+}
 </style>

+ 93 - 7
src/features/OnlineExam/Examing/QuestionView.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class="question-view">
-    <div class="question-group">{{examQuestion}}</div>
-    <div class="question-group-progress">{{examQuestion}}</div>
-    <div class="question-body">{{examQuestion}}</div>
-    <div class="question-options">{{examQuestion}}</div>
+  <div v-if="question && examQuestion" class="question-view">
+    <div class="question-group">{{"大题占位"}}</div>
+    <div class="question-group-progress">{{"大题进度占位"}}</div>
+    <div class="question-body" v-html="question.body"></div>
+    <div class="question-options" v-html="question.options[0].content"></div>
   </div>
 </template>
 
@@ -11,14 +11,100 @@
 export default {
   name: "QuestionView",
   data() {
-    return {};
+    return {
+      question: null
+    };
   },
   props: {
     examQuestion: Object
   },
-  async mounted() {},
   computed: {
     all: function() {}
+  },
+  methods: {
+    async updateQuestion() {
+      if (!this.examQuestion) {
+        return;
+      }
+      const res = await this.$http.get(
+        "/api/exam_question/question/?question_id=" +
+          this.examQuestion.questionId
+      );
+      const question = res.data;
+      const examQuestion = this.examQuestion;
+
+      const transferWellNumberAndTrustInBody = function(repQuestion) {
+        //将题干中的三个#替换为下划线
+        if (repQuestion.body) {
+          //将题干里的&nbsp;换成空格
+          repQuestion.body = repQuestion.body
+            .toString()
+            .replace(new RegExp("&nbsp;", "g"), " ");
+          repQuestion.body = repQuestion.body
+            .toString()
+            .replace(new RegExp("###", "g"), "_______");
+          //将题干中的两个##数字##替换为下划线
+          var baseIndex = examQuestion.orders - 1;
+          repQuestion.body = repQuestion.body
+            .toString()
+            .replace(/##(\d+)##/g, function(a, b) {
+              return "__" + (baseIndex + parseInt(b)) + "__";
+            });
+          // repQuestion.body = $sce.trustAsHtml(repQuestion.body);
+        }
+      };
+      const initQuestion = function(repQuestion) {
+        if (
+          repQuestion.questionType === "SINGLE_ANSWER_QUESTION" ||
+          repQuestion.questionType === "MULTIPLE_ANSWER_QUESTION"
+        ) {
+          for (var i = 0, imax = repQuestion.options.length; i < imax; i++) {
+            // repQuestion.options[i].content = $sce.trustAsHtml(
+            //   repQuestion.options[i].content
+            // );
+          }
+        }
+        if (repQuestion.questionType === "FILL_BLANK_QUESTION") {
+          if (repQuestion.answer && repQuestion.answer.indexOf("##") > -1) {
+            //优先使用##
+            repQuestion.answerList = repQuestion.answer.split("##");
+          } else {
+            repQuestion.answerList = [repQuestion.answer];
+          }
+        }
+
+        transferWellNumberAndTrustInBody(repQuestion);
+      };
+
+      //判断是否为套题
+      if (question.nestedQuestion) {
+        transferWellNumberAndTrustInBody(question);
+        for (var j = 0, jmax = question.subQuestionList.length; j < jmax; j++) {
+          initQuestion(question.subQuestionList[j]);
+        }
+        // 对子题进行排序
+        if (question.subQuestionList && question.subQuestionList.length > 0) {
+          question.subQuestionList.sort(function(a, b) {
+            if (a.quesNumber > b.quesNumber) {
+              return 1;
+            } else if (a.quesNumber < b.quesNumber) {
+              return -1;
+            } else {
+              return 0;
+            }
+          });
+        }
+      } else {
+        initQuestion(question);
+      }
+
+      this.question = question;
+    }
+  },
+  watch: {
+    examQuestion: function() {
+      this.updateQuestion();
+    }
   }
 };
 </script>

+ 0 - 1
src/features/OnlineExam/OnlineExamFaceCheckModal.vue

@@ -120,4 +120,3 @@ export default {
   line-height: 1.8em;
 }
 </style>
-

+ 1 - 1
src/features/Password/Password.vue

@@ -125,7 +125,7 @@ export default {
         if (res.status == 200) {
           this.$Message.success("保存成功");
         }
-      } catch {
+      } catch (e) {
         this.$Message.error("保存失败");
       }
     }

+ 1 - 1
src/features/login/Login.vue

@@ -92,7 +92,7 @@ export default {
       );
       const productName = res.data.examSysName;
       this.productName = productName || "远程教育网络考试";
-    } catch {
+    } catch (e) {
       this.productName = "远程教育网络考试";
     }
     window.localStorage.removeItem("token");

+ 5 - 0
src/utils/axios.js

@@ -1,5 +1,6 @@
 import Vue from "vue";
 import axios from "axios";
+import { loadProgressBar } from "./axiosProgress";
 import { Message } from "iview";
 import router from "../router";
 import { UPYUN_UPLOAD_URL, UPYUN_HEADER_AUTH } from "@/constants/constants.js";
@@ -86,6 +87,8 @@ qmInstance.defaults.withCredentials = true; //允许跨域携带cookie
 qmInstance.defaults.timeout = 10000; //超时时间
 qmInstance.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"; //标识这是一个 ajax 请求
 
+loadProgressBar(qmInstance);
+
 const upyunInstance = axios.create({
   baseURL: UPYUN_UPLOAD_URL
 });
@@ -93,6 +96,8 @@ const upyunInstance = axios.create({
 upyunInstance.defaults.headers.common = {};
 upyunInstance.defaults.headers.common["Authorization"] = UPYUN_HEADER_AUTH;
 
+loadProgressBar(upyunInstance);
+
 Vue.prototype.$http = qmInstance;
 Vue.prototype.$upyunhttp = upyunInstance;
 export default {

+ 46 - 0
src/utils/axiosProgress.js

@@ -0,0 +1,46 @@
+import iView from "iview";
+import axios from "axios";
+
+const calculatePercentage = (loaded, total) => Math.floor(loaded * 1.0) / total;
+
+export function loadProgressBar(instance = axios) {
+  let requestsCounter = 0;
+
+  const setupStartProgress = () => {
+    instance.interceptors.request.use(config => {
+      requestsCounter++;
+      iView.LoadingBar.start();
+      return config;
+    });
+  };
+
+  const setupUpdateProgress = () => {
+    const update = e =>
+      iView.LoadingBar.update(calculatePercentage(e.loaded, e.total));
+    instance.defaults.onDownloadProgress = update;
+    instance.defaults.onUploadProgress = update;
+  };
+
+  const setupStopProgress = () => {
+    const responseFunc = response => {
+      if (--requestsCounter === 0) {
+        iView.LoadingBar.finish();
+      }
+      return response;
+    };
+
+    const errorFunc = error => {
+      if (--requestsCounter === 0) {
+        iView.LoadingBar.error();
+      }
+      console.log(error);
+      return error;
+    };
+
+    instance.interceptors.response.use(responseFunc, errorFunc);
+  };
+
+  setupStartProgress();
+  setupUpdateProgress();
+  setupStopProgress();
+}

+ 13 - 1
vue.config.js

@@ -40,11 +40,23 @@ const stu = [
 
 for (const s of stu) {
   proxy[s] = {
-    target: " http://ecs-dev.qmth.com.cn:8003", // 陈恳
+    target: "http://ecs-dev.qmth.com.cn:8003", // 陈恳
     changeOrigin: true
   };
 }
 
+const mock = [{ source: "/api/mock/exam_question", dest: "/examQuestions" }];
+
+for (const m of mock) {
+  proxy[m.source] = {
+    target: "http://localhost:3000/",
+    changeOrigin: true,
+    pathRewrite: {
+      ".*": m.dest
+    }
+  };
+}
+
 var webpack = require("webpack");
 module.exports = {
   devServer: {

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.