Namespace: data

Angular.questionnaireDirective# data

The data used to build the questionnaire. data is bound to $scope.questionnaireData on the enclosing scope.

Properties:
Name Type Description
title string

The title of the questionnaire (optional)

introductoryText string

A block of introductory text for the questionnaire (optional)

structure Array.<questionnaireStructureEntry>

An array of questions for the questionnaire (see questionnaireStructureEntry) (optional)

Source:

Type Definitions

questionnaireStructureEntry

Represents an individual question in a questionnaire.

Type:
  • Object
Properties:
Name Type Description
questionType string

The question type. Supported questionTypes include 'likert', 'radio', 'dropdown', and 'checkbox'. (required)

questionId string

All question types support this property. It should be a single-word string that uniquely identifies this question within this questionnaire. (required)

questionLabel string

All question types support this property. It should be a string that contains the text of the question itself (e.g., 'How old are you?') (optional)

questionStoragePath string

All question types support this property. It should be a 'keypath' into the TrialData.data object at which the response to this question should be stored. See TrialData#setValueForPath for more information on these keypaths. (required)

questionIsAssociatedToMedia boolean

All question types support this property. The value of this property specifies that a question corresponds to a particular media excerpt by taking a Boolean true or false as its value. When this value is set to true, multiple responses for questions with the same questionStoragePath property are stored in an ordered array that is used as the value for the questionStoragePath property in TrialData#data. (optional)

For example, in the demonstration study provided with the framework, two media excerpts are played. We present the same questionnaire to the participant following each media excerpt. In order to specify that responses on the questionnaire following the first excerpt are associated with the first excerpt (and the same for the second questionnaire and excerpt), the values for questionIsAssociatedToMedia for all questions in these questionnaires are all set to true. So, for those questons with their questionStoragePath property set to "data.answers.positivity", the corresponding section of a participant's TrialData#data might look something like this:

{
    data: {
        answers: {
            positivity: [2, 5]
        }
    }
}

Here, the participant chose a value of 2 when responding to the positivity question following the first excerpt. Likewise, they chose a value of 5 when responding to the positivity question following the second excerpt.

questionRequired boolean

All question types support this property. If its value is false, the user will not be required to answer the question. If its value is anything other than false (true, undefined, 49, etc.), the user will be required to answer the question. (optional)

questionLabelType string

This property is used by the 'likert' question type. Providing a value of 'labelLeft' for this property will produce the questionLabel as a left-justified label in the standard font size. Otherwise, the label will be printed in a larger font and centered over the scale. (optional)

questionLikertMinimumDescription string

This property is used by the 'likert' question type. The minimum description is displayed below the left end of the scale. If this property is specified, then questionLikertMaximumDescription must also be specified. (optional)

questionLikertMaximumDescription string

This property is used by the 'likert' question type. The minimum description is displayed below the right end of the scale. If this property is specified, then questionLikertMinimumDescription must also be specified. (optional)

questionLikertSingleImageSrc string

This property is used by the 'likert' question type. The value should be a path to an image to be displayed above and centered over the scale. (optional)

questionLikertLeftImageSrc string

This property is used by the 'likert' question type. The value should be a path to an image to be displayed above and above the left end of the scale. If this property is specified, then `questionLikertRightImageSrc must also be specified. (optional)

questionLikertRightImageSrc string

This property is used by the 'likert' question type. The value should be a path to an image to be displayed above and above the right end of the scale. If this property is specified, then `questionLikertLeftImageSrc must also be specified. (optional)

questionOptions Object

This property is used and required by all question types. In general, each question type requires that this be an object that has a choices property, the value of which is an array. Each entry in the choices array should be an object that represents a single question choice. Each of these objects should have both a label and a value property. The value of the label property should be a string that is used for the display of this question type. The value of the value property should be the value that should be stored when this choice is selected by the user for their answer.

// questionOptions example:
{
    choices: [
        {
            label: 'Strongly disagree',
            value: 1
        },
        {
            label: 'Somewhat disagree',
            value: 2
        },
        {
            label: 'Neither agree nor disagree',
            value: 3
        },
        {
            label: 'Somewhat agree',
            value: 4
        },
        {
            label: 'Strongly agree',
            value: 5
        }
    ]
}
Source: