Building a reading speed test that can't be gamed by skimming
Our book review site needed a feature readers would actually use, and that other sites would want to link to. We settled on a reading speed test, then found that most existing tests share a flaw: skim the passage, press stop, and you're suddenly reading at 1,000 words per minute. Here's how we built one that pushes back, in a single React client component inside a Next.js app. The flow The…
A new reading speed test has been developed for the book review site, a feature that is actually useful and desirable for linking to. Most existing tests have a flaw: readers can skim the passage and instantly claim a high reading speed. The new test addresses this issue.
The component, written in React and integrated into a Next.js app, moves through four stages: intro, reading, quiz, and result. Three original passages, each about 300 words, are used, with no copyright concerns. Timing is done using performance.now(), which is more reliable than Date.now(). The timer updates every four seconds, but the score is calculated using the exact start and end values.
A 5-second delay is added to the "I'm done" button to prevent a reflex click from producing a score. The reading speed is calculated using the formula: words / (seconds / 60). A comprehension check is also implemented, with three questions appearing after the passage disappears. If the score is below 2, the user is suggested to retake the test at a slower pace.
To prevent skimming, any score above 900 words per minute is labeled "Too fast to measure" and not saved. The rationale behind this limit is that comprehension drops sharply when people push past normal reading speeds. The Open Library search API is used to get book details, with only necessary fields requested to minimize the response size. The total words, minutes, and days are calculated using simple math formulas.
The developer plans to add more passages for repeat visitors and separate averages for reading on a phone and desktop. A working prototype can be tried at Reading Speed Test.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to