From b26bf780de5e4f8bec02e71cfc68fcadcefc8067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= Date: Sun, 12 Nov 2017 09:14:40 +0000 Subject: [PATCH] Fixed show error getting categories --- Server.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Server.py b/Server.py index 3f2bff1..4dc3ff8 100644 --- a/Server.py +++ b/Server.py @@ -14,7 +14,7 @@ conn, addr = thisSocket.accept() print ("The Connection ip is : " + str(addr)) def sendMessage(message, EOM = True): - ''' Given a message input, and a Flase value, send the message and the + ''' Given a message input, and a False value, send the message and the client keeps wayting for another message ''' resp = "" if (EOM): @@ -90,9 +90,12 @@ def qChallenge(): ''' Question challenge, test user knowledge with some questions ''' cat = getCategories(True, 3) if ("Error" in cat): - sendMessage(cat[1], False) - sendMessage("Lets try again.") - return (True) + sendMessage("{}: {}".format(cat[0], cat[1]), False) + if (cat[1] == 7): + sendMessage("Lets try again.") + return(True) + else: + return(False) receivedMessage = askSomething(-1, ["Pick a subject.", cat[0], cat[1], cat[2]], ["You can choose a category from the list above, like 'Music'.",