The first thing to do, if you're on a Mac, is to install homebrew from http://mxcl.github.io/homebrew/
The command to type into terminal to install homebrew is:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
The first thing to do, if you're on a Mac, is to install homebrew from http://mxcl.github.io/homebrew/
The command to type into terminal to install homebrew is:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Qualtrics.SurveyEngine.addOnload(function () { | |
var that = this; | |
this.questionclick = function(event,element) { | |
var choices = that.getSelectedChoices(); // returns an array of all selected options | |
if (choices.length >= 6) { | |
// now reveal the question! | |
jQuery('#QID2').show(); | |
} else { | |
// or not | |
jQuery('#QID2').hide(); |
Qualtrics.SurveyEngine.addOnload(function() { | |
var qid = this.questionId; | |
document.onkeydown = function(event) { | |
console.log('keydown',event); | |
if (event.which == 37) { | |
event.preventDefault(); | |
Qualtrics.SurveyEngine.registry[qid].setChoiceValue(1, true); | |
} else if (event.which == 39) { | |
event.preventDefault(); |
Qualtrics.SurveyEngine.addOnload(function() { | |
var qid = this.questionId; | |
document.onkeydown = function(event) { | |
console.log('keydown',event); | |
if (event.which == 37) { | |
event.preventDefault(); | |
Qualtrics.SurveyEngine.registry[qid].setChoiceValue(1, true); | |
jQuery('#NextButton').click(); | |
} else if (event.which == 39) { |
Qualtrics.SurveyEngine.addOnReady(function() { | |
//variables | |
var draggableClassName = ".chair"; // the class name of elements that should be draggable | |
var edField = "distance"; // this will be the name of the Embedded Data field with the distance. | |
jQuery( function() { | |
jQuery( draggableClassName ).draggable({ | |
stop: function() { | |
var distance = getDistanceBetweenElements(document.getElementById("Chair1"), |
var previousAnswer =""; | |
Qualtrics.SurveyEngine.addOnload(function() { | |
var questionId = this.questionId; | |
this.questionclick = function(event, element) { | |
if (element.type == 'radio') { | |
var options = document.querySelectorAll('.q-checked'); | |
for (var i = 0; i < options.length; i++) { | |
var ansArr = options[i].htmlFor.split('~'); | |
var ansStr = ansArr[2] + '_' + ansArr[3]; |
Qualtrics.SurveyEngine.addOnload(function() { | |
// Qualtrics.SurveyEngine.setEmbeddedData('${q://QID18/ChoiceNumericEntryValue/3}', 67); // impossible | |
var x =34; | |
document.getElementById("demo1").innerHTML = x; | |
}); |
Qualtrics.SurveyEngine.addOnload(function() { | |
// may need to modify these | |
var pickGroupQID = 'QID5'; // this is the qid of the Pick, Group, and Rank question | |
var numberOfGroups = 3; // how many groups do you have? | |
// add listeners to text boxes | |
for (var i = 1; i < numberOfGroups + 1; i++) { | |
var selector1 = '#' + this.questionId + ' .ChoiceStructure table tr:nth-child(' + i + ') input'; | |
// store the group number for recall within event handler |
Qualtrics.SurveyEngine.addOnload(function() { | |
var regex = /(my text string)|(my other text string)/gi; | |
var fieldName = 'FieldName'; | |
// add listener to text boxes | |
jQuery('#' + this.questionId + ' textarea').on('blur', function() { | |
// Find the value typed in textbox | |
var value = jQuery(this).val(); | |
if (value.match(regex)) { |