| Reference | Downloads | Github

Pavlovia - "Number of sessions" as variable for randomization

Hi all,

I am programming an online experiment in javascript and jsPsych that will run in pavlovia, and I am wondering if it could be possible to know the number of sessions that has already run, before starting the experiment

I would like to use this variable to perform the randomization assignment of parameters to the different participants

Thanks for your help!

For online random allocation to groups I’d recommend that you use my new study portal which can take account of non finishers.

If you are happy to live without that feature and don’t want hosting of study information, then you could use my previous app which allocated a consecutive participant number suitable for equal distribution to groups.

Thanks for your comment, but it is not exactly what I want,

I see from the server is sending this number session, so I just I would like to use this parameter in the code,

Can that parameter be saved to a variable @thomas_pronk / @Becca ?

I suspect it will give duplicates when participants overlap.

What’s the URL that goes with that nbSessions property?

The URL is this one, it is a simple example to learn how pavlovia works,

I think this parameter is this one (picture), that the server response send, at the same time with the experiment to the client, I imagine is the same for all the experiments

Ah I just noticed it’s jsPsych. I happen to maintain the Pavlovia plugin for jsPsych, so I guess I can set this up. It might take a couple of days though. See this post at jsPsych forum for latest version: jsPsych Pavlovia plugin · Discussion #1738 · jspsych/jsPsych · GitHub

Ready! I’ve added this feature in v2020.4 of the Pavlovia plugin, which you can download (and try out) over here: Thomas Pronk / jsPsych_SimpleReactionTime · GitLab

I illustrate it’s use by presenting the nbSessions property in a trial.

1 Like

Great!! Thanks so much Thomas,
I will try it out!!

1 Like