Questionnaire Presentation Interface (QPI)

The Questionnaire Presentation Interface (QPI) presents questions to the subject via a web browser. The questions are presented on a web page as created in the Question Editor, and ordered by the researcher in the Form Editor. A series of web pages or Ensemble "forms" comprise an Ensemble survey. The surveys can be extended to an experiment by associating stimuli with the forms. Note that whether the series of forms are used as a survey or an experiment, the organizational unit is still referred to as an "experiment" in Ensemble.

The QPI is launched in a web brower with a master ticket, or user ticket supplied by the researcher. Both ticket types are in the form of web URLs with unique codes appended to them. The URLs are generated in the Experiment Editor for a particular experiment. User tickets may only be used to access the experiment once, while master tickets may be used any number of times before their expiration dates. We generally use master tickets for administering experiments within our center and email user tickets for remote subjects. This provides the means to present ongoing experiments in a controlled environment while providing some level of control over on-line usage. User tickets also provide a means to monitor whether a particular subject has run the survey or experiment by keeping a record of the user tickets sent to subjects. This is useful, for example, for issuing credit to subjects which are participating as part of a course's curriculum. Note that you may still use master tickets for remote subjects and this may be useful if broadly publishing a survey or experiment.

The arrangement of questions on a form, presentation of associated stimuli, and writing of responses to the database are accomplished with form handlers. A form handler is assigned to each form, prior to running any QPI sessions, in the Experiment Editor. Most forms use a generic form handler that displays the form questions without playing stimuli or performing specialized logic. If a form’s occurrence is conditional on previous responses, the form is trial-based, stimuli need to be presented, or a Matlab function must be called, specialized form handlers are assigned. For example, a specialized form handler might play a stimulus before presenting questions associated with the form. Typically, specialized form handlers differ from the generic form handler by only a few lines of code, and once created, specialized form handlers can be used in many different experiments with minimal modification. Ensemble was designed so that the typical user would not have to modify or write any PHP code.

A basic flowchart for a single QPI form handler is illustrated in Figure 1. Each of the boxes correspond to a PHP script called by the form handler. Thus, in order to change the logic of the form handler, one only needs to add or remove the line of code that calls the PHP script.

Forms are designated as a questionnaire-type or trial-type by the form handler chosen for the form. The two types of forms are handled very similarly and only differ in the way that information about them is queried from the database. The former are linked directly to questions while the latter are linked to a series of trials which in turn link to a question and a stimulus or pair of stimuli. Trial forms are usually placed in a loop in the experiment so that the form can progress through the trials by querying the next trial through its form handler.

Conditional forms, which are forms that are only presented if specific responses were made for previous questions, use a PHP script called by the form handler to check for those responses. A condition code associated with the form in the MySQL database, which describes the responses on previous forms to be matched, is referenced in this process.

Responses are checked for validity before submission to the MySQL database. If responses are of incorrect data types (e.g. alphabetical characters where an integer is required), incorrect ranges (e.g. a value of 30 where a number between 1 through 10 is required), or are blank for required questions, the subject is sent back to the form with an error message so that he or she can correct them.


Figure 1. QPI Form Handler Flowchart

Online consent forms, if used in lieu of paper consent forms in the experiment, use a specialized form handler which displays the consent form text and an option to agree or disagree. If the subject disagrees, the form handler terminates the session immediately with a message explaining that the experiment cannot continue without the subject’s consent. Consent forms are generally added to the beginning of the experiment, since the researcher cannot collect data from the subject without his or her consent. The consent form responses are recorded in the response table for the experiment, and are linked to a temporary subject ID until a permanent ID is generated for the subject.

A subject ID form handler or anonymous ID form handler usually follows the consent forms. The subject ID form handler collects the subject's name and birthdate and generates a subject ID based on this information. The anonymous ID form handler generates an anonymous ID in the event that identifying information is not being collected. The anonymous ID form handler can be associated with a form that presents questions like any other form. The subject will not notice that an anonymous ID is being generated and questions are presented as they would on the generic form handler.

A form rendered by the QPI is shown in Figure 2. A few question types are illustrated. Question 1 is implemented as a multi-question so that the two questions always appear together. Question 3 is a multi-title question with four iterations. Questions 2, 4, and 5 are questions linked to enumerated types defined by the researcher. Question 5 presents a pulldown menu instead of checkboxes, a formatting choice that was specified in the QEI. In addition to providing different appearances, answer display formats also provide different capabilities for multiple choice answers. Pulldown menus and radiobuttons only allow a single answer at a time while checkboxes (questions 2 and 4) provide for multiple simultaneous answers.


Figure 2. Form Rendered by QPI

After all of the QPI forms have been presented to the subject, the end_session form clears the session variables and concludes the session. Once the required number of QPI sessions for the experiment have been executed, the researcher launches the Matlab Workspace to perform data analysis.

Form Handlers

  • form_generic.php

    A generic form handler that is used in most debriefing forms. Displays the questions and response options in an html form. Submits the responses to submit_response.php.

  • form_conditional.php

    A form which is only visited if certain conditions are met. The conditions are referenced in the form table in the database.

  • form_autobio_v1.php

    Specialized form handler for the Autobio experiment. Calls a matlab script to determine the next stimulus to play based on the subject's age and musical preference. Serves an audio stimulus, queried from the stimulus table, without any audio controls. After the stimulus has finished playing, the form is called back to display the questions associated with this stimulus.

  • form_MBEA_v1.php

    Specialized form handler for Montreal Battery of Evaluation of Amusia. The form obtains responses for trials rather than for questions from the question table. Queries a trial from the form_x_trial and trial tables associated with a certain trial_order and form_id. Embeds a flash player with a “play” button to serve the stimulus or stimuli for the trial. When the stimuli finish playing, the form is called back to display the answer choices for the trial.

  • form_MBEA_training_v1.php

    Specialized form handler for Montreal Battery of Evaluation of Amusia. Similar to form_MBEA_v1.php except that the response is submitted back to the form handler. The form handler then checks to see if the answer was correct, and gives feedback to the subject for training purposes. The responses are not submitted to the database.

  • form_MBEA_lexical_cond_v1.php

    Conditional form for the lexical test. Presents the subject with a list of piece names selected from all the possible correct piece names for the lexical test. The subject is asked to select a piece if the response for this trial was “familiar”. Otherwise, this form handler is bypassed, and the session is updated for the next form.

  • form_MBEA_lexical_cond_v1.php

    Same as form_MBEA_lexical_cond_v1.php, except that the subject is given feedback on whether their answer was correct or not. If the previous answer was “unfamiliar,” the correct answer is queried immediately and the subject is given feedback. If the previous answer was “familiar,” the subject is asked to select the piece name, after which the form is called back to query the correct answer and give feedback to the subject.

  • Many more form handlers are now available and descriptions of them will be posted soon.

    bottom corner