Explorar o código

add mock data

Michael Wang %!s(int64=2) %!d(string=hai) anos
pai
achega
4c8a2f8391

+ 21 - 1
cypress/e2e/mark-header.spec.cy.ts

@@ -1,4 +1,24 @@
 describe("评卷页面", () => {
+  beforeEach(() => {
+    cy.intercept("POST", "/mark/getSetting", {
+      fixture: "settings-1.json",
+    });
+    cy.intercept("GET", "/slice/1/374/46208374-1.jpg", {
+      fixture: "assets/46208374-1.jpg,null",
+    });
+    cy.intercept("GET", "/slice/1/374/46208374-2.jpg", {
+      fixture: "assets/46208374-2.jpg,null",
+    });
+    cy.intercept("GET", "/slice/1/374/46208374-3.jpg", {
+      fixture: "assets/46208374-3.jpg,null",
+    });
+    cy.intercept("GET", "/slice/1/374/46208374-4.jpg", {
+      fixture: "assets/46208374-4.jpg,null",
+    });
+    // FIXME: need better way to do it
+    cy.intercept("GET", "/slice/**", { fixture: "assets/46208374-1.jpg,null" });
+  });
+
   it("成功加载", () => {
     cy.visit("/"); // change URL to match your dev URL
   });
@@ -10,7 +30,7 @@ describe("评卷页面", () => {
 
   it("用户姓名显示", () => {
     cy.visit("/");
-    cy.get(".header-container").should("contain", "小兰");
+    cy.get(".header-container").should("contain", "小兰");
   });
 
   it("小助手显示", () => {

BIN=BIN
cypress/fixtures/assets/46208374-1.jpg


BIN=BIN
cypress/fixtures/assets/46208374-2.jpg


BIN=BIN
cypress/fixtures/assets/46208374-3.jpg


BIN=BIN
cypress/fixtures/assets/46208374-4.jpg


BIN=BIN
cypress/fixtures/assets/66186163-1.jpg


BIN=BIN
cypress/fixtures/assets/66186163-2.jpg


BIN=BIN
cypress/fixtures/assets/66186163-3.jpg


BIN=BIN
cypress/fixtures/assets/66186163-4.jpg


+ 0 - 5
cypress/fixtures/example.json

@@ -1,5 +0,0 @@
-{
-  "name": "Using fixtures to represent data",
-  "email": "hello@cypress.io",
-  "body": "Fixtures are a great way to mock data for responses to routes"
-}

+ 16 - 0
cypress/fixtures/groups-1.json

@@ -0,0 +1,16 @@
+[
+  {
+    "markerId": 426,
+    "number": 3,
+    "title": "分析题",
+    "totalCount": 311,
+    "markedCount": 301
+  },
+  {
+    "markerId": 451,
+    "number": 9,
+    "title": "简述题,作文",
+    "totalCount": 311,
+    "markedCount": 0
+  }
+]

+ 82 - 0
cypress/fixtures/settings-1.json

@@ -0,0 +1,82 @@
+{
+  "examType": "SCAN_IMAGE",
+  "startTime": 1617443479000,
+  "endTime": 1661939475000,
+  "topCount": 0,
+  "enableAllZero": true,
+  "statusValue": "FORMAL",
+  "groupNumber": 9,
+  "groupTitle": "简述题,作文",
+  "fileServer": "http://localhost:9000/",
+  "uiSetting": {
+    "answer.paper.scale": 1,
+    "score.board.collapse": false,
+    "normal.mode": "keyboard",
+    "score.fontSize.scale": 1.5,
+    "minimap.modal": false,
+    "paper.modal": false,
+    "answer.modal": false,
+    "specialTag.modal": false,
+    "shortCut.modal": false
+  },
+  "splitConfig": [0, 0.55, 0.45, 0.55],
+  "prefetchCount": 3,
+  "mode": "TRACK",
+  "forceMode": false,
+  "forceSpecialTag": false,
+  "sheetView": true,
+  "sheetConfig": [
+    {
+      "i": 1,
+      "x": 729,
+      "y": 511,
+      "w": 1416,
+      "h": 681
+    },
+    {
+      "i": 1,
+      "x": 1094,
+      "y": 480,
+      "w": 487,
+      "h": 361
+    },
+    {
+      "i": 1,
+      "x": 775,
+      "y": 620,
+      "w": 311,
+      "h": 354
+    },
+    {
+      "i": 2,
+      "x": 0,
+      "y": 0,
+      "w": 0,
+      "h": 0
+    }
+  ],
+  "enableSplit": false,
+  "autoScroll": true,
+  "subject": {
+    "name": "金融学综合",
+    "code": "431",
+    "paperUrl": "paper/1/431.pdf",
+    "answerUrl": "answer/1/431.pdf"
+  },
+  "userName": "王小兰",
+  "problemTypes": [
+    {
+      "id": 1,
+      "name": "答错位置",
+      "examId": 1,
+      "custom": false
+    },
+    {
+      "id": 2,
+      "name": "试卷模糊",
+      "examId": 1,
+      "custom": false
+    }
+  ],
+  "selective": false
+}

+ 8 - 0
cypress/fixtures/status-1.json

@@ -0,0 +1,8 @@
+{
+  "personCount": 0,
+  "totalCount": 311,
+  "markedCount": 0,
+  "problemCount": 0,
+  "arbitrateCount": 0,
+  "valid": true
+}

+ 145 - 0
cypress/fixtures/task-1.json

@@ -0,0 +1,145 @@
+{
+  "libraryId": 30585,
+  "studentId": 1581,
+  "secretNumber": "46208374",
+  "studentName": "兰福坪",
+  "studentCode": null,
+  "examNumber": null,
+  "subject": {
+    "name": "金融学综合",
+    "level": null,
+    "category": null,
+    "objectiveScore": 0,
+    "subjectiveScore": 235,
+    "totalScore": 235,
+    "uploadCount": 311,
+    "remark": null,
+    "sliceConfig": null,
+    "sheetConfig": null,
+    "cardType": null,
+    "paperFileType": "PDF",
+    "answerFileType": "PDF",
+    "sasConfig": "{\"passScore\":60,\"excellentScore\":80}",
+    "trialCount": 0,
+    "autoScroll": null,
+    "enableSplit": false,
+    "groupCount": 0,
+    "paperUrl": null,
+    "answerUrl": null,
+    "cardUrl": null,
+    "paperType": null,
+    "locked": false,
+    "displayName": "金融学综合",
+    "sheetConfigList": [],
+    "sliceConfigList": [],
+    "excellentScore": 80,
+    "passScore": 60,
+    "code": "431",
+    "examId": 1
+  },
+  "sliceUrls": [
+    "slice/1/374/46208374-1.jpg",
+    "slice/1/374/46208374-2.jpg",
+    "slice/1/374/46208374-3.jpg",
+    "slice/1/374/46208374-4.jpg"
+  ],
+  "sliceConfig": [
+    {
+      "i": 1,
+      "x": 126,
+      "y": 0,
+      "w": 1862,
+      "h": 1175
+    },
+    {
+      "i": 1,
+      "x": 223,
+      "y": 811,
+      "w": 1917,
+      "h": 698
+    },
+    {
+      "i": 2,
+      "x": 0,
+      "y": 0,
+      "w": 0,
+      "h": 0
+    },
+    {
+      "i": 3,
+      "x": 6,
+      "y": 1,
+      "w": 1180,
+      "h": 1509
+    },
+    {
+      "i": 3,
+      "x": 883,
+      "y": 1,
+      "w": 1246,
+      "h": 1509
+    },
+    {
+      "i": 4,
+      "x": 0,
+      "y": 0,
+      "w": 0,
+      "h": 0
+    }
+  ],
+  "jsonUrl": null,
+  "questionList": [
+    {
+      "groupNumber": 9,
+      "mainNumber": 2,
+      "subNumber": "100",
+      "intervalScore": 0.1,
+      "defaultScore": 0,
+      "title": "简述题",
+      "score": null,
+      "maxScore": 30,
+      "minScore": 0,
+      "trackList": []
+    },
+    {
+      "groupNumber": 9,
+      "mainNumber": 2,
+      "subNumber": "101",
+      "intervalScore": 1,
+      "defaultScore": 0,
+      "title": "简述题",
+      "score": null,
+      "maxScore": 5,
+      "minScore": 0,
+      "trackList": []
+    },
+    {
+      "groupNumber": 9,
+      "mainNumber": 10,
+      "subNumber": "100",
+      "intervalScore": 1,
+      "defaultScore": 0,
+      "title": "作文",
+      "score": null,
+      "maxScore": 40,
+      "minScore": 0,
+      "trackList": []
+    }
+  ],
+  "specialTagList": null,
+  "sheetUrls": [
+    "sheet/1/581/1501581-1.jpg",
+    "sheet/1/581/1501581-2.jpg",
+    "sheet/1/581/1501581-3.jpg",
+    "sheet/1/581/1501581-4.jpg"
+  ],
+  "objectiveScore": null,
+  "markerScore": null,
+  "markerTime": null,
+  "markerName": null,
+  "inspectTime": null,
+  "message": null,
+  "previous": false,
+  "rejected": false,
+  "self": false
+}

+ 145 - 0
cypress/fixtures/task-2.json

@@ -0,0 +1,145 @@
+{
+  "libraryId": 30586,
+  "studentId": 1591,
+  "secretNumber": "66186163",
+  "studentName": "熊天柱",
+  "studentCode": null,
+  "examNumber": null,
+  "subject": {
+    "name": "金融学综合",
+    "level": null,
+    "category": null,
+    "objectiveScore": 0,
+    "subjectiveScore": 235,
+    "totalScore": 235,
+    "uploadCount": 311,
+    "remark": null,
+    "sliceConfig": null,
+    "sheetConfig": null,
+    "cardType": null,
+    "paperFileType": "PDF",
+    "answerFileType": "PDF",
+    "sasConfig": "{\"passScore\":60,\"excellentScore\":80}",
+    "trialCount": 0,
+    "autoScroll": null,
+    "enableSplit": false,
+    "groupCount": 0,
+    "paperUrl": null,
+    "answerUrl": null,
+    "cardUrl": null,
+    "paperType": null,
+    "locked": false,
+    "displayName": "金融学综合",
+    "sheetConfigList": [],
+    "sliceConfigList": [],
+    "excellentScore": 80,
+    "passScore": 60,
+    "code": "431",
+    "examId": 1
+  },
+  "sliceUrls": [
+    "slice/1/163/66186163-1.jpg",
+    "slice/1/163/66186163-2.jpg",
+    "slice/1/163/66186163-3.jpg",
+    "slice/1/163/66186163-4.jpg"
+  ],
+  "sliceConfig": [
+    {
+      "i": 1,
+      "x": 126,
+      "y": 0,
+      "w": 1862,
+      "h": 1175
+    },
+    {
+      "i": 1,
+      "x": 223,
+      "y": 811,
+      "w": 1917,
+      "h": 698
+    },
+    {
+      "i": 2,
+      "x": 0,
+      "y": 0,
+      "w": 0,
+      "h": 0
+    },
+    {
+      "i": 3,
+      "x": 6,
+      "y": 1,
+      "w": 1180,
+      "h": 1509
+    },
+    {
+      "i": 3,
+      "x": 883,
+      "y": 1,
+      "w": 1246,
+      "h": 1509
+    },
+    {
+      "i": 4,
+      "x": 0,
+      "y": 0,
+      "w": 0,
+      "h": 0
+    }
+  ],
+  "jsonUrl": null,
+  "questionList": [
+    {
+      "groupNumber": 9,
+      "mainNumber": 2,
+      "subNumber": "100",
+      "intervalScore": 0.1,
+      "defaultScore": 0,
+      "title": "简述题",
+      "score": null,
+      "maxScore": 30,
+      "minScore": 0,
+      "trackList": []
+    },
+    {
+      "groupNumber": 9,
+      "mainNumber": 2,
+      "subNumber": "101",
+      "intervalScore": 1,
+      "defaultScore": 0,
+      "title": "简述题",
+      "score": null,
+      "maxScore": 5,
+      "minScore": 0,
+      "trackList": []
+    },
+    {
+      "groupNumber": 9,
+      "mainNumber": 10,
+      "subNumber": "100",
+      "intervalScore": 1,
+      "defaultScore": 0,
+      "title": "作文",
+      "score": null,
+      "maxScore": 40,
+      "minScore": 0,
+      "trackList": []
+    }
+  ],
+  "specialTagList": null,
+  "sheetUrls": [
+    "sheet/1/591/1501591-1.jpg",
+    "sheet/1/591/1501591-2.jpg",
+    "sheet/1/591/1501591-3.jpg",
+    "sheet/1/591/1501591-4.jpg"
+  ],
+  "objectiveScore": null,
+  "markerScore": null,
+  "markerTime": null,
+  "markerName": null,
+  "inspectTime": null,
+  "message": null,
+  "previous": false,
+  "rejected": false,
+  "self": false
+}

+ 145 - 0
cypress/fixtures/task-3.json

@@ -0,0 +1,145 @@
+{
+  "libraryId": 30587,
+  "studentId": 1110,
+  "secretNumber": "98496150",
+  "studentName": "黄帅",
+  "studentCode": null,
+  "examNumber": null,
+  "subject": {
+    "name": "金融学综合",
+    "level": null,
+    "category": null,
+    "objectiveScore": 0,
+    "subjectiveScore": 235,
+    "totalScore": 235,
+    "uploadCount": 311,
+    "remark": null,
+    "sliceConfig": null,
+    "sheetConfig": null,
+    "cardType": null,
+    "paperFileType": "PDF",
+    "answerFileType": "PDF",
+    "sasConfig": "{\"passScore\":60,\"excellentScore\":80}",
+    "trialCount": 0,
+    "autoScroll": null,
+    "enableSplit": false,
+    "groupCount": 0,
+    "paperUrl": null,
+    "answerUrl": null,
+    "cardUrl": null,
+    "paperType": null,
+    "locked": false,
+    "displayName": "金融学综合",
+    "sheetConfigList": [],
+    "sliceConfigList": [],
+    "excellentScore": 80,
+    "passScore": 60,
+    "code": "431",
+    "examId": 1
+  },
+  "sliceUrls": [
+    "slice/1/150/98496150-1.jpg",
+    "slice/1/150/98496150-2.jpg",
+    "slice/1/150/98496150-3.jpg",
+    "slice/1/150/98496150-4.jpg"
+  ],
+  "sliceConfig": [
+    {
+      "i": 1,
+      "x": 126,
+      "y": 0,
+      "w": 1862,
+      "h": 1175
+    },
+    {
+      "i": 1,
+      "x": 223,
+      "y": 811,
+      "w": 1917,
+      "h": 698
+    },
+    {
+      "i": 2,
+      "x": 0,
+      "y": 0,
+      "w": 0,
+      "h": 0
+    },
+    {
+      "i": 3,
+      "x": 6,
+      "y": 1,
+      "w": 1180,
+      "h": 1509
+    },
+    {
+      "i": 3,
+      "x": 883,
+      "y": 1,
+      "w": 1246,
+      "h": 1509
+    },
+    {
+      "i": 4,
+      "x": 0,
+      "y": 0,
+      "w": 0,
+      "h": 0
+    }
+  ],
+  "jsonUrl": null,
+  "questionList": [
+    {
+      "groupNumber": 9,
+      "mainNumber": 2,
+      "subNumber": "100",
+      "intervalScore": 0.1,
+      "defaultScore": 0,
+      "title": "简述题",
+      "score": null,
+      "maxScore": 30,
+      "minScore": 0,
+      "trackList": []
+    },
+    {
+      "groupNumber": 9,
+      "mainNumber": 2,
+      "subNumber": "101",
+      "intervalScore": 1,
+      "defaultScore": 0,
+      "title": "简述题",
+      "score": null,
+      "maxScore": 5,
+      "minScore": 0,
+      "trackList": []
+    },
+    {
+      "groupNumber": 9,
+      "mainNumber": 10,
+      "subNumber": "100",
+      "intervalScore": 1,
+      "defaultScore": 0,
+      "title": "作文",
+      "score": null,
+      "maxScore": 40,
+      "minScore": 0,
+      "trackList": []
+    }
+  ],
+  "specialTagList": null,
+  "sheetUrls": [
+    "sheet/1/110/1501110-1.jpg",
+    "sheet/1/110/1501110-2.jpg",
+    "sheet/1/110/1501110-3.jpg",
+    "sheet/1/110/1501110-4.jpg"
+  ],
+  "objectiveScore": null,
+  "markerScore": null,
+  "markerTime": null,
+  "markerName": null,
+  "inspectTime": null,
+  "message": null,
+  "previous": false,
+  "rejected": false,
+  "self": false
+}