Commit dd40725b authored by Bernardo di Spitz's avatar Bernardo di Spitz
Browse files

adding data and experiment code

parent 706adfee
File added
{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\f0\fs24 \cf0 \
Retriever_V_01\
\
Including a N-Back task and the Retriever (value-based decision task)\
\
To run the task, use \'93Running all\'94 and introduce all parameters.\
\
Important:\
\
(1) If needed, press Q to quit the task (not recommended).\
\
(2) If the experiment stopped for any reason, it is possible to continue the decision task introducing the exact participant\'92s name, confirming that the participant is not new and selecting the number of the trial to continue.\
\
(3) Because of (2), it is REALLY IMPORTANT THAT EACH PARTICIPANT HAS A UNIQUE ID.\
\
Info about Folders\
\
Instructions: slides to explain the tasks\
Results_decision: Output file for the decision task\
Results_nback: Output file for the n-back task\
Sequences: Sequences using per participants (saving this information if we need to continue the task later)\
Settings: Some parameters setting for the tasks\
Some_scripts: Some script and function to run the task\
Stimuli: Stimuli for running the task (practice and real task)\
Task: Scripts of both tasks\
\
}
\ No newline at end of file
Retriever_Version_01_1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Set up the experiment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
rand('state', sum(100*clock)); % Initialize the random number generator
% Open a Prompt Window and decoding the answer
prompt = {'New participant? (0=no, 1=yes)','Practice? (0=no, 1=yes)','Participant''s ID', 'Gender (M/F/Other)','Age','Number of stimuli','Number of blocks (Decision-task)','Time out for responses (seconds)','Probability of feedback (%)','Value random var (0=no, 1=yes)','Variation value is normdistr with a STD of =','First Trial Decision-Task','N-Back task? (0=no, 1=yes)', '# Item Repetitions N-back'};
defaults = {'1','1','xxxxxx','x','18','8','8','2','100','1','0.40','1','1','100'};
answer = inputdlg(prompt, 'Experimental Setup Information', 1, defaults);
[new_participant, practice, subID, gender,age,number_of_stimuli,number_of_blocks,timeout_response,feedback_prob,rand_var,std_var,first_trial_decision,n_back, stim_rep_nback] = deal(answer{:});
new_participant = str2num(new_participant);
practice = str2num(practice);
age = str2num(age);
number_of_blocks = str2num(number_of_blocks);
timeout_response = str2num(timeout_response);
feedback_prob = str2num(feedback_prob);
rand_var=str2num(rand_var);
number_of_stimuli= str2num(number_of_stimuli);
first_trial_decision = str2num(first_trial_decision);
first_trial_nback = 1%str2num(first_trial_nback);
std_var=str2num(std_var); %Max variation in STD
n_back = str2num(n_back);
stim_rep_nback=str2num(stim_rep_nback);
prob_change_n_back=0.20; %probabily of change n-back
%% Adding some paths
addpath('./settings/')
addpath('./some_scripts/')
addpath('./tasks/')
%% Adding Psychtoolbox Path
ptb_path;
%% Running N-back
if n_back
nback_v01;
end
%% Running Retrieved
retriever_v01;
%%
clear all
%% Ready 4 GitLab and piloting
\ No newline at end of file
{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\f0\fs24 \cf0 \
Retriever_V_01.1\
\
Updates:\
\
- Instructions updated\
- All objects (including instructions) belong to either animate or non-biological inanimate categories \
-Inter-blocks feedback in decision task is about real value of object (not including variation). Unless participants have a 100% accuracy using real value+random variation \
-Down key removed \
-Fixed a bug regarding the final trial selection for the extra reward\
-Object showed on the screen have a retinal size of ~5 visual degrees}
\ No newline at end of file
% Settings for image sequence experiment
% How long showing each object (in seconds)
objectTimeout = 0.5;
% How long wait until next fixation cross (in seconds)
timeobjectgap = 1.5;
% How long we show the feedback screen (in seconds)
feedbacktimeout = 0.5;
% How long (in seconds) is the duration of the fixation point
fixationDuration = 0.5;
%Prepare the stimuli selection for each trial or selecting a previous
%matrix is we have a new participant
if new_participant == 1
sequence_of_pairs=create_sequence(number_of_stimuli,number_of_blocks);
name_sti = strcat('sequences/m_sequence_decision_',subID,'.mat');
save(name_sti,'sequence_of_pairs');
elseif new_participant == 0 %MODIFY THIS
name_sti_load = strcat('sequences/m_sequence_decision_',subID,'.mat');
load(name_sti_load);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Set up stimuli lists and values
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Get the image files for the experiment:
if number_of_stimuli==8
imageFolder = 'stimuli/stimuli_08';
elseif number_of_stimuli==16
imageFolder = 'stimuli/stimuli_16';
end
imgList = dir(fullfile(imageFolder,['*.' 'jpg']));
imgList = {imgList(:).name};
stimuli_info = tdfread(strcat(imageFolder, '/stimuli_info_tab.txt'),'tab');
% Get values (lineal)
min_value=10;
max_value=90;
value_distance=(max_value-min_value)/(length(stimuli_info.Item_ID)-1);
all_values=linspace(0,1,number_of_stimuli);
variation=(-std(all_values)*2:.2:std(value_distance)*2);%Let add in each trial random variation to this values
%Assigning value to items (distributing equally low and high values in
%micro and macro categories)
low_values(:,1)=all_values(1:(length(all_values))/2)';
high_values(:,1)=(all_values(((length(all_values))/2)+1:end))';
rand_order_low=randperm(length(all_values)/2);
rand_order_high=randperm(length(all_values)/2);
counter=1;
for sti=1:2:length(stimuli_info.Item_ID)
if randi(2)==1
value_assigned(sti)=low_values(rand_order_low(counter));
value_assigned(sti+1)=high_values(rand_order_high(counter));
else
value_assigned(sti)=high_values(rand_order_high(counter));
value_assigned(sti+1)=low_values(rand_order_low(counter));
end
counter=counter+1;
end
stimuli_info.Value=value_assigned';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Set up others variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%To control when the experiment should end
last_trial=size(sequence_of_pairs,1);
remaining_trials=((last_trial - first_trial_decision)+1);
% To counter the hits per block and give feedback
hits_per_block_counter=0;
hits_per_block_counter_real=0;
%Onset variables
OnsetObjectP1 = [];
OnsetObjectP2 = [];
OnsetQuestion = [];
OnsetResponse = [];
OnsetFeedback = [];
OnsetFinalExperiment = [];
%% Setting the counter for the BONUS
bonus_counter = [];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Set up results file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set up the output file (this output is for info related with the
% presention of room-object association and word tasks)
resultsFolder = 'results_decision';
outputfile = fopen([resultsFolder '/resultfile_' num2str(subID) '.txt'],'a');
fprintf(outputfile, 'subID\t sub_gender\t sub_age\t block_number\t trial\t object_p1_name\t object_p1_ID\t object_p1_value\t object_p1_value_plus_rand\t object_p2_name\t object_p2_ID\t object_p2_value\t object_p2_value_plus_rand\t rt_response\t acc_real\t acc_feedback\t feedback\t item_chosen_name\t item_chosen_ID\t item_chosen_value\t dif_chosen_minus_reject\t Onset_object_p1\t Onset_object_p2\t Onset_decission_screen\t Onset_response\t Onset_feedback\n');
\ No newline at end of file
% Settings for image sequence experiment
% How long showing each object (in seconds)
objectTimeout = 0.5;
% How long wait until next fixation cross (in seconds)
timeobjectgap = 1.5;
% How long we show the feedback screen (in seconds)
feedbacktimeout = 0.5;
% How long (in seconds) is the duration of the fixation point
fixationDuration = 0.5;
%Prepare the stimuli selection for each trial or selecting a previous
%matrix is we have a new participant
if new_participant == 1
sequence_of_pairs=create_sequence(number_of_stimuli,number_of_blocks);
name_sti = strcat('sequences/m_sequence_decision_',subID,'.mat');
save(name_sti,'sequence_of_pairs');
elseif new_participant == 0 %MODIFY THIS
name_sti_load = strcat('sequences/m_sequence_decision_',subID,'.mat');
load(name_sti_load);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Set up stimuli lists and values
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Get the image files for the experiment:
if number_of_stimuli==8
imageFolder = 'stimuli/stimuli_08';
elseif number_of_stimuli==16
imageFolder = 'stimuli/stimuli_16';
end
imgList = dir(fullfile(imageFolder,['*.' 'jpg']));
imgList = {imgList(:).name};
stimuli_info = tdfread(strcat(imageFolder, '/stimuli_info_tab.txt'),'tab');
% Get values (lineal)
min_value=10;
max_value=90;
value_distance=(max_value-min_value)/(length(stimuli_info.Item_ID)-1);
all_values=linspace(0,1,number_of_stimuli);
variation=(-std(all_values)*2:.2:std(value_distance)*2);%Let add in each trial random variation to this values
%Assigning value to items (distributing equally low and high values in
%micro and macro categories)
low_values(:,1)=all_values(1:(length(all_values))/2)';
high_values(:,1)=(all_values(((length(all_values))/2)+1:end))';
rand_order_low=randperm(length(all_values)/2);
rand_order_high=randperm(length(all_values)/2);
counter=1;
for sti=1:2:length(stimuli_info.Item_ID)
if randi(2)==1
value_assigned(sti)=low_values(rand_order_low(counter));
value_assigned(sti+1)=high_values(rand_order_high(counter));
else
value_assigned(sti)=high_values(rand_order_high(counter));
value_assigned(sti+1)=low_values(rand_order_low(counter));
end
counter=counter+1;
end
stimuli_info.Value=value_assigned';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Set up others variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%To control when the experiment should end
last_trial=size(sequence_of_pairs,1);
remaining_trials=((last_trial - first_trial_decision)+1);
% To counter the hits per block and give feedback
hits_per_block_counter=0;
hits_per_block_counter_real=0;
%Onset variables
OnsetObjectP1 = [];
OnsetObjectP2 = [];
OnsetQuestion = [];
OnsetResponse = [];
OnsetFeedback = [];
OnsetFinalExperiment = [];
%% Setting the counter for the BONUS
bonus_counter = [];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Set up results file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set up the output file (this output is for info related with the
% presention of room-object association and word tasks)
resultsFolder = 'results_decision';
outputfile = fopen([resultsFolder '/resultfile_' num2str(subID) '.txt'],'a');
fprintf(outputfile, 'subID\t sub_gender\t sub_age\t block_number\t trial\t object_p1_name\t object_p1_ID\t object_p1_value\t object_p1_value_plus_rand\t object_p2_name\t object_p2_ID\t object_p2_value\t object_p2_value_plus_rand\t rt_response\t acc_real\t acc_feedback\t feedback\t item_chosen_name\t item_chosen_ID\t item_chosen_value\t dif_chosen_minus_reject\t Onset_object_p1\t Onset_object_p2\t Onset_decission_screen\t Onset_response\t Onset_feedback\n');
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment