Skip to content

Commit

Permalink
chore: Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
drikusroor committed Jan 11, 2024
1 parent fa54dcc commit feb5c47
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/experiment/rules/visual_matching_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ def first_round(self, experiment):
rendered = render_to_string('consent/consent_matching_pairs.html')
consent = Consent(rendered, title=_(
'Informed consent'), confirm=_('I agree'), deny=_('Stop'))
# 2. Choose playlist.

playlist = Playlist(experiment.playlists.all())

# 3. Start session.
start_session = StartSession()

explainer = Explainer(
Expand Down Expand Up @@ -85,6 +84,7 @@ def next_round(self, session):
feedback_info=self.feedback_info()
)
cont = self.get_visual_matching_pairs_trial(session)

return [score, cont]

def get_visual_matching_pairs_trial(self, session):
Expand All @@ -104,11 +104,13 @@ def get_visual_matching_pairs_trial(self, session):
result_id=prepare_result('visual_matching_pairs', session),
config={'show_continue_button': False}
)

return trial

def calculate_score(self, result, data):
moves = data.get('result').get('moves')
for m in moves:
m['filename'] = str(Section.objects.get(pk=m.get('selectedSection')).filename)
score = data.get('result').get('score')

return score

0 comments on commit feb5c47

Please sign in to comment.