Display percentage on Assessment

More
1 year 4 months ago #140151 by alan2001
alan2001 created the topic: Display percentage on Assessment
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?

Please Log in to join the conversation.

More
1 year 4 months ago #140158 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

More
1 year 3 months ago #140890 by alan2001
alan2001 replied the 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.

Please Log in to join the conversation.

More
1 year 3 months ago - 1 year 3 months ago #140892 by tpartner
tpartner replied the 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:
{if(q1 == 'A1', 1, 0)}

2) Then, you can display a score percentage something like:
The score is: {(sum(q1Score, q2Score, q3Score)/3)*100}

Sample survey attached:

File Attachment:

File Name: limesurvey...-4-5.lss
File Size:19 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 1 year 3 months ago by tpartner.

Please Log in to join the conversation.

More
1 year 2 months ago #142523 by teracomp
teracomp replied the topic: Display percentage on Assessment
Thanks for posting this sample...really helps me learn how Equation Questions work!!

Dave Phillips

Please Log in to join the conversation.

More
7 months 3 days ago #154635 by marektondryk
marektondryk replied the 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) ?

Please Log in to join the conversation.

More
7 months 2 days ago #154689 by marektondryk
marektondryk replied the topic: Display percentage on Assessment
{if(q1 == 'A1', 5, 0)}
{if(q1 == 'A2', 2, 0)}

Doesn't work :(

Please Log in to join the conversation.

More
7 months 2 days ago #154705 by tpartner
tpartner replied the 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.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
7 months 2 days ago #154709 by LouisGac
LouisGac replied the 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

Please Log in to join the conversation.

More
6 months 2 weeks ago #155093 by marektondryk
marektondryk replied the 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?

Please Log in to join the conversation.

More
6 months 2 weeks ago #155094 by tpartner
tpartner replied the topic: Display percentage on Assessment
You will need to use nested IF statements:

{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.

Please Log in to join the conversation.

More
6 months 2 weeks ago #155165 by marektondryk
marektondryk replied the topic: Display percentage on Assessment
Thanks Tony! Works GREAT!!!

Please Log in to join the conversation.

More
6 months 1 week ago #155313 by marektondryk
marektondryk replied the topic: Display percentage on Assessment
{if(q1 == 'A1', 5, if(q1 == 'A2', 3, 0))}

q1 is a code of question, right?

Why I can't use q10 code?
I have 10 questions in a group.
q1-q9 works but q10 deosen't....

Please Log in to join the conversation.

More
6 months 1 week ago #155315 by tpartner
tpartner replied the topic: Display percentage on Assessment
Yes, q1 is the question code. Assuming you have used the correct code, I have no idea why q10 doesn't work.

Here is a working sample survey with both q1 and q10:

File Attachment:

File Name: limesurvey...5-29.lss
File Size:18 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:

Please Log in to join the conversation.

More
6 months 1 week ago #155316 by marektondryk
marektondryk replied the topic: Display percentage on Assessment
After restarting computer works with q10 :)

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!