Pavlovia Doesn't Save Stimuli Names in Results

URL of experiment: https://pavlovia.org/run/sabrina.schalz/cat-voice-discrimination/html/

Description of the problem: When I download the results from Pavlovia, they don’t include the names of the stimuli that were played. It’s a discrimination task that plays 2 wav files per trial and then participants respond with key presses. The wav files are presented in a random order using a loop (which is forced to terminate after each trial), so I need to know which stimuli were played to analyse the data. It’s currently set to pilot, but was on running when the results were generated.

Offline, PsychoPy saves the stimuli names and the key presses in the text file:
|27.3041 |EXP |New trial (rep=0, index=0): OrderedDict([(‘a’,‘Genna10.wav’), (‘b’, ‘Genna8.wav’)])|
|27.3084 |DATA |Keypress: y|

Online it only saves the key press, not the wav names.

I have changed the data settings to debug and that did result in more information in the online results files, but still no names of the stimuli in the text files. In the online excel file, it saves the stimuli names of the first trial, but not of the other 41.

The loop that generates the random stimuli order is forced to terminate early with a custom code component:
Begin Experiment: myCount = 0
Begin Routine: myCount = myCount + 1
Each Frame: if trials.finished == True:
continueRoutine = False
else:
continueRoutine = True
End Routine: if myCount > 0:
trials.finished = True
skipThisTrial = True
continueRoutine = False
else:
trials.finished = False
skipThisTrial = False
continueRoutine = True

How can I fix this so that the stimuli names are displayed in at least one of the results files?

Are you sure you’ve checked all the columns? If the file name is in the Excel file and istrials is ticked then it should be saved online as well as offline. However, the columns online aren’t in the same order.

Yes, istrials is ticked and the columns for the stimuli names are in the results excel file online, but only the first row contains the stimuli names. The rows below are just empty, even though key presses and times are filled out in the same rows in the other columns. So it’s not the entire row missing, just the content within the stimuli columns below row 1.
Offline, all 42 stimuli pairs are named in the results files, but online only the first pair is named, the rest are empty rows.

image

I wonder if there’s an issue with your variable names a and b being too simple and used elsewhere. Try calling them fileA and fileB (or similar) and see if that helps.

Unfortunately that didn’t work:

image

I was wondering whether it’s because I force the loop to end after the first trial, because the stimuli names in the first trial are recorded as usual. It’s only the subsequent trials where stimuli names are missing. That custom code component (see original question) was the only one that worked to stop the loop from going through all 42 stimuli pairs in one go. Offline I would have used $random(1)*41, but that doesn’t work online.

Sorry, I hadn’t spotted your code.

That totally explains the issue.

Your code is saying “end this trial early if it isn’t the first one”.

If you just want to present one trial use currentLoop.finished = True in End Routine and remove all of the rest of your code.

Oh, I see!

I changed the code component and synched with pavlovia, but unfortunately the results excel sheet still only shows the stimuli in the first trial.

Don’t you only want one trial to be recorded?

No, I need all trials recorded.

Basically what I need is to play one stimuli pair at a time, go to the next routine where participants tell me what they heard, and then for this to repeat 42 times. The pairs have to be sampled randomly from the stimuli list. That’s why the loop has to terminate after the first trial.
So trial is the routine where the stimuli are, trials is the loop that randomly samples the pairs and terminates after the first pair was played, then the test, and then the loop trials_2 makes this repeat 42 times so that I end up with 42 trials in total.
image

I need the stimuli names for all of the total 42 trials, and they are included in the results files when I run it offline, but when I run it offline only the first pair name is shown. All pairs played after that are not named, but I need their names as well.

Why do you need concentric loops? Are you trying to randomly allocate different versions of trial with different versions of test? If not, then couldn’t you remove trials_2, put test inside the trials loop and remove the code entirely?

The test is always the same, but the stimuli pairs are different each time. I have to randomly sample one pair per round, and I can only play 1 pair per round.
Without the 2nd loop, it would play one pair (trial 1), do the test and then be finished. I need it to play one pair, do the test, repeat 42 times so that I have 42 trials in total (42 different stimuli pairs played individually at random, each followed by the same test).

The test has to be shown after the playback of the pair, not during. So the loop that samples the stimuli has to be finished before the test can start, and then I need the second loop to start the next trial.

This is all working fine, the only issue is that the stimili names are not shown in the results. They are all shown in the offline results, but just one pair in the online results. I need all names in the table, matched to the responses people gave in the test.

Is there any way to force it to print the stimuli names in the pavlovia results?

Please could you send me your psyexp file? I think it would be easier for me to demonstrate what I’m suggesting than continue to try to explain it.

I suddenly understood what you meant, changed it and now it works! Thank you so much!!!

1 Like