Advertisement
Guest User

Untitled

a guest
Jun 8th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.27 KB | None | 0 0
  1. # Generated by OpenSesame 0.27.2 (Frisky Freud)
  2. # Sat Jun 8 13:23:54 2013 (posix)
  3. # <http://www.cogsci.nl/opensesame>
  4.  
  5. set foreground "white"
  6. set subject_parity "even"
  7. set description "A template containing a practice and an experimental phase"
  8. set title "Extended template"
  9. set compensation "0"
  10. set coordinates "relative"
  11. set height "768"
  12. set mouse_backend "xpyriment"
  13. set width "1024"
  14. set sampler_backend "legacy"
  15. set keyboard_backend "legacy"
  16. set background "black"
  17. set subject_nr "0"
  18. set canvas_backend "xpyriment"
  19. set start "experiment"
  20. set synth_backend "legacy"
  21.  
  22. define inline_script declare_trial_count
  23. set _run ""
  24. ___prepare__
  25. # Determine the trial count.
  26. # The built-in counter 'count_trial_sequence'
  27. # starts counting at zero (in line with the zero-based
  28. # indexing generally used in Python).
  29.  
  30. # Therefore, we want to add '1' to the
  31. # counter variable you want to show to
  32. # the participant.
  33.  
  34. # Firstly, we 'get' the in-the-GUI-defined variable
  35. # 'count_trial_sequence' to use it in an inline_script.
  36.  
  37. # To do so, we use the built-in experiment function
  38. # self.get(). This function takes one argument, namely the
  39. # name of the OpenSesame variable:
  40. # For more info, see:
  41. # http://osdoc.cogsci.nl/python-inline-code/experiment-functions/#experiment.get
  42.  
  43. trial_count = self.get("count_trial_sequence")
  44.  
  45. # Next, we add '1' to the trial_count:
  46. trial_count = trial_count + 1
  47.  
  48. # To determine how many trials the participant still
  49. # has to do, we use the previously-defined
  50. # variable 'total', which we 'get' with self.get():
  51. trials_remaining = self.get("total") - trial_count
  52.  
  53. # Finally, we have to set the here-defined variables to
  54. # make them available in the GUI:
  55. exp.set("trial_count", trial_count)
  56. exp.set("trials_remaining", trials_remaining)
  57. __end__
  58. set description "Executes Python code"
  59.  
  60. define inline_script declare_total
  61. set _run ""
  62. ___prepare__
  63. # Declare the total number of trials, which should correspond
  64. # to the number of trials in the block loop
  65. # (depending on 'cycles' and 'repeat').
  66. total = 5
  67.  
  68. # To make an in-an-inline_script-item-defined variable
  69. # available in the GUI (e.g., in our case, a sketchpad item)
  70. # as well, we 'set' the variable by using the built-in
  71. # experiment function exp.set().
  72.  
  73. # This function takes two arguments: the name
  74. # of the variable and its value.
  75. # For more information, see:
  76. # http://osdoc.cogsci.nl/python-inline-code/experiment-functions/#experiment.set
  77. exp.set("total", total)
  78. __end__
  79. set description "Executes Python code"
  80.  
  81. define loop block_loop
  82. set repeat "1"
  83. set description "A single block of trials"
  84. set item "trial_sequence"
  85. set column_order ""
  86. set cycles "5"
  87. set order "random"
  88. run trial_sequence
  89.  
  90. define sketchpad sketchpad
  91. set duration "0"
  92. set description "Displays stimuli"
  93. set start_response_interval "no"
  94. draw fixdot 0 0 color=white show_if="always"
  95. draw textline 0 -192 "This is trial [trial_count]/[total]" center=1 color=white font_family="mono" font_size=18 font_italic=no font_bold=no show_if="always"
  96. draw textline 0 -96 "You still have [trials_remaining] trials to go..." center=1 color=white font_family="mono" font_size=18 font_italic=no font_bold=no show_if="always"
  97.  
  98. define sequence experiment
  99. set flush_keyboard "yes"
  100. set description "The main sequence of the experiment"
  101. run declare_total "always"
  102. run experimental_loop "always"
  103.  
  104. define sequence trial_sequence
  105. set flush_keyboard "yes"
  106. set description "A single trial"
  107. run declare_trial_count "always"
  108. run sketchpad "always"
  109. run keyboard_response "always"
  110. run logger "always"
  111.  
  112. define loop experimental_loop
  113. set repeat "1"
  114. set description "A loop containing one or more experimental blocks"
  115. set item "block_sequence"
  116. set column_order "practice"
  117. set cycles "1"
  118. set order "random"
  119. setcycle 0 practice "no"
  120. run block_sequence
  121.  
  122. define keyboard_response keyboard_response
  123. set description "Collects keyboard responses"
  124. set timeout "infinite"
  125. set flush "yes"
  126.  
  127. define logger logger
  128. set description "Logs experimental data"
  129.  
  130. define sequence block_sequence
  131. set flush_keyboard "yes"
  132. set description "A sequence containing a single block of trials followed by feedback to the participant"
  133. run block_loop "always"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement