Qualtrics Question API



Similar documents
HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

Custom fields validation

How To Draw A Pie Chart On Google Charts On A Computer Or Tablet Or Ipad Or Ipa Or Ipam Or Ipar Or Iporom Or Iperom Or Macodeo Or Iproom Or Gorgonchart On A

How to set up a scoring algorithm and automatic triggers for Qualtrics measures

Working with Indicee Elements

FedTraveler.com. Log o FedTraveler.com using your valid Member ID and PIN.

CRM Developer Form

Client SuiteScript Developer s Guide

Tutorial: Building a Dojo Application using IBM Rational Application Developer Loan Payment Calculator

WebSocket Server. To understand the Wakanda Server side WebSocket support, it is important to identify the different parts and how they interact:

SharePoint Form Field Assistant SPFF. Form Manipulations. Getting Started. Hide

5 Point Choice ( 五 分 選 擇 題 ): Allow a single rating of between 1 and 5 for the question at hand. Date ( 日 期 ): Enter a date Eg: What is your birthdate

Dynamic Web-Enabled Data Collection

07/04/2014 NOBIL API. Version 3.0. Skåland Webservice Side 1 / 16

Designing and Implementing Forms 34

InPost UK Limited GeoWidget Integration Guide Version 1.1

Installing and Sending with DocuSign for NetSuite v2.2

MicroStrategy Quick Guide: Creating Prompts ITU Data Mart Support Group, Reporting Services

Using the VMRC Plug-In: Startup, Invoking Methods, and Shutdown on page 4

[COGNOS DATA TRAINING FAQS] This is a list of frequently asked questions for a Cognos user

FORM-ORIENTED DATA ENTRY

jquery Tutorial for Beginners: Nothing But the Goods

IMPORTING FACILITIES TO CONTRACTS

JavaScript: Arrays Pearson Education, Inc. All rights reserved.

Performance Testing for Ajax Applications

DocuSign for Salesforce Administrator Guide v6.1.1 Rev A Published: July 16, 2015

Traitware Authentication Service Integration Document

Tutorial JavaScript: Switching panels using a radio button

XHTML Forms. Form syntax. Selection widgets. Submission method. Submission action. Radio buttons

Setup Guide for Magento and BlueSnap

How to Configure the Workflow Service and Design the Workflow Process Templates

Specify the location of an HTML control stored in the application repository. See Using the XPath search method, page 2.

lectures/6/src/blink.html blink.html David J. Malan Computer Science S-75 Harvard Summer School 10. <!DOCTYPE html> 12. </script> 16.

How to pull content from the PMP into Core Publisher

Client-side Web Engineering From HTML to AJAX

WEB DESIGN COURSE CONTENT

Implementing Sub-domain & Cross-domain Tracking A Complete Guide

How do I create a Peachtree (Sage 50) Payroll export file?

Developing coaches in human services

PLAYER DEVELOPER GUIDE

JavaScript: Client-Side Scripting. Chapter 6

This matches a date in the MM/DD/YYYY format in the years The date must include leading zeros.

NewsletterAdmin 2.4 Setup Manual

By sending messages into a queue, we can time these messages to exit the cue and call specific functions.

DATA SHEET Setup Tutorial

USC Marshall School of Business Academic Information Services. Excel 2007 Qualtrics Survey Analysis

Netsmart Sandbox Tour Guide Script

Microsoft Dynamics GP. SmartList Builder User s Guide With Excel Report Builder

Creating and Configuring a Custom Visualization Component

Lecture 9 Chrome Extensions

Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY

<option> eggs </option> <option> cheese </option> </select> </p> </form>

Editing Data with Microsoft SQL Server Reporting Services

How to create database in GlycomcsPortal?

English. Asema.com Portlets Programmers' Manual

BT Cloud Voice. Call Forward Selective. What is it? How do I set up a rule?

WebSphere Business Monitor V7.0 Script adapter lab

WebIOPi. Installation Walk-through Macros

IMRG Peermap API Documentation V 5.0

Java Application Developer Certificate Program Competencies

Developers Guide version 1.1

Custom Javascript In Planning

SQL Injection for newbie

Building GUIs in Haskell

SuiteBuilder (Customization) Guide September 3, 2013 Version 2013 Release 2

Reports and Documents Generator for SharePoint ver.: 2.2

Data Management Applications with Drupal as Your Framework

CONTACTUS.COM A START GUIDE FOR CREATING YOUR FIRST CONTACT FORM

How do I share a file with a friend or trusted associate?

Integrating SalesForce with SharePoint 2007 via the Business Data Catalog

Fast track to HTML & CSS 101 (Web Design)

JavaScript Basics & HTML DOM. Sang Shin Java Technology Architect Sun Microsystems, Inc. sang.shin@sun.com

E-Learning User Manual

5.6.2 Optional Lab: Restore Points in Windows Vista

Web development... the server side (of the force)

How-To: Submitting PDF forms to SharePoint from custom websites

Storage and Playback Getting Started Guide

Web Development 1 A4 Project Description Web Architecture

Trustkeeper PCI Compliance Guide for Merchants

Managing Distribution Lists in Cisco Unity 8.x

Making an online form in Serif WebPlus

Installation Guide MAGENTO PAYMENT PLUGIN. release 1.0.1

Initial Setup of Microsoft Outlook with Google Apps Sync for Windows 7. Initial Setup of Microsoft Outlook with Google Apps Sync for Windows 7

Integration Guide. Integrating Extole with Salesforce. Overview. Use Cases

Gravity Forms: Creating a Form

FormAPI, AJAX and Node.js

Import Filter Editor User s Guide

User Guide for Smart Former Gold (v. 1.0) by IToris Inc. team

Transcription:

Qualtrics Question API API subject to change without notice Version: 2010.01.12 Contents Introduction... 2 Functions... 2 disablenextbutton... 2 disablepreviousbutton... 2 enablenextbutton... 3 enablepreviousbutton... 3 hidenextbutton... 3 hidepreviousbutton... 3 shownextbutton... 3 showpreviousbutton... 3 clicknextbutton... 3 clickpreviousbutton... 3 hidechoices... 3 getquestioncontainer... 3 getquestiontextcontainer... 4 getchoicecontainer... 4 setchoicevalue... 4 setchoicevaluebyrecodevalue... 4 setchoicevaluebyvariablename... 4 getchoicevalue... 5 getquestioninfo... 5 getchoicesfromvariablename... 5 getchoicesfromrecodevalue... 5 Properties... 6 questionid... 6 questioncontainer... 6 questionclick... 6 Page 1

Introduction The Qualtrics Question API allows users to interact with a question in a survey using JavaScript. Note that interaction with questions is not limited to the functions available in the API. The API simply abstracts the most used functionality to a set of methods called on the question object. All functions using the API must be wrapped in a Qualtrics.SurveyEngine.addOnload function. The addonload function automatically instantiates the Question Data class and binds the instantiated object to allow its functions and properties to be accessed using the this keyword directly. <script> Qualtrics.SurveyEngine.addOnload(function () //create Qualtrics.SurveyEngine.QuestionData object this.disablenextbutton(); //disables the next button on the page this.questionclick = function(event,element) //question click is a simple onclick handler //attached to the question's container div console.log(event); //by default you get the click event as the first parameter console.log(element); //and the clicked element as the second parameter if (element.type == 'radio') var choicenum = element.id.split('~')[2]; alert('you clicked on choice '+choicenum); if (choicenum == 2) this.enablenextbutton(); //enables the next button - Note that the QuestionData //object is bound to this to make it easier to use else this.disablenextbutton(); //disables the next button ); </script> Functions This is a list of predefined functions that can be used on the QuestionData class. Note that the addonload function on the Qualtrics.SurveyEngine object automatically instantiates the QuestionData class and binds the instantiated object to allow these functions to be called using this directly. disablenextbutton Sets the disabled attribute to true on the next button to disable it. disablepreviousbutton Sets the disabled attribute to true on the previous button to disable it. Page 2

enablenextbutton Sets the disabled attribute to false on the next button to enable it. enablepreviousbutton Sets the disabled attribute to false on the previous button to enable it. hidenextbutton Hides the next button hidepreviousbutton Hides the previous button shownextbutton Shows the Next Button showpreviousbutton Shows the Previous Button clicknextbutton Emulates a click on the next button to submit the page //Hides the next button and displays the question //for 5 seconds before moving to the next page this.hidenextbutton(); var that = this; (function()that.clicknextbutton();).delay(5); clickpreviousbutton Emulates a click on the previous button to submit the page hidechoices Hides the choice container getquestioncontainer Returns the div of the question (.QuestionOuter) Page 3

getquestiontextcontainer Returns the div of the question text (.QuestionText) getchoicecontainer Returns the div of the choices (.ChoiceStructure) setchoicevalue Sets the actual value of a choice in the question. If a matrix-style question, also specify the subid (answerid). choiceid <String> Yes The ID of the choice being set value <String> Yes The value being set Examples: this.setchoicevalue(3,true); //sets the value of choice 3 to true (selected) this.setchoicevalue(3,2,true); //sets the value of row choice 3 answer col 2 setchoicevaluebyrecodevalue Sets the value of the choice(s) specified by a recode value. Multiple choices in a question may have the same recode value. An attempt will be made to set each choice that is found. For single answer questions this may result in only the last matching choice being set. recodevalue <String> Yes The recode value of the choice(s) being set value <String> Yes The value being set setchoicevaluebyvariablename Sets the value of the choice(s) specified by a variable name. Multiple choices in a question may have the same variable name. An attempt will be made to set each choice that is found. For single answer questions this may result in only the last matching choice being set. variablename <String> Yes The variable name of the choice(s) being set value <String> Yes The value being set Page 4

getchoicevalue Gets the actual value of a choice in the question. If a matrix-style question, also specify the subid (answerid). choiceid <String> Yes The ID of the choice Examples: this.getchoicevalue(3); //returns the value of choice 3 this.getchoicevalue(3,2); //returns the value of row choice 3 answer col 2 getquestioninfo Returns an object containing information about the question. QuestionID (String) The question id QuestionText (String) The question text QuestionType (String) The question type code Choices (Object) Key is the choice id, value is information about the choice RecodeValue (String) VariableName Text Exclusive getchoicesfromvariablename Returns an array of choice ids that have matching variable names. variablename <String> yes The variable name to search for getchoicesfromrecodevalue Returns an array of choice ids that have matching recode values. recodevalue <String> yes The recode value to search for Page 5

Properties questionid The question ID questioncontainer The question container // returns the question text var questiontext = $(this.questioncontainer).down('.questiontext').innerhtml; questionclick Can be set to a callback function to perform a custom function when any element of the question is clicked. The function will be passed the following parameters: Parameter event element Description The click event The element that was clicked this.questionclick = function(event,element) //for a single answer multiple choice question, the element type will be radio if (element.type == 'radio') var choicenum = element.id.split('~')[2]; alert('you clicked on choice '+choicenum); Page 6