Mallory created this simple CLI practice test generator during her first week at App Academy to help herself and other students prepare for our first assessment. She wanted a way to simulate the actual test rather than just solving practice problems individually. The questions, Jasmine tests, and solutions were largely pulled from exercises we had encountered during the prepwork and first week of class, or contributed by other students. I pulled on her work and refactored it into JavaScript.
All of the practice problems are listed and categorized in list.csv
(categories include: recursion, sorting, enumerable, array, string). When you run generator.rb
on the command line and provide your desired number of questions from each category, it uses your input and the CSV file to randomly select practice problems. It combines these problems and writes 3 new files inside the repo folder:
practice_test.js
contains the problems to be solvedspec.js
combines the specs for the chosen problems into one file for easy testingsolutions.js
combines the solutions for each problem
-
Clone this repo
-
Navigate to the folder in terminal and run
ruby generator.rb
-
Input your practice test requests in the form
category: # of problems
-
You will now have three new files:
practice_test.js
,spec.js
andsolutions.js
. Once these files are created, openSpecRunner.html
in your browser. If you have not generated these files, the page will not open. -
Check your solutions against those in
solutions.js
.
Note: if you run the generator again in the same folder, it will re-write those three files and erase your previous work. If you wish to save your previous work, you will need to rename the files.