Skip to content

Instantly share code, notes, and snippets.

@jnothman
Created April 27, 2021 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnothman/92ea1c2e3bbc7911fe7c025ad438bafe to your computer and use it in GitHub Desktop.
Save jnothman/92ea1c2e3bbc7911fe7c025ad438bafe to your computer and use it in GitHub Desktop.
UserJS script to put newlines in qualtrics reports
// ==UserScript==
// @name Show newlines in Sydney U qualtrics reports
// @version 0.1
// @description try to take over the world!
// @author Joel Nothman
// @match https://sydney.au1.qualtrics.com/CP/Report.php?*
// @icon https://www.google.com/s2/favicons?domain=qualtrics.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
console.log("foo");
var dataElems = document.getElementsByClassName("Data")
for (var i in dataElems) {
if (dataElems[i].parentElement && /Q_TextResponse/.match(dataElems[i].parentElement.getAttribute("class"))) {
dataElems[i].innerHTML = dataElems[i].innerHTML.replace(/\n/g, "<br>")
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment