Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headphone test #93

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e842b16
Added a version check so get_magic_quotes_gpc() is only used for PHP …
Simon-Stone Jan 28, 2021
2adb2bd
Merge branch 'audiolabs:master' into master
Simon-Stone May 19, 2022
34116f7
started working on the preference test. Nothing is working so far.
May 27, 2022
54ad3ff
adds a working prototype of the preference test. Also adds ability to…
May 31, 2022
c90510c
adds support for grouped stimuli so that only pairs from each group a…
May 31, 2022
bb3fed8
adds support for 'mustPlay' flag
May 31, 2022
6d47a8c
adds hotkey notice
May 31, 2022
98a560f
added some more explanations
May 31, 2022
f2a4566
removing personal config yaml and adding demo yamls for the Preferenc…
May 31, 2022
721fe84
fixes a bug when certain config paramters are undefined
May 31, 2022
14c4276
adds documentation for the preference_test page and makes the pref_gr…
May 31, 2022
6a19954
Merge pull request #1 from nullpunktTUD/preference_test
Simon-Stone Jun 1, 2022
8e7eb41
adds documentation in the doc files
Jun 1, 2022
2c2cee1
removes some dead code
Jun 2, 2022
b062a7a
adds a dropdown to the widget options for the questionnaire
Jun 3, 2022
137aee1
restores to a generic version
Jun 3, 2022
a370979
fixes missing time calculation
Jun 3, 2022
7892742
Merge pull request #2 from nullpunktTUD/preference_test
Simon-Stone Jun 7, 2022
8fe2adf
basic implementation of the headphones test; not yet functional
Jun 13, 2022
567de4c
adds support to write the results correctly
Jun 20, 2022
c4dfe69
stimuli are now correctly randomized on each page
Jun 20, 2022
47bf74b
results are now displayed for the headphones screening
Jun 20, 2022
bf86605
first fully functional prototype of the headphones screening
Jun 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions configs/complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,20 @@ pages:
label: Male
- value: other
label: Other
- type: dropdown
name: referral
label: How have you heard of us?
response:
- value: searchEngine
label: Google/internet search
- value: friends
label: Friends or colleagues
- value: participant
label: Previous experiment
- value: paper
label: Seen in published paper
- value: other
label: Other
- type: long_text
label: Feedback
name: feedback
Expand Down
53 changes: 53 additions & 0 deletions configs/headphones_screen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
testname: webMUSHRA Example
testId: headphones_screen_example
bufferSize: 2048
stopOnErrors: true
showButtonPreviousPage: true
remoteService: service/write.php


pages:
- type: generic
id: first_page
name: Welcome
content: Welcome to webMUSHRA!
- type: volume
id: vol
name: Volume settings
content: Please adjust the volume to a comfortable level.
stimulus: configs/resources/audio/stimuli_HugginsPitch/HugginsPitch_calibration.wav
defaultVolume: 0.5
- type: headphones_screen
id: hp_check
name: Headphones check
repetitions: 6
target: configs/resources/audio/stimuli_HugginsPitch/HugginsPitch_1.wav
other:
A: configs/resources/audio/stimuli_HugginsPitch/HugginsPitch_2.wav
B: configs/resources/audio/stimuli_HugginsPitch/HugginsPitch_3.wav
- type: finish
name: Thank you
content: Thank you for attending!
showResults: true
writeResults: true
generateSubjectId: true
questionnaire:
- type: text
label: eMail
name: email
- type: number
label: Age
name: age
min: 0
max: 100
default: 30
- type: likert
name: gender
label: Gender
response:
- value: female
label: Female
- value: male
label: Male
- value: other
label: Other
30 changes: 30 additions & 0 deletions configs/pref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# test config preference test


testname: Preference test
testId: pref
bufferSize: 2048
stopOnErrors: true
showButtonPreviousPage: true
remoteService: service/write.php

pages:
- type: preference_test
id: trialpref
name: Preference test
content: |
<p><b>Which sound do you prefer?</b></p>
considerOrder: true
mustPlayback: ended
stimuli:
C1: configs/resources/audio/mono_c1.wav
C2: configs/resources/audio/mono_c2.wav
C3: configs/resources/audio/mono_c3.wav

- type: finish
name: Thank you
content: Thank you for attending
showResults: true
writeResults: true
generateSubjectId: true
confirmationCode: your_code_here
28 changes: 28 additions & 0 deletions configs/pref_grouped.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# test config preference test


testname: Preference test
testId: pref_grouped
bufferSize: 2048
stopOnErrors: true
showButtonPreviousPage: true
remoteService: service/write.php

pages:
- type: preference_test
id: trialpref
name: Preference test
content: |
<p><b>Which sound do you prefer?</b></p>
considerOrder: true
stimuli:
- C1: configs/resources/audio/mono_c1.wav
C2: configs/resources/audio/mono_c2.wav
- C3: configs/resources/audio/mono_c3.wav
C2: configs/resources/audio/mono_c2.wav

- type: finish
name: Thank you
content: Thank you for attending
showResults: true
writeResults: true
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
29 changes: 29 additions & 0 deletions doc/experimenter.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ The volume page can be used to set the volume used in the experiment.
* **stimulus** Filepath to the stimulus that is used for setting the volume.
* **defaultVolume** Default volume (must be between 0.0 and 1.0).


#### `headphones_screen` page

This page can be used to perform a headphones screening. Sample files to conduct a test according to [Milne A, Bianco R, Poole K, Zhao S, Oxenham A, Billig A & Chait M. (2020) An online headphone screening test based on dichotic pitch. Behavior Research Methods.](https://rdcu.be/cbWrX) are provided, but the page can be used for any test following the same basic paradigm of identifying a target stimulus among a list of decoy stimuli.

**Important:** There is currently no automated pass/fail arbitration so even subject failing to identify any of the targets will be allowed to complete the rest of the experiment. You can, however, use the results of the screening to filter your experiment results post-hoc.

* **type** must be headphones_screen
* **id** Identifier of the page.
* **name** Name of the page (is shown as title)
* **content** Content (HTML) of the page. The content is shown on the upper part of the page.
* **repetitions** Determines how many randomized repetitions of the task need to be completed.
* **target** Filepath to the target stimulus to be identified.
* **other** A map of stimuli to use as decoys. The key is the name of the decoy. The value is the filepath to the stimulus (WAV file).

#### `mushra` page

A mushra page shows a trial according to ITU-R Recommendation BS.1534.
Expand Down Expand Up @@ -96,6 +111,18 @@ A paired comparison page creates a forced or unforced paired comparison (AB/ABX/
* **reference** Filepath to the reference stimulus (WAV file).
* **stimuli** A map of stimuli representing three conditions. The key is the name of the condition. The value is the filepath to the stimulus (WAV file).

#### `preference_test` page

A preference test page creates a forced paired comparison between two stimuli. The main difference to `paired_comparison` is that there is no reference or ground truth.

* **type** must be preference_test.
* **id** Identifier of the page.
* **name** Name of the page (is shown as title)
* **content** Content (HTML) of the page. The content is shown on the upper part of the page.
* **considerOrder** If set to true, a complete set of pairs is generated from the list of stimuli: A set of `{A, B}` would result in two pairs `(A, B)` and `(B, A)`. Otherwise only the pair `(A, B)` would be generated.
* **mustPlayback** If set to `ended`, the participant must fully play back all stimuli to the end. If set to `processUpdate`, the participant must start playing back all stimuli before responding becomes possible.
* **stimuli** Either a map of stimuli or an array of maps of stimuli. If it is a map, pairs will be generated from the list and then shuffled. If it is an array of maps, pairs will be generated for each map individually and then all the pairs from all maps are shuffled.

#### `likert_multi_stimulus` page

A likert multi stimulus page creates a multi-stimulus likert rating.
Expand Down Expand Up @@ -133,6 +160,8 @@ The finish page must be the last page of the experiment.
* **content** Content (HTML) of the page. The content is shown on the upper part of the page.
* **showResults** The results are shown to the participant.
* **writeResults** The results are sent to the remote service (which writes the results into a file).
* **generateSubjectId** If set to true, a random subject ID is generated and appended to the results.
* **confirmationCode:** If set, this code is displayed after the results were sent. This can be used to confirm that subjects have completed the experiment and facilitates


## Results
Expand Down
5 changes: 5 additions & 0 deletions doc/participant.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@
* <kbd>SPACE</kbd> Play/pause the current selection
* <kbd>a</kbd> Set begin of loop to current position
* <kbd>b</kbd> Set end of loop to current position

### Preference test

* <kbd>1</kbd> Play item A
* <kbd>2</kbd> Play item B
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
<script src="lib/webmushra/datamodel/LikertSingleStimulusRating.js"></script>
<script src="lib/webmushra/datamodel/PairedComparisonChoice.js"></script>
<script src="lib/webmushra/datamodel/Participant.js"></script>
<script src="lib/webmushra/datamodel/PreferenceTestChoice.js"></script>
<script src="lib/webmushra/datamodel/HeadphonesScreenResponse.js"></script>
<script src="lib/webmushra/datamodel/Session.js"></script>
<script src="lib/webmushra/datamodel/Stimulus.js"></script>
<script src="lib/webmushra/datamodel/Trial.js"></script>
Expand Down Expand Up @@ -108,9 +110,13 @@
<script src="lib/webmushra/pages/BS1116PageManager.js"></script>
<script src="lib/webmushra/pages/FinishPage.js"></script>
<script src="lib/webmushra/pages/GenericPage.js"></script>
<script src="lib/webmushra/pages/HeadphonesScreenPage.js"></script>
<script src="lib/webmushra/pages/HeadphonesScreenPageManager.js"></script>
<script src="lib/webmushra/pages/MushraPage.js"></script>
<script src="lib/webmushra/pages/PairedComparisonPage.js"></script>
<script src="lib/webmushra/pages/PairedComparisonPageManager.js"></script>
<script src="lib/webmushra/pages/PreferenceTestPage.js"></script>
<script src="lib/webmushra/pages/PreferenceTestPageManager.js"></script>
<script src="lib/webmushra/pages/VolumePage.js"></script>
<script src="lib/webmushra/pages/LikertSingleStimulusPage.js"></script>
<script src="lib/webmushra/pages/LikertSingleStimulusPageManager.js"></script>
Expand Down
12 changes: 12 additions & 0 deletions lib/webmushra/datamodel/HeadphonesScreenResponse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*************************************************************************
(C) Copyright AudioLabs 2017

This source code is protected by copyright law and international treaties. This source code is made available to You subject to the terms and conditions of the Software License for the webMUSHRA.js Software. Said terms and conditions have been made available to You prior to Your download of this source code. By downloading this source code You agree to be bound by the above mentionend terms and conditions, which can also be found here: https://www.audiolabs-erlangen.de/resources/webMUSHRA. Any unauthorised use of this source code may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under law.

**************************************************************************/

function HeadphonesScreenResponse() {
this.correct = null;
this.comment = null;
this.time = null;
}
14 changes: 14 additions & 0 deletions lib/webmushra/datamodel/PreferenceTestChoice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*************************************************************************
(C) Copyright AudioLabs 2017

This source code is protected by copyright law and international treaties. This source code is made available to You subject to the terms and conditions of the Software License for the webMUSHRA.js Software. Said terms and conditions have been made available to You prior to Your download of this source code. By downloading this source code You agree to be bound by the above mentionend terms and conditions, which can also be found here: https://www.audiolabs-erlangen.de/resources/webMUSHRA. Any unauthorised use of this source code may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under law.

**************************************************************************/

function PreferenceTestChoice() {
this.optionA = null;
this.optionB = null;
this.answer = null;
this.comment = null;
this.time = null;
}
10 changes: 10 additions & 0 deletions lib/webmushra/nls/nls.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ nls['fr']['slightly'] = "Légèrement gênante";
nls['fr']['annoying'] = "Dégradation gênante";
nls['fr']['very'] = "Dégradation très gênante";

// captions Preference Test
nls['en']['pref'] = "Which item do you prefer?";
nls['de']['pref'] = "Welche Version bevorzugen Sie?";
nls['fr']['pref'] = "Quel item préférez-vous?";


// captions Paired Comparison AB/ABN
Expand All @@ -90,3 +94,9 @@ nls['fr']['results'] = "Vos résultats:";
nls['en']['attending'] = "Thank you for your participation!";
nls['de']['attending'] = "Vielen Dank für die Teilnahme!";
nls['fr']['attending'] = "Merci pour votre participation!";
nls['en']['response'] = "Response";
nls['de']['response'] = "Antwort";
nls['fr']['response'] = "Réponse";
nls['en']['code'] = "Your confirmation code:";
nls['de']['code'] = "Ihr Bestätigungscode:";
nls['fr']['code'] = "Votre code de confirmation:";
Loading