diff --git a/backend/experiment/rules/huang_2022.py b/backend/experiment/rules/huang_2022.py index f377a9eef..89c1399ad 100644 --- a/backend/experiment/rules/huang_2022.py +++ b/backend/experiment/rules/huang_2022.py @@ -232,6 +232,7 @@ def final_score_message(self, session): ] return " ".join([str(m) for m in messages]) + def get_test_playback(): from section.models import Section test_section = Section.objects.get(song__name='audiocheck') diff --git a/backend/experiment/rules/matching_pairs.py b/backend/experiment/rules/matching_pairs.py index f4fb9f30e..a96f5aa70 100644 --- a/backend/experiment/rules/matching_pairs.py +++ b/backend/experiment/rules/matching_pairs.py @@ -12,6 +12,7 @@ from section.models import Section + class MatchingPairsGame(Base): ID = 'MATCHING_PAIRS' num_pairs = 8 diff --git a/backend/experiment/tests/test_utils.py b/backend/experiment/tests/test_utils.py index 59abc310e..0ae83aea7 100644 --- a/backend/experiment/tests/test_utils.py +++ b/backend/experiment/tests/test_utils.py @@ -2,6 +2,7 @@ from experiment.utils import create_player_labels + class TestExperimentUtils(TestCase): def test_create_player_labels(self): diff --git a/backend/experiment/utils.py b/backend/experiment/utils.py index 20cd64704..17dcaaa89 100644 --- a/backend/experiment/utils.py +++ b/backend/experiment/utils.py @@ -1,5 +1,6 @@ import roman + def serialize(actions): ''' Serialize an array of actions ''' if isinstance(actions, list): @@ -30,9 +31,11 @@ def external_url(text, url): # Create a HTML element for an external url return '{}'.format(url, text) + def create_player_labels(num_labels, label_style='number'): return [format_label(i, label_style) for i in range(num_labels)] + def format_label(number, label_style): if label_style == 'alphabetic': return chr(number + 65)