<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Ed,<div class=""><br class=""></div><div class="">I recently completed a project for Department for Education that did a good chunk of those things from scratch:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">- Complex routing through the questionnaire</div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">- "Go back" to previous questions/change answers</div></blockquote><div class=""><br class=""></div><div class="">Adding “resume” and scoring wouldn’t be too difficult but wasn’t needed for this particular project.</div><div class=""><br class=""></div><div class="">It's open source and available to view on GitHub: <a href="https://github.com/DFE-Digital/claim-additional-payments-for-teaching" class="">https://github.com/DFE-Digital/claim-additional-payments-for-teaching</a>.</div><div class=""><br class=""></div><div class="">The best place to start to get an idea of how it works is to look at the <font face="Courier" class=""><span style="font-style: normal;" class="">ClaimsController</span></font>, the central <font face="Courier" class="">Claim</font> model and the two journey-specific <font face="Courier" class="">SlugSequence</font> classes that combine with the <font face="Courier" class="">PageSequence</font> class to provide the routing logic/flow.</div><div class=""> </div><div class="">It was written to support two separate question sets/flows that have a shared set of common questions (the <font face="Courier" class=""><span style="font-style: normal;" class="">Claim</span></font>) and flow-specific questions (see the polymorphic <font face="Courier" class=""><span style="font-style: normal;" class="">Eligibility</span></font> models and corresponding namespaces), with the idea that more could be added in the future without too much difficulty.</div><div class=""><br class=""></div><div class="">I know of the <a href="https://github.com/zombocom/wicked" class="">wicked</a> 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.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">
<div>Tekin<br class=""><a href="http://tekin.co.uk" class="">http://tekin.co.uk</a> / <a href="https://twitter.com/tekin" class="">@tekin</a><br class=""></div></div><div><br class=""></div><div><br class=""></div><div><blockquote type="cite" class=""><div class="">On 22 Jul 2020, at 10:37, Ed James <<a href="mailto:ed.james.spam@gmail.com" class="">ed.james.spam@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi all<div class=""><br class=""></div><div class="">Does anyone have any experience with building out a complex questionnaire engine?</div><div class="">I’m very interested in hearing what people have done and whether you wrote from scratch or used any 3rd-party tools/gems/etc.</div><div class=""><br class=""></div><div class="">Some of the things I need to be able to handle are:</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">Complex routing through the questionnaire based on answers to previous question(s)</li><li class="">Scoring/weighting of answers to calculate a final score</li><li class="">Grouping of weighted questions to allow for score calculations of “question groups”</li><li class="">Ability to “resume” questionnaire</li><li class="">Ability to “go back” through previous questions to change answers before completion</li></ul><div class=""><br class=""></div><div class="">Any advice/insights would be greatly appreciated.</div><div class=""><br class=""></div><div class="">Thanks!</div><div class="">
<br class="">
<hr style="display: block; height: 1px; border: 0; border-top: 1px dotted #ccc; margin: 5px 0; padding: 0;" class="">
<br class="">
<table border="0" cellpadding="0" width="100%" class="">
  <tbody class="">
    <tr class="">
      <td valign="top" width="70" class="">
        <img height="60" src="http://ej-public.s3.amazonaws.com/images/rubbish.png" style="margin: 8px 8px 0 0;" class="">
      </td>
      <td style="font-family:'Lucida Grande',sans-serif" class="">
          <span style="font-weight:bold; color: #333333; font-size: 18px; line-height:30px;" class="">Ed James</span>
          <br class="">
          <span style="font-weight:normal; color: #999; font-size: 12px; line-height:16px;" class="">
              <a href="mailto:ed.james.spam@gmail.com" style="color:#999; text-decoration:none" target="_blank" class="">I will respect your spam</a>
          </span>
      </td>
    </tr>
  </tbody>
</table>

</div>

<br class=""></div></div>_______________________________________________<br class="">Chat mailing list<br class=""><a href="mailto:Chat@lists.lrug.org" class="">Chat@lists.lrug.org</a><br class="">Archives: http://lists.lrug.org/pipermail/chat-lrug.org<br class="">Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org<br class="">List info: http://lists.lrug.org/listinfo.cgi/chat-lrug.org<br class=""></div></blockquote></div><br class=""></div></body></html>