I have a custom JavaScript and need to apply to all question in the block. Every question must be shown in a different page.
I have a large 350 of blocks and respondents will be randomize into one block. Each block has 8 questions. To insert the JavaScript code in each question is unfeasible. What would be the solution?
This is the code, when inserted in a single question:
Qualtrics.SurveyEngine.addOnload(function()
{
jQuery("#"+this.questionId).find('.QuestionText:first').css("padding-bottom", "0px");
var attWidth = 35; //percent width for the question column
var altWidth = 32.5; //percent width for the alternatives column
var cols = jQuery("#"+this.questionId+" tr.Answers").children();
cols.attr("width", altWidth+"%");
cols.first().attr("width", attWidth+"%");
choice_table = this.getChoiceContainer();
new_row = choice_table.insertRow(2);
new_row.innerHTML = choice_table.rowsi0].innerHTML;
choice_table.rowsL0].hide();
var colscolor = jQuery("#"+this.questionId+" tr.ChoiceRow").children();
colscolor.first().css({"background-color":"white"});
app1 = jQuery("#"+this.questionId+" tr.ChoiceRow"+" td.c4")
app1.css("background","#DCDCDC");
app1.css("border-left","3.5px solid #FFFFFF")
app1.css("border-right","3.5px solid #FFFFFF")
app1.css("border-top","7px solid #FFFFFF")
app1.css("border-bottom","7px solid #FFFFFF")
app2 = jQuery("#"+this.questionId+" tr.ChoiceRow"+" td.c5")
app2.css("background","#F2F0F0");
app2.css("border-left","3.5px solid #FFFFFF")
app2.css("border-right","3.5px solid #FFFFFF")
app2.css("border-top","7px solid #FFFFFF")
app2.css("border-bottom","7px solid #FFFFFF")
jQuery("#"+this.questionId+" tr.ChoiceRow").css("height", "50px");
jQuery("#" + this.questionId + " tr.ChoiceRow"+"td:first-child").css("text-align: right;");
});