Gaze cuing task in OpenSesame#

from IPython.display import IFrame

The tutorial can be found here

IFrame(src="https://osdoc.cogsci.nl/3.3/tutorials/beginner/", width="800", height="600")

Exercises#

Exercise 1. Express the location of the cues in relative terms#

Let’s now adapt the gaze cuing experiment you created in the tutorial. Change the 300 and -300 values into percentages (e.g. 10% and -10%) and calculate the x-coordinates of both the target and the distractor based on the resolution (width) of the screen.

Test whether the location is updated when you change the resolution of the screen.

Exercise 2. Track the number of trials per block#

Count the total number of trials presented in each block by adding an inline script that increments itself with 1 at the end of each trial (i.e. var.TrialCounter = var.TrialCounter + 1). The first trial should get value 1. Make sure the counter resets for each block separately. Check using the variable inspect (while running OpenSesame in windowed mode) and in the log file whether the stored trial number is correct.

Exercise 3. Calculate a running average of the accuracy#

Now, add another counter that calculates the total number of correct trials using var.CorrectCounter = var.CorrectCounter + var.correct. Make sure this code is run AFTER the experimental variable var.correct has the correct value (i.e., you should add this inline after the response collection object). Calculate the running average by dividing the value of CorrectCounter by TrialCounter. Show this running average value on the screen by inserting a feedback object in the trial sequence.

Exercise 4. Add a progressbar (advanced)#

Now, let’s utilize the trial counter you created in Exercise 2 to incorporate a progress bar into the trials. The progress bar should consist of a horizontal white rectangle that gradually fills up from left to right using a red filled rectangle displayed on top of it. Additionally, include a column at the block level that indicates the total number of trials per block. To calculate the width of the red bar, divide the trial number by this total and multiply it by a constant. Make sure to reference this variable to adjust the width of the red bar (refer to the ‘w’ parameter of the red rectangle in the script view).