From c055f1eaae99b6144d40595a0a579e7575433a47 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 10 May 2020 14:36:27 +0100 Subject: [PATCH] added punctuation to the database --- public/js/db.js | 3 ++- public/js/script.js | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/js/db.js b/public/js/db.js index a2299487d..299af4f7c 100644 --- a/public/js/db.js +++ b/public/js/db.js @@ -1,6 +1,6 @@ const db = firebase.firestore(); -function db_testCompleted(wpm, correctChars, incorrectChars, acc, mode, mode2) { +function db_testCompleted(wpm, correctChars, incorrectChars, acc, mode, mode2, punctuation) { if (wpm > 250 || acc < 50 || acc > 100) return false; @@ -17,6 +17,7 @@ function db_testCompleted(wpm, correctChars, incorrectChars, acc, mode, mode2) { acc: acc, mode: mode, mode2: mode2, + punctuation: punctuation, timestamp: Date.now() }) } diff --git a/public/js/script.js b/public/js/script.js index a9b6b8b06..00da8dfb2 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -472,9 +472,9 @@ var wpmOverTimeChart = new Chart(ctx, { datasets: [{ label: "wpm", data: [], - backgroundColor: 'rgba(255, 99, 132, 0.2)', - borderColor: 'rgba(255, 99, 132, 1)', - borderWidth: 1 + backgroundColor: 'rgba(255, 255, 255, 0.25', + borderColor: 'rgba(255, 255, 255, 1)', + borderWidth: 2 }], }, options: { @@ -538,7 +538,7 @@ function showResult2() { if (data.wpm < stats.wpm || data == false) { $("#result .stats .wpm .top").append('
'); } - db_testCompleted(stats.wpm, stats.correctChars, stats.incorrectChars, stats.acc, config.mode, mode2); + db_testCompleted(stats.wpm, stats.correctChars, stats.incorrectChars, stats.acc, config.mode, mode2, config.punctuation); }) } else { alert('test invalid');