JA_interim_feedback_warming_up.m 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. function [Par] = JA_interim_feedback_warming_up(Par)
  2. CF_screen_position = Par.screen_dimensions(3:4)/2;
  3. SBJ_screen_position = [0 Par.screen_dimensions(4)/2];
  4. %% check CF's "performance" first
  5. if strcmp(Par.final_design.Type{Par.tr}, 'ok_catch') || strcmp(Par.final_design.Type{Par.tr}, 'failed_catch')
  6. switch Par.CF_classification{Par.tr}
  7. case 'no_response' % correct
  8. text_CF.string = 'ottimo!'
  9. text_CF.color = [0 1 0];
  10. Par.CF_RT{Par.tr} = [];
  11. otherwise % not correct (it implies a movement)
  12. text_CF.string = 'presta \n attenzione!';
  13. text_CF.color = [1 0 0];
  14. Par.CF_RT{Par.tr} = [];
  15. end
  16. else % in the case is a standard trial...produce text output in the following cases
  17. switch Par.final_design.CF_performance_Type{Par.tr}
  18. case 'no_response'
  19. text_CF.string = 'prova ad essere \n pi? veloce!';
  20. text_CF.color = [1 0 0];
  21. Par.CF_RT{Par.tr} = [];
  22. case {'out_fast_press', 'out_fast_lift'}
  23. text_CF.string = 'aspetta il colore \n prima di muoverti!';
  24. text_CF.color = [1 0 0];
  25. Par.CF_RT{Par.tr} = [];
  26. case 'wrong_response'
  27. text_CF.string = 'risposta_sbagliata';
  28. text_CF.color = [1 0 0];
  29. Par.CF_RT{Par.tr} = [];
  30. otherwise % in case of lift or press
  31. text_CF.string = '';
  32. text_CF.color = [0 0 0];
  33. Par.CF_RT{Par.tr} = Par.SBJ_RT_tmp{Par.tr};
  34. end
  35. end
  36. %% if it is a catch trial
  37. if strcmp(Par.final_design.Type{Par.tr}, 'ok_catch') || strcmp(Par.final_design.Type{Par.tr}, 'failed_catch')
  38. switch Par.SBJ_classification{Par.tr}
  39. case 'no_response' % correct
  40. text_SBJ.string = 'ottimo!'
  41. text_SBJ.color = [0 1 0];
  42. Par.SBJ_RT{Par.tr} = [];
  43. otherwise % not correct (it implies a movement)
  44. text_SBJ.string = 'presta \n attenzione!';
  45. text_SBJ.color = [1 0 0];
  46. Par.SBJ_RT{Par.tr} = [];
  47. end
  48. else % in the case is a standard trial...produce text output in the following cases
  49. switch Par.final_design.SBJ_performance_Type{Par.tr}
  50. case 'no_response'
  51. text_SBJ.string = 'prova ad essere \n pi? veloce!';
  52. text_SBJ.color = [1 0 0];
  53. Par.SBJ_RT{Par.tr} = [];
  54. case {'out_fast_press', 'out_fast_lift'}
  55. text_SBJ.string = 'aspetta il colore \n prima di muoverti!';
  56. text_SBJ.color = [1 0 0];
  57. Par.SBJ_RT{Par.tr} = [];
  58. case 'wrong_response'
  59. text_SBJ.string = 'risposta_sbagliata';
  60. text_SBJ.color = [1 0 0];
  61. Par.SBJ_RT{Par.tr} = [];
  62. otherwise % in case of lift or press
  63. text_SBJ.string = '';
  64. text_SBJ.color = [0 0 0];
  65. Par.SBJ_RT{Par.tr} = Par.SBJ_RT_tmp{Par.tr};
  66. end
  67. end
  68. %% set texts position
  69. text_CF.position = CF_screen_position;
  70. text_SBJ.position = SBJ_screen_position;
  71. %% draw on the screen with text
  72. Screen('FillRect', Par.window, [0 0 0], Par.screen_dimensions);
  73. Screen('TextSize', Par.window, 30); % prova 20
  74. DrawFormattedText(Par.window, text_CF.string, text_CF.position(1),...
  75. text_CF.position(2), text_CF.color);
  76. DrawFormattedText(Par.window, text_SBJ.string, text_SBJ.position(1),...
  77. text_SBJ.position(2), text_SBJ.color);
  78. [Par.VBL] = Screen(Par.window, 'Flip');
  79. % is there smthng to show?
  80. if strcmp(text_CF.string, '') && strcmp(text_SBJ.string, '')
  81. % if there is nothing to show, go on fast
  82. WaitSecs(1);
  83. else
  84. % if there is something to show leave it on the screen for 2 seconds
  85. WaitSecs(2);
  86. end