Welcome to the LimeSurvey Community Forum

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

Calculating (equation) score, saving in db (as question) and showing stats

  • baybug
  • baybug's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #223017 by baybug
Hi Lime Community
I have a challenge:
At the end of the survey I calculate a score for the participant with the "equation" question type. I display the score and it works great. However, it is the equation that is saved in question type and not the actual numerical number.

I would like to be able to save the results from the equation in a question.

In my attempt to have the calculated score saved I have tried to insert a text question and in the "default value" paste the equation. It does not seem to recognize the equation in the field and the score does not get pre-filled.

Any help as to how I save the equation score in the DB as a numerical question value?

I have another great wish - and this is probably far reaching: I would like limesurvey to calculate an average score of a specific question (the question above) based on all submitted surveys [total sum of q1 /total number of surveys].

This may be server intensive - but any ideas on how to do something similar would be great as it would constantly allow participants to compare their score with the overall average - without I having to periodically export data, calculate average and insert it manually.

Any help much appreciated :)

Many thanks
Max

 
The topic has been locked.
  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
3 years 4 months ago #223019 by tammo
What version of LimeSurvey are you using?


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #223020 by Joffm
Hi,

I have tried to insert a text question and in the "default value" paste the equation

This is not the best way to achieve this, though it works, too.
To store the reesult of an equation you have to use a question of type "equation".
Then there is a database column with this name and the result.

Later you may use this question to display the value of your equation.

Always the best is to show us what you tried (without success) by attaching a LSS export of these relevant questions.

By the way: Why didn't you fill the mask at the beginning?

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • baybug
  • baybug's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #223024 by baybug
Thanks a lot - I got that working.

Is there a way to calculate the average of completed surveys? Sum total score divided by number of surveys?

Best,
Max
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #223027 by Joffm
@tammo asked already:
Which version?

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • baybug
  • baybug's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #223041 by baybug
sorry - using ver. 3.22 - I can upgrade if there is a need to?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #223050 by Joffm
Well,
I asked this because since version 5.x. there are built in functions "statFunctions" (with functions "statCount" and "statCountIf") to be able to calculate a "total score" and a "total mean".
In version 3.x. you have to use a plugin called "getStatInSurvey"
[url] github.com/SondagesPro/LS-getStatInSurvey [/url]

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • baybug
  • baybug's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #223068 by baybug
Wow - sounds like just what I need. I will try and upgrade to ver 5 - hopefully the survey and template will import nicely into the latter version :)

Many many thanks
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #223070 by holch
The survey will import without a problem. From lower versions to higher versions of Limesurvey is no problem. You just can't import surveys from LS4 and LS5 into lower versions.

Now the template/theme system has changed from LS 3 to LS4/5 and your template/theme will most probably not be easily imported into LS4/5

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The following user(s) said Thank You: baybug
The topic has been locked.
  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
3 years 4 months ago #223071 by tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The following user(s) said Thank You: DenisChenu
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose