From 61cbc168046ddb470c09c90e0f29687fe2499056 Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Mon, 26 Aug 2024 17:21:35 +0200 Subject: [PATCH] replace function `session.section_from_any_song`->`session.playlist.get_section` --- .../management/commands/templates/experiment.py | 2 +- backend/experiment/rules/toontjehoger_2_preverbal.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/experiment/management/commands/templates/experiment.py b/backend/experiment/management/commands/templates/experiment.py index 9c866974d..41588d9ea 100644 --- a/backend/experiment/management/commands/templates/experiment.py +++ b/backend/experiment/management/commands/templates/experiment.py @@ -69,7 +69,7 @@ def get_trial(self, session): # define a key, by which responses to this trial can be found in the database key = 'test_trial' # get a random section - section = session.section_from_any_song() + section = session.playlist.get_section() question = BooleanQuestion( question=_( "Do you like this song?"), diff --git a/backend/experiment/rules/toontjehoger_2_preverbal.py b/backend/experiment/rules/toontjehoger_2_preverbal.py index 176fd09a1..1ff5f6da0 100644 --- a/backend/experiment/rules/toontjehoger_2_preverbal.py +++ b/backend/experiment/rules/toontjehoger_2_preverbal.py @@ -176,19 +176,19 @@ def get_round_2_question(self): def get_round1_playback(self, session): # Get sections - sectionA = session.section_from_any_song( + sectionA = session.playlist.get_section( filter_by={'tag': 'a', 'group': '1'}) if not sectionA: raise Exception( "Error: could not find section A for round 1") - sectionB = session.section_from_any_song( + sectionB = session.playlist.get_section( filter_by={'tag': 'b', 'group': '1'}) if not sectionB: raise Exception( "Error: could not find section B for round 1") - sectionC = session.section_from_any_song( + sectionC = session.playlist.get_section( filter_by={'tag': 'c', 'group': '1'}) if not sectionB: raise Exception( @@ -215,13 +215,13 @@ def get_round2(self, round, session): # Get sections # French - sectionA = session.section_from_any_song( + sectionA = session.playlist.get_section( filter_by={'tag': 'a', 'group': '2'}) if not sectionA: raise Exception( "Error: could not find section A for round 2") # German - sectionB = session.section_from_any_song( + sectionB = session.playlist.get_section( filter_by={'tag': 'b', 'group': '2'}) if not sectionB: raise Exception(