Actions

Difference between revisions of "SGQA identifier"

From LimeSurvey Manual

(No difference)

Revision as of 16:51, 19 May 2009

Hint: This page describes how you can find out an SQGA identifier. For information how to use it please refer to the page Adding a question.

General Description

The SGQA (Survey/Group/Question/Answer) identifier is a shortcut to the answer of a question. Every survey, group and question you are creating gets a unique number assigned in your database. You can see this number in the admin interface in the title of the survey, group and question bar.

SGQA.png

To determine the SGQA identifier, you have to put these numbers together with the letter 'X' in between.

Note: Always use capital letters ("X" instead of "x")!

Identifier for Single Choice Questions

For example: Survey has ID 1, Group has ID 6, Question has ID 12. Your identifier for a single choice question would look like this:

1X6X12

Identifier for Single Choice Questions using Label Sets

Since it is a single choice question using a label set the particular answer from the label set must be identified too. Just add the code of that label without an X. For example: Survey has ID 1, Group has ID 6, Question has ID 12. The particular label has code 'lab1'

Your identifier for a Single Choice question answer would look like this:

1X6X12lab1

Identifier for Multiple Choice Questions

Since it is a multiple choice question the particular answer must be identified too. Just add the code of that answer without an X. For example: Survey has ID 1, Group has ID 6, Question has ID 12. The particular answer has code 'ber1'.

Your identifier for this multiple choice question answer would look like this:

1X6X12ber1

Identifier for "Array (Multi Flexible)" text or number Questions

Since it is a combined array question the particular answer within the cell must be identified too. Add the answer code of the row without an X, then append the underscore char and finally add the label code that indentify the column. For example: Survey has ID 1, Group has ID 6, Question has ID 12. The particular answer has code 'ber1', and the column is identified by the label with code 'lab1'

Your identifier for this Array (Multi Flexible) 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.