Hi, I am trying to present consistently updating information at the top of a page based on user's responses on a constant sum question, similar to what was done here.
How to display score on survey page that dynamically updates?I have tried the solution of pulling responses from items in the Constant Sum question and using the following code to update a span id used in a presentation item:
This is my number:
This is my number:
javascript in the Constant Sum question
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
this.questionclick = function(event,element){
var number1 = parseInt(jQuery("#"+this.questionId+" input.ResultsInput").eq(0).val());
$('number1'). update(new Intl.NumberFormat().format(number1));
var number2 = parseInt(jQuery("#"+this.questionId+" input.ResultsInput").eq(1).val());
$('number2'). update(new Intl.NumberFormat().format(number2));
}
});
However, the span id is not dynamically updating, as if the numbers are not being pull from the constant sum as user's slide values (it's a slider).
Any thoughts would be greatly appreciated! Very much the toddler with a chainsaw when it comes to java/html.
Be the first to reply!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.