Hi everyone, I am building up a survey for a time-use diary analysis, so I have several blocks of questions about what respondents did during day. For every activity they insert (one different block everytime they pass on to a new activity), I ask them the timing, so that at each block I have the question "untill which time did you do last activity the respondent indicated he/she was doing?" With piped text everything works fine untill there, but I would like to set a costum validation, i.e. I would like to impose the timing of the new activity to be after the time they indicated as the ending time of the previous activity. Anyway, when I ask qualtrics for a custom validation, I am propmted with this screen
!
where I cant impose any reference to other questions and I have to select a choice from the options I put myself as possible answer to the question (i.e possible hourse of the day). Instead I would like to have:
Validation will pass if the following condition is met:
IF "Q37 ECC.." "*SELECTED CHOICE OF Q37*" is greater or equal to "*the time selected as the ending one of the preceding activity*"
By the way, it is the same problem I have if I try to put a display logic: instead of having a square starting with an "IF"+*little square indicating the selected question* I only have the little square indicating the selected question, as you can see by the screen below:
!
I have no clue about why I cant impose the validation I would like (from the forum it seems it is something I should be able to do without any java vel similia, anyway any solution is accepetd!).
Thank you in advance!
Page 1 / 1
On custom validation, if you want to compare greater than or equal to a previous question then Q37 has to be a text entry question and you have to pipe in the value from the previous text entry question you want to compare it to (e.g. ${q://QID1/ChoiceTextEntryValue}. Since they are times, you need to make sure they are in a format that they can be compared.
As for Display Logic, the "IF" is implied.
As for Display Logic, the "IF" is implied.
Okay TomG, thank you for your reply. So, I changed the question type of Q37 into "Text Entry" (with "Text type:single line"). Anyway, I need at this point to have a content validation forcing people to put only times (particularly I would like them to have the complete 24-h format and only slots of 10 minuts-I mean I dont want them to fill in with 10:13 or 10:28 but only 10:10, 10:20, 10:30 and so on), but among the varius options for content validation there is just "date" and not "time". May you help me with this? Thanks a lot!!
@C882,
If I were you, I would use flatpicker.js with noCalendar, enableTime, and minuteIncrement options for time inputs.
If I were you, I would use flatpicker.js with noCalendar, enableTime, and minuteIncrement options for time inputs.
@TomG
Thank you for your suggestions. Anyway, I am not able to find documentation on the internet to make this thing work. For example, if I write in the Javascript (having "textentry" as Question Type):
Qualtrics.SurveyEngine.addOnload(function()
{
jQuery("#"+this.questionId+" .InputText").flatpickr({enableTime: true, noCalendar: true, dateFormat: "H:i"});
});
nothing happens when I preview the question. I tried to add this to the rich content editor of the question:
!
but actually this just made a flatpicker to show up in the question space rather that in the answer one, so it is not what I needed (and I further wasnt able to find a way to put minutes increments of only 10 minutes each, but this is a secondary issue). May you explain me how I am supposed to do for havong my flatpicker work? Thanks a lot
Thank you for your suggestions. Anyway, I am not able to find documentation on the internet to make this thing work. For example, if I write in the Javascript (having "textentry" as Question Type):
Qualtrics.SurveyEngine.addOnload(function()
{
jQuery("#"+this.questionId+" .InputText").flatpickr({enableTime: true, noCalendar: true, dateFormat: "H:i"});
});
nothing happens when I preview the question. I tried to add this to the rich content editor of the question:
!
but actually this just made a flatpicker to show up in the question space rather that in the answer one, so it is not what I needed (and I further wasnt able to find a way to put minutes increments of only 10 minutes each, but this is a secondary issue). May you explain me how I am supposed to do for havong my flatpicker work? Thanks a lot
@C882,
What you added to your question text is an html5 time input (that Qualtrics won't record because it doesn't know about it).
For flatpickr you need to load the Flatpickr JavaScript and CSS in the header. This thread may help you:
https://www.qualtrics.com/community/discussion/2146/how-to-attach-flatpickr-to-a-text-input.
For your flatpickr command you also need to add the option `minuteIncrement:10`.
What you added to your question text is an html5 time input (that Qualtrics won't record because it doesn't know about it).
For flatpickr you need to load the Flatpickr JavaScript and CSS in the header. This thread may help you:
https://www.qualtrics.com/community/discussion/2146/how-to-attach-flatpickr-to-a-text-input.
For your flatpickr command you also need to add the option `minuteIncrement:10`.
Thank you so much TomG! it now works 😃
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.