Hey, I am trying to find a custom code that would allow me to hide/ exclude a particular block from response summary? Can you help me with a custom JS code?
Add this EVERY question in the block:
Qualtrics.SurveyEngine.addOnload(function () {
let qc = this.questionContainer;
if (document.querySelector("#EndOfSurvey")) {
qc.style.display = "none";
}
});
https://www.qualtrics.com/community/discussion/comment/38320#Comment_38320Hello ahmedA thank you for your response. Code works like a charm. However, it seems to work on all questions in a certain block but not in the other block. Anything that I need to be mindful of while using this code?
UPDATE: after a lot of hit and trial, I realized that this code does not work for questions on the last page. My last block had no page breaks so code didnt work on any of those questions, but when I added a page break before the last question it has magically started to work on all questions except last.
ahmedA is it something you can look at? Again thank you for helping me with this lovely solution.
I don't know why this is happening. The code works at the question level, so irrespective of how many questions you have on the page/block, it should work.
It basically checks for the "EndOfSurvey" element, which ONLY comes when they are viewing the report.
Perhaps you could look at the implementation once agian.
Updating this response, as it appears that something has changed at the End of Survey page:
Add this to every question you want to hide from the response summary.
Qualtrics.SurveyEngine.addOnReady(function () {
const quest = this;
if (document.querySelector("#EndOfSurvey")) {
document.querySelector("#" + quest.questionId).style.display = "none";
}
});
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.