Skip to content

Commit

Permalink
Rename RulesTemplate to TwoAlternativeForced, rules_template.py to ta…
Browse files Browse the repository at this point in the history
…fc.py
  • Loading branch information
albertas-jn committed Jul 1, 2024
1 parent 7d1fb21 commit 16e05f8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions backend/experiment/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from .toontjehoger_4_absolute import ToontjeHoger4Absolute
from .toontjehoger_5_tempo import ToontjeHoger5Tempo
from .toontjehoger_6_relative import ToontjeHoger6Relative
from .rules_template import RulesTemplate
from .tafc import TwoAlternativeForced
from .toontjehogerkids_1_mozart import ToontjeHogerKids1Mozart
from .toontjehogerkids_2_preverbal import ToontjeHogerKids2Preverbal
from .toontjehogerkids_3_plink import ToontjeHogerKids3Plink
Expand Down Expand Up @@ -65,7 +65,7 @@
RhythmBatteryFinal.ID: RhythmBatteryFinal,
RhythmBatteryIntro.ID: RhythmBatteryIntro,
RhythmDiscrimination.ID: RhythmDiscrimination,
RulesTemplate.ID: RulesTemplate,
TwoAlternativeForced.ID: TwoAlternativeForced,
Speech2Song.ID: Speech2Song,
ThatsMySong.ID: ThatsMySong,
ToontjeHoger1Mozart.ID: ToontjeHoger1Mozart,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
"""
Setup experiment data in the admin panel
* Choose a slug for the experiment ('rt')
* Choose a slug for the experiment ('tafc')
* Upload sound files
* Find the root directory name of the uploaded sound files. It is backend/upload on your local machine. On a server, ask the administrator.
* Create a new directory within the root directory, use slug 'rt' for the name
* Create a new directory within the root directory, use slug 'tafc' for the name
* Copy files (sample_1.wav - sample_5.wav)
* Create playlist:
* Playlists -> Add
* Name: rules_template
* Name: tafc
* Process CSV: yes
* CSV (see format explanation at the bottom of text entry field):
Sample Artist 1,Sample Song 1,0.0,1.25,rt/sample_1.wav,A,CRV
Sample Artist 2,Sample Song 2,0.0,1.25,rt/sample_2.wav,B,MTW
Sample Artist 3,Sample Song 3,0.0,1.25,rt/sample_3.wav,A,CRV
Sample Artist 4,Sample Song 4,0.0,1.25,rt/sample_4.wav,A,GWN
Sample Artist 5,Sample Song 5,0.0,1.25,rt/sample_5.wav,B,CGB
Sample Artist 1,Sample Song 1,0.0,1.25,tafc/sample_1.wav,A,CRV
Sample Artist 2,Sample Song 2,0.0,1.25,tafc/sample_2.wav,B,MTW
Sample Artist 3,Sample Song 3,0.0,1.25,tafc/sample_3.wav,A,CRV
Sample Artist 4,Sample Song 4,0.0,1.25,tafc/sample_4.wav,A,GWN
Sample Artist 5,Sample Song 5,0.0,1.25,tafc/sample_5.wav,B,CGB
* Save
* Create experiment
* Admin panel -> Experiments -> Add
* Choose name: rules_template
* Slug: rt
* Rules: RuleTemplate
* Choose name: TwoAlternativeForced
* Slug: tafc
* Rules: TwoAlternativeForced
* Rounds: 5
* Playlists: rules_template
* Playlists: tafc
* Save and continue editing
* QUESTION SERIES -> Add rules' default and save
"""
Expand All @@ -40,16 +40,16 @@
from result.utils import prepare_result


class RulesTemplate(Base):
class TwoAlternativeForced(Base):
"""
first_round() and next_round() are required methods for the class.
"""

# Add to __init.py__ file in the same directory as the current file:
# from .rules_template import RulesTemplate
# from .tafc import TwoAlternativeForced
# To EXPERIMENT_RULES dictionary in __init.py__
# RulesTemplate.ID: RulesTemplate
ID = 'RULES_TEMPLATE'
# TwoAlternativeForced.ID: TwoAlternativeForced
ID = 'TWO_ALTERNATIVE_FORCED'

def __init__(self):
# Create questionaire to ask for age, gender, native language and musical experience. It will be run after a session is created.
Expand Down Expand Up @@ -122,7 +122,7 @@ def next_trial_action(self, session):

# Determine expected response, in this case section tag (A or B)
expected_response = section.tag
print("Expected response: ", expected_response)

# Build Trial action, configure through config argument. Trial has Playback and Form with ChoiceQuestion to submit response.

playback = PlayButton([section])
Expand Down

0 comments on commit 16e05f8

Please sign in to comment.