]> jfr.im git - irc/rizon/acid.git/commitdiff
Merge branch 'quotes/outputlimit' into 'master'
authorAdam <redacted>
Fri, 25 Sep 2015 21:43:48 +0000 (21:43 +0000)
committerAdam <redacted>
Fri, 25 Sep 2015 21:43:48 +0000 (21:43 +0000)
Limit quotes output to the limit set in the config

Limit the quotes output if it exceeds the limit set in the config

See merge request !8

pyva/pyva/src/main/python/trivia/trivia_engine.py

index 47e2c238bd72d78f8745d8e32e3e7edb31263cb1..3ebc7592604ac028e4a610f4283dda64e1ebbc69 100644 (file)
@@ -162,6 +162,12 @@ class Trivia(object):
                found = False
                for a in self.answer:
                        try:
+                               # Issue #10: do not accept '200' when the correct answer is '20'
+                               float(a)
+                               if answer == a:
+                                       found = True
+                                       break
+                       except ValueError:
                                if a.lower() in answer.lower():
                                        found = True
                                        break