Welcome to the LimeSurvey Community Forum

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

Using Expression Script

More
4 days 11 hours ago #273978 by BjornW
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition Version 6.16.8+260209
Own server or LimeSurvey hosting: Own server
Survey theme/template: Not relevant, used multiple
==================
Hi, 
I'd like to know if I can use Expression Script in Assessment rules?

My objective is to calculate the amount of relevant questions and display this to the user after the they have filled in the survey, per question group.

E.g.
'On the questions relevant for digital sovereignty, you've scored A From the B number of relevant questions'
I use "{PERC}" to get A, but B is depended on amount of questions that were relevant. The relevance is determined on the answers of 2 questions and show/hide questions based on these answers (these works). 

I have a hard time understanding Expression Script in general due to a lack of documentation. What is the syntax? Where can I insert these statements etc. So any up-to-date information would be very welcome as I find the manual lacking in this regard. Thank you in advance!   
   


 

Please Log in to join the conversation.

More
3 days 12 hours ago #273979 by Joffm
Replied by Joffm on topic Using Expression Script
Hi,

I'd like to know if I can use Expression Script in Assessment rules?

Not only that you can, you really should use ExpressionScript (only the name "ExpressionManager" was changed to avoid confusion)
These "assessment rules" are absolutely outdated. Not flexible at all, the result is not stored in the dataset, ...
The only useful  part is the assessment value.
This might be useful, if you want to have negative weights or if two or more items in one question have the same weight
Like this
 

To learn about ExpressionScript you may read this part of the manual
[url] www.limesurvey.org/manual/Expression_Manager/en [/url]
that refers to the first of the sample surveys 
[url] www.limesurvey.org/manual/ExpressionScript_sample_surveys/en [/url]
As you see you can use all implemented functions.

And to show something related to your example




As you see there are different numbers of relevant questions.

And you calculate summing up the "code" resp. summing up the "relevanceStatus"

Now if you have specific questions, please send a sample file (lss export) where you shgow what you want to do.

Joffm
 

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

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose