Replies: 1 comment 1 reply
-
Hi! This is a good question. There are a few ways you could do this:
session.blocks.Shuffle();
session.blocks.Remove(practiceBlock);
session.blocks.Insert(0, practiceBlock);
using System.Linq;
...
practiceBlock.settings.SetValue("practice", true);
session.blocks = session.blocks
.OrderBy(block => block.settings.GetBool("practice", false) ? -1 : Random.value)
.ToList(); This orders by a random value between |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone!
I am new to UXF (and Unity in general) and I am currently building an experiment with 1 practice and 4 experimental blocks. The practice block needs to always be presented first, thought to avoid order effects the experimental blocks need to be randomly presented per participant. At the moment I struggle to find how to shuffle only the experimental session blocks. For example session.blocks.Shuffle(); is randomizing all the session blocks, including practice block.
I apologize in advance if this is already answered, but it has not come to my attentions through my search to other threads. Any thoughts or guidance on how to acheave this, would be greatly appreciated.
Thank you in advance for your time.
Beta Was this translation helpful? Give feedback.
All reactions