diff --git a/backend/src/api/controllers/result.ts b/backend/src/api/controllers/result.ts index 2e9bd0b55..937ad666f 100644 --- a/backend/src/api/controllers/result.ts +++ b/backend/src/api/controllers/result.ts @@ -322,6 +322,7 @@ export async function addResult( delete result.keyOverlap; delete result.lastKeyToEnd; delete result.startToFirstKey; + delete result.charTotal; if (req.ctx.configuration.users.lastHashesCheck.enabled) { let lastHashes = user.lastReultHashes ?? []; diff --git a/backend/src/api/schemas/result-schema.ts b/backend/src/api/schemas/result-schema.ts index 69400e5bf..c033427e6 100644 --- a/backend/src/api/schemas/result-schema.ts +++ b/backend/src/api/schemas/result-schema.ts @@ -8,6 +8,7 @@ const RESULT_SCHEMA = joi blindMode: joi.boolean().required(), challenge: joi.string(), charStats: joi.array().items(joi.number().min(0)).required(), + charTotal: joi.number().min(0), chartData: joi .alternatives() .try( diff --git a/frontend/src/ts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts index 9fa856093..a99781aba 100644 --- a/frontend/src/ts/test/test-logic.ts +++ b/frontend/src/ts/test/test-logic.ts @@ -1307,6 +1307,7 @@ interface CompletedEvent extends MonkeyTypes.Result { keyOverlap: number; lastKeyToEnd: number; startToFirstKey: number; + charTotal: number; } type PartialCompletedEvent = Omit, "chartData"> & { @@ -1359,6 +1360,7 @@ function buildCompletedEvent(difficultyFailed: boolean): CompletedEvent { wpm: undefined, rawWpm: undefined, charStats: undefined, + charTotal: undefined, acc: undefined, mode: Config.mode, mode2: undefined, @@ -1414,6 +1416,7 @@ function buildCompletedEvent(difficultyFailed: boolean): CompletedEvent { stats.extraChars, stats.missedChars, ]; + completedEvent.charTotal = stats.allChars; completedEvent.acc = stats.acc; // if the last second was not rounded, add another data point to the history