From 873dffd93222a1b25b7694f21d7bfd8487b9aed0 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Tue, 20 May 2025 14:13:43 +0200 Subject: [PATCH] implemented the onlyResults query on /status --- src/routes/answers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/answers.py b/src/routes/answers.py index b4ebe77..b3e041d 100644 --- a/src/routes/answers.py +++ b/src/routes/answers.py @@ -96,7 +96,11 @@ def status(id): subject = Subject.id2subject[id] if subject.status == Status.COMPLETE: - return jsonify({"status": "complete", "type": subject.type, "results": subject.results}) + only_results = request.args.get('onlyResults', 'false').lower() == 'true' + if only_results: + return jsonify(subject.results) + else: + return jsonify({"status": "complete", "type": subject.type, "results": subject.results}) socketio = current_app.extensions['socketio'] sid = request.headers.get('X-Socket-Id')