Lets say there is a question called Q1.
What I'd like to have is exactly the 'Q1' as a result (string) of an expression within this very question.
Something like {self.????}
- self.code is used for other purposes
- self.name is not implemented
- self.jsName does not fit into my needs
If you are wondering why I'm asking: I do have a long list of almost similar questions from Q1 to Q15 (more than once) and I am too lazy to change the formulas in 15x10 subquestions containing the number given by the question name (ie 1 to 15)
But if you need to refer to actual SGQA or Question num : {SGQ} or {QID}
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
I have a survey with 100 questions; each user gets asked only 10-15 of them. I'm trying to find a way to create only 1 survey, and then 'extract' a custom survey for each user just by specifying the questions to show in the token table (I have a spreadsheet of users and strings, so all it will take is uploading this into the token field). The problem I'm running into is that I have not yet figured out how to tell the logic statement which question *I am currently on*
My steps:
- Each question is named with a unique identifier (eg Q001 up to q100). This goes into the 'CODE' field
- In the Token table, I created a custom attribute where I listed all of the question IDs to show.
For example, for a specific user, I want the survey to show questions 1,4, and 99
- The question 'code' for the first question is "q001"
- In the token table, the custom Attribute_1 is a string that looks like this: "q001 q004 q099"
- The display logic (in the EM editor) that I am trying to use is as follows:
"Attribute_1 [From token table] Regular expression \b{CODE}\b"
where {CODE} is supposed to be this question's identifier (i.e. q001). (strictly speaking those \b may not be necessary, but that's not important right now)
Essentially I'm looking for a way to use EM to evaluate the following:
If (current question code appears in my token's attribute_1 field) then display the question.
You could bring the token info into a hidden question then set the logic for its matched question to only show if logic q is equal to constant 'q0001'.
You shouldn't have to track which question you are on.
For example, if you made an equation question in the first page of your survey and put {TOKEN:ATTRIBUTE_1} in the question text, what ever is in attribute 1 for that respondent will display in that question but also be stored as an answer. You can then use the question relevance to only show a specific question if this equation question answer equals a specific string.
Under the relevance for the question/questions you want to show based on attribute_1, select this equation question, set it to equals, select 'constant' then enter the exact string that will be in token one of the sample. Now this question will only show if token one is equal to the string of your choice in attribute_1.