Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

calculate sum scores for only spec. qs within a group to provide feedback to par

  • hannahtrappe
  • hannahtrappe's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 months 5 days ago #256979 by hannahtrappe
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.4.5
LimeSurvey hosting:
Survey theme/template: fruity_twentythree
==================
Hello,

Do you know if I can use the ExpressionScript feature and if yes, do you know how to program the following:
- Calculate a sum score for only specific questions within a question group to then show participants a the end of the survey a specific text if they surpassed a certain value for the sum score. I would like to do this for multiple sets of questions within the same question group. 

So for example from group 2, I would like to sum up Question 1 (G2Q1), G2Q3, G2Q6 and G2Q7 and display a text if sum score >= 10. Besides that, I would like to sum up G2Q2, G2Q4 and G2Q5 and display a text if sum score >= 10.

Due to standardized order of the questions, I cannot put them into individual question groups. 

Do you have any idea whether that is possible? Where can I read up on that?

Thank you very much for your ideas,

Best regards,

Hannah Trappe

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 5 days ago #256986 by Joffm
Hi,
did you read the manual about implemented functions?
[url] manual.limesurvey.org/ExpressionScript_-...mplemented_functions [/url]

There you find the function "sum(arg1, arg2, arg3,...)" and the function "if(test, result_if_true, result_if_false)".
This is all you need.
IF the SUM of these questions is greater than 9, display a text, else do nothing

In LimeSurvey-synatx
{if(sum(Q1.NAOK, Q3.NAOK, Q4.NAOK, Q6.NAOK)>9,"You are a wonderful person","")}

And read the manual here
[url] manual.limesurvey.org/ExpressionScript_-...ion/en#Usage_of_NAOK [/url]
to know why NAOK is important here.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: hannahtrappe

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose