0 votes
in SoSci Survey (English) by s029671 (120 points)
reshown by s029671

Dear SoSci Team,

I aim to limit the number of total participants (unrelated to a specific variable) in my study.

Could you please help me in setting up a PHP code at the beginning of the study to limit the number of participants to 250? I found the following online but it does not seem to work.

$n = statistic('count');
if ($n > 251) {
text('quotafull');
buttonHide();
pageStop();
}

Many thanks!

by s109993 (11.6k points)
wenn ich das richtig lese, dann ist 'count' eine Option. Das heißt es fehlt eine variable, die sie Zählen wollen. Probieren Sie einmal $n = statistic('count', 'finished', 1);

Also alle Fälle werden gezählt, die den fragebogen abgeschlossen haben. Aber ich habe statistic() noch nie benutzt, daher ist das gerade nur eine Idee ;)

Ah, english, sorry:
I think count is an option, therefore you would have to use a variable which you want to count. Try the following: $n = statistic('count', 'finished', 1); It should count all the cases, which have finished the questionnaire. But I have never used statistic(), thats why I put the answer as a comment and not as actual answer ;)
by s029671 (120 points)
Thank you very much for your help.

Is there another way to limit the number of participants?

Many thanks!

1 Answer

0 votes
by SoSci Survey (322k points)

The above code is the recommended option.

Please create an internal variable (e.g. IV01_01) and use put() on the page where you consider a case useful:

put('IV01_01', 1);

Then you can easily employ statistic()

$n = statistic('count', 'IV01_01', 1); 
by s029671 (120 points)
Thank you so much! Now it works!

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...