Hello again:
I'm making a bit of progress, but am still struggling with the Qualtrics Variable Names.
Here is my updated code:
Qualtrics.SurveyEngine.addOnSubmit(function()
{
function dateproduce(x) {
const myArray1 = x.split(".")
var y1 = myArray1[1];
var m1 = myArray1[0]-1;
if(m1==-1) {
m1 = 12;
y1 = y1 - 1;
}
var dt1 = new Date(y1,m1);
return dt1;
}
var st = "${q://QID3%231/ChoiceTextEntryValue/1/1}";
console.log(st)
let dta1 = dateproduce(st);
var et = "${q://QID3%232/ChoiceTextEntryValue/1/1}";
let dta2 = dateproduce(et);
if(dta2 < dta1)
Qualtrics.SurveyEngine.setEmbeddedData('FinalResponse',"incorrect");
else
Qualtrics.SurveyEngine.setEmbeddedData('FinalResponse',"correct");
});
```
The FinalResponse is not getting any value.
Any suggestions much appreciated.
Sincerely,
Erin
Question
More about dates and JavaScript
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
