Is there a list somewhere of what are the allowed functions in Expression only questions. There are 7 listed as allowed with an ‘and others’ when you click on the ? above the Expression input field.
Specifically I’m looking for a way to randomly assign participants to groups where they are not coming from Sona but from a social media posting. So far that requires user input in a previous question to give some sort of varying pseudo random input, eg what are the last 4 digits of your phone number which I then do a {PhoneNum} %3 +1 on. But obviously it would be a lot better to not require a previous input and use something like The Seconds instead.
I’m aware random group assignment is on the way and am looking for an interim solution so if anyone is reading this after Jan 2023 the specific problem should be gone
I was just wondering if the random() function works in Expression questions? I’m trying to do something similar to Andrew and assign groups to participants to show them different parts of the survey, but the random() function doesn’t seem to generate anything for me so I’m not sure if I’m doing something wrong or if it’s not working properly.
Hi Lorna, as it happens I’ve been working on it this week/. It doesn’t work Iin previews (the example will always return 1) however if you Run the survey it will work.
I’ve a quick demo of it working at Pavlovia Survey - note that when you make a selection in the matrix table both the random number in Q1 and the group selection based on it change. The group 1,2,3 part is just using display logic to determine which of 3 questions is shown based on the random value. I just used the first part of the expression above
as I’m currently only testing without any credits, do I need to purchase to test if the random() function work? since running in pilot mode does not seem to work for me.