DRAFT - Version 2 SurveyGizmo Survey Integration Documentation

NOTE: This integration requires knowledge of the JavaScript programming language.

Introduction

This describes how to embed the morphii technology into a SurveyGizmo survey. This integration encapsulates most of the the coding needed. Note that this is not the only way to integrate morphii into a SurveyGizmo survey, but this document focuses on using the integration.

Limitations

The integration does have limitations. This does not mean that these things cannot be done, just they are limitations for this integration implementation.

The survey must use the standard layout for desktop and mobile interaction. This setting is found in the Survey Style Layout section.

Morphii Questions

SurveyGizmo survey questions that are associated with the morphii widget should be Textbox List type questions. Create a new question by by choosing the Textbox List question type. Enter your question text in the “What question do you want to ask?” text field. You can also use this field to format your question text.
In the “Multiple Choice Options” section you need to add the following 6 options. Order does not matter.

id: The morphii id selected will be stored in this element.

name: The morphii name selected will be stored in this element.

intensity: The morphii intensity will be stored in this element.

part_name: The morphii part name will be stored in this element. This is useful when using bi-directional morphiis.

question: The question text associated with the morphii question will be stored in this element.

comment: The comment text will be stored in this element.(NOTE: This response element must be set as not Required.)

Question ID

The integration requires the ID assigned to a question. The ID can be found in the Build tab for a survey.

JavaScript Action

The integration requires that a JavaScript Action be added to each page that a morphii question is on. This is where the JavaScript code will reside to interface with the integration.

NOTE: The JavaScript Action MUST be inserted after the Morphii questions. It is recommended that the JavaScript Action element be the last element on the page.

JavaScript

Below is sample JavaScript which can be used in the “JavaScript Action” mentioned above. This sample code only shows the required properties. There are multiple properties to configure the integration. Each property is described in the the sections below.

The integration MUST be added to a property named _mIntegrationParams on the global window object. (window['_mIntegrationParams'] = { })

Questions Array

(REQUIRED) The questions array contains objects that define the configuration to use for each morphii question. These configurations include control over the comment field, slider, instruction text, and morphii to be displayed.

id

(REQUIRED) The id property is the question id. This can be found in the Build tab for the survey.

morphii_ids

(REQUIRED) The morphii_ids property is an array of morphii objects to use for the question. The object contains the following properties:

id: This property is required. It is the unique id of the morphii.

name: This property holds the morphii name for each supported language. Each translation is defined separately. The en translation of the name is required if any other language is declared. If omitted the default morphii name will be used.

weight: An arbitrary integer value assigned to this morphii. If omitted the value will be 0. Setting this property is helpful if using the morphii selection callback.

comment

(OPTIONAL) The comment property is used to configure the comment field. It contains the properties:

show: Flag to display the morphii comment field or not. Default: false

required: Flag to mark comment field as required. Default: false

maxlength: The max character length of the comment field. Default: 512

label: The property that holds the text in each supported language. The label above the comment field. Each translation is defined separately. The en version of the label is required if any other language is declared. Default: Please leave a comment

instructions

(OPTIONAL) The instructions property defines the options for the instruction text.

show: This property is the flag to show the instruction text. Value is true or false. Default: true.

pre_select_label: This property is used to override the default text for the instruction text that is displayed when a morphii selection has not been made. Each translation is defined separately. The en version of the label is required if any other language is declared.

post_select_label: This property is used to override the default text for the instruction text that is displayed when a morphii is selected. Each translation is defined separately. The en version of the label is required if any other language is declared.

morphii_show_name

(OPTIONAL) The morphii_show_name property is used to configure if the morphii label is displayed or not. This defaults to true if not set. The property is used when using bi-directional morphiis in the survey.

selection

(OPTIONAL) The selection property is used to require a morphii be selected for this morphii question. The default is false.

Example:

varselection={required:false};

intensity

(OPTIONAL) The intensity property is used to require the intensity be set for this morphii question. The default is false.

Example:

varintensity={required:false};

Exporting Survey Data

When exporting SurveyGizmo survey data to a CVS, the morphii data will be included in the export. The columns will map to the Textbox List fields that you created in the survey.

Testing

When testing your SurveyGizmo survey, add the query string parameter preview=true to the survey URL. This will mark reaction results as testing and omit them in final analysis results. For example: http://www.surveygizmo.com/s3/4945218/sample?preview=true

Sample Survey

The following is a sample SurveyGizmo survey. The JavaScript for this sample is below.