From 9949c3ebf033bcf833d6290d2f52d84d533c5455 Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Mon, 4 Dec 2023 10:14:08 +0100 Subject: [PATCH] listening_conditions: use prepare_result util --- backend/experiment/rules/listening_conditions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/experiment/rules/listening_conditions.py b/backend/experiment/rules/listening_conditions.py index 286f9c1e0..3b06ee71d 100644 --- a/backend/experiment/rules/listening_conditions.py +++ b/backend/experiment/rules/listening_conditions.py @@ -6,6 +6,7 @@ from experiment.actions.form import ChoiceQuestion, Form from experiment.actions.playback import Playback from experiment.actions.utils import final_action_with_optional_button +from result.utils import prepare_result class ListeningConditions(Base): @@ -17,7 +18,7 @@ def next_round(self, session, request_session=None): feedback_form = None if round_number == 1: key = 'quiet_room' - result_pk = Base.prepare_result(session, expected_response=key) + result_pk = prepare_result(session, expected_response=key) feedback_form = Form([ ChoiceQuestion( key=key, @@ -34,7 +35,7 @@ def next_round(self, session, request_session=None): )]) elif round_number == 2: key = 'internet_connection' - result_pk = Base.prepare_result(session, expected_response=key) + result_pk = prepare_result(session, expected_response=key) feedback_form = Form([ChoiceQuestion( key='internet_connection', question=_( @@ -49,7 +50,7 @@ def next_round(self, session, request_session=None): )]) elif round_number == 3: key = 'headphones' - result_pk = Base.prepare_result(session, expected_response=key) + result_pk = prepare_result(session, expected_response=key) feedback_form = Form([ ChoiceQuestion( key=key, @@ -66,7 +67,7 @@ def next_round(self, session, request_session=None): ]) elif round_number == 4: key = 'notifications_off' - result_pk = Base.prepare_result(session, expected_response=key) + result_pk = prepare_result(session, expected_response=key) feedback_form = Form([ ChoiceQuestion( key=key,