Can you have branch/skip logic based on if a page was autoadvanced (i.e. timed out) | XM Community
Question

Can you have branch/skip logic based on if a page was autoadvanced (i.e. timed out)

  • 24 January 2019
  • 5 replies
  • 17 views

Userlevel 2
Badge +8
I am currently working on a research project in which participants must type an small paragraph (minimum of 400 characters including spaces) without using certain letters (e.g. you cannot use the letter C, therefore you cannot use any word that has the letter C in it). Participants must type a minimum of 400 characters before the page will allow them to submit (custom validation). However, as this is a paid survey, and participants might become frustrated/fatigued over time if they cannot meet the minimum threshold of characters, I am concerned they will drop out early and not finish the survey. A solution (in my mind) would be to incorporate the timing feature to autoadvance all participants after four minutes of trying the exercise.

I wouldn't want to prime participants to sit and wait for the page to advance rather than doing the exercise, therefore I would not tell them the page would advance. However, IF the page did advance, I would need to tell participants what happened.

That is, some participants may indeed complete the exercise in less than the autoadvance feature (i.e. they type their 400 characters in less than four minutes), therefore they would be able to submit normally through the character validation. However, some participants would "time-out" and be autoadvanced. For the latter group, I would want to branch them to a page detailing what happened (e.g. do not worry, you were autoadvanced in order to stay true to the advertised time of the survey, please click next to continue).

So, I want to know if it is possible to somehow use branch/skip/display logic to:

1) display a clarification message to ONLY participants that are autoadvanced, and not those that complete the exercise normally (i.e. character validation)

5 replies

Userlevel 7
Badge +23
I have a question at this point. What if someone is still writing when the page autoadvances? Another thing is how auto-advancing works with custom validation? I don't think you can have both, can you?
Userlevel 2
Badge +8
In regard to your first question, the actual content of the message is not important, so if someone is still typing or "hasn't finished their sentence" it is okay. As it is important that the just stick to the rules of their task for approximately four minutes.

To answer your second question, you can have both a time and character validation by using custom validation settings.

1) create the time question in your block/page
2) set the auto-advance time to what you want
3) create the question that will be timed
4) custom validation - select the Time question from Step 1 - select the "page submit" as the point of validation - select "is greater than or equal to" as the parameter - put the amount of time in seconds (e.g. 240) in the box provided
5) add an element of custom validation by pressing the plus sign
6) select the question you created in Step 3 - the question as the point of validation - then select "matches Regex as the parameter" - you then insert a code that denotes that character length in the text box must be X, or between X and Y.

The code is:
^\\w{0,10}$ # maximum of 10 characters.
^\\w{5,}$ # requires more than 4 characters.
^\\w{5,10}$ # requires 5 and 10 characters.


However, after getting this point the issue I am now having is that if you fail the character range validation in the custom range (i.e. click submit with <400 characters) this resets the page timer, resetting the auto-advance feature. Fortunately, if you attempt to manually submit after the denoted time in step four (e.g. 240 seconds) the program will allow it.

So does anyone know how to make sure that the timer doesn't reset?
Userlevel 7
Badge +23
@wpm24 That is what i meant, that the autoadvance will not work if you have a custom validation on the page
Userlevel 2
Badge +8
@MsIreen ahh, I now understand what you are saying, sorry for that.

An edit to the step by step process above, you need to add the second point of validation as an "OR" validation. This will allow either the page to advance automatically, or have participants be able to advance when they complete the character count.

Where I think we both are agreeing is the issue is, is when a participants FAILS one form of the validation, in this particular instance, attempting to submit below the required character count, this refreshes the whole page (rather than just having a red x over the submission or an error message), causing the timer to refresh, and thus the auto-advance to refresh again.

Does anyone know how to prevent this from happening? That is, how do you prevent the timer from restarting, simply from the page refreshing?
Userlevel 5
Badge +6
Hi,
regarding branching based on whether the page was auto-advanced: You could define a new embedded field in the survey flow with some value (e.g.: "NO"). In case the page was auto-advanced, you can change it to another value (e.g.: "YES") using a function in your timer. Then you can do the branching using this embedded field.
And regarding the problem with the validation: Instead of the validation, you check your text each time user releases a key and enable the Next button only if the text meets your conditions.

So the whole code could look somehow like this:

Qualtrics.SurveyEngine.addOnload(function()
{
this.disableNextButton();

var ID = this.getQuestionInfo().QuestionID;
var that = this;

var responseTextField;
var A;

document.addEventListener("keyup", zOnChange);

setTimeout(function(){
that.clickNextButton();
Qualtrics.SurveyEngine.setEmbeddedData("auto", "YES");
}, 10000);

function zOnChange()
{
responseTextField = document.getElementById('QR~' + ID);
A = responseTextField.value;
if(A.length >= 5 && !A.includes("c") && !A.includes("C") ) {this.enableNextButton();}
}

});

Leave a Reply