- Posts: 22
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Assessments as Percentage
- Salini
- Topic Author
- Offline
- Junior Member
Less
More
3 years 6 months ago #206336
by Salini
Assessments as Percentage was created by Salini
Hello,
In my survey, I'm using the Assessments mode to calculate some score.
For this, instead of score as figures, I will need the score as percentage. Can this done? And how?
Thanks for your help,
Salini
In my survey, I'm using the Assessments mode to calculate some score.
For this, instead of score as figures, I will need the score as percentage. Can this done? And how?
Thanks for your help,
Salini
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10110
- Thank you received: 3593
3 years 6 months ago - 3 years 6 months ago #206350
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 Assessments as Percentage
You are probably better off using ExpressionScript to calculate scores and load them into equation questions.
Assessments is a legacy from before ExpressionScript and is not nearly as powerful.
- manual.limesurvey.org/ExpressionScript_E..._-_Quick_start_guide
Assessments is a legacy from before ExpressionScript and is not nearly as powerful.
- manual.limesurvey.org/ExpressionScript_E..._-_Quick_start_guide
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 3 years 6 months ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- Salini
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 1
3 years 6 months ago #206353
by Salini
Replied by Salini on topic Assessments as Percentage
Hello Tony Partner,
Thank you for your reply.
Do you know where can I have a small demo to do the above.
Actually, I need to calculate a scorecard for the client, where after completing the survey, the participant can see his score. Example, each answer for question1 has a weight. Answer 1 have a weight of 1, Answers 2 have a weigh of 3 and Answers 3 have a weight of 4. If the participant gives answer 1, the score is 1 over 4. Then we need to check same for question 2. If same weight is applied for question 2 as question 1 and the answer for question 2 is 3. Then the overall score will be (1+4)/8.
Will the ExpressionScript works on the above and how. If you have an example that would be great as I not used to ExpressionScript.
Note that I have more or less 30 questions in my survey with on average 5 to 6 answer option.
Thanks a lot,
Salini
Kind Regards,
Salini
Thank you for your reply.
Do you know where can I have a small demo to do the above.
Actually, I need to calculate a scorecard for the client, where after completing the survey, the participant can see his score. Example, each answer for question1 has a weight. Answer 1 have a weight of 1, Answers 2 have a weigh of 3 and Answers 3 have a weight of 4. If the participant gives answer 1, the score is 1 over 4. Then we need to check same for question 2. If same weight is applied for question 2 as question 1 and the answer for question 2 is 3. Then the overall score will be (1+4)/8.
Will the ExpressionScript works on the above and how. If you have an example that would be great as I not used to ExpressionScript.
Note that I have more or less 30 questions in my survey with on average 5 to 6 answer option.
Thanks a lot,
Salini
Kind Regards,
Salini
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10110
- Thank you received: 3593
3 years 6 months ago #206354
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 Assessments as Percentage
There are examples listed in the manual and searching the forum will yield many more.
- manual.limesurvey.org/LimeSurvey_Manual
- manual.limesurvey.org/LimeSurvey_Manual
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12944
- Thank you received: 3979
3 years 6 months ago #206355
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Assessments as Percentage
Hi,
as you read here
manual.limesurvey.org/ExpressionScript_-...#Access_to_variables
you access the assessment value of an answer option by "Q1.valueNAOK", resp. "Q1_SQ001.valueNAOK".
So in your case you only have to enter in your resultpage:
Your score for question 1 and question 2 was: {sum(Q1.valueNAOK,Q2.valueNAOK)/8}
(Better to use "sum" instead of "+"; "+" also is used to concatinate strings)
And you may use all implemented functions you find here
manual.limesurvey.org/ExpressionScript_-...mplemented_functions
Joffm
as you read here
manual.limesurvey.org/ExpressionScript_-...#Access_to_variables
you access the assessment value of an answer option by "Q1.valueNAOK", resp. "Q1_SQ001.valueNAOK".
So in your case you only have to enter in your resultpage:
Your score for question 1 and question 2 was: {sum(Q1.valueNAOK,Q2.valueNAOK)/8}
(Better to use "sum" instead of "+"; "+" also is used to concatinate strings)
And you may use all implemented functions you find here
manual.limesurvey.org/ExpressionScript_-...mplemented_functions
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- Salini
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 1
3 years 6 months ago #206363
by Salini
Replied by Salini on topic Assessments as Percentage
Thank you,
Regards,
Salini
Regards,
Salini
The topic has been locked.
- Salini
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 1
3 years 6 months ago #206364
by Salini
Replied by Salini on topic Assessments as Percentage
Hello Joffm,
Thank you for your reply. Sorry for late reply. I was trying to implement what you suggested above and seems to be working. Except for multiple answer question.
Do you know how to apply assessment value for multiple answer question?
Kind Regards,
Salini
Thank you for your reply. Sorry for late reply. I was trying to implement what you suggested above and seems to be working. Except for multiple answer question.
Do you know how to apply assessment value for multiple answer question?
Kind Regards,
Salini
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12944
- Thank you received: 3979
3 years 6 months ago #206369
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Assessments as Percentage
Hi,
you do not expect my answer "Yes, I know", do you?
But I hope you know that multiple questions are stored
selected = "Y"
not selected = ""
And knowing that in a boolean expression "0" means FALSE and "1" means TRUE (therefore the default relevance equation is "1") you can do the following
{sum(1*intval(Q1_SQ001=="Y"),2*intval(Q1_SQ002=="Y"),3*intval(Q1_SQ003=="Y"),4*intval(Q1_SQ004))}
You see:
If Q1_SQ001 is selected, the term Q1_SQ001=="Y" is TRUE (=1). The function "intval" just to make sure it is an integer.
This you multiplicate with your desired assessment value.
Here I chose the values 1,2,3,4, just to show something.
Example: SQ001 and SQ003 are selected. The result of the equation is:
{sum(1*1,2*0,3*1,4*0)} = 4
Joffm
you do not expect my answer "Yes, I know", do you?
But I hope you know that multiple questions are stored
selected = "Y"
not selected = ""
And knowing that in a boolean expression "0" means FALSE and "1" means TRUE (therefore the default relevance equation is "1") you can do the following
{sum(1*intval(Q1_SQ001=="Y"),2*intval(Q1_SQ002=="Y"),3*intval(Q1_SQ003=="Y"),4*intval(Q1_SQ004))}
You see:
If Q1_SQ001 is selected, the term Q1_SQ001=="Y" is TRUE (=1). The function "intval" just to make sure it is an integer.
This you multiplicate with your desired assessment value.
Here I chose the values 1,2,3,4, just to show something.
Example: SQ001 and SQ003 are selected. The result of the equation is:
{sum(1*1,2*0,3*1,4*0)} = 4
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- Salini
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 1
3 years 6 months ago #206382
by Salini
Replied by Salini on topic Assessments as Percentage
Hello Joffm,
I know you know the answer .
Sorry again for late reply. Time difference.
I have applied what you proposed and it's working perfectly.
Thanks again,
salini
I know you know the answer .
Sorry again for late reply. Time difference.
I have applied what you proposed and it's working perfectly.
Thanks again,
salini
The topic has been locked.