Slider marker position set differently every repeat

Hi all, I have been trying to set the slider marker position to start at different values every repeat based on a parameter in my condition file. My slider ranges from 0-100, ticks (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21), labels (0,10,20,30,40,50,60,70,80,90,100), the parameter I’m trying to use is titled “posit_own” which contains numeric values from 1-21, and it’s in the same condition file I use to run the loop.

I originally tried putting the “posit_own” in the builder GUI in section “marker start value”, However, the error message keeps on saying “posit_own not defined”, and I tried putting in another parameter that is used in other routines, it’s still giving the same error message. I then put the following code in the “begin experiment” section: trial_handler = data.TrialHandler(nReps=1, method=‘sequential’,
trialList=data.importConditions(‘participant_0016.csv’)) #my condition file for this loop
for trial in trial_handler:
posit_own = float(trial[‘posit_own’])

Then in the “Begin Routine” section I put:


However, now that posit_own is defined, it’s still not changing based on the values in the parameter, but somehow the marker position is defaulted to “2”.

I then tried not converting it to float, just leaving the parameter as it is. Still not working.

The only way I could make the slider marker to start at the position defined in the parameter is by putting the “slider.markerPos = posit_own” in “Each Frame” section. However, that way the key component would not work anymore, which is also not desirable.

If anyone could give me a better solution, it would be greatly appreciated!!! Thank you so much for your time in advance!!!

OS : macOS Big Sur
PsychoPy version: 2023.1.2
Standard Standalone? (y/n) If not then what?: y