Solved
Increment embeded field data by 1 upon question display
Hello,
I'm wandering how can I increment by 1 a numeric embedded data filed when a given questions is displayed?
In my survey I'm using attention checks for some of the questionnaires. These are simple tasks - like "please choose 4 as your answer".
If a particiapnt fails to pick the write answer I will diplay him a warning (text type question) asking him to be more attentive.
What I would like to do, is to keep a live track on how many times a warning was shown so that I can eventually set a end-of-survey if those warinings where shown for example 3 times.
Is there an easy way to do it, for someone not fluent in JS?
Thank you
Best answer by Pete_L
I want to be sure I understand what's happening.
Q1 - Respondent picks wrong answer and clicks submit/next
Q1_WARNING - Displays if respondent clicked wrong answer at Q1. Click next to go to Q2
Q2 - Respondent picks wrong answer and clicks submit/next
Q2_WARNING - Displays if respondent clicked wrong answer at Q2. Click next to go to Q3
Etc...
Is this correct?
If respondents are not able to back up, then you could do onPageSubmit to increment the embedded data on the warning page itself. Something like this on the warning pages:
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
var warns = "${e://Field/warns}";
var plusone = warns+1;
Qualtrics.SurveyEngine.setEmbeddedData("warns", plusone);
});
This will increment your embedded data by +1 whenever they click NEXT on those warning screens. If you're letting people back up then I suggest adding scoring your questions as right/wrong, adding it up at the end, and then displaying what you need to do at that point.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

Any help would be appreciated.