[solved] How to let the subject know how many more trials they have
I'd like to be able to have my fixation screen have a line that says something like:
"This is trial [trial_number] of [total_number_of_trials]" or:
"There are [total_number_of_trials - trial_number] remaining"
But I'm not sure if there are already variables that I can use or if I have to create them (is count_trial_sequence what I should use?).
If I have to create them I may have to set them to a starting value and then increment them with some kind of loop statement such as "trial_number=trial_number + 1". I don't know how to do either of those things.
Also, what is the syntax for something like [total_number_of_trials - trial_number] ? When I was running a short experiment with 16 trials I tried to use "There are [16 - count_trial_sequence] trials remaining", but all I got was that statement literally on the screen.
Sorry for so many questions, but I don't quite have the hang of this yet. Thanks.
Comments
Hi Bob,
Using the square-bracket in a feedback or sketchpad item (in your case the fixation screen) to inform the participant about how far in the experiment they are, is a very good idea.
However, the square-bracket method can only use (e.g. display) the value of a previously defined variable, not change it. (That's why something like
[16 - count_trial_sequence]will not work.)Thus, we'll first have to define the to-be-displayed variables. We'll use a little bit of Python inline scripting to do so.
1.) Declare the total number of trials:
The total number of trials is a constant variable. To set this variable, append an inline_script item to the beginning of your experiment, and place something like the following code in its Prepare-phase tab (see comments for more info):
2.) Declare the trial count and the number of remaining trials:
The values of those variables are not constant, and therefore have to be redefined at the beginning of every trial sequence. To do so, append an inline_script item to the beginning of your trial sequence, and add something like the following code to its Prepare-phase tab:
3.) Use the square-bracket method in your sketchpad item:
For example:
This is trial [trial_count]/[total]You still have [trials_remaining] trials to go...After applying those suggestions, your overview area should look something like this:

A working example experiment can be downloaded here (simple download, change the extension from '.txt' into '.opensesame.tar.gz' and open as normally):
Does this make sense?
Best,
Lotje
Did you like my answer? Feel free to

I tried your instructions and they appeared to work as I needed. Thanks! It appears this issue is solved.
I say they "appeared" to work as I had a little trouble seeing the screens with the trial number notices. They were supposed to remain until a key was pressed, but instead advanced quickly on their own. I'll start a new thread about that issue.
--- Bob
Hi Bob,
Glad to hear the trial info works!
To keep the trial info displayed until a keypress, you can
If the keypress is a variable of interest, the latter method should be used. If the keypress is not relevant and does not have to appear in the log file, you can use the former method as well.
Best,
Lotje
Did you like my answer? Feel free to

Hi Lotje,
It turns out that the instructions you provided to display the trial number work exactly as I need them to on most OS's. The problem with the screens not waiting for a keypress, however, seems to be unrelated to the trial number issue. And it's strange because it only happens on one OS, hardware combination. As I said above, I'll start a new thread on that one. Thanks.
--- Bob