123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- function [Par] = JA_outcome_feedback(Par, GD)
- if ~isempty(find(ismember(Par.outcome_feedback_trials, Par.tr), 1))
-
- game_type = GD.SBJ_wins_distribution(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 = 60;
-
-
- combined = [];
- combined.string = 'O';
- combined.dimension = dimension;
- combined.position = Par.screen_dimensions(3:4)/2;
- combined.position(1) = combined.position(1) - round(slide(1)/2);
-
-
- text_CF = [];
- text_CF.string = 'O';
- text_CF.dimension = dimension;
- text_CF.position = Par.screen_dimensions(3:4)/2;
- text_CF.position(1) = text_CF.position(1) + slide(1);
-
- text_SBJ = [];
- text_SBJ.string = 'O';
- text_SBJ.dimension = dimension;
- text_SBJ.position = [0 Par.screen_dimensions(4)/2];
- text_SBJ.position(1) = text_SBJ.position(1) + slide(1);
-
-
- %%
-
- switch Par.relationship
-
- %%% non va bene!!!! il colore dipende anche da relationship
- case 'competitive'
- target_text_CF = text_CF;
- target_text_SBJ = text_SBJ;
-
- % in case SBJ wins --> CF loses and vice versa
- if game_type == 1
- target_text_CF.color = [1 0 0];
- target_text_SBJ.color = [0 1 0];
- else
- target_text_CF.color = [0 1 0];
- target_text_SBJ.color = [1 0 0];
- end
-
-
- case 'parallel'
- target_text_CF = text_CF;
- target_text_SBJ = text_SBJ;
-
- % no visual ffedback for CF
- if game_type == 1
- target_text_CF.color = [0 0 0];
- target_text_SBJ.color = [0 1 0];
- else
- target_text_CF.color = [0 0 0];
- target_text_SBJ.color = [1 0 0];
- end
-
-
- case 'joint'
- target_text_CF = combined;
- target_text_SBJ = combined;
-
- if game_type == 1
- target_text_CF.color = [0 1 0];
- target_text_SBJ.color = [0 1 0];
- else
- target_text_CF.color = [1 0 0];
- target_text_SBJ.color = [1 0 0];
- end
-
- case 'imagery'
- target_text_CF = text_CF;
- target_text_SBJ = text_SBJ;
-
- if game_type == 1
- target_text_CF.color = [0 0 0];
- target_text_SBJ.color = [0 1 0];
- else
- target_text_CF.color = [0 0 0];
- target_text_SBJ.color = [1 0 0];
- end
-
- end
-
-
- % if wahsout show nothing
- if strcmp(GD.games_distribution_names(Par.final_design.Games{Par.tr}), 'wash_out')
- target_text_CF.color = [0 0 0];
- target_text_SBJ.color = [0 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, target_text_CF.string, target_text_CF.position(1),...
- target_text_CF.position(2), target_text_CF.color);
-
- DrawFormattedText(Par.window, target_text_SBJ.string, target_text_SBJ.position(1),...
- target_text_SBJ.position(2), target_text_SBJ.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);
-
- else % in case is not a last Game trials go ahead
- return
- end
- end
|