diff --git a/.db.cache/index.faiss b/.db.cache/index.faiss index 7016e56..8fcef7d 100644 Binary files a/.db.cache/index.faiss and b/.db.cache/index.faiss differ diff --git a/.db.cache/index.pkl b/.db.cache/index.pkl index d8581d6..47bf7bd 100644 Binary files a/.db.cache/index.pkl and b/.db.cache/index.pkl differ diff --git a/sources/jsonl/opensesame-howtos.jsonl b/sources/jsonl/opensesame-howtos.jsonl index a66b0ac..0b07bdb 100644 --- a/sources/jsonl/opensesame-howtos.jsonl +++ b/sources/jsonl/opensesame-howtos.jsonl @@ -2,9 +2,12 @@ {"content": "To diagnose and fix crash issues in OpenSesame:\n\n1. Run your experiment script in OpenSesame with the debug window open (View > Show console).\n2. When the crash occurs, check the console for any error messages or tracebacks that can help identify the cause of the crash.\n3. If an error message is displayed, search for the error online in the OpenSesame documentation, forums, or general programming resources to find potential solutions.\n4. Review your experiment script for any syntax errors, incorrect variable names, or other coding issues that may be causing the crash.\n5. Try running your experiment script with a different backend or on a different computer to see if the crash is specific to a particular setup.", "url": "https://forum.cogsci.nl", "title": "How to diagnose and fix crash issues in OpenSesame"} {"content": "To optimize audio playback in OpenSesame:\n\n1. Ensure that your audio files are in a compatible format (e.g., .wav or .ogg) and have appropriate sample rates and bit depths.\n2. Use the \"sampler\" item in OpenSesame to play audio files.\n3. Adjust the \"duration\", \"fade_in\", and other properties of the sampler item to fine-tune the audio playback timing and onset.\n5. Test your experiment script on different computers and audio setups to ensure consistent playback across various environments.", "url": "https://forum.cogsci.nl", "title": "How to optimize audio playback in OpenSesame"} {"content": "To randomly select an image from a predefined list in an inline_script:\n\n1. In an INLINE_SCRIPT item, create a list of image file names, e.g., `image_list = [\"image1.png\", \"image2.png\", \"image3.png\"]`\n2. Use `random.choice(image_list)` to randomly select an image file name from the list\n3. Store the randomly selected image file name in an experimental variable, e.g., `chosen_image = random.choice(image_list)`\n4. In a SKETCHPAD item, draw a dummy image (which can be anything)\n4. Edit the script of the SKETCHPAD and use the `chosen_image` variable for the `file` keyword:\n ```\n draw image center=1 file=\"{chosen_image}\" scale=1 show_if=True x=0 y=0 z_index=0\n ```", "url": "https://forum.cogsci.nl", "title": "How to randomly select an image from a list in an inline_script an show it in a SKETCHPAD"} +{"content": "To properly display accented characters in OpenSesame:\n\n1. If you are reading text from a text file, such as the source file for a LOOP item, ensure that the file (e.g., CSV) is saved with UTF-8 encoding.\n2. When displaying the text, use a font that supports the required character set. The default Sans font in OpenSesame supports most accented characters.\n3. Run the experiment and verify that the accented characters are displayed correctly.", "url": "https://forum.cogsci.nl", "title": "How to properly display accented characters in OpenSesame"} +{"content": "To use HTML formatting to display special characters in OpenSesame:\n\n1. Convert the accented characters in your text to their HTML entity equivalents. For example, '\u00e9' becomes `é`, '\u00e2' becomes `â`, '\u00e7' becomes `ç`, etc.\n2. When displaying the text, enable HTML formatting by setting the `html` parameter to `yes`. For example, in a SKETCHPAD item: `draw textline 0 0 \"Exposé\" html=yes`.\n3. Run the experiment and verify that the special characters are displayed correctly using the HTML formatting.", "url": "https://forum.cogsci.nl", "title": "How to use HTML formatting to display special characters in OpenSesame"} {"content": "To create two blocks of questions and randomize the order within each block in OpenSesame:\n\n1. Create a LOOP item for each block of questions (e.g., \"block1_loop\" and \"block2_loop\").\n2. Within the table of each LOOP item, add a column called `question`. \n3. Add all questions to the `question` column.\n4. In the LOOP item's properties, set the \"Order\" field to \"random\" to randomize the order of questions within the block.\n5. Inside the loop, create a trial sequence that presents the question to the participant, for example using a `form_text_input` item.\n5. Create a SEQUENCE item to contain the two LOOP items.\n6. Add the LOOP items to the SEQUENCE in the desired order of the blocks.", "url": "https://forum.cogsci.nl", "title": "How to create two blocks of questions and randomize the order within each block in OpenSesame"} {"content": "If your trial corresponds to an item called trial_sequence, the start time of a trial is available as the variable `time_trial_sequence`.\n\nIf the start of a trial corresponds to another event, you need to manually register it as follows:\n\n1. Create an `inline_script` item at the beginning of your trial sequence.\n2. In the `inline_script`, use the `clock.time()` function to get the current time in seconds (e.g., `start_time = clock.time()`).\n3. Use the stored start time variable in subsequent items or calculations as needed.", "url": "https://forum.cogsci.nl", "title": "How to record the start time of a trial in OpenSesame"} {"content": "To measure response times for each option in a custom FORM_BASE item:\n\n1. FORM_BASE items don't automatically record a response time, so you need to manually track it.\n2. Insert a FORM_BASE item into your experiment. Let's assume it's called `my_form`.\n3. Insert an INLINE_SCRIPT item after the my_form.\n4. In the run phase of the INLINE_SCRIPT, calculate the response time by subtracting the onset time of `my_form` from the current time, like so:\n ```python\n response_time = clock.time() - time_my_form\n ```", "url": "https://forum.cogsci.nl", "title": "How to measure response times in a custom FORM_BASE item"} +{"content": "By default, the LOGGER only logs simple data types (`int`, `float`, `str`, `bytes`, `None`). This is to avoid the log file from being polluted by complex data types, which are often not intended for logging. However, in some cases you may want to also log complex data types. You can do this by explicitly entering the name of the to-be-logged variable in the Include field of the LOGGER item. Always check that your variables are logged correctly!", "url": "https://forum.cogsci.nl", "title": "How to log complex data types in OpenSesame"} {"content": "To set the color of a Rectangle element on a Canvas:\n\n1. In an inline_script item, create a Canvas object using `my_canvas = Canvas()`.\n2. Add a Rectangle element to the Canvas using `my_canvas['rect'] = Rect(x, y, w, h)`, specifying the position and size.\n3. Set the color property of the Rectangle element directly in the constructor: `my_canvas['rect'] = Rect(x, y, w, h, color='red')`.\n4. If needed, modify the color after the Rectangle element has been created using the `color` attribute: `my_canvas['rect'].color = 'blue'`.\n5. Call `my_canvas.show()` to display the Canvas with the colored Rectangle.", "url": "https://forum.cogsci.nl", "title": "How to set the color of a Rectangle element on a Canvas"} {"content": "To modify properties of Canvas elements after creation:\n\n1. Create a Canvas object and add elements to it, assigning them unique names.\n2. Access the desired element using its name, like `my_canvas['element_name']`.\n3. Modify the element's properties using dot notation, e.g., `my_canvas['circle'].radius = 50`.\n4. Update other properties such as position, color, or visibility in a similar manner.\n5. Redraw the Canvas using `my_canvas.show()` to reflect the changes.", "url": "https://forum.cogsci.nl", "title": "How to modify properties of Canvas elements after creation"} {"content": "To animate Canvas elements using Python inline_script:\n\n1. Create a Canvas object and add the elements you want to animate.\n2. Use a `for` loop to update the properties of the elements incrementally.\n3. Call `my_canvas.show()` within the loop to redraw the Canvas after each update.\n4. Use `clock.sleep()` to introduce a small delay between each frame of the animation.\n5. Adjust the loop range and property changes to control the duration and behavior of the animation.", "url": "https://forum.cogsci.nl", "title": "How to animate Canvas elements using Python inline_script"} @@ -26,6 +29,9 @@ {"content": "To present images randomly in OpenSesame:\n\n1. Create a loop item and add a list of image file names as rows to a column of the loop table called 'image_file'\n2. In the loop item's properties, set the \"Order\" to \"random\".\n3. Create a sketchpad item within the loop and add an image element to it.\n4. Add the script of the image element, and set the \"file\" keywowrd to \"{image_file}\": `file=\"{image_file}\"'. The curly braces indicate that image_file is a Python expression that refers to the variable `image_file`.\n5. Each iteration of the loop will now display a randomly selected image from your list.", "url": "https://forum.cogsci.nl", "title": "How to present images randomly in OpenSesame"} {"content": "To implement different instructions based on trial conditions:\n\n1. Decide whether you want to vary the instruction from trial to trial, in which case the instructions below relate to the block_loop and the trial_sequence (assuming that you named your items following the standard OpenSesame naming conventions); or from block to block, in which case the instructions below relate to the experimental_loop and block_sequence.\n1. In your loop table, create a column called `instruction_text` that contains the text that should be presented as instruction to the participant (e.g., \"maintain\" or \"decrease\").\n2. Add a sketchpad item for the instruction screen to the start of the sequence.\n3. Add a text element to the instruction sketchpad to show the text \"{instruction_text}\".\n4. The curly braces indicate that instruction_text is a Python expression that refers to the variable `instruction_text`.\n5. OpenSesame will now display the appropriate instruction for each trial or each block based on the value in the loop table.", "url": "https://forum.cogsci.nl", "title": "How to implement different instructions based on trial conditions"} {"content": "OpenSesame does not contain a rating scale by default, but it is easy to implement one.\n\nHow to create a rating scale using a form_multiple_choice item:\n\n1. Add a form_multiple_coice item to your experiment.\n2. Make sure that 'Allow multiple options to be selected' is disabled.\n3. Add each rating option as a separate line in the options field at the bottom of the controls.\n\nHow to create a rating scale using a sketchpad item:\n\n1. Design the rating scale using one sketchpad element, called 'rating_sketchpad', for each clickable option. For example, you could use five filled circles or five images of a star to create five-point likert scale.\n2. Give each clickable element a unique name, such as 'rating1', 'rating2', etc.\n3. After rating_sketchpad, insert a mouse_response.\n4. In the mouse_response, select rating_sketchpad as 'Linked sketchpad'.\n5. The clicked option will now be available through the `cursor_roi` variable.\n6. To let the experiment continue only when participants have clicked on an option (and not the background, for example), put the mouse_response in a loop that breaks only when an option was clicked, for example with a break-if expression: `'cursor_roi.startswith('rating')`.", "url": "https://forum.cogsci.nl", "title": "How to create a rating scale in OpenSesame"} +{"content": "You cannot change the size of a Canvas in OpenSesame, because a Canvas always covers the entire window, the size of which is determined by the resolution of the experiment. However, you can change the resolution of the experiment as follows:\n\n1. Open the Experiment Properties by clicking on the top-level element of the overview area.\n2. Change the resolution (width and height) to the desired dimension.\n3. The resolution will available as the `width` and `height` variables.\n\nImportant note: when running the experiment full-screen, the resolution of the experiment means something different depending on the selected backend:\n\n- When you have selected 'On the desktop with PsychoPy (psycho)' or 'On the desktop with Expyriment (xpyriment)', the resolution of the display is not actually changed, so it's recommended to change the experiment resolution to match the display resolution.\n- When you have selected 'On the desktop with legacy (psycho)', the resolution of the display is changed tp the experiment resolution.\n- When you have selected 'In a browser with OSWeb', the resolution determines the size of the experiment canvas that is shown in the browser window. You can experiment with different values to find out which resolution works best.", "url": "https://forum.cogsci.nl", "title": "How to set the size of a Canvas in OpenSesame"} +{"content": "To position elements on a Canvas using pixel coordinates in OpenSesame:\n\n1. Create a Python INLINE_SCRIPT.\n2. In the INLINE_SCRIPT, create a Canvas object.\n3. Add the desired elements (e.g., Rectangle, Circle, Image, etc.) and specify their positions using the `x` and `y` parameters. For example:\n ```python\n my_canvas = Canvas()\n my_canvas['rect'] = Rect(x=100, y=200, w=50, h=50)\n my_canvas['circle'] = Circle(x=300, y=400, r=30)\n my_canvas.show()\n ```\n4. The `x` and `y` values represent the pixel coordinates relative to the center of the Canvas. Positive `x` values move the element to the right, while positive `y` values move it downward.\n5. Adjust the `x` and `y` values to position the elements at the desired locations on the Canvas.\n6. Run the experiment to verify that the elements are positioned correctly.", "url": "https://forum.cogsci.nl", "title": "How to position elements on a Canvas using pixel coordinates"} +{"content": "To display an image on a Canvas in OpenSesame:\n\n1. Create a Python INLINE_SCRIPT.\n2. In the INLINE_SCRIPT, create a Canvas object.\n2. Add an `Image` element to load and display the image. For example:\n ```python\n my_canvas = Canvas()\n my_canvas['image'] = Image(pool['image.png'], x=0, y=0)\n my_canvas.show()\n ```\n Replace `'image.png'` with the actual name of your image file, which should be placed in the file pool.\n3. Use the `x` and `y` parameters to specify the position of the image on the Canvas. The default values of `x=0` and `y=0` will center the image on the Canvas.\n4. If needed, you can adjust the size of the image using the `scale` parameter. For example:\n ```python\n my_canvas['image'] = Image(pool['image.png'], x=0, y=0,scale=0.5)\n ```\n A `scale` value of 1.0 represents the original size of the image, while values less than 1.0 will shrink the image and values greater than 1.0 will enlarge it.\n5. Run the experiment to verify that the image is displayed correctly on the Canvas.", "url": "https://forum.cogsci.nl", "title": "How to display an image on a Canvas"} {"content": "To set up a GazePoint eye tracker in OpenSesame:\n\n1. Install the necessary GazePoint drivers and software on your computer.\n2. In OpenSesame, add a PYGAZE_INIT item to the start of your experiment.\n3. In the PYGAZE_INIT item properties, select \"OpenGaze\" as the eye tracker type.\n4. Configure the OpenGaze settings according to your preferences and hardware setup.\n5. Add a PYGAZE_START_RECORDING item before the trial sequence to start recording eye tracking data.\n6. Add a PYGAZE_LOG item at the end of the trial sequence to log experimental variables to the log file.\n7. Add a PYGAZE_STOP_RECORDING item after the trial sequence to stop recording eye tracking data.\n8. You can also use the 'Eye tracking template', which already contains the basic structure of an eye-tracking experiment.", "url": "https://forum.cogsci.nl", "title": "How to set up a GazePoint eye tracker in OpenSesame"} {"content": "To display multiple images and play audio simultaneously in OpenSesame:\n\n1. Create a sketchpad item and add image elements for each of the four pictures you want to display.\n2. Adjust the position and size of the image elements to arrange them on the screen as desired.\n3. Create a sampler item and specify the audio file you want to play.\n4. If you want the sketchpad to be shown when the sampler starts playing and to remain visible until the sampler is done playing, insert the sketchpad and set the duration of the sketchpad to 0, and have this followed by the sampler and set the duration of the sampler to 'sound'.", "url": "https://forum.cogsci.nl", "title": "How to display multiple images and play audio simultaneously in OpenSesame"} {"content": "To define time windows (or: epochs, or: phases) for eye tracking analysis in OpenSesame:\n\n1. After each event that corresponds to the start of a time window, send a message to the eye-tracking log file.\n2. You can log messages using the PYGAZE_LOG item or in an INLINE_SCRIPT item using the `eyetracker.log()` function.\n3. Make sure that the log messages match the assumption of the analysis pipeline that you intend to use. For example, if you want to use the `eyelinkparser`, indicate the start of each phase using a 'start_phase cue' message, where cue stands for the name of the phase.", "url": "https://forum.cogsci.nl", "title": "How to define time windows (or: epochs, or: phases) for eye tracking analysis in OpenSesame"} @@ -64,6 +70,8 @@ {"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"} {"content": "To examine the data collected by an online experiment hosted through JATOS/ MindProbe:\n\n1. Log in to the JATOS server where the study is hosted, for example MindProbe.eu\n2. Navigate to the study and open the Study results page\n3. Click on 'Export Results' and select the file format (e.g. JATOS Results Archive or Data only)\n4. In OpenSesame, open the OSWeb and JATOS control panel, and use the convert OSWeb results to .csv/ .xlsx option\n4. Open the converted .csv / .xlsx file in a spreadsheet or text editor \n5. Each row corresponds to one variable logging operation, which is typically one trial (although that depends on the structure of your experiment)\n6. Check that all expected variables are present and have sensible values\n7. Look for missing values, unexpected repetitions, or other anomalies\n8. If data appears to be missing or incorrect, proceed to further troubleshooting", "url": "https://forum.cogsci.nl", "title": "How to examine the data after running an experiment online"} {"content": "If an experiment hosted online through JATOS/ MindProbe is not correctly logging data, you can troubleshoot by:\n\n1. Running the experiment locally, after enabling in OSWeb by selecting 'In a browser with OSWeb' in the experiment properties, to check for error messages in the browser console (F12) \n2. Checking that all variables are initialized with default values at the start of the experiment \n3. Verifying that variables are set correctly in each trial, for example in an INLINE_JAVASCRIPT item\n4. Confirming that a LOGGER is executed at the end of each trial to write variables to the log \n5. Checking that no JATOS or JavaScript errors occur in the browser console when the experiment is run on JATOS\n6. Testing whether data is stored correctly if the experiment is aborted or navigated away from prematurely", "url": "https://forum.cogsci.nl", "title": "How to troubleshoot data logging issues in online experiments"} +{"content": "To find Eye Trackers that are compatible with OpenSesame:\n\n1. Visit the OpenSesame website (https://osdoc.cogsci.nl/).\n2. Look for the \"Eye tracking\" category in the documentation under Manual.\n3. Review the list of Eye Trackers that are currently supported by OpenSesame. This list includes popular brands such as EyeLink, SMI, and Tobii.\n4. Check the specific models and versions of each Eye Tracker brand to ensure compatibility with your setup.\n5. If your Eye Tracker is not listed, search the OpenSesame forums or contact the developers to inquire about potential support for your specific device.", "url": "https://forum.cogsci.nl", "title": "How to find Eye Trackers compatible with OpenSesame"} +{"content": "To set up an Eye Tracker in OpenSesame:\n\n1. Ensure that your eye tracker is supported by OpenSesame.\n2. Install the required Eye Tracker drivers and software on your computer, following the manufacturer's instructions.\n3. Connect your Eye Tracker to your computer using the appropriate cables or wireless connections.\n4. Launch OpenSesame and create a new experiment or open an existing one.\n5. Add a `pygaze_init` item to your experiment sequence to initialize the Eye Tracker connection.\n6. Configure the `pygaze_init` item by selecting your Eye Tracker brand and model from the dropdown menu and specifying any additional settings (e.g., calibration type, sample rate).\n7. Add a `pygaze_calibrate` item to your experiment sequence to perform the necessary calibration procedure for your Eye Tracker.\n8. Use `pygaze_start_recording` and `pygaze_stop_recording` items to control when the Eye Tracker starts and stops collecting data during your experiment.\n9. You can also start from the \"Eye Tracking Template\", which already provides the basic structure of an eye tracking experiment.", "url": "https://forum.cogsci.nl", "title": "How to set up an Eye Tracker in OpenSesame"} {"content": "To migrate an OpenSesame experiment from an older version to version 4.0:\n\n1. Review the 4.0 release notes at: https://osdoc.cogsci.nl/4.0/notes/400/\n2. Open the experiment in OpenSesame 4.0.\n3. Review the script for any deprecated functions or syntax changes.\n4. In inline_script tiems, remove any `exp.` or `var.` prefixes before variable names. In OpenSesame 4.0, variables are globals and not properties of the `var` or `exp` object.\n5. Replace `self.sleep()` with `clock.sleep()` for pausing execution.\n6. Test the script thoroughly to ensure all functionality works as expected.\n7. Save the updated script and use it in your experiment.", "url": "https://forum.cogsci.nl", "title": "How to migrate an OpenSesame experiment from older version (3.2 or 3.3) to version 4.0"} {"content": "To replace the deprecated `self.copy_sketchpad()` function:\n\n1. Identify where `self.copy_sketchpad()` is used in your script.\n2. Remove the `self.` prefix. The function is simply called `copy_sketchpad()` in recent versions of OpenSesame.\n3. Repeat this process for all occurrences of `self.copy_sketchpad()` in your script.", "url": "https://forum.cogsci.nl", "title": "How to replace the deprecated `self.copy_sketchpad()` function"} {"content": "To pause execution in OpenSesame 4.0:\n\n\n1. Identify where you need to pause execution in your script.\n2. Use `clock.sleep()` (e.g., `clock.sleep(1000)` to pause for 1000 milliseconds, or 1 second).\n3. Ensure that the pause duration is specified in milliseconds.\n4. Use `clock.sleep()` consistently throughout your script for any pauses in execution. Do not use `self.sleep()`, which is deprecated, or `time.sleep()`, which is from the Python standard library and is not optimized for accurate timing.", "url": "https://forum.cogsci.nl", "title": "How to pause execution in OpenSesame 4.0"}