- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Display percentage on Assessment
- alan2001
- Topic Author
- Offline
- New Member
Less
More
7 years 7 months ago #140151
by alan2001
Display percentage on Assessment was created by alan2001
Can you display the percentage of an assessment e.g. I have an exam and I'd like to show the percentage scored the end of the exam.
Currently I can only find {TOTAL} and {PERC} but I can't calculate a percentage.
Is it possible to calculate a percentage?
Currently I can only find {TOTAL} and {PERC} but I can't calculate a percentage.
Is it possible to calculate a percentage?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
7 years 7 months ago #140158
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Display percentage on Assessment
You can use Expression Manager to create the "score". I think you'll find it fsr more powerful than the old assessments.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- alan2001
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
7 years 6 months ago #140890
by alan2001
Replied by alan2001 on topic Display percentage on Assessment
Hi Tony
Thanks for your reply about Assessments - I've had a close look but I'm still having a problem displaying a percentage.
I've tried using the following in the Assessment rule at Scope = Total Level
Total score: {TOTAL}
<This provides a simple sum of all the scores in the Assessment field which is fine, but what I'd like to do is provide the user with a percentage as below [this is pseudocode as I can't find out how to create a percentage score]>
Percentage: ( {TOTAL} / NumberOfQuestions) * 100
I've also used the {PERC} assuming that would return a percentage but again that just returns the sum of all the Assessment values.
Any further hep would be much appreciated.
Thanks for your reply about Assessments - I've had a close look but I'm still having a problem displaying a percentage.
I've tried using the following in the Assessment rule at Scope = Total Level
Total score: {TOTAL}
<This provides a simple sum of all the scores in the Assessment field which is fine, but what I'd like to do is provide the user with a percentage as below [this is pseudocode as I can't find out how to create a percentage score]>
Percentage: ( {TOTAL} / NumberOfQuestions) * 100
I've also used the {PERC} assuming that would return a percentage but again that just returns the sum of all the Assessment values.
Any further hep would be much appreciated.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
7 years 6 months ago - 7 years 6 months ago #140892
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Display percentage on Assessment
As I said, I would not use assessments but would use Expression Manager.
1) For every "scorable" question, create a hidden equation question to store that question score. Something like:
2) Then, you can display a score percentage something like:
Sample survey attached:
1) For every "scorable" question, create a hidden equation question to store that question score. Something like:
Code:
{if(q1 == 'A1', 1, 0)}
2) Then, you can display a score percentage something like:
Code:
The score is: {(sum(q1Score, q2Score, q3Score)/3)*100}
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 7 years 6 months ago by tpartner.
The topic has been locked.
- teracomp
- Offline
- Elite Member
Less
More
- Posts: 162
- Thank you received: 14
7 years 5 months ago #142523
by teracomp
Dave Phillips
Replied by teracomp on topic Display percentage on Assessment
Thanks for posting this sample...really helps me learn how Equation Questions work!!
Dave Phillips
The topic has been locked.
- marektondryk
- Offline
- Premium Member
Less
More
- Posts: 105
- Thank you received: 0
6 years 10 months ago #154635
by marektondryk
Replied by marektondryk on topic Display percentage on Assessment
Sample survey attached:
File Attachment:
File Name: limesurvey...-4-5.lss
File Size:19 KB
What if I want to have in first question q1 two scored answers?
A1 = 5 (5 points of total score)
A2= 2 (2 points of total score) ?
File Attachment:
File Name: limesurvey...-4-5.lss
File Size:19 KB
What if I want to have in first question q1 two scored answers?
A1 = 5 (5 points of total score)
A2= 2 (2 points of total score) ?
The topic has been locked.
- marektondryk
- Offline
- Premium Member
Less
More
- Posts: 105
- Thank you received: 0
6 years 10 months ago #154689
by marektondryk
Replied by marektondryk on topic Display percentage on Assessment
{if(q1 == 'A1', 5, 0)}
{if(q1 == 'A2', 2, 0)}
Doesn't work
{if(q1 == 'A2', 2, 0)}
Doesn't work
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
6 years 10 months ago #154705
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Display percentage on Assessment
There is no way for us to diagnose that with so little information.
My guess is incorrect question and/or answer codes.
My guess is incorrect question and/or answer codes.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- LouisGac
- Visitor
6 years 10 months ago #154709
by LouisGac
Replied by LouisGac on topic Display percentage on Assessment
just for information, in the next LS major release the assessments page will be easy to customise from any template (even the calculation of scores):
github.com/LimeSurvey/LimeSurvey/blob/de...ews/assessments.twig
github.com/LimeSurvey/LimeSurvey/blob/de...ews/assessments.twig
The topic has been locked.
- marektondryk
- Offline
- Premium Member
Less
More
- Posts: 105
- Thank you received: 0
6 years 9 months ago #155093
by marektondryk
Replied by marektondryk on topic Display percentage on Assessment
I have question:
How often do you brush your teeth?
a) 3 or times a day
b) 2 times a day
c) 1 or less
For answer a) I want 5 points, b) 3 points, c) 0
Hidden equation question {if(q1 == 'A1', 5, 3, 0)} doesn't work...
How can I solve this problem?
How often do you brush your teeth?
a) 3 or times a day
b) 2 times a day
c) 1 or less
For answer a) I want 5 points, b) 3 points, c) 0
Hidden equation question {if(q1 == 'A1', 5, 3, 0)} doesn't work...
How can I solve this problem?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
6 years 9 months ago #155094
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Display percentage on Assessment
You will need to use nested IF statements:
See this discussion on nested IF statements - www.limesurvey.org/community/forums/can-...question-text#155058
Code:
{if(q1 == 'A1', 5, if(q1 == 'A2', 3, 0))}
See this discussion on nested IF statements - www.limesurvey.org/community/forums/can-...question-text#155058
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- marektondryk
- Offline
- Premium Member
Less
More
- Posts: 105
- Thank you received: 0
6 years 9 months ago #155165
by marektondryk
Replied by marektondryk on topic Display percentage on Assessment
Thanks Tony! Works GREAT!!!
The topic has been locked.