added punctuation to the database

This commit is contained in:
Jack 2020-05-10 14:36:27 +01:00
parent f7010d70ed
commit c055f1eaae
2 changed files with 6 additions and 5 deletions

View file

@ -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()
})
}

View file

@ -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('<div class="crown"><i class="fas fa-crown"></i></div>');
}
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');