Skip to content

Commit

Permalink
Update sources
Browse files Browse the repository at this point in the history
  • Loading branch information
smathot committed Mar 28, 2024
1 parent 8995c74 commit ae7a9bb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 0 deletions.
Binary file modified .db.cache/index.faiss
Binary file not shown.
Binary file modified .db.cache/index.pkl
Binary file not shown.
1 change: 1 addition & 0 deletions sources/jsonl/opensesame-howtos.jsonl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
{"content": "To create an animated Canvas with Python inline_script, you can dynamically update the properties of Canvas elements in between subsequent calls to `show()`. For example, to create an animation of a moving circle, you could use the following script:\n\n```python\nanimated_canvas = Canvas()\nanimated_canvas['circle'] = Circle(x=-100, y=0, r=10)\nfor x in range(-100, 101):\n animated_canvas['circle'].x = x\n animated_canvas.show()\n clock.sleep(10)\n```", "url": "https://forum.cogsci.nl", "title": "How to create an animated Canvas with Python inline_script"}
{"content": "If a visual stimulus is shown at the end of a trial, it is not automatically removed when the trial ends. Rather, it stays on the screen until a new display is shown at the start of the next trial, which due to intertrial preparation time may take a while. As a result, if a trial ends with a KEYBOARD_RESPONSE, the experiment can seem not react to the key press. To avoid this, simply add a blank SKETCHPAD at the end of the trial. This will ensure that the trial ends with a blank display, and avoid the experiment from feeling sluggish or delayed to the participantl.", "url": "https://forum.cogsci.nl", "title": "How to avoid the last display of a trial from being shown for too long"}
{"content": "If you want to register key pressed continuously, while at the same presenting a series of sketchpad items, you need to use a `coroutines` item. This allows you to run multiple items (seemingly) in parallel. For example:\n\n1. Insert a `coroutines` item into the trial sequence.\n2. Set the duration of the `coroutines`, for example to 5000 ms.\n3. Add a `keyboard_response` to the `coroutines` and let it run for the entire duration of the `coroutines` by setting the start time to 0 and the end time to 5000 ms.\n4. Add multiple `sketchpad` items to the `coroutines` and use the start times for these items to show them at the appropriate moments.", "url": "https://forum.cogsci.nl", "title": "How to register key presses continuously while presenting a series of sketchpad items"}
{"content": "In some cases, you want to provide participants with a file that they can execute directly in order to start the experiment. There are a few ways to do this:\n\n- Export the experiment to HTML using the OSWeb and JATOS control panel. This will generate a single HTML file that participants can double-click to launch it in a browser. This requires that the experiment is compatible with OSWeb.\n- Create a Windows batch file that uses opensesamerun to launch the experiment directly. This requires that the participant is running Windows. The best way to do this is to create your own version of the 'no installation required' `zip` package of OpenSesame, and include the batch file in this package.\n ```\n opensesamerun your_experiment.osexp -s 1 -l your-logfile.csv -f\n ```\n- Create a Python script that launches the experiment directly using OpenSesame as a Python module. This requires a Python environment with OpenSesame installed, and a way to easily launch the Python script.\n ```\n from libopensesame.python_workspace_api import Experiment\n exp, win, clock, log = Experiment(osexp_path='my_experiment.osexp', subject_nr=2)\n exp.run()\n ```\n\nIn all cases, provide clear instructions to the participant on how they can launch the experiment!", "url": "https://forum.cogsci.nl", "title": "How to create a Run-Only File in OpenSesame"}
{"content": "To add line breaks in OpenSesame text:\n\n1. Open the item (e.g., sketchpad, form_text_input, etc.) where you want to add line breaks.\n2. When entering text, you can typically enter multiple lines in the text input, and line breaks will be automatically inserted.\n3. When editing the script of an item, you need to manually indicate line breaks as shown below.\n4. In the item script, locate the text field where you need to insert line breaks.\n5. To add a line break, use the HTML tag `<br>` at the point where you want the text to start on a new line.\n6. If you need multiple consecutive line breaks, use multiple `<br>` tags.\n7. Save the changes to the item.\n8. Run the experiment to verify that the line breaks appear as expected.\n\nImportant side note: When running an experiment on the desktop, long lines are automatically wrapped so that they run out of the screen. However, when running an experiment in a browser with OSWeb, this doesn't happen, and you need to explicitly indicate line breaks to avoid lines from running out of the screen.", "url": "https://forum.cogsci.nl", "title": "How to add line breaks in OpenSesame text"}
{"content": "OpenSesame supports regular HTML formatting for text. To format text in OpenSesame using HTML tags:\n\n1. Identify the item (e.g., sketchpad, form_text_input, etc.) where you want to format the text.\n2. Use the appropriate HTML tags to format the text:\n - For bold text, use `<b>text</b>`\n - For italic text, use `<i>text</i>`\n - For underlined text, use `<u>text</u>`\n - For text color, use `<span style=\"color: red;\">text</span>` (replace \"red\" with the desired color)\n3. Apply the HTML tags around the text you want to format.\n4. Save the changes to the item.\n5. Run the experiment to verify that the text formatting appears as expected.", "url": "https://forum.cogsci.nl", "title": "How to format text in OpenSesame using HTML tags"}
{"content": "OpenSesame assumes that text is encoded in UTF-8 format and also uses UTF-8 for the log file.\n\nIf you find that text from a file, for example a source file for a LOOP table, is incorrectly encoded (because non-ASCII characters are not shown correctly), this generally means that the file uses a different file encoding. In that case, change the character encoding of the file to UTF-8, which is something that most text editors allow you to do. \n\nSimilarly, if you open an OpenSesame log file and find that it is incorrectly encoded (because non-ASCII characters are not shown correctly), indicate in the text editor or spreadsheet that the file is encoded using UTF-8.\n\nCharacter-encoding issues are especially common on Windows, because most versions of Windows do not use UTF-8 encoding by default.", "url": "https://forum.cogsci.nl", "title": "How to debug text encoding issues in OpenSesame"}
Expand Down

0 comments on commit ae7a9bb

Please sign in to comment.