Skip to content

Commit

Permalink
Merge pull request #1236 from Amsterdam-Music-Lab/bugfix/section-from…
Browse files Browse the repository at this point in the history
…-any-song

Remove occurrences of `section_from_any_song`
  • Loading branch information
BeritJanssen authored Sep 9, 2024
2 parents 637e281 + 61cbc16 commit 6a3912b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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?"),
Expand Down
10 changes: 5 additions & 5 deletions backend/experiment/rules/toontjehoger_2_preverbal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 6a3912b

Please sign in to comment.