How to use attributes defined in the token table to fill in questions.
* Go to global settings and set the setting 'XSS-Filter' to 'off'.
* Add a new question
* In the question field, expande the tool bar by clicking the upper grey bar to get to the source code editor:
* Click on the button LimeFitWin to get full screen mode with even more buttons in the tool bar:
* Click on the button Source
2. You need to be able to load info in the token table. I just exported an existing table to understand the structure, than used CONCAT in excel to create the text for a CSV, which I pasted in Notepad to save as .CSV .
In recent versions of Limesurvey, you can create unlimited token fields. These have 'nicknames' and internal names. I could only make it work if i used the Token table editor to create the needed fields, then import the CSV file. Extra token fields have to be referred to in this form TOKEN:ATTRIBUTE_X , not using their nickname.
a. To fill in an open text field question I pasted this script into the source code of the question text:
Where 74931 is the survey ID, 156 the group ID and 880 the question ID. Of course, you can use any token. For example TOKEN:ATTRIBUTE_45 .
b. For a single choice question, I used the script below. Here the IF statement refers to a certain individual property, which in this case is a text. It's interesting to know that the syntax does not change if your attribute is text or integer.
I use X1 through X7 to define answer options. You choose this yourself when defining answer option codes. Be careful, as this info is case sensitive.
c. This syntax would work just as well for a multi answer question, if it weren't that of course you cannot define more than one answer in just one attribute. Hence you need at least as much attribute columns in your token table as the user with the biggest number of crossed answer options had in your original table.
In this case, attribute 3 through 5 contain the old answers. For example 21 could refer to apples, 22 to pears. The answer code for 'apples' is X21, for 'pears' X22. So if a person has the value 21 on either of the three attributes, answer option X21 will be marked.