![]() As for that trial/row playing twice, I think I know why it’s happening but it’s hard to avoid when you are juggling two different types of randomization that aren’t well-connected to each other. ![]() However, now that I think about it, making the types random on every cycle will also introduce the risk of the end of one cycle sharing stimuli with the start of the next. The reason that it’s the same order of stimuli on every cycle is that nTrials is only shuffled once, where you want it to be shuffled after every six trials, but honestly I’m not entirely sure how because your two-loop structure seems like it should avoid that problem. trials_3 would be redundant in my version, but your solution might work better in some ways. I was thinking you would have trials_2 as you have it now, but trials would only loop across the dotprobetrial 24 times after the condition order is established in the blank trial. If you want to do this online, that’s still probably going to be the general outline of the solution, but you’ll need to figure out some JS code that can do this. The outer loop repeats four times, and then you put another loop around the test trial itself that repeats 24 times. You’ll need a trial to sit in between each cycle of 24, but it can even be a blank trial with the code component you currently have under “begin experiment” under “begin routine”. If you’re just trying to run this locally on your computer, the easiest solution will be a nested loop structure in builder. PsychoPy’s ability to convert Python code components to JavaScript can’t support importing external libraries like pandas. Is the idea that you want a random order, but you don’t want the same “voice” file to play twice in a row? So, for example, you never want one of the top four lines to be selected after another of the top four lines, but you do want the order to be otherwise fully random for 24 trials?Īlso, a question I feel I should ask up front, are you planning to run this online on Pavlovia? If so, the solution will look nothing like what you have now. I need a little clarification on what you’re trying to do. UseCondition = conditionType.pop() # Get condition from shuffled list and remove index from listĬonditionType = # If list is empty, create a new one. TrialSet = dat = nTrials] # Uses trialhandler to index random trial number from list NTrials = list(range(0, dat.max()+1)) # Takes max value from Type column and creates a list of trial numbers See below for the code I have inserted so far:ĬonditionType = # a list for each type of condition I am very new to psychopy/ coding so apologies if I haven’t explained this very well - please let me know if I need to go into more depth! If anyone could help, that would be appreciated. there are 6 types and 4 trials so there should be a total of 24 trials). However, I think I am missing code which instructs psychopy to repeat the cycle so all conditions for each type eventually play (i.e. I have tried inserting some code which I modifed based on this thread: Randomly select every 4 row in condition file
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |