Welcome to the LimeSurvey Community Forum

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

Saving the assessment Value in the database and/or exporting it

  • lokas22
  • lokas22's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago #227265 by lokas22
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.15
Own server or LimeSurvey hosting: on-premises
Survey theme/template: Fruity Theme (fruity)
==================
Hi all,

I've created a survey that contains around 70 questions type List (radio) each question has two answers Yes and No. If the user chooses Yes they'll get a point, if they choose no they'll get 0. (Some question has more points than the others) I've enabled assessment mode and have configured the assessment value and under Assessment rules I've created a rule that shows the total score.

Following the documentation ( section tilted "Save Assessment Value in Data") I created a question type equation and added the {ASSESSMENT_CURRENT_TOTAL} but the total points value still doesn't appear when I export the responses.

I checked around and many people are suggesting using expression manager but I still don't know how to actually do it with expression manager. How do I calculate the total amounts of points for 70 yes or no radio type question ? what happens if the user left a question unanswered? can I still use the values (points) that I set in assessment mode?

Thanks in advance!

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #227266 by tpartner
Use the point values as answer codes. Then you can place something like this in an equation question:

Code:
sum(intval(Q1), intval(Q2), intval(Q3)...)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: lokas22

Please Log in to join the conversation.

  • lokas22
  • lokas22's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago #227270 by lokas22
Thank you so much for the hint. The Q in there is the question code right?

just tried it and it's showing "sum(intval(Q1), intval(Q2), intval(Q3)...) " instead of showing the total points

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago - 1 year 11 months ago #227271 by holch
Code:
{sum(intval(Q1), intval(Q2), intval(Q3)...)}

Equations need to be in between { and }

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 1 year 11 months ago by holch.
The following user(s) said Thank You: lokas22

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #227272 by tpartner
oops...forgot the curly braces.

I'm new at this. :)

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.

  • lokas22
  • lokas22's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago - 1 year 11 months ago #227276 by lokas22
Thank you both so much! I'm aware that the equation needs a curly brackets but for some reasons when I export the survey responses it still shows the code and not the total points.

Could it be effected by the fact that my questions are divided into groups and the equation question is part of the last group?
Last edit: 1 year 11 months ago by lokas22.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #227280 by Joffm
No, this does not affect it.
Attach the lss export and we will have a look.
Probably a tiny issue or typo.
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • lokas22
  • lokas22's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago #227281 by lokas22
Thank you so much! Attached is the lss file.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #227284 by Joffm
At first look at it.
It's a typo.
There is no question "es12". You named it "Es12"
 
And there is a blank before "intval(o1)". Remove it in source code mode.
Obviously you copy/pasted something.
 

Mal kurz auf Deutsch:
1. Ein bisschen mehr "sex appeal" kann der Fragebogen wirklich vertragen. Der ist ja so dröge und langweilig.
Schau Dir wenigstens einmal ein paar andere Darstellungsweisen an. (und wenn es nur bootstrap-buttons sind)

2. Wie stellst Du Dir die Auswertung vor, wenn Du nur für "Ja" den Punkt vergibst, der Teilnehmer sich aber auf einen Tag beschränken muss?
An diesem hat er höchstwahrscheinlich gerade keine Blumen gepflanzt, an einem anderen aber schon.
Dann gibt es Alternativfragen, bei denen beide Möglichkeiten nicht zutreffen, wie
"Ich habe smile.amazon statt amazon zum Einkaufen benutzt (smile.amazon spendet 0,5 % des Kaufpreises für eine Organisation deiner Wahl)"
Habe ich heute beides nicht gemacht. Also lasse ich die Frage frei.
Sie wird aber genauso bewertet wie eine mit "Nein" beantwortete Frage.

3. Schalte den Bewertungsmodus aus. Du benutzt ihn nicht, aber es wird defaultmäßig auf der letzten Seite angezeigt

And your relevance equation.
What for do you use it?
1. A relevance equation here is without curly brackets as the entry field already contains them
 
2. This is not a logical term that has a TRUE or FALSE result .
Here you have to use something like sum(a,b,c)>100 or Q1==1 OR Q2<3
The first equation is TRUE if the sum is greater than 100, otherwise FALSE.
And the question is displayed if the equation is TRUE, or it is not displayed. This is used to filter questions ("Only ask if question XYZ was answered "Yes", or so)
The same with group relevance and subquestion relevance.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: lokas22

Please Log in to join the conversation.

More
1 year 2 months ago #239822 by giorgi
Hi,

I also was trying to save assessment values in the database, but sometimes the questionnaire might get little complex (in my case i want to save scores for several questions groups). The workaround for me is to create DB connection to limesurvey database, fetch responses (answer codes) and link it to lime survey answers tables which of course has assessment values along with each code. 

from response database parse question IDs from the response columns, then fetch answer IDs and assessment values from answer table, link to the actual response and get sum of assessment values.  Am i doing it in a complicated way? Maybe this feature already been added? LS v5.4.10

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 months ago #239828 by Joffm
Well, it's an option.

But why do you do it so complicated?
You only need ONE hidden question of type "multiple numeric" (to store the results) (QResult) and ONE hidden question of type "equation" to do ALL calculations.

You put all assignments into this same equation.
Like:
mean of assessment values of array Q1 (though you need assessment values only if there are negative values or two or more answer options with the same value)
{QResult_SQ001=sum(that.Q1.valueNAOK)/count(that.Q1.NAOK)}

sum of assessment values of several single questions
{QResult_SQ002=sum(Q1.valueNAOK,Q2.valueNAOK,Q3.valueNAOK,Q4.valueNAOK)}

BMI (Q1=weight in kg, Q2=height in cm)
{QResult_SQ003=10000*Q1/(Q2*Q2)}

sum of assessment values of an array (1-5) with reverse items ("normal" subquestions coded "N001", "N002",..., "reverse" subquestions coded "R001", "R002",...
{QResult_SQ004=sum(sum(that.Q1.sq_N.valueNAOK),(6*count(that.Q1.sq_R.NAOK)-sum(that.Q1.sq_R.valueNAOK)))}

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose