ui.cli: Unwrap multiline answers in display_result
authorW. Trevor King <wking@tremily.us>
Thu, 7 Feb 2013 21:11:41 +0000 (16:11 -0500)
committerW. Trevor King <wking@tremily.us>
Thu, 7 Feb 2013 21:11:41 +0000 (16:11 -0500)
No need to surprise the user with the internal list representation.

quizzer/ui/cli.py

index 4663077a29fbec2c6be81532707e2a4dc969aafd..94255a2f5e1df843f95aca7974d4119f0fa4e8cf 100644 (file)
@@ -159,7 +159,10 @@ class CommandLineInterface (UserInterface):
             else:
                 correct = 'incorrect'
             correct = _colorize(self.colors[correct], correct)
-            print('  you answered: {}'.format(answer['answer']))
+            ans = answer['answer']
+            if question.multiline:
+                ans = '\n                '.join(ans)
+            print('  you answered: {}'.format(ans))
             print('     which was: {}'.format(correct))
 
     def display_totals(self):