Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
# Generated by OpenSesame 0.27.2~pre5 (Frisky Freud) # Tue Apr 23 11:29:21 2013 (posix) # <http://www.cogsci.nl/opensesame> set foreground "white" set subject_parity "even" set description "A template containing a practice and an experimental phase" set title "Extended template" set compensation "0" set coordinates "relative" set height "768" set mouse_backend "xpyriment" set width "1024" set sampler_backend "legacy" set keyboard_backend "legacy" set background "black" set subject_nr "0" set canvas_backend "xpyriment" set start "experiment" set synth_backend "legacy" define loop patch_loop set repeat "1" set description "A single block of trials" set skip "0" set offset "no" set item "stream_of_patches" set column_order "" set cycles "1" set order "random" run stream_of_patches define sequence vigilance_task set flush_keyboard "yes" set description "A sequence containing a single block of trials followed by feedback to the participant" run define_patch_list "always" run patch_loop "always" define form_multiple_choice mc set question "" set allow_multiple "no" set description "A simple multiple choice item" set advance_immediately "no" set options "" define reset_feedback _reset_feedback define sequence stream_of_patches set flush_keyboard "yes" set description "A single trial" run mc "never" run inline_script "always" run logger "never" define loop experimental_loop set repeat "1" set description "A loop containing one or more experimental blocks" set item "vigilance_task" set column_order "" set cycles "2" set order "random" run vigilance_task define sequence experiment set flush_keyboard "yes" set description "The main sequence of the experiment" run constants "always" run experimental_loop "always" define inline_script inline_script ___run__ import pygame from openexp.exceptions import response_error # Start by playing the sound file: my_sampler.play() sampler_paused = False # Walk through the list of patches: for i in range(len(patch_list)): # If the sampler was paused in the previous iteration, it has # to be resumed. if sampler_paused: my_sampler.resume() # Determine the stimulus by selecting one item from the # stimulus list (without replacement). # (Of course, you might do this differently, for example # by defining the variable 'stim' in a loop item.) stim = patch_list.pop() # Determine the absolute path to the image in the file pool: path = exp.get_file(stim) # Set the stimulus for future use in the GUI (notably, the logger # item): exp.set("stim", stim) # Show the stimulus: # Start with a gray background for a certain duration: my_canvas.clear() # We have to draw something in order to clear the background. my_canvas.circle(0,0,0,color=self.get('background')) my_canvas.show() self.sleep(wait) # Present the patch my_canvas.image(path) my_canvas.show() # The patch is presented until a mouse or key response is given, # or a timeout (of duration ISI) occurred: # Geth the current time: start_time = self.time() # Give the value 'time_passed' a beginning value (0). time_passed = 0 # Check for key or mouse responses until a timeout occurs: while time_passed < ISI: # Keep checking whether the duration of this # while loop is still below the maximum duration # (i.e. ISI). time_passed = self.time()-start_time # To poll the keyboard and mouse at the same time, we use pygame # directly. This means that this piece of code requires the xpyriment # or pygame backend! See: # <http://www.pygame.org/docs/ref/event.html> # First, give the variables 'button' and 'key' the beginning # value 'False': button = False key = False # Loop through all 'events', which are key presses or button clicks for event in pygame.event.get([pygame.MOUSEBUTTONDOWN, pygame.KEYDOWN]): if event.type == pygame.MOUSEBUTTONDOWN: button = True elif event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: raise response_error("The escape key was pressed.") # Make sure the stream is only paused by a press on the # space bar (and not by any key press): elif event.key == pygame.K_SPACE: key = True # If a key was pressed or a button was clicked, exit the loop if button or key: break # Set the given responses so that they will be logged by # the logger item. Note that for the variable "mouse_click" (see below) # True' indicates that a mouse click was given, whereas'False' # indicates that no mouse response was given. This, in combination # with the variable 'stim', will enable you to evaluate participants' # performance (i.e. whether a mouse click was correct or a false alarm, etc.): exp.set("mouse_click", button) # If a mouse response was collected, the for loop will be # continued. However, if the spacebar was pressed, we need to # do something else: if key: # Pause the sampler: my_sampler.pause() # And set 'sampler_paused' to True, such that we won't # forget to resumse the sound stimulus after the pause. sampler_paused = True # Show the in-the-GUI-prepared form items: # NOTE: the 'Run if' box for this form item should # be set to 'never' in the GUI. self.experiment.items['mc'].prepare() self.experiment.items['mc'].run() # Finally, log the responses: # NOTE: the 'Run if' box for this logger item should # be set to 'never' in the GUI. self.experiment.items['logger'].prepare() self.experiment.items['logger'].run() # And set the variable 'form_response' to 'NA' again. exp.set('form_response', "NA") __end__ ___prepare__ # Create a canvas item to display the stimulus: global my_canvas from openexp.canvas import canvas my_canvas = canvas(exp, bgcolor = "#7F7F7F") # Create a sampler item that we'll need for playing # the sounds. global my_sampler from openexp.sampler import sampler # Determine the to-be-played sound file: sound_stim = sound_list.pop() sound_file = exp.get_file(sound_stim) my_sampler = sampler(exp, sound_file) __end__ set description "Executes Python code" define inline_script define_patch_list set _run "" ___prepare__ # Declare the visual stimulus list: global patch_list patch_list = ["horizontal.png"] * 2 + ["vertical.png"] * 1 random.shuffle(patch_list) __end__ set description "Executes Python code" define logger logger set ignore_missing "yes" set description "Logs experimental data" set auto_log "yes" set use_quotes "yes" define inline_script constants set _run "" ___prepare__ # Here we'll declare the global variables of the # experiment: # Import the module 'random', which we'll need to shuffle the # patch list: global random import random # Declare the sound list: global sound_list sound_list = ["sound1.wav", "sound2.wav"] random.shuffle(sound_list) # Declare durations in ms: global wait, ISI # Wait between blank screen and patch (to make it # flickering): wait = 100 # Inter stimulus interval: ISI = 1000 __end__ set description "Executes Python code" define reset_feedback reset_feedback
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
⭐⭐⭐Make $1500 in 20 minutes⭐⭐⭐
Java | 2 sec ago | 0.06 KB
⭐⭐⭐Make $1500 in 20 minutes⭐⭐⭐
Java | 13 sec ago | 0.09 KB
⭐⭐⭐Make $15OO in 2O minutesV E⭐⭐⭐
Java | 30 sec ago | 0.06 KB
⭐⭐⭐MAKE $9OO INSTANTLY D A⭐⭐⭐
Java | 33 sec ago | 0.09 KB
⭐⭐⭐GMAIL Logs (2FA disabled)⭐⭐⭐
Java | 41 sec ago | 0.06 KB
⭐⭐⭐MAKE $9OO INSTANTLY D A⭐⭐⭐
Java | 52 sec ago | 0.09 KB
⭐⭐⭐Make $1500 in 20 minutes⭐⭐⭐
Java | 1 min ago | 0.09 KB
⭐⭐⭐ChangeNOW Exploit⭐⭐⭐
Java | 1 min ago | 0.09 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!