Welcome! Log In Create A New Profile

Advanced

Wrong trials

Posted by annaipata 
Wrong trials
July 31, 2023 06:45PM
Hi,
I noticed that the timestamps for incorrect trials are not showing up in the analog data, as if the timing script only sends event codes for successful trials.
Here is the timing script. Is there something that I miss?
Thank you
Anna

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

button = ML_ButtonsAvailable;
if length(button)<1, error('This task requires at least one button. Please set it up or try the simulation mode.'); end
hotkey('x', 'escape_screen(); assignin(''caller'',''continue_'',false);');
bhv_code(10,'Fixation',1,'LeftHand 1',2,'RightHand 2',20,'Sample',40,'Target',50,'Reward'); % behavioral codes

dashboard(1,''); %
dashboard(2,''); %
dashboard(3,''); %
dashboard(4,''); %
dashboard(5,''); %

fixation_point = 1;
sample = 2;
target = 3;
% distractor = 4;
fix_code=10;
sample_code=20;
% target_code=40;

max_reaction_time = 2000;
sample_time=800;
fix_time=100;

error_type = 0;


% initial fixation:
dashboard(1,'Fix Point on');
if error_type == 0
t_target =toggleobject(fixation_point, 'eventmarker',10); % turn on target)
[chosen_target,~,t_acquired] = eyejoytrack('acquiretouch',[1 2],[],fix_time)

if chosen_target
if 1==chosen_target
toggleobject(fixation_point);
ontarget = eyejoytrack('holdtouch', 1, [], 100);
error_type = 2;
dashboard(2,'Button 1 in advance')
else
toggleobject(fixation_point);
ontarget = eyejoytrack('holdtouch', 2, [], 100);
error_type = 2;
dashboard(2,'Button 2 in advance')
end
end
end


% Sample
if error_type == 0
dashboard(1,'Sample on');
toggleobject(fixation_point)
t_target =toggleobject(sample, 'eventmarker',20); % turn on target)
[chosen_target,~,t_acquired] = eyejoytrack('acquiretouch',[1 2],[],sample_time)
if chosen_target
if 1==chosen_target
toggleobject(fixation_point);
ontarget = eyejoytrack('holdtouch', 1, [], 100);
error_type = 3;
dashboard(2,'Button 1 in advance')
else
toggleobject(fixation_point);
ontarget = eyejoytrack('holdtouch', 2, [], 100);
error_type = 3;
dashboard(2,'Button 2 in advance')
end
end
end


% Target
if error_type == 0
dashboard(1,'Target on');
toggleobject(sample)
t_target =toggleobject(target, 'eventmarker',40); % turn on target)
[chosen_target,~,t_acquired] = eyejoytrack('acquiretouch',[1 2],[],max_reaction_time)
if chosen_target
if 1==chosen_target
toggleobject(target);
ontarget = eyejoytrack('holdtouch', 1, [], 100);
dashboard(2,'Correct')
rt = t_acquired - t_target;
elseif 2 == chosen_target
toggleobject(target);
ontarget = eyejoytrack('holdtouch', 2, [], 100);
error_type = 4;
dashboard(2,'Wrong')
rt = t_acquired - t_target;
end
else
error_type = 5; % no response
dashboard(2,'No response')
end
end


toggleobject([sample target fixation_point],'status','off'); % clear screens
if 0==error_type
idle(200);
end

if 0==error_type
goodmonkey(200, 'juiceline',1, 'numreward',1, 'eventmarker',50); % 100 ms of juice x 2
dashboard(2,'Reward');

else
idle(700);
end

trialerror(error_type); % add the result to the trial history

set_iti(2000);
Re: Wrong trials
July 31, 2023 09:26PM
Your description of the problem is not sufficient. What are "the timestamps for incorrect trials"? Are you saying that you do not see the timestamps in BHV2 or neural data?
Re: Wrong trials
August 01, 2023 11:04AM
I do not see the timestamps of wrong trials only in the neural data.

thank you
A
Re: Wrong trials
August 01, 2023 03:01PM
You should describe it better. It is at the end of a trial that you come to know whether the trial is a success or not. However, eventcodes are sent as soon as relevant commands are executed. Most of the time when an eventcode is sent, the success status of a trial is not determined yet. So what do you mean by the timestamps of wrong trials? What are the codes that you do not see?

For example, Code 9 is sent even before a timing script is executed. Are you saying you do not see the 9 (and 18), either, for wrong trials?

Most part of your code is not executed when there is an error in the earlier steps. Is that what you are talking about?

You first should fix the polarity of your strobe signals, before asking about any of these.

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.