Welcome, Guest
Username: Password: Remember me

TOPIC: How to get the name (Code) of a question

How to get the name (Code) of a question 1 month 3 weeks ago #110559

  • orvil
  • orvil's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 104
  • Thank you received: 4
  • Karma: 4
Hi there,

does anyone know a solution for this:

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)

THX for all your ideas
Best regards/Beste Grüße,
O. Villani
Last Edit: 1 month 3 weeks ago by orvil.
The administrator has disabled public write access.

How to get the name (Code) of a question 1 month 2 weeks ago #110605

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6256
  • Thank you received: 799
  • Karma: 239
Don't think we have a way in EM,

But if you need to refer to actual SGQA or Question num : {SGQ} or {QID}
The administrator has disabled public write access.

How to get the name (Code) of a question 1 month 1 week ago #110850

  • Ari
  • Ari's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
I'm hoping to get clarity on this topic.

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.

Is this possible?
The administrator has disabled public write access.

How to get the name (Code) of a question 1 month 1 week ago #110868

  • Bigred
  • Bigred's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Thank you received: 5
  • Karma: 1
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'.
The administrator has disabled public write access.

How to get the name (Code) of a question 1 month 1 week ago #110869

  • Ari
  • Ari's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
This sounds promising. Can you please elaborate?
The administrator has disabled public write access.

How to get the name (Code) of a question 1 month 1 week ago #110870

  • Ari
  • Ari's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
The part I still have not figured out is how to identify the current question code so that I can compare it (to the token, constant, etc).

Thanks again.
Ari
The administrator has disabled public write access.

How to get the name (Code) of a question 1 month 1 week ago #110871

  • Bigred
  • Bigred's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Thank you received: 5
  • Karma: 1
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.
The administrator has disabled public write access.

How to get the name (Code) of a question 1 month 1 week ago #110872

  • Bigred
  • Bigred's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Thank you received: 5
  • Karma: 1
You can actually just look directly at the sample so no need for the hidden question. Check out question relevance in the manual.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.126 seconds
Donation Image