TOPIC: Change question text based on a previous answer

How can I change the text of a question dynamically based on the answer of a previous question? I have a question that should be phrased in one of two possible ways, depending on how the user answered a previous question.

Can I maybe use a replacement field and somehow set up the value for that replacement field depending on a previous answer?

I believe I have found the answer to my own question: You have to use javascript inside the question text to dynamically set the question text where the javascript will use a previous question answer token embedded inside the actual javascript.

Steps:
1. Go to global settings and set the setting 'XSS-Filter' to 'off' to allow javascript

2. Edit the question text, position the cursor at say the end of your question text and click on the last [Insert/Edit Limesurvey replacement field] button to select the answer of a previous question that you wish to use in the conditional logic. It will insert something like {INSERTANS:87647X2X17} which will be replaced at runtime with the actual text from that answer

3. Now click on the first [Toggle fullscreen...] toolbar button

4. When the big editor comes up, click on the [Source] button to show the HTML source

5. Add a DIV tag somewhere within your text that you want to have replaced dynamically at rune time, e.g. <DIV id="dynamicText"></DIV>

7. If you now close the source editor and save everything and preview this question you will see the DIV tag being replace by the "XXX-Dynamic Text-XXX" above

8. You can now move the {INSERTANS:87647X2X17} token into the javascript to use in conditional logic. Here is the final sample version of the source for my question (puts the two possible versions of text in 2 div tags and then toggles the visibility of those tags based on the previous question answer):