<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="">Thanks for the feedback everyone. <div class="">Very useful.<br class=""><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>
<div style=""><br class=""><blockquote type="cite" class=""><div class="">On 23 Jul 2020, at 10:01, Andrew Premdas <<a href="mailto:apremdas@gmail.com" class="">apremdas@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">For wizards on Rails I personally prefer a full controller, views, and model for each stage in the wizard. I came to this conclusion after using wicked amongst other things. At first this seems counter-intuitive, overkill, and far to complex but it has several benefits.</div><div class=""><br class=""></div><div class="">- you have full control</div><div class="">- conditional validation is super easy, and very clear</div><div class="">- conditional routing depending on step results is fairly straightforward</div><div class="">- you progress is recorded each time you submit a step</div><div class="">- you don't have to do anything in js</div><div class=""><br class=""></div><div class="">As far as the models go, you just create your basic rails model. Then for each stage in the wizard you subclass the model (I store these in form_models). So you get something like</div><div class=""><br class=""></div><div class=""><span style="font-family:monospace" class="">class Tax::AdditionalIncome < Tax</span></div><div class=""><span style="font-family:monospace" class=""> validates: xxx</span></div><div class=""><span style="font-family:monospace" class=""> validates: yyy</span></div><div class=""><span style="font-family:monospace" class=""> ...</span></div><div class=""><span style="font-family:monospace" class="">end</span></div><div class=""><br class=""></div><div class="">The same applies to controllers and views, everything is just the same as bog standard rails form. This approach is initially a lot slower, creating each step takes more time, but you more than make up for that when you have to tweak steps, change orders etc. etc.</div><div class=""><br class=""></div><div class="">All best</div><div class=""><br class=""></div><div class="">Andrew<br class=""></div><div class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 22 Jul 2020 at 10:37, Ed James <<a href="mailto:ed.james.spam@gmail.com" class="">ed.james.spam@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" 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=""><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-color:rgb(204,204,204) currentcolor currentcolor;border-style:dotted none none;border-width:1px 0px 0px;margin:5px 0px;padding:0px" class="">
<br class="">
<table width="100%" cellpadding="0" border="0" class="">
<tbody class="">
<tr class="">
<td width="70" valign="top" class="">
<img style="margin: 8px 8px 0px 0px;" height="60" class="">
</td>
<td style="font-family:"Lucida Grande",sans-serif" class="">
<span style="font-weight:bold;color:rgb(51,51,51);font-size:18px;line-height:30px" class="">Ed James</span>
<br class="">
<span style="font-weight:normal;color:rgb(153,153,153);font-size:12px;line-height:16px" class="">
<a href="mailto:ed.james.spam@gmail.com" style="color:rgb(153,153,153);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" target="_blank" class="">Chat@lists.lrug.org</a><br class="">
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank" 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" rel="noreferrer" target="_blank" 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" rel="noreferrer" target="_blank" class="">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br class="">
</blockquote></div><br clear="all" class=""><br class="">-- <br class=""><div dir="ltr" class="gmail_signature"><div class="">------------------------</div>Andrew Premdas<div class=""><a href="http://blog.andrew.premdas.org/" target="_blank" class="">blog.andrew.premdas.org</a></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>