From TSG Doc
Jump to navigation Jump to search


Qualtrics is a web service to which the Faculty of Social Sciences has a subscription for its employees and students. Using this service is allowed under General Data Protection Regulation (GDPR) since the Faculty and the Supplier have a data processing agreement. Usage is only allowed for those purposes where on campus storage of data is not considered necessary.

The subscription to Qualtrics includes support. Please use the Qualtrics help > contact support function to contact the Support Center.

Support limits

Qualtrics support does not include help with custom code (HTML, CSS, JavaScript): Qualtrics Support does not offer assistance or consultation on custom coding Contact the Technical Support Group if you need help with this.


To add custom JavaScript, click the gear icon (Advanced Question Options) next to a question and click Add JavaScript... Here are two examples:

Check for leaving page

var leaveDates = []
function handleLeave(event) {
    leaveDates.push(new Date().toISOString())
    alert("Please don't leave the window")
    document.getElementById("Page").addEventListener("mouseleave", handleLeave, false)

    document.getElementById("Page").removeEventListener("mouseleave", handleLeave, false)
    Qualtrics.SurveyEngine.setEmbeddedData("date", leaveDates.join(","))

prevent cutting and pasting

Use the following code to prevent cutting and pasting from and to text fields, expect people to become angry if you use this.

    /* Place your JavaScript here to run when the page is fully displayed */
    ee = document.getElementsByClassName("InputText")
    for(e of ee){
        e.onpaste=function(){ return false }
        e.oncut=function(){ return false }