Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: randomly assign participants to groups

randomly assign participants to groups 8 months 2 weeks ago #101488

Hi Cecilia,
If you go to your question, you should include the code below in your source code (click source)
- This is for 4 conditions;
- you have to adjust the SurveyIdXGroupIdXQuestionId to correspond with your own Id-numbers (leave the X between the Id-numbers);
- and the last line $('#question1979503').hide(); is to hide the question with question Id number 1979503 -- you need to adjust this too to correspond with your question ID

Hope this helps!

Here's the code:


<script type="text/javascript">
<!--
$(document).ready(function()
{
// Find a random number between 1 and 4
var randNumber = Math.floor(Math.random()*4 + 1);
$('input#answerSurveyIdXGroupIdXQuestionId').val(randNumber);
checkconditions(randNumber,'SurveyIdXGroupIdXQuestionId','text');
$('#question1979503').hide();
})
//-->
</script>
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.120 seconds
Donation Image