ui.cli: Add a `skip` command to the quizzer shell
authorW. Trevor King <wking@tremily.us>
Fri, 8 Feb 2013 03:39:18 +0000 (22:39 -0500)
committerW. Trevor King <wking@tremily.us>
Fri, 8 Feb 2013 03:39:18 +0000 (22:39 -0500)
This lets you bypass a difficult question on the stack and continue
with the rest of the quiz.

quizzer/ui/cli.py

index 94255a2f5e1df843f95aca7974d4119f0fa4e8cf..e5a8e4906731d01400e60b2c3f16c048a8a42f33 100644 (file)
@@ -107,6 +107,13 @@ class QuestionCommandLine (_cmd.Cmd):
         self._reset()
         return True
 
+    def do_skip(self, arg):
+        "Skip the current question, and continue with the quiz"
+        self.question = self.ui.get_question()
+        if not self.question:
+            return True  # out of questions
+        self._reset()
+
     def do_hint(self, arg):
         "Show a hint for the current question"
         self._reset()