Welcome to the LimeSurvey Community Forum

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

Average score of a group of questions

  • pachos
  • pachos's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 days ago #160260 by pachos
Hi everyone,

I have a survey with 6 groups of questions, and all the answers to these questions are on list radio from number 1 to 10.
I need that in the results of the survey, shows the average score of each group, and save it to the DB so I could print later the results.
For example:
(group) Social = 7
(group) Health = 8
(group) Financial = 5

Also I need to show an image next to the numeric result if the average score is between 3 scores.
For example:
If the average score is between 0 and 3, the result shows an A.png next to the numeric result
If the average score is between 4 and 6, the result shows an B.png next to the numeric result
If the average score is between 7 and 10 the result shows an C.png next to the numeric result

Thak you in advanced!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 days ago #160264 by Joffm
Replied by Joffm on topic Average score of a group of questions
Hello, pachos,
there is no implemented function "average".
So you have to do it the usual way.
In an equation sum up the values {sum(Q1.NAOK,Q2.NAOK,...)]
and divide by the count of questions {count(Q1,Q2,...)} By the way, you know the number of questions in the group.
See www.limesurvey.org/manual/Expression_Man...#Access_to_Functions
This value is stored in the database.

And you'd like to display an image depending on this average.
Here the buzzword is "Tayloring".
www.limesurvey.org/manual/Expression_Man...Tailoring_.2F_Piping

Something like: <img src={if(average<4,"A.png",if(average<7,"B.png","C.png"))}>


Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: tpartner
The topic has been locked.
  • pachos
  • pachos's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 days ago - 7 years 2 days ago #160293 by pachos
Replied by pachos on topic Average score of a group of questions
Thank you very much Joffm.

Do I have to use an Equation question type? or can I Continue using List radio type?

So, these equations and tayloring, goes at the end of each group of questions?

And, I would be able to export to pdf the "average" results and the images??

Thanks in advanced!
Last edit: 7 years 2 days ago by pachos. Reason: I forgot to ask something else
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 days ago - 7 years 2 days ago #160294 by Joffm
Replied by Joffm on topic Average score of a group of questions
Hello, nachos,

I do not understand.
You have your radio lists and you calculate sum and average in an equation.
you can put one equation at the end of each group or the equations at the end of the survey, up to you.

And what is your pdf-report?
If you put your pictures into an question of type text display it will be in the report.
www.limesurvey.org/manual/Expression_Man...e_using_placeholders

Just try.

In case, send your survey, just a sample with the problematic questions.


Best regards
Joffm


And please, do not cross-post.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 7 years 2 days ago by Joffm.
The topic has been locked.
  • pachos
  • pachos's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 1 day ago #160301 by pachos
Replied by pachos on topic Average score of a group of questions
Thanks for your help and patience, but I still have some problems with the survey.

I have attached a survey sample. It contains only 2 groups of questions. The "average" score of each group doesn't appear in the statistics nor the end of the group when the survey is answered. I've put the equations at the end of each group.

Also, I don't know where to upload the images to be show with the results, according the "average" score in the results of each group. Need to be included in the report.

Thanks again Joffm!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 15 hours ago - 7 years 15 hours ago #160303 by Joffm
Replied by Joffm on topic Average score of a group of questions
Hello, nachos,
1. how do you calculate the mean of the following texts: A3, B7, C2, D1?
That's what you are trying.
Of course the codes have to be numerical. (1,2,3,4,5,...)

2. Wrong brackets in your equation. The "/" has to be inside the equation.

3. Why did you enter the assessment values? You do not use this in your survey.

4. The pictures can be anywhere in the Internet, as long as you enter the correct url.
If you upload them to your template you can use the placeholder {TEMPLATEURL} to enter the correct path.


I corrected the errors(codes only in grupo 2).

You can hide the boilerplate question; but only by adding the css class "hidden". I did that.
You should hide the equation questions as well.

File Attachment:

File Name: limesurvey...1-05.lss
File Size:50 KB


Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 7 years 15 hours ago by Joffm.
The following user(s) said Thank You: pachos
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 hours ago - 7 years 11 hours ago #160307 by Joffm
Replied by Joffm on topic Average score of a group of questions
Hello, nachos,

maybe I misunderstood. You never mentioned assessments before.

So if you want to use assessments, it is not necessaray to calculate a mean to show the appropriate picture. You can calculate it to display the mean in your summary.

E.g. grupo 2:
All questions are mandatory.
If sum between 4 and 15 -> mean <4
If sum between 16 and 27 -> 4 <= mean <7

So you have to define assessment rules like:
grupo
grupo 2
minimum: 4
maximum: 15
title: [something you like]
message: Your message; here you can include the calculated mean {summo} and the [link to picture small mean] (just use the editor)




Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 7 years 11 hours ago by Joffm.
The topic has been locked.
  • pachos
  • pachos's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 8 hours ago #160310 by pachos
Replied by pachos on topic Average score of a group of questions
Thanks a lot Joffm!

I used assessments in the survey sample because I saw some examples in the forum using assessments, so it's not mandatory to use it in my survey.

So, if I used the survey that you've attached, would be able to show the result in a report as the image that you show in your last reply?
The topic has been locked.
  • pachos
  • pachos's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 11 minutes ago #160313 by pachos
Replied by pachos on topic Average score of a group of questions
I mean, the survey is not public nor anonymous. I'm going to send invitations (tokens), and when the participants finish the survey, I want to print/export (to PDF) the report of each participant as the image that you've attached. Example

- (Name of participant)
- title of Survey

- Name of group of questions 1
- "Average" Score :
- (with the image accordding the "average" score)

- Name of group of questions 2
- "Average" Score :
- (with the image accordding the "average" score)

and so on.....

I don't need to print/export all the questions and answers of each group.
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 11 months ago #160325 by LouisGac
Replied by LouisGac on topic Average score of a group of questions
also, in LS3, assesments page can be customized from templates :
github.com/LimeSurvey/LimeSurvey/blob/de...ews/assessments.twig
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 11 months ago #160336 by Joffm
Replied by Joffm on topic Average score of a group of questions
Hi, pachos,

if you import and run the survey I attached, you will see the following.after "imprimir repuestas".

And you can print it.

Now the rest is your turn.

By the way: Did you set the tet color of the questions to "white"?
This is done by the template.
And in your report you do not see the text.
So, please remove.


Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • pachos
  • pachos's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 11 months ago #160341 by pachos
Replied by pachos on topic Average score of a group of questions
Hi Joffm,

I've tested the survey and I see that you say. But this "button" is for the participants, right?
Is there any option to see this results in the statistics (backend), as the sample survey (imprimir respuestas)??
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose