Difference between revisions of "Participant Counter"

From TSG Doc
Jump to navigation Jump to search
(first edit)
(No difference)

Revision as of 16:12, 25 May 2020

Imagine you are building an online experiment that will use an external panel system. The participants will reach the experiment via a link supplied by the panel system The panel system will give you a participant identifier like this: ae56b232. Now you want to counterbalance your conditions. Normally you would do this by making a list of conditions:

participant condition a condition b
0 Red Horizontal
1 Green Horizontal
2 Red Vertical
3 Green Vertical

Now you would normally use the participant number to determine the condition: participant 0 get red, horizontal, participant 1 get green horizontal, participant 0 get red, vertical, participant 2 get green vertical en participant 2 gets red, horizontal again. (in real life the number of conditional can be much larger of course) This nice system is ruined by the fact that we have no consecutive participant numbers. Using the random participant numbersfrom the panel system may work if the number of participant is very large and the number of conditions is very small, but otherwise our counterbalancing is ruined.

Use the participant counter to solve this. Just give the participant counter a nice unique name for our experiment and each time you call it, it will give you a new number. It has some additional features as well.

just count

 # curl 'https://www.socsci.ru.nl/wilberth/nocms/radcloud/participant_counter.php?experiment=1'
 {"experiment":"1","counter":"0","timeout":""} # first counter value
 # curl 'https://www.socsci.ru.nl/wilberth/nocms/radcloud/participant_counter.php?experiment=1'
 {"experiment":"1","counter":"1","timeout":""} # a new counter value
 # curl 'https://www.socsci.ru.nl/wilberth/nocms/radcloud/participant_counter.php?experiment=1'
 {"experiment":"1","counter":"2","timeout":""} # and yet another counter value

count with timeout

 # curl 'https://www.socsci.ru.nl/wilberth/nocms/radcloud/participant_counter.php?experiment=1&timeout=10'
 {"experiment":"1","counter":"3","timeout":"10"} # ppn is released after ten seconds
 # sleep 15
 # curl 'https://www.socsci.ru.nl/wilberth/nocms/radcloud/participant_counter.php?experiment=1&timeout=10'
 {"experiment":"1","counter":"3","timeout":"10"} # we get the same counter value again

finalizing counter at the end of an experiment

experiment finished in time, finalizing successfull

 # curl 'https://www.socsci.ru.nl/wilberth/nocms/radcloud/participant_counter.php?experiment=1&timeout=10'
 {"experiment":"1","counter":"3","timeout":"10"}
 # curl 'https://www.socsci.ru.nl/wilberth/nocms/radcloud/participant_counter.php?experiment=1&counter=3'
 {"experiment":"1","counter":"3","timeout":""} # nu lukt het finalizen wel, want je was op tijd, je krijgt je counter terug

experiment takes too long and finalizing fails

 # curl 'https://www.socsci.ru.nl/wilberth/nocms/radcloud/participant_counter.php?experiment=1&timeout=10' # nog een keer
 {"experiment":"1","counter":"3","timeout":"10"}
 # sleep 15 # wait too long
 curl 'https://www.socsci.ru.nl/wilberth/nocms/radcloud/participant_counter.php?experiment=1&counter=3' # attempt to finalize counter
 {"experiment":"1","counter":"","timeout":""} # attempt fails, your were late (counter is not returned) 

Automatic forwarding to experiment

Adding a participant identifier from the panel system