Welcome! Log In Create A New Profile

Advanced

How to distinguish conditions in userloop

Posted by Rom 
Rom
How to distinguish conditions in userloop
March 27, 2020 08:41AM
Hello,

I'm new to ML, so if this a question that already been covered, I will be glad if someone points me to relevant reading material / topic.

In the TaskObjects tip section it is said that if I have one condition with several TaskObjects, I can initialize TaskObject#1 and TaskObject#2 by writing:
C = { 'fix(0,0)', 'pic(A,0,0)' };  % fix is TaskObject#1 and pic, TaskObject#2.

What I dont understand, is what should I do if I have multiple conditions?
For example if my conditions are:
Condition	Frequency	Block	Timing File	TaskObject#1	TaskObject#2
1		1		1 3	dms		fix(0,0)	pic(A,0,0)
2		1		1 3	dms		fix(0,0)	pic(B,0,0)

How can I add them both in userloop? For example If I write:
C = { 'fix(0,0)', 'pic(A,0,0)',  'fix(0,0)', 'pic(B,0,0)' };

How can ML know what are TaskObjects for the first condition, and what for the second?
How will it know how many conditions I have at all?


Thank you very much,
Rom
Re: How to distinguish conditions in userloop
March 27, 2020 10:11AM
The userloop function is called every time before a trial starts. You should make it return what is necessary for the next trial and one trial only.
https://monkeylogic.nimh.nih.gov/docs_CreatingTask.html#Userloop
Rom
Re: How to distinguish conditions in userloop
March 28, 2020 05:06AM
Thank you very much.

I understand it now. Each line in the condition file defines a different task. And all the relevant taskObjects (things that will appear on the screen during the task run) are written in this line.
The full "run" is combined of running all the tasks in sequence.
A condition file file with several lines defines several tasks, and to achieve the same in userLoop I need to define several task "calls" in the switch of the loop. Each of this tasks will have diffent "C" array corresponding to relevant line of the condition file.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.