Pre-filling the “participant” field via URL

Hi everyone,

In my study, I filter access by participant number. The goal is to prevent non-participants from entering and to force participants to arrive through a link where their participant ID is pre-filled.

Example URL: Image_designation [PsychoPy]

my gatekeeping logic blocks entry

endExpAfterThis = false;
let isAllowed = false;

let allowedCodes = ["101",101,"202", "303", "404"]; // ← adapte cette liste

// --- Lecture et normalisation du code saisi ---
let rawCode = expInfo['participant'];      // saisi dans la boîte de dialogue
console.log(rawCode)

// --- État global pour la routine Gate ---


// Vérifications
if (allowedCodes.includes(String(rawCode))) {
  isAllowed = true;
}

if (isAllowed) {
  let endExpAfterThis = false; // flag pour quitter ensuite
// passe directement à la suite de l’expérience
// Récupération depuis shelf

} else {
  // Afficher le message de blocage pendant 5 secondes
// --- Begin Routine ---
consigne.setAutoDraw(false);
instrucdeb.stop();
let msg = "Accès refusé.\n Votre code n'est pas autorisé.";
text.setText(msg + "\n\n Veuillez contacter l'expérimentateur.");
endExpAfterThis = true;   // on demandera à quitter après la routine
}

When I use a URL in this format, my gatekeeping logic blocks entry. With some console logging, I can see that rawcode ends up as a random 6-digit value. Everything I do afterward works as expected (e.g., fetching info from the Pavlovia shelf), but the initial value seems to be overwritten somewhere.

Thank in advance
Djeser

In your example URL you have Participant instead of participant.

https://run.pavlovia.org/Pasteur/sced_experiment/?Participant=101%20Session=2

should be

https://run.pavlovia.org/Pasteur/sced_experiment/?participant=101&session=2

Yes it’s that thanks I found this URL template in the internal documentation in my team I will fix it.

Have a good day