Qualtrics:Show All Questions

Show All Questions on Qualtrics (use in edit mode of survey)

Από την 13/07/2016. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name Qualtrics:Show All Questions
// @description Show All Questions on Qualtrics (use in edit mode of survey)
// @include https://*.qualtrics.com/*Edit*
// @grant none
// @version 0.0.2.20170713
// @namespace https://greasyfork.org/users/4252
// ==/UserScript==
//Note: Only been tested in firefox
jQuery(document).ready(function(){
    if (jQuery(".EditSection").length){ //if in edit mode
        var div = jQuery("<div></div>").attr("href","#").addClass('btn btn-primary').click(OutputQuestions).appendTo("#ToolbarContainer div.right");
        jQuery("<span></span>").addClass('icon toolbar-icon-open').appendTo(div);
        jQuery("<span></span>").text("Output Questions").appendTo(div);
    }
});

function OutputQuestions() {

    var Questions = jQuery(".QuestionText").not("#TrashArea .QuestionText");

    var output = jQuery("<div></div>");
    jQuery("<button></button>").attr("id","button").attr("type","button").attr("onclick","ShowHideNAN()").text("Show/Hide Questions without numbers").appendTo(output);
    var table = jQuery("<table></table>").appendTo(output);
    jQuery.each(Questions, function(index, Question) {
        var cell = jQuery("<td></td>").html(Question.innerHTML);
        var row = jQuery("<tr></tr>").append(cell).appendTo(table);
        if (isNaN(Question.textContent.trim().substr(0, 1))) { //if it doesn't start with a number then hide it
            row.addClass("hidden");
        }
    });

    var myWindow = window.open("", "_blank", "scrollbars=yes, menubar=yes");

    var newStyle = jQuery("<style></style>").html(".hidden{ display:none;} table, td{border:1px solid black;display:block;}");
    myWindow.document.head.appendChild(newStyle[0]);

    var newScript = jQuery("<script></script>").html('function ShowHideNAN() { rule = document.styleSheets[0].cssRules[0]; if (rule.style.display == "none") rule.style.display = "block"; else rule.style.display = "none"; }');
    myWindow.document.head.appendChild(newScript[0]);

    myWindow.document.body.appendChild(output[0]);
}