From 5e41a657f5cb5cff8b0fa45dbdab9e586ba0efdd Mon Sep 17 00:00:00 2001 From: zhl Date: Tue, 25 May 2021 20:13:52 +0800 Subject: [PATCH] =?UTF-8?q?type=E4=B8=BA3=E7=9A=84=E9=A2=98=E7=9B=AEresult?= =?UTF-8?q?=E8=BF=94=E5=9B=9E1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/controllers/exam.controller.ts | 2 +- src/api/controllers/puzzle.controller.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/controllers/exam.controller.ts b/src/api/controllers/exam.controller.ts index f8366f7..1cf9205 100644 --- a/src/api/controllers/exam.controller.ts +++ b/src/api/controllers/exam.controller.ts @@ -134,7 +134,7 @@ class ExamController extends BaseController { history.markModified('members') await history.save() let gameResult = 0 - let rspData: any = { result: result === 0, answer: record.type === 3 ? '' : record.answers[0], stats: history.members, overtime } + let rspData: any = { result: record.type === 3 ? 1 : result === 0 ? 1 : 0, answer: record.type === 3 ? '' : record.answers[0], stats: history.members, overtime } if (statMap.answer.size >= history.questions.size) { gameResult = 1 } diff --git a/src/api/controllers/puzzle.controller.ts b/src/api/controllers/puzzle.controller.ts index f821ec2..c62f82f 100644 --- a/src/api/controllers/puzzle.controller.ts +++ b/src/api/controllers/puzzle.controller.ts @@ -131,7 +131,7 @@ class PuzzleController extends BaseController { history.markModified('members') let gameResult = 0 await history.save() - let rspData: any = { result: result === 0, answer: record.type === 3 ? '' : record.answers[0], stats: history.members } + let rspData: any = { result: record.type === 3 ? 1 : result === 0 ? 1 : 0, answer: record.type === 3 ? '' : record.answers[0], stats: history.members } if (mode == 1) { let score = result === 0 ? calcPvpScore(history.scheduleKey, statMap.comboCount) : 0 if (record.type === 3) {