Check out the LimeSurvey source code on GitHub!

Controlling the order in which assessment rules are evaluated

5 years 6 months ago #62748 by wabrit
I have a survey with a number of question groups that is assessment enabled.

I have some assessment rules which are based on overall (Total) score, and others which are based on individual question group score.

I want the survey taker to see the assessment triggers thus:

<Assessment rule trigger matching overall total score>
[<Assessment rule trigger matching individual question group scores>]*


"You scored very low on this safety assessment. Some things to remember are:

* Don't walk in front of buses.
* Never stick your finger in an electric socket."

Where the opening paragraph is triggered by a rule on the total score, and the bullets are triggered by rules on individual sections.

I can certainly get multiple rules to fire, but I can't see a way to "order" my rules so that the output is guaranteed to look exactly how I want. In the above examples I might get the bullets followed by the introductory paragraph.

Another thing I would like to do is impose a limit on how many rules will fire e.g. if I have per-question group assessment rules each of which can trigger a bulleted list item like in the example above, then I might want to say "stop after n rules have fired" so that the list does not become too long.

Please Log in to join the conversation.

5 years 6 months ago #62756 by TMSWhite
In the short-term, perhaps someone can propose a JavaScript-based work-around.

Longer term, once these user patches are done and incorporated, you would have complete flexibility in using assessment results to tailor the output, even including a "stop after n rules have fired"-type functionality.

Please Log in to join the conversation.

5 years 6 months ago #62766 by tpartner
Yeah, I'm sure we can sort this out with JavaScript.

wabrit, does the Total Assessment message always show last in your tests?

Can you attach a sample survey to test?

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.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form