Identifiants SGQA
From LimeSurvey Manual
Description générale
L'identifiant SGQA (pour Survey/Group/Question/Answer en français, Questionnaire/Groupe/Question/Réponse mais seule la notation anglaise est interprétée par LimeSurvey) est un raccourci vers une réponse à une question. Chaque questionnaire, chaque groupe et chaque question que vous créez se voit attribuer un code unique dans la base de données. Vous pouvez retrouver ces nombres (appelés aussi xID) dans l'écran d'administration dans les barres de titres de questionnaire, de groupe et de question.
Pour déterminer l'identifiant SGQA vous devez rassembler ces nombres en les séparant par la lettre "X".
Use editor to add placeholder
The integrated editor has a feature to select the placeholder for a certain question. The icon is called "LimeSurvey replacement fields". This feature always lists questions of previous survey pages only, so it depends on the survey mode.
Identifiant pour une question à choix unique :
Par exemple, le questionnaire a l'ID 1, le groupe a l'ID 6 et la question a l'ID 12. L'identifiant pour ce genre de question à choix unique doit ressembler à quelque chose comme ceci :
1X6X12
Identifiant pour une question à choix unique utilisant un jeu d'étiquettes
Puisque cela reste une question à choix unique qui utilise des étiquettes pour les réponses, cette réponse particulière doit elle-aussi être identifiée. Pour cela, ajoutez simplement le code de cette étiquette sans le "X". Par exemple, questionnaire d'ID 1, groupe d'ID 6, question d'ID 12. La réponse qui nous intéresse possède le code "lab1".
L'identifiant ressemblera donc à ça~hs~:
1X6X12lab1
Identifiant pour une question à choix multiples
Comme il s'agit d'une question à choix multiples, la réponse recherchée doit aussi être identifiée. Ajoutez simplement le code de cette réponse sans le "X".
Par exemple, questionnaire d'ID 1, groupe dD 6, question d'ID 12. La réponse recherchée possède le code "ber1".
L'identifiant ressemblera donc à ça~hs~:
1X6X12ber1
Identifier for Array (Text) or Array (Number) Questions
Since it is a combined array question the particular answer within the cell must be identified too. Add the subquestion code of the row without an X, then append the underscore char and finally add the subquestion code that indentifies the column. For example: Survey has ID 1, Group has ID 6, Question has ID 12. The particular subquestion has code 'ber1', and the column is identified by the subquestion with code 'lab1'
Your identifier for this "Array (Text)" question answer would look like this:
1X6X12ber1_lab1
Uses of the SGQA identifier
The SGQA identifier can be used to load the answers to previously saved questions into the question text of later questions. (See Adding a question - Information from previous answers)
It can also be used in the query URL of a survey to "prefill" answers to a survey. eg: for SGQA 1X6X121ab1, your query URL could include "&1X6X121ab1=Y" to prefill that answer with a "Y". (See workarounds -> Prefilling survey answers using the survey URL)
The SGQA identifier is also the field name where the data for each question is stored in the database survey responses table.
Dynamically reference the SGQ identifier
Some people may find a need to reference a question dynamically. For instance, if you would like to hide the input text field of a short text answer. You can now do this (as of SVN build 9755) by using the {SGQ} identifier. LimeSurvey will replace the {SGQ} with the full Id of that question, ex: 3583X84X249