Replacement tags

From Catglobe Wiki
Jump to: navigation, search

Replacement tags

There exists a tag system which makes it possible for us, to insert replacement values directly in texts (question, subquestion, answer option) without using text replacement conditions. These tags are replaced by the answer the respondent gave in an earlier question of the same questionnaire.

An example could be:

”You have answered that your favorite soft drink is {{FavoriteSoftdrink.Text}}.”

Which could result in a text like:

”You have answered that your favorite soft drink is Cherry Coke”

The logic for text replacement tags are as follows:

Q_Label should in the following be replaced by the question that replacement texts are to be collected from. How the replacement tags are to be used depends on which question type the tag refers to. Examples of all are presented below:

Single

{{Q_label}}: is replaced with the text of the respondent's chosen answer option

{{Q_label.value}}: is replaced with the value of the respondent's chosen answer option

{{Q_label.text}}: is replaced with the text of the respondent's chosen answer option

{{Q_label.openvalue}}: is replaced with the open text part of the respondent's chosen answer option (if such a value exists)

{{Q_label.index}}: is replaced with the index of the respondent's chosen answer option

Multi

{{Q_label[AnswerOption_index]}}: is replaced with the text of the respondent's chosen answer option

{{Q_label[AnswerOption_index].value}}: is replaced with the value of the respondent's chosen answer option

{{Q_label[AnswerOption_index].text}}: is replaced with the text of the respondent's chosen answer option

{{Q_label[AnswerOption_index].openvalue}}: is replaced with the open text part of the respondent's chosen answer option (if such a value exists)

{{Q_label[AnswerOption_index].index}}: is replaced with the index of the respondent's chosen answer option

Single Grid

{{Q_label[grid_index]}}: is replaced with the text of the respondent's chosen answer option on the specified sub question

{{Q_label[grid_index].value}}: is replaced with the value of the respondent's chosen answer option on the specified sub question

{{Q_label[grid_index].text}}: is replaced with the text of the respondent's chosen answer option on the specified sub question

{{Q_label[grid_index].index}}: is replaced with the index of the respondent's chosen answer option on the specified sub question

** grid_index should be replaced with the index of the subquestion the users wants the text replacement based on. The first subquestion is always indexed with 0, next one is 1 and so on.

Multi Grid

{{Q_label[grid_index][AnswerOption_index]}}: is replaced with the text of the respondent's chosen answer option on the specified sub question

{{Q_label[grid_index][AnswerOption_index].value}}: is replaced with the value of the respondent's chosen answer option on the specified sub question

{{Q_label[grid_index][AnswerOption_index].text}}: is replaced with the text of the respondent's chosen answer option on the specified sub question

{{Q_label[grid_index][AnswerOption_index].index}}: is replaced with the index of the respondent's chosen answer option on the specified sub question

** grid_index should be replaced with the index of the subquestion the users wants the text replacement based on. The first subquestion is always indexed with 0, next one is 1 and so on.

Text, Open, Multimedia, Scale, Numeric

{{Q_label}}: is replaced with the respondent's actual answer

Open - closed answer

{{Q_label[option_index]}}: return true/false, get status checked of closed answer options

Scale Grid, Text Grid

{{Q_label[grid_index]}}: is replaced with the respondent's actual answer to the specified sub question

CGScript

{{Script;}}: CGScript can also be run in text by placing them in the {{}} brackets.