Skip to content

Script configuration

Julian Unkel edited this page Jun 11, 2019 · 2 revisions

Script configuration

Go to the "osemHub" questionnaire page. In the PHP code element, edit the options according to your study design.

End conditions

$osemEnd contains values for all possible end conditions:

  • The number of clicks ("clicks" =>) has to be set to a positive integer (less than 100). Important: This number has to be set even if you are not using a selection limit. In this case, set it to a high number that is above the maximum number of selection you realistically expect from any given participant (the default value of 20 should be fine for most experiments).
  • The time limit ("time" =>) can be set to any positive integer (=time limit in seconds), or to 0 if the task should not have a time limit.
  • The option for the user to manually abort the selection task ("manual" =>) can be set to either TRUE or FALSE.

Bar display

$osemBar contains settings to display the bar and/or certain elements of it (TRUE/ FALSE), and text strings to be used for bar elements.

Adapt question files

The internal variable question fields imported in step 2 of "File import" store all selection task variables. Make sure that the number of internal variable questions in categories CL, DT, and MO (which store click, dwell time, and cursor movement information, respectively) match the number of clicks defined in $osemEnd. In case you need more than the 20 that are imported by default, you can easily duplicate these question fields by selecting the question via "List of Questions" and click on the "Duplicate"-Button on top.

The number of questions in CO (coordinates of spoke links on the hub page) should match the number of spokes present on the hub.

Demo project

First, head to the "hub" questionnaire page. For our demo project, we want to use a combination of a time limit of 180 seconds and the possibility to manually abort. We would thus specify "time" => 180 in $osemEnd (the other default values are fine):

$osemEnd = [
    "clicks" => 20,
    "time" => 180,
    "manual" => TRUE
];

As we do not want to have a selection limit (at least not an explicit one, see above), we may also want to hide the number of selections left in the info bar displayed above the stimulus by setting 'showClicks' => FALSE in $osemBar:

$osemBar = [
    'showBar' => TRUE,
    'showAbort' => TRUE,
    'showBackToHub' => TRUE,
    'showTimer' => TRUE,
    'showClicks' => FALSE,

    'textAbort' => 'End selection task',
    'textBackToHub' => 'Back to hub',
    'textTimerBefore' => '',
    'textTimerAfter' => ' seconds left',
    'textClicksBefore' => '',
    'textClicksAfter' => ' selections left'
];

Second, adapt the question variables. As we only have four spokes present on our hub, we can delete the question "CO05" to "CO12" under "CO OSEM Coordinates" in the "List of Questions".

We can now upload and integrate our stimulus files.