<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="">We've used Wicked a few times, and wrote a gem to allow you to do conditional validation based on the step you're on: <a href="https://github.com/errorstudio/wicked-wizard-validations/" class="">https://github.com/errorstudio/wicked-wizard-validations/</a><div class=""><br class=""></div><div class="">I would echo Tekin - it's not the right solution for this. It's hard to reason with after a while, and that gem kinda demonstrates the complexity of relatively simple stuff.</div><div class=""><br class=""></div><div class="">Ed<br class=""><div class=""><div class="">
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">--</div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;"><b class="">Error</b><br class="">A human-centred interaction agency<br class=""><br class="">4th Floor, 86-90 Paul Street,<br class="">London, EC2A 4NE<br class=""><br class="">Tel: 020 3637 5060<br class="">Mobile: 0779 187 4282<br class="">Twitter: @erroragency<br class=""><a href="http://error.agency" class="">http://error.agency</a></div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 22 Jul 2020, at 11:41, Tekin Süleyman <<a href="mailto:tekin@tekin.co.uk" class="">tekin@tekin.co.uk</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 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 class="">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 class=""><br class=""></div><div class=""><br class=""></div><div class=""><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: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" class="">http://lists.lrug.org/pipermail/chat-lrug.org</a><br class="">Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" class="">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br class="">List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" class="">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br class=""></div></blockquote></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></div></body></html>