I'm suddenly having trouble with several survey questions where I elicit participants' confidence intervals around a previous answer.
For example, in Q102 I ask participants to provide me a number. Q103 should autopopulate into its second blank from the previous question's answer Q102 (). Participants should arrive at Q103 with that second blank already filled in with their previous answer. They should then be able to enter a value in the first blank of Q103 and see the range they've created around their guess in Q102 in the third and fourth blanks.
This was working well when I previewed the survey in the past, but now the second blank in Q103 is no longer populating and thus the whole question is not working properly. Is there something wrong with the underlying javascript in Q103 or Q104? Or has something else about the platform changed? Copying in the text for Q102 and the javascript for Q103 and Q104 below:
Q102: How many questions out of 50 do you think they answered correctly?
Q103 Text: We will now ask you to report your confidence interval around your guess of ${q://QID102/ChoiceNumericEntryValue/1}. Edit the first box below until it reflects a range within which you are very confident the true average score falls:
I am very certain (95% sure) that the true average number of questions answered correctly is within:
Q103 Javascript:
Qualtrics.SurveyEngine.addOnload(function()
{
document.getElementById("QR~QID103~2").disabled = true;
document.getElementById("QR~QID103~3").disabled = true;
document.getElementById("QR~QID103~4").disabled = true;
var val="${q://QID102/ChoiceNumericEntryValue/1}";
document.getElementById("QR~QID103~2").value = val;
setInterval(function(){
var val_1=Number(Number(document.getElementById("QR~QID103~1").value).toFixed(1));
var val_2=Number(Number(document.getElementById("QR~QID103~2").value).toFixed(1));
var val_3=Number(Number(val_2-val_1).toFixed(1));
var val_4=Number(Number(val_1+val_2).toFixed(1));
document.getElementById("QR~QID103~3").value=val_3;
document.getElementById("QR~QID103~4").value=val_4;
}, 100);
});
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
Q104 Javascript:
Qualtrics.SurveyEngine.addOnload(function()
{
setInterval(function(){
var val_main="${q://QID102/ChoiceNumericEntryValue/1}";
jQuery("#QID104").hide();
var val_1=parseInt(document.getElementById("QR~QID103~1").value);
if(val_main<26 && val_1<=val_main)
{
document.getElementById("QR~QID104").value=1;
}
else if(val_main>25 && val_1<=50-val_main)
{
document.getElementById("QR~QID104").value=1;
}
else
{
document.getElementById("QR~QID104").value=0;
}
}, 100);
});
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
Qualtrics survey question custom code
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
