123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- function [Par] = JA_outcome_feedback_warming_up(Par)
- if ~isempty(find(ismember(Par.outcome_feedback_trials, Par.tr), 1))
-
- game_number = Par.final_design.Games{Par.tr};
-
-
-
- % set rigger for game number
- value = Par.final_design.Games{Par.tr};
- EEG_Trigger(Par.PP,Par.address,value);
- %% set parameters
- slide = prop2dim(Par.screen_dimensions, 0.1, 0);
-
- dimension = 30;
-
-
- text_catch = [];
- text_catch.dimension = dimension;
- text_catch.position = Par.screen_dimensions(3:4)/2;
- text_catch.position(1) = text_catch.position(1) - round(slide(1)/2);
-
-
- text_real = [];
- text_real.dimension = dimension;
- text_real.position = Par.screen_dimensions(3:4)/2;
- text_real.position(1) = text_real.position(1) - round(slide(1)/2);
- text_real.position(2) = round(Par.screen_dimensions(4)/1.5);
-
-
- %CF_catch_correctness(1:11) = [];
-
- %% check correctness
- for x = (Par.tr - 11+1):Par.tr
-
- % in case it is a catch trial...
- if strcmp(Par.final_design.CF_colors{x}, 'catch_color')
-
- if strcmp(Par.CF_classification(x), 'no_response')
- CF_catch_correctness(x) = 1;
- else
- CF_catch_correctness(x) = 0;
- end
- if strcmp(Par.SBJ_classification(x), 'no_response')
- SBJ_catch_correctness(x) = 1;
- else
- SBJ_catch_correctness(x) = 0;
- end
-
- else % in case it is a standard one...
-
- % considering CF performance
- switch Par.final_design.CF_colors{x}
-
- case 'press_color'
- if strcmp(Par.CF_classification(x), 'press')
- CF_real_correctness(x) = 1;
- else
- CF_real_correctness(x) = 0;
- end
-
- case 'lift_color'
- if strcmp(Par.CF_classification(x), 'lift')
- CF_real_correctness(x) = 1;
- else
- CF_real_correctness(x) = 0;
- end
- end
-
-
- % considering SBJ performance
- switch Par.final_design.SBJ_colors{x}
-
- case 'press_color'
- if strcmp(Par.SBJ_classification(x), 'press')
- SBJ_real_correctness(x) = 1;
- else
- SBJ_real_correctness(x) = 0;
- end
-
- case 'lift_color'
- if strcmp(Par.SBJ_classification(x), 'lift')
- SBJ_real_correctness(x) = 1;
- else
- SBJ_real_correctness(x) = 0;
- end
- end
-
-
- end
- end
-
- total_catch = (100*(sum(CF_catch_correctness) + sum(SBJ_catch_correctness))/(2*Par.catch_trials_x_game));
- total_real = (100*(sum(CF_real_correctness) + sum(SBJ_real_correctness))/(2*Par.real_trials_x_game));
-
- % if strcmp(Par.relationship, 'warming_up')
- %
- %
- %
- % end
-
- %%
-
- text_catch.string = strcat('prove di attenzione:', ' ', num2str(round(total_catch,0)), '%');
- text_real.string = strcat('prove normali:', ' ', num2str(round(total_real,0)), '%');
-
- % set colors based onpercentage of correctness
- if total_catch >= 50
-
- text_catch.color = [0 1 0];
- else
- text_catch.color = [1 0 0];
- end
-
- if total_real >= 70
-
- text_real.color = [0 1 0];
- else
- text_real.color = [1 0 0];
- end
-
- %% draw on the screen with text
-
- Screen('FillRect', Par.window, [0 0 0], Par.screen_dimensions);
-
- Screen('TextSize', Par.window, dimension); % prova 20
-
- DrawFormattedText(Par.window, text_catch.string, 'center',...
- text_catch.position(2), text_catch.color);
-
- DrawFormattedText(Par.window, text_real.string, 'center',...
- text_real.position(2), text_real.color);
-
-
- [Par.VBL] = Screen(Par.window, 'Flip');
-
-
- % leave it on the screen for 2 seconds
- WaitSecs(5);
-
- % Ready screen
- Screen('FillRect', Par.window, [0 0 0], Par.screen_dimensions);
-
- Screen('TextSize', Par.window, dimension); % prova 20
-
- DrawFormattedText(Par.window, 'Pronti', 'center',...
- 'center', [1 1 1]);
-
-
- % wait for someone allowing going on
- %KbStrokeWait;
-
- [Par.VBL] = Screen(Par.window, 'Flip');
-
- % leave it on the screen for 2 seconds
- WaitSecs(1);
-
- Par.warming_up_correctness.catch{game_number}= total_catch;
- Par.warming_up_correctness.real{game_number}= total_real;
-
- else % in case is not a last Game trials go ahead
- return
- end
- end
|