Skip to content

Commit

Permalink
Merge pull request #1028 from Amsterdam-Music-Lab/release/2.1.0
Browse files Browse the repository at this point in the history
Chore: Merge release/2.1.0 into main
  • Loading branch information
drikusroor authored May 27, 2024
2 parents 681daa3 + 0f83432 commit e23d9f3
Show file tree
Hide file tree
Showing 70 changed files with 888 additions and 523 deletions.
91 changes: 0 additions & 91 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

89 changes: 89 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: "🐛 Bug Report"
title: "🐛 [BUG] - <title>"
description: "Create a report to help us improve MUSCLE"
assignees: []
labels: [
"bug"
]
body:
- type: textarea
id: description
attributes:
label: "Description"
description: Please enter an explicit description of your issue
placeholder: |
Short and explicit description of your incident...
## Screenshots:
Please also post any screenshots of the bug you encountered
value: |
<!-- Short and explicit description of your incident... -->
### Screenshots
<!-- You can upload screenshots of the issue (if any) here... -->
validations:
required: true
- type: input
id: reprod-url
attributes:
label: "Reproduction URL"
description: Please enter your the URL to provide a reproduction of the issue
placeholder: ex. http://acc.amsterdammusiclab.nl/tunetwins
validations:
required: false
- type: textarea
id: reprod
attributes:
label: "Reproduction steps"
description: Please enter an explicit description of your issue
value: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
render: bash
validations:
required: true
- type: textarea
id: logs
attributes:
label: "Logs"
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: bash
validations:
required: false
- type: dropdown
id: browsers
attributes:
label: "Browsers"
description: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Opera
validations:
required: false
- type: dropdown
id: os
attributes:
label: "OS"
description: What is the impacted environment ?
multiple: true
options:
- Windows
- Linux
- Mac
validations:
required: false
- type: textarea
id: context
attributes:
label: "Additional context"
description: Add any other context about the problem here.
placeholder:
validations:
required: false
1 change: 1 addition & 0 deletions backend/aml/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
path('result/', include('result.urls')),
path('section/', include('section.urls')),
path('session/', include('session.urls')),
path('theme/', include('theme.urls')),
path('admin/', admin.site.urls),

# Sentry debug (uncomment to test Sentry)
Expand Down
3 changes: 0 additions & 3 deletions backend/experiment/actions/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class Playback(BaseAction):
- preload_message: text to display during preload
- instruction: text to display during presentation of the sound
- play_from: where in the audio file to start playing/
- ready_time: how long to show the "Preload" view (loading spinner)
- show_animation: whether to show animations with this player
- mute: whether to mute the audio
- timeout_after_playback: once playback has finished, add optional timeout (in seconds) before proceeding
Expand All @@ -38,7 +37,6 @@ def __init__(self,
preload_message='',
instruction='',
play_from=0,
ready_time=0,
show_animation=False,
mute=False,
timeout_after_playback=None,
Expand All @@ -54,7 +52,6 @@ def __init__(self,
self.instruction = instruction
self.play_from = play_from
self.mute = mute
self.ready_time = ready_time
self.timeout_after_playback = timeout_after_playback
self.stop_audio_after = stop_audio_after
self.resume_play = resume_play
Expand Down
9 changes: 8 additions & 1 deletion backend/experiment/actions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,21 @@ def final_action_with_optional_button(session, final_text='', title=_('End'), bu
return a Final.action, which has a button to continue to the next experiment if series is defined
"""
collection_slug = session.load_json_data().get(COLLECTION_KEY)

if session.participant.participant_id_url:
participant_id_url = session.participant.participant_id_url
redirect_url = f'/collection/{collection_slug}?participant_id_url={participant_id_url}'
else:
redirect_url = f'/collection/{collection_slug}'

if collection_slug:
return Final(
title=title,
session=session,
final_text=final_text,
button={
'text': button_text,
'link': f'/collection/{collection_slug}'
'link': redirect_url
}
)
else:
Expand Down
1 change: 0 additions & 1 deletion backend/experiment/actions/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def song_sync(session: Session, section: Section, title: str,
submits=True
)]),
playback=Autoplay([section], show_animation=True,
ready_time=3,
preload_message=_('Get ready!'),
instruction=_('Do you recognize the song?'),
),
Expand Down
7 changes: 4 additions & 3 deletions backend/experiment/rules/congosamediff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import random
import re
import math
import string
Expand Down Expand Up @@ -112,10 +113,10 @@ def next_round(self, session: Session):
groups_amount = session.playlist.section_set.values('group').distinct().count()
variants_amount = real_trial_variants.count()

# get the participant's group variant
participant_id = session.participant.participant_id_url
# get the participant's group variant based on the participant's id # else default to random number between 1 and variants_amount
participant_id = session.participant.id
participant_group_variant = self.get_participant_group_variant(
int(participant_id),
participant_id,
group_number,
groups_amount,
variants_amount
Expand Down
1 change: 0 additions & 1 deletion backend/experiment/rules/eurovision_2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def next_heard_before_action(self, session):
playback = Autoplay(
sections = [section],
show_animation=True,
ready_time=3,
preload_message=_('Get ready!')
)
expected_result=novelty[round_number]
Expand Down
3 changes: 1 addition & 2 deletions backend/experiment/rules/hooked.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def first_round(self, experiment):
playlist = Playlist(experiment.playlists.all())

return [
explainer,
consent,
playlist,
explainer,
]

def next_round(self, session):
Expand Down Expand Up @@ -305,7 +305,6 @@ def next_heard_before_action(self, session):
playback = Autoplay(
[section],
show_animation=True,
ready_time=3,
preload_message=_('Get ready!')
)
expected_response = this_section_info.get('novelty')
Expand Down
1 change: 0 additions & 1 deletion backend/experiment/rules/kuiper_2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def next_heard_before_action(self, session):
playback = Autoplay(
[section],
show_animation=True,
ready_time=3,
preload_message=_('Get ready!')
)
expected_result=novelty[round_number]
Expand Down
4 changes: 2 additions & 2 deletions backend/experiment/rules/matching_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ def calculate_score(self, result, data):
def calculate_intermediate_score(self, session, result):
''' will be called every time two cards have been turned '''
result_data = json.loads(result)
first_card = result_data['lastCard']
first_card = result_data['first_card']
first_section = Section.objects.get(pk=first_card['id'])
first_card['filename'] = str(first_section.filename)
second_card = result_data['currentCard']
second_card = result_data['second_card']
second_section = Section.objects.get(pk=second_card['id'])
second_card['filename'] = str(second_section.filename)
if first_section.group == second_section.group:
Expand Down
11 changes: 3 additions & 8 deletions backend/experiment/rules/speech2song.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def next_repeated_representation(session, is_speech, group_id=-1):
section = session.playlist.section_set.get(group=group_id)
else:
section = session.previous_section()
actions = [sound(section, i) for i in range(1, n_representations+1)]
actions = [sound(section)] * n_representations
actions.append(speech_or_sound_question(session, section, is_speech))
return actions

Expand Down Expand Up @@ -226,15 +226,10 @@ def question_sound(session, section):
)


def sound(section, n_representation=None):
if n_representation and n_representation > 1:
ready_time = 0
else:
ready_time = 1
def sound(section):
title = _('Listen carefully')
playback = Autoplay(
sections = [section],
ready_time = ready_time,
sections=[section],
)
view = Trial(
playback=playback,
Expand Down
12 changes: 6 additions & 6 deletions backend/experiment/rules/tests/test_matching_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,21 @@ def test_intermediate_score(self):
self.session.save()
self.session_data = {'session_id': self.session.id}
sections = self.playlist.section_set.all()
data = {'lastCard': {'id': sections[0].id},
'currentCard': {'id': sections[1].id}}
data = {'first_card': {'id': sections[0].id},
'second_card': {'id': sections[1].id}}
result = self.intermediate_score_request(data)
assert result.score == 10
assert result.given_response == 'lucky match'
data['currentCard'].update({'seen': True})
data['second_card'].update({'seen': True})
result = self.intermediate_score_request(data)
assert result.score == 20
assert result.given_response == 'match'
data['currentCard'] = {'id': sections[3].id, 'seen': True}
data['second_card'] = {'id': sections[3].id, 'seen': True}
result = self.intermediate_score_request(data)
assert result.score == -10
assert result.given_response == 'misremembered'
data['lastCard'].update({'seen': True})
data['currentCard'].pop('seen')
data['first_card'].update({'seen': True})
data['second_card'].pop('seen')
result = self.intermediate_score_request(data)
assert result.score == 0
assert result.given_response == 'no match'
Loading

0 comments on commit e23d9f3

Please sign in to comment.