I have been trying to follow tutorial 32, specifically the second part - where I am trying to use the answers from the earlier part of the survey (Revealed preference), and trying to increase that by a defined % in the Stated Preference survey.
I created the derived equations for the initial response, and then used the following code from the tutorial (tailored to how the initial derived equation was labelled): $plus20_gp3
While I get the code to appear in the same way as it does on the tutorial, I’ve not been able to get it working. Anyone have any experience for this?
The code needs to be ‘marked up’ so that the renderer knows to evaluate it rather than just echo it back.
In SurveyEngine anywhere you mark up content with the ‘expression’ class it will be evaluated.
Review the tutorials on expressions to see this in detail.
Briefly tho. In any editor select code view (the </> button)
If you enter in <span class='expression'>2+3</span>
This will be replaced with the whatever is between the span markups - in this case ‘5’
If you have variables - do the same - so in your case
click codeview (</>)
enter in <span class='expression'>$plus20_gp3</span>
Then whatever the current value of $plus20_gp3 will rendered out.