Hi,
use less "stupid" answer option codes like yours "D21A0", "D21A1",...
Use
0: Did not apply to me at all
1: Applied to me to some degree or some of the time
2: Applied to me to a considerable degree or a good part of the time
3: Applied to me very much or most of the time
you have these three easy equations:
Stress:
{sum(that.DASSASS.sq_DASS.NAOK)*2}
Anx:
{sum(that.DASSASS.sq_DASA.NAOK)*2}
Dep:
{sum(that.DASSASS.sq_DASD.NAOK)*2}
NAOK is important, because the "sum" will fail if one of the questions is not answered (therefore "No Answer is OK")
Read the manual about implemented functions and "that", "self" and the meaning of "sq"
[url]
www.limesurvey.org/manual/ExpressionScri...mplemented_functions
[/url]
[url]
www.limesurvey.org/manual/ExpressionScri....22that.22_variables
[/url]
and the correct use of the IF-statement.
And do not enter HTML code in an equation. You only calculate something.
If you want to display the value use a question of type "text display"
Joffm
If you insist on your answer option codes you may use these equations:
Stress:
{2*sum(countif('D21A1',that.DASSASS.sq_DASSS.NAOK)*1, countif('D21A2',that.DASSASS.sq_DASSS.NAOK)*2, countif('D21A3',that.DASSASS.sq_DASSS.NAOK)*3)}
Anx:
{2*sum(countif('D21A1',that.DASSASS.sq_DASSA.NAOK)*1, countif('D21A2',that.DASSASS.sq_DASSA.NAOK)*2, countif('D21A3',that.DASSASS.sq_DASSA.NAOK)*3)}
Dep:
{2*sum(countif('D21A1',that.DASSASS.sq_DASSD.NAOK)*1, countif('D21A2',that.DASSASS.sq_DASSD.NAOK)*2, countif('D21A3',that.DASSASS.sq_DASSD.NAOK)*3)}