Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BeritJanssen committed Jan 15, 2024
1 parent 21a8058 commit ed6ffb9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/experiment/rules/huang_2022.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 1 addition & 0 deletions backend/experiment/rules/matching_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from section.models import Section


class MatchingPairsGame(Base):
ID = 'MATCHING_PAIRS'
num_pairs = 8
Expand Down
1 change: 1 addition & 0 deletions backend/experiment/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from experiment.utils import create_player_labels


class TestExperimentUtils(TestCase):

def test_create_player_labels(self):
Expand Down
3 changes: 3 additions & 0 deletions backend/experiment/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import roman


def serialize(actions):
''' Serialize an array of actions '''
if isinstance(actions, list):
Expand Down Expand Up @@ -30,9 +31,11 @@ def external_url(text, url):
# Create a HTML element for an external url
return '<a href="{}" target="_blank" rel="noopener noreferrer" >{}</a>'.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)
Expand Down

0 comments on commit ed6ffb9

Please sign in to comment.