I'm currently working on a task in MonkeyLogic that involves a series of steps. Firstly, a fixation point will appear on the screen, serving as a visual cue for the monkeys. Once the fixation point appears, the monkeys will be required to press two bars simultaneously, using their left and right hands respectively.
The bars will need to be maintained in a pressed state for a specific duration, known as the fixation time. Once the monkeys successfully maintain the bars pressed for the required fixation time, a stimulus will be presented on the screen. This stimulus will provide instructions to the monkeys regarding which hand, either left or right, should be released.
To summarize, the task flow in MonkeyLogic consists of the following steps:
Display fixation point.
Monkeys press the left and right bars simultaneously.
Bars are maintained in a pressed state for the fixation time.
Stimulus appears on the screen.
The stimulus instructs the monkeys to release either the left or right bar.
I wrote this scropt but it does not work. Any suggestions? Thank you!
% initial fixation: check if both bars are pressed
dashboard(1,'Fix Point on');
if error_type == 0
t_target =toggleobject(fixation_point, 'eventmarker',10); % turn on target)
[chosen_LeftHand,~,t_LeftHand] = eyejoytrack('touchtarget',1,fix_time)
[chosen_RightHand,~,t_RightHand] = eyejoytrack('touchtarget',2,fix_time)
if ~chosen_LeftHand | ~chosen_RightHand
toggleobject(fixation_point);
error_type = 2; % do not tiugh one or both bars
dashboard(2,'No bars not touched ')
end
end
% %=if both bars are pressed shows teh cue, but do not release the bars
if error_type == 0
dashboard(1,'Sample on');
t_target =toggleobject(sample, 'eventmarker',20); % turn on target)
[chosen_LeftHand,~,t_LeftHand] = eyejoytrack('touchtarget',1,fix_time)
[chosen_RightHand,~,t_RightHand] = eyejoytrack('touchtarget',2,fix_time)
if chosen_LeftHand | chosen_RightHand
toggleobject(fixation_point);
error_type = 3;
dashboard(2,'Bars release in advance')
end
end
% %=if both bars are pressed shows the target, and reease the left bar
if error_type == 0
dashboard(1,'Target on');
toggleobject(sample)
t_target =toggleobject(target, 'eventmarker',40); % turn on target)
[chosen_LeftHand,~,t_LeftHand] = eyejoytrack('touchtarget',1,fix_time)
[chosen_RightHand,~,t_RightHand] = eyejoytrack('touchtarget',2,fix_time)
if ~chosen_LeftHand & chosen_RightHand % if release the correct left bar
toggleobject(target);
dashboard(2,'Correct right hand reselase')
end
if chosen_LeftHand & ~chosen_RightHand % if release the wrong igh bar
toggleobject(target);
dashboard(2,'Wrong left hand reselase')
error_type = 4; % wrong trials
end
if chosen_LeftHand & chosen_RightHand % if release both hands
toggleobject(target);
dashboard(2,'Both hands released')
error_type = 5; % both hand reselsed
end
if ~chosen_LeftHand & ~chosen_RightHand % if release both hands
toggleobject(target);
dashboard(2,'Both hands not reseased ')
error_type = 6; % both hand reselsed
end
end