Saving Variable Data in Pavlovia

Hi,
At Begin Experiment, I am initialising two variables through the coder.
I select a random number between 1 and 50, then I paste a string at the end of it, and I would like to save these two variables.

# Select a random number between 1 and 50
selected_number = str(randint(1,51))

# Assign the selected number to the corresponding Excel file
current_file_code = selected_number+".xlsx"

# save the codes as a variables
thisExp.addData('current_file_code', current_file_code)
thisExp.addData('selected_number', selected_number)

I am currently coding as ‘Auto->JS’, and I can see that “thisExp.addData” is correctly translated to “psychoJS.experiment.addData” in the JS column.

(I also tried to type into a JS coder with ‘psychoJS.experiment.addData’, and it still did not work!)

When running the experiment in PsychoPy, I have no issues with saving this variable.
However, it seems to give some issues when uploaded to Pavlovia.

Later in the experiment I have two similar variables being correctly initialised and saved (also coded in 'Auto->JS):

thisExp.addData('incorrectResp', keyStim_preRND_1.keys)
thisExp.addData('incorrectResp.rt', keyStim_preRND_1.rt)

Can anyone tell me, how I can save these new variables in Pavlovia?

Thanks in advance
Phil :))

The auto translate is fine for saving data. If you’ve made a recent change, are you looking at the latest version? Ctrl-Shift-R or an incognito tab

Hi,
thanks for the reply.
Yes, the study is uploaded on Pavlovia, status ‘Running’ and I also checked the code uploaded on Gitlab (which matches the offline version).

I tried to execute the task both in ‘Pilot’ and ‘Run’, but it does not seem to be working.