- Posts: 55
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
{ $a = 5 } // nothing is printed here { $b = 6 } // nothing is printed here { $c = $a + $b } // nothing is printed here { print($c) } // "11" is printed in the mail.
coeneisma wrote: Maybe I don't understand the question correct, but you can use Expression Manager code in the admin mail notification, which can be used to display scores.
Mazi wrote: If the variables are not defined within the survey, where does the data come from? If it is no dynamic data, why can't you hard code it within the text?
tpartner wrote: In Expression manager, unlike JavaScript and other languages, you cannot simply declare and define variables. Variables are only question or sub-question answers, token attributes or a few other survey parameters so, as Mazi says, must be defined in the survey.
www.limesurvey.org/manual/Expression_Man...#Access_to_Variables
{ if ( countif(Q1=='A1',Q2=='A1',Q3=='A1',Q4=='A1') > 1, 'more than one' , 'not more than one') } { if ( ( countif(Q1=='A1',Q2=='A1',Q3=='A1',Q4=='A1') - 2 ) > 1, 'more than one' , 'not more than one') }
{if(sum(Q1=='A1',Q2=='A1',Q3=='A1',Q4=='A1') > 1, 'more than one' , 'not more than one')} {if((sum(Q1=='A1',Q2=='A1',Q3=='A1',Q4=='A1') - 2) > 1, 'more than three' , 'not more than three')}