Skip to content

Commit 36b5251

Browse files
committed
input history
1 parent 442ddb4 commit 36b5251

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

frontend/src/ts/test/events/stats.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,18 @@ export function getChars(countPartialLastWord = false): CharCounts {
438438
};
439439
}
440440

441+
export function getInputHistory(): string[] {
442+
const eventsPerWordIndex = getInputEventsPerWord();
443+
const history: string[] = [];
444+
445+
for (const events of eventsPerWordIndex.values()) {
446+
const simulatedInput = getSimulatedInput(events);
447+
history.push(simulatedInput.trimEnd());
448+
}
449+
450+
return history;
451+
}
452+
441453
export function getAccuracy(): {
442454
correct: number;
443455
incorrect: number;

frontend/src/ts/test/test-logic.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ import {
106106
getCurrentAccuracy,
107107
getCurrentTestDurationMs,
108108
getDateBasedTestDurationMs,
109+
getInputHistory,
109110
} from "./events/stats";
110111
import { calculateWpm } from "../utils/numbers";
111112

@@ -922,6 +923,7 @@ export async function finish(difficultyFailed = false): Promise<void> {
922923
cleanupData();
923924

924925
logEventsDataToTheConsoleTable();
926+
console.log(getInputHistory());
925927

926928
const ce = buildCompletedEvent();
927929
PaceCaret.setLastTestWpm(ce.wpm);

0 commit comments

Comments
 (0)