quizzer.git
11 years agoFix 'hint' -> 'help' typos
W. Trevor King [Tue, 5 Feb 2013 16:52:30 +0000 (11:52 -0500)]
Fix 'hint' -> 'help' typos

11 years agoquestion: Use Question._state_attributes in __init__ and __setstate__
W. Trevor King [Tue, 5 Feb 2013 16:39:43 +0000 (11:39 -0500)]
question: Use Question._state_attributes in __init__ and __setstate__

11 years agoquestion: Add Question._state_attributes for easier subclassing
W. Trevor King [Tue, 5 Feb 2013 16:05:15 +0000 (11:05 -0500)]
question: Add Question._state_attributes for easier subclassing

This way subclasses can extend the list instead of overriding
__getstate__.

11 years agoAdd question class storage (lookups in QUESTION_CLASS)
W. Trevor King [Tue, 5 Feb 2013 15:58:40 +0000 (10:58 -0500)]
Add question class storage (lookups in QUESTION_CLASS)

This allows us to specify questions with alternate processing classes.
As a simple example, I've added NormalizedStringQuestion, which
softens the string comparison used in the basic Question.  The next
step is to add a command-line question ;).

11 years agoui.cli: Rework display_result() for multiple answers per question
W. Trevor King [Tue, 5 Feb 2013 15:45:11 +0000 (10:45 -0500)]
ui.cli: Rework display_result() for multiple answers per question

11 years agoui: Add dependency handling to UserInterface.get_question
W. Trevor King [Tue, 5 Feb 2013 15:37:41 +0000 (10:37 -0500)]
ui: Add dependency handling to UserInterface.get_question

We start the stack with all the leaf questions (i.e. questions that
are not dependencies of other question).  If the user gets one wrong,
we push the question back on the stack (so they can try again later),
and also push all of that questions direct dependencies onto the stack
(so they can get the background they need to answer the question they
got wrong).

11 years agoquestion: Add Question.__str__() and __repr__()
W. Trevor King [Tue, 5 Feb 2013 15:27:16 +0000 (10:27 -0500)]
question: Add Question.__str__() and __repr__()

For easily viewing questions in lists.

11 years agoCatch EOFError (control-d) in CommandLineInterface input() call
W. Trevor King [Tue, 5 Feb 2013 15:16:26 +0000 (10:16 -0500)]
Catch EOFError (control-d) in CommandLineInterface input() call

11 years agoAdd dependency storage (list of question IDs)
W. Trevor King [Tue, 5 Feb 2013 15:15:16 +0000 (10:15 -0500)]
Add dependency storage (list of question IDs)

11 years agoUse question.id instead of question.prompt for answer indexing
W. Trevor King [Tue, 5 Feb 2013 15:08:52 +0000 (10:08 -0500)]
Use question.id instead of question.prompt for answer indexing

This decouples the keying from the prompt, which is useful if you want
to use another value for the `id` (e.g. a question number).

If `id` is not specified, it defaults to `prompt`.

11 years agoAdd trailing newlines to saved JSON files
W. Trevor King [Tue, 5 Feb 2013 15:01:49 +0000 (10:01 -0500)]
Add trailing newlines to saved JSON files

11 years agoAdd a persistent answers database
W. Trevor King [Tue, 5 Feb 2013 15:01:25 +0000 (10:01 -0500)]
Add a persistent answers database

11 years agoVisually separate the results from the questions
W. Trevor King [Tue, 5 Feb 2013 14:34:03 +0000 (09:34 -0500)]
Visually separate the results from the questions

11 years agoAdd .display_results() for showing users their results and scores
W. Trevor King [Tue, 5 Feb 2013 14:29:58 +0000 (09:29 -0500)]
Add .display_results() for showing users their results and scores

11 years agoDisplay results (but not the correct answers)
W. Trevor King [Tue, 5 Feb 2013 14:19:36 +0000 (09:19 -0500)]
Display results (but not the correct answers)

11 years agoDon't crash with IndexError when we run out of questions
W. Trevor King [Tue, 5 Feb 2013 14:09:50 +0000 (09:09 -0500)]
Don't crash with IndexError when we run out of questions

11 years agoMake get_question() a bit more interesting
W. Trevor King [Tue, 5 Feb 2013 14:07:18 +0000 (09:07 -0500)]
Make get_question() a bit more interesting

11 years agoAdd a simple command line interface
W. Trevor King [Tue, 5 Feb 2013 14:06:44 +0000 (09:06 -0500)]
Add a simple command line interface

11 years agoAdded saving, loading, and a test quiz
W. Trevor King [Tue, 5 Feb 2013 13:49:54 +0000 (08:49 -0500)]
Added saving, loading, and a test quiz

11 years agoStubbing out the initial framework
W. Trevor King [Mon, 4 Feb 2013 23:05:32 +0000 (18:05 -0500)]
Stubbing out the initial framework