[LRUG] Questionnaire engine

Tekin Süleyman tekin at tekin.co.uk
Wed Jul 22 03:41:35 PDT 2020

Hi Ed,

I recently completed a project for Department for Education that did a good chunk of those things from scratch:

- Complex routing through the questionnaire
- "Go back" to previous questions/change answers

Adding “resume” and scoring wouldn’t be too difficult but wasn’t needed for this particular project.

It's open source and available to view on GitHub: https://github.com/DFE-Digital/claim-additional-payments-for-teaching <https://github.com/DFE-Digital/claim-additional-payments-for-teaching>.

The best place to start to get an idea of how it works is to look at the ClaimsController, the central Claim model and the two journey-specific SlugSequence classes that combine with the PageSequence class to provide the routing logic/flow.
It was written to support two separate question sets/flows that have a shared set of common questions (the Claim) and flow-specific questions (see the polymorphic Eligibility models and corresponding namespaces), with the idea that more could be added in the future without too much difficulty.

I know of the wicked <https://github.com/zombocom/wicked> gem that I’ve seen used for step-by-step wizard-style flows. I’ve not used it personally but I would be very wary of building an engine of any sort of complexity on top of something like this. In my experience they work great until you need to do something slightly outside of what it supports, then you’re buggered.

http://tekin.co.uk <http://tekin.co.uk/> / @tekin <https://twitter.com/tekin>

> On 22 Jul 2020, at 10:37, Ed James <ed.james.spam at gmail.com> wrote:
> Hi all
> Does anyone have any experience with building out a complex questionnaire engine?
> I’m very interested in hearing what people have done and whether you wrote from scratch or used any 3rd-party tools/gems/etc.
> Some of the things I need to be able to handle are:
> Complex routing through the questionnaire based on answers to previous question(s)
> Scoring/weighting of answers to calculate a final score
> Grouping of weighted questions to allow for score calculations of “question groups”
> Ability to “resume” questionnaire
> Ability to “go back” through previous questions to change answers before completion
> Any advice/insights would be greatly appreciated.
> Thanks!
>        	Ed James 
> I will respect your spam <mailto:ed.james.spam at gmail.com>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> Archives: http://lists.lrug.org/pipermail/chat-lrug.org
> Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org
> List info: http://lists.lrug.org/listinfo.cgi/chat-lrug.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20200722/908b2876/attachment.html>

More information about the Chat mailing list