Flash Type

Lin (Kitty) Wang, Kayla Tsui, Justine Kyi Period 5

Project Overview/Description

Hello! This is the main landing page for Flash Type. Our team, Kit Kat Juice, aims to create a user-friendly Python program that functions as a typing speed test, which will test how fast the user can type a random sentence (created through a program like generate_text and displayed one line at a time) based on words per minute. At the end of the round, error frequency analysis and the typing speed computations will be displayed (this will be made possible with the time module). The random sentences generated for the user to test themselves on are taken from various text files from Project Gutenberg, and every "sentence" displayed for the user to type is randomly sourced from one of three books: .

Image of the starting page of Flash Type

Instructions

A typing test measures the test-taker's typing speed and accuracy. Typing tests usually give one or more sentences/paragraphs for the typer to copy within a certain time frame. The program collects data on how fast the tester is able to copy that passage and the amount of errors they make while typing it. This data is displayed at the end of the typing test. Flash Type is a specific typing test that will utilize data analysis and imported modules using Python. To play, the program will display the sentence that the user needs to copy. Make sure to click on the black text box before typing. Once the user finishes typing the sentence, click enter to go to the next sentence. This process continues until the typing test is over, when the results of the typing test will then be generated. Flash Type offers one minute long typing rounds at the end of which users receive analyses results based on their input.
To enjoy your experience with Flash Type:

  1. Peruse the landing load page
  2. When the screen has transitioned to the test phase, please click on the black input box to begin the test
  3. Type the sentence displayed above the input box in lavender to the best of your ability. Press enter when done.
  4. The next sentence to type in will appear, and you may begin typing once again.
  5. Repeat steps 3 & 4 until the round is over, when the results will be returned to the user, which consists of one's most frequent error, accuracy, and words per minute typing rate (displayed as "wpm").
  6. Should the user decide to play another round, they may click the reset button, which takes the form of a keyboard at the bottom of the screen.

How it Works

Flash Type will take a randomly generated sentence from one of the chosen texts (see the Files section for more info on the texts used). The user will retype that sentence. The program will assess how correct the user's sentence was (such as any errors they made when compared to the original sentence). The Time module and program calculations will be based on one line at a time, and this data is then scaled to record wpm (words per minute). To accomplish all of this, Flash Type uses a game class and a main() method that maintains the running of the program. To source the words of the sentences, a list containing the three book's filenames are stored and passed into two methods that process the text and generate a new sentence with eight random words from the book. The main() method begins by resetting all variables storing values from the previous round (which are declared in the __init__ step), and initializes the landing page. After 2.7 seconds, the user will be directed to the typing speed test page. All lines of text displayed on the screen are rendered by the two write text functions as the background image is loaded. When the user clicks on the black input box to begin typing, the timer begins and the user's keyboard inputs are stored and updated with every change to render a typewriter-like effect in the input box. When the user completes typing each line, they may enter the return key, which will invoke a new line to be generated and displayed for typing. Meanwhile, the total time is recorded again, as the user input and the sample "sentence" for the previous line are appended to a record keeping string. The accuracy for the line is then calculated and stored in a list, and the overall accuracy is computed at the end of the round (after ~60 seconds have elapsed) as the mean of the list of accuracy rates.

At the end of the round, the user will be able to view their most frequent error (the most common character that has been typed incorrectly), holistic accuracy rate, and words per minute rate. A reset button in the form of a keyboard will also be displayed and the position of the user's mouse click will be assessed to determine whether the program will run another round.

Files

Resources

Flash Type uses two Python modules: Pygame and time.

Bugs/Errors/Things to be Aware of