From 16e05f80b98057a3586fb4d465cbe3fc1119daf3 Mon Sep 17 00:00:00 2001 From: albertas-jn <24507839+albertas-jn@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:14:46 +0200 Subject: [PATCH] Rename RulesTemplate to TwoAlternativeForced, rules_template.py to tafc.py --- backend/experiment/rules/__init__.py | 4 +-- .../rules/{rules_template.py => tafc.py} | 34 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) rename backend/experiment/rules/{rules_template.py => tafc.py} (90%) diff --git a/backend/experiment/rules/__init__.py b/backend/experiment/rules/__init__.py index 8b503da52..9f515d37c 100644 --- a/backend/experiment/rules/__init__.py +++ b/backend/experiment/rules/__init__.py @@ -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 @@ -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, diff --git a/backend/experiment/rules/rules_template.py b/backend/experiment/rules/tafc.py similarity index 90% rename from backend/experiment/rules/rules_template.py rename to backend/experiment/rules/tafc.py index fe569a0b1..d027d69a3 100644 --- a/backend/experiment/rules/rules_template.py +++ b/backend/experiment/rules/tafc.py @@ -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 """ @@ -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. @@ -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])