diff --git a/src/elena/elena.py b/src/elena/elena.py index 9cff78a..bb6b8c3 100644 --- a/src/elena/elena.py +++ b/src/elena/elena.py @@ -249,15 +249,14 @@ def handle_GET(self): self.keys = list(qdict.keys()) self.n_questions = len(self.keys) random.shuffle(self.keys) - # q = random.choice(list(qdict.keys())) if self.counter < self.n_questions: q = self.keys[self.counter] ans = qdict[q] self.counter += 1 + return jsonify({"question": q, "answer": ans}) else: self.counter = 0 - msg = "You have made it! You answered all the questions!" - msg += "Now, I will take you back to the beginning!\n" + msg = "We completed all questions in the deck and are now starting from the beginning. " self.keys = list(qdict.keys()) self.n_questions = len(self.keys) @@ -266,7 +265,7 @@ def handle_GET(self): ans = qdict[q] msg += q self.counter += 1 - return jsonify({"question": q, "answer": ans}) + return jsonify({"question": msg, "answer": ans}) elif request.headers.get("Internal-Type") in self.manual_ptype: with open(