Given a CSV like below, where the first column is the question and the second column is the answer:
5+5,10
7+3,10
1+1,2
8+3,11
1+2,3
8+6,14
3+1,4
1+4,5
5+1,6
2+3,5
3+3,6
2+4,6
5+2,7
Create a program that will accept the CSV filepath and a time limit (in seconds) as flags and will then run the the quiz reading each problem in order and stopping the quiz as soon as the time limit has been exceeded.
Users should be asked to press enter (or some other key) before the timer starts, and then the questions should be printed out to the screen one at a time until the user provides an answer. Regardless of whether the answer is correct or wrong the next question should be asked.
At the end of the quiz the program should output the total number of questions correct and how many questions there were in total. Questions given invalid answers or unanswered are considered incorrect.
As a bonus exercises you can also...
- Add string trimming and cleanup to help ensure that correct answers with extra whitespace, capitalization, etc are not considered incorrect. Hint: Check out the strings package.
- Add an option (a new flag) to shuffle the quiz order each time it is run.