None option added to carried forward statements | XM Community
Skip to main content

Hello, 

I have a question where I want to carry forward statements from the previous matrix question and also add a “none of the above” option anchored at end. The previous question’s statements are randomized, and I want the statements to present in the same order as the previous question.

 

The problem is the “none of the above” option shows up at the top of the list and I can’t figure out how to move it the bottom (using move down did not move it). I can’t use advanced randomization because then the order of the statements will be different from the previous questions. 

 

I could add the “none of the above” option to the previous matrix question, hide it, and then carry forward all statements displayed and hidden, but I would like to do something less messy.

 

All suggestions are appreciated! Thank you!  

 

Assuming the question where you are carry forwarding is a multiple choice question; use the below script:

jQuery("#"+this.questionId+" .Selection:first").appendTo("#"+this.questionId+" .Selection:last");

 


Create one hidden question Q2hidden after Q1 with carray forward display all visible options of Q1 into it. Then punch all the selected options of Q1 along with none via JS in Q2hidden. Then carryforward selected options of Q2hidden into main Q2.


@Shashi Thanks for your reply!! The JavaScript didn’t work for me. None of the above was still the first choice. Is there anything I should check?  


Shashi’s JavaScript is working on my end to move the None of the Above to the bottom of the Carried Forward list. Is the JavaScript of the Multiple Choice question set up like the below? Are you using Flat, Modern, or Classic layout?

Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
jQuery("#"+this.questionId+" .Selection:first").appendTo("#"+this.questionId+" .Selection:last");
});

 


Hi @Tom_1842. Thank you! This JavaScript now works except for about half a second I can see the none of the above option at the top before it moves the the bottom. Is there a way to fix this? Thanks again! 


The JavaScript only runs when the page is ready, so I don't think there is a way to avoid the brief flash that takes place while the code runs. The way around this is closer to the approach you mentioned in your post where the page is drawn with None of the above already at the bottom: Add 'None of the above’ to the previous matrix question, Hide it with Display Logic (True - False = False), and then Carry Forward all statements displayed and hidden to the following question.


You can use addOnload() instead of addOnReady() and movement of the ‘None of these’ choice will happen a tad sooner. We use this technique quite often, and it’s never an issue. There are other techniques to hide the question until after the JS does its thing, but I don’t think it is worth the trouble for this.

BTW, I have a more robust function that does this called carryForwardPlusNA. It automatically moves all non-carryforward choices (i.e., multiple) to the bottom. It also handles carryforwards of carryforwards.


Leave a Reply