One option is to export the survey, edit the export file, and reimport the survey into Qualtrics. This method is not well documented in Qualtrics support, but it does work. This help file explains how to export and import a Qualtrics survey as QSF file (i.e., Qualtrics Survey Formatting file).
Thus, the main challenge is to work out how to edit the QSF in order to add the relevant java script 200 times.
The QSF file is in JSON format. Prior to this, I'd heard of, but never had to use JSON format. Perhaps this is typical of Qualtrics users.
By default the QSF file is in a serial form (i.e., it's on one line). I found this online editor helpful for formatting and parsing the hierarchical structure of QSF files.

In general, the structure of QSF files starts with a SurveyEntry
that has general survey specifications. It then has a bunch of SurveyElements
. The first six elements in my example related to general features of the survey. In particular, the first elements represented the blocks and set out the order of questions in the block. After the first six were the questions. Each question include a range of ID type variables followed by the Payload
. The Payload
includes the core attribute-values pairs that control features of the question.
In particular, the javascript for a question is maintained in the QuestionJS
variable. I don't think the order of the attributes in the Payload matters, but I'm not really sure.
So the task is simply to add some code like this inside the Payload
attribute of each question.
"QuestionJS":"Qualtrics.SurveyEngine.addOnload(function()\n{\n var that = this;\n this.questionclick = function(event,element){\n if (element.type == 'radio') {\n that.clickNextButton();\n }\n }\n\n\n});",
Presumably, there are better ways of editing json scripts that make better use of the data structure, but it should be possible to do a simple find and replace. For example, if all your questions are of type multiple choice, you could do something like
Find:
"QuestionType":"MC",
Replace
"QuestionType":"MC","QuestionJS":"Qualtrics.SurveyEngine.addOnload(function()\n{\n var that = this;\n this.questionclick = function(event,element){\n if (element.type == 'radio') {\n that.clickNextButton();\n }\n }\n\n\n});",
This idea could be extended to other occasions where you want to add a particular attribute to a set of questions.