This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from openexp.mouse import mouse | |
| from openexp.canvas import canvas | |
| # Uncomment for 0.25 and earlier | |
| # exp = self.experiment | |
| # The name of the sketchpad item to draw the cursor on | |
| src_sketchpad = 'my_sketchpad' | |
| # The size of the cursor crosshair |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| For security reasons, the script-based embedding does | |
| not work, but you can embed snippets using the | |
| following syntax: | |
| [gist:(your gist id)] | |
| You can find your gist id in the URL of your | |
| gist. If the URL is: | |
| https://gist.github.com/2709074 | |
| The following code embeds the paste into your forum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Margins are defined as "top;right;bottom;left". Each value corresponds to a | |
| # margin in pixels. | |
| set margins "50;100;50;100" | |
| # The spacing is simply a value in pixels. | |
| set spacing "25" | |
| # The sizes of the rows are relative. "1;2;1" means that there are three rows, | |
| # where the middle one is twice as large as the bottom and top ones. So "1;2;1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OPENSESAME SCRIPT SYNTAX | |
| ======================== | |
| 1 ABOUT OPENSESAME SCRIPT | |
| ========================= | |
| OpenSesame script is a simple definitional language that defines an experiment. It is not a full fledged programming language. The OpenSesame script is interpreted by an OpenSesame runtime environment. | |
| 2 GENERAL REMARKS | |
| ================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set rows "1;1;1;1;1" | |
| set cols "1;1" | |
| widget 0 0 2 1 label text="Indicate how much you agree with the following statements" | |
| widget 0 1 1 1 label center="no" text="Forms are easy" | |
| widget 1 1 1 1 rating_scale var="question1" nodes="Agree;Don't know;Disagree" | |
| widget 0 2 1 1 label center="no" text="I like data" | |
| widget 1 2 1 1 rating_scale var="question2" nodes="Agree;Don't know;Disagree" | |
| widget 0 3 1 1 label center="no" text="I like questionnaires" | |
| widget 1 3 1 1 rating_scale var="question3" nodes="Agree;Don't know;Disagree" | |
| widget 0 4 2 1 button text="Next" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create a canvas to show info on screen | |
| from openexp.canvas import canvas | |
| canvas = canvas(self.experiment) | |
| from ctypes import windll, c_ubyte | |
| io = windll.dlportio # requires dlportio.dll !!! | |
| # Define port: | |
| port = 0x4cf8 | |
| # Execute the script below twice, once in the old way, once in the | |
| # newly-suggested way: | |
| for change_to_ubyte in (False, True): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OpenSesame supports a sub-set of HTML tags: | |
| - <b>Bold face</b> | |
| - <i>Italic</i> | |
| - <u>Underline</u> | |
| In addition, you can pass 'color', 'size', and 'style' as keywords to a 'span' tag: | |
| - <span color="red">Color</span> | |
| - <span size="32">Font size</span> | |
| - <span style="serif" mce_style="serif">Font style</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Ref: <http://forum.cogsci.nl/discussion/198> | |
| # This script should be placed in the prepare phase of an inline_script, before | |
| # the open_question item. | |
| # | |
| # First retrieve the full path to a file called 'question.txt' in the file pool | |
| path = exp.get_file('question.txt') | |
| # Read the entire contents of the file. | |
| question = open(path).read() | |
| # Set the variable, so that the open_question item can use it. | |
| exp.set('_question', question) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from expyriment import stimuli, control, design | |
| import time | |
| from random import randint | |
| control.defaults.initialize_delay = 0 | |
| control.defaults.open_gl = True | |
| exp = design.Experiment() | |
| control.initialize(exp) | |
| l = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generated by OpenSesame 0.27~pre31 (Frisky Freud) | |
| # Fri Nov 30 17:42:30 2012 (posix) | |
| # <http://www.cogsci.nl/opensesame> | |
| set foreground "white" | |
| set subject_parity "even" | |
| set font_size "18" | |
| set description "Default description" | |
| set title "Xpyriment timing check" | |
| set font_bold "no" |