mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-08 14:42:46 +08:00
added the ability to see the percentage of correct keys after the test was finished
This commit is contained in:
parent
fccb59a51d
commit
bda44ffdb9
2 changed files with 10 additions and 1 deletions
|
@ -705,7 +705,7 @@
|
|||
</div>
|
||||
<div class="group key">
|
||||
<div class="top">char</div>
|
||||
<div class="bottom">-</div>
|
||||
<div class="bottom" aria-label="" data-balloon-pos="up">-</div>
|
||||
</div>
|
||||
|
||||
<!-- </div> -->
|
||||
|
|
|
@ -1379,6 +1379,15 @@ function showResult(difficultyFailed = false) {
|
|||
$("#result .stats .raw .bottom").attr("aria-label", stats.wpmRaw);
|
||||
$("#result .stats .acc .bottom").text(Math.floor(stats.acc) + "%");
|
||||
$("#result .stats .acc .bottom").attr("aria-label", stats.acc + "%");
|
||||
|
||||
let correctcharpercent = roundTo2(
|
||||
((stats.correctChars + stats.correctSpaces) /
|
||||
(stats.correctChars + stats.correctSpaces + stats.incorrectChars)) *
|
||||
100
|
||||
);
|
||||
$("#result .stats .key .bottom").text(testtime + "s");
|
||||
$("#result .stats .key .bottom").attr("aria-label", `${correctcharpercent}%`);
|
||||
|
||||
$("#result .stats .key .bottom").text(
|
||||
stats.correctChars + stats.correctSpaces + "/" + stats.incorrectChars
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue