Prevent response recording on the first day? | XM Community
Skip to main content
Hi everyone,



I have a unique situation that I'm hoping has a viable solution. I am running a survey that has 1 single question (out of ~40) that it is imperative that the user come back the next day to answer, and only the next day. Not the same day, and not two days after.



My desired flow is:

* Day 1: users take 39 out of 40 questions, but are prevented from submitting a response

* Day 2: users take the 40th question and any unanswered questions from Day 1. If all 40 questions are taken, the response is submitted.

* Day 5: if the user hasn't returned to the survey after Day 1 or 2, the response is recorded.



I have created the embedded data fields to record what Day 1 and Day 2 should be, and the logic to only display Question 40 on Day 2.



My question boils down to this:

_How can I prevent the user from reaching the end of the survey on Day 1, so that the response isn't recorded until they have had a chance to return on Day 2?_



Thanks,

Aaron
Add a JavaScript to Q40 that disables and/or hides the NextButton unless it is day 2.
There are any number of ways to do this.



One that comes to mind inlcudes:

* Branching logic based on the day

* Table of contents

* Using JavaScript to hide the next button on a specific page



Process:

* Create at least 2 blocks. 1 Block for Q1-Q39 and 1 Block for Q40 only.

* Use display logic to only show Q40 block on days 2,3,4 or 5 (not sure how you are creating these fields, but I assume it is some sort of embedded data).

* Write descriptive text on the page AFTER Q39 that gives instructions to return the next day. Hide the next button on this page. - This is important as it keeps the person from completing the survey, but still records Q1-Q39.

* Include a table of contents page for ease of navigating around the questions/blocks.
Thanks! Will try the Javascript approach.
I put the following JS into the final Day 1 question (Q39) and it worked when tested on Day 2:



Qualtrics.SurveyEngine.addOnload(function()

{

/*Place your JavaScript here to run when the page loads*/

this.hideNextButton();

var today = "${date://CurrentDate/SL}"

var Day1 = "${e://Field/LPMDate}"

if (today == Day1) {

this.clickNextButton();

}

});



`LPMDate` is set when the user answers the relevant question about whether they should come back on Day 2. The format is identical to the format in the `today` var.



Thanks everyone for your assistance.
> @TomG said:

> Add a JavaScript to Q40 that disables and/or hides the NextButton unless it is day 2.



Thanks - in my use case, I needed to shield Q40 until day 2, so the JavaScript had to be placed in Q39 to prevent advancement.

Leave a Reply