Krlos Posted December 6, 2017 Share Posted December 6, 2017 Hi, need to implement a simple quiz form with 10 questions. Yes/No answers. Someone has tried something similar? I had thought to do it with fields, but wich fields? repeaters? I'm not a processwire expert so maybe I'm not seeing something obvious. Thank you. Link to comment Share on other sites More sharing options...
qtguru Posted December 6, 2017 Share Posted December 6, 2017 I have done something like this but this was in Spring Framework and not Processwire, you don't really need fields to do this ( This is my issue with using PW,it's easier for me to translate logic to classes than fields and pages). What i did was to create different Object in Java and created an interface to make things easier so you have your MultiChoice Class, True or False Class, Open End Question class , all i needed to do was return a JSON that had enough meta-data to inform the UI what to render on the frontend and based on the question type it would generate the control to display the question and save the answer to a QuizManager which stores the question id and the answer for each quiz. Link to comment Share on other sites More sharing options...
mr-fan Posted December 6, 2017 Share Posted December 6, 2017 Hi, yes you can work with simple repeaters for all questions of a form. For yes/no answers you can use a pagefield or fieldtypeoptions (pagefield would be more flexible if you need more features)... So you could render the form inputfields from the repeater field on frontend. You are on the right track. Best regards mr-fan 2 Link to comment Share on other sites More sharing options...
rick Posted December 6, 2017 Share Posted December 6, 2017 There are also a few javascript based wizards you could use, such as jquery smart wizard, steps, form to wizard, etc. Depending on your needs, you can use processwire to create the appropriate data for whichever wizard, and then save and track the results. 2 Link to comment Share on other sites More sharing options...
SamC Posted December 6, 2017 Share Posted December 6, 2017 1 hour ago, mr-fan said: For yes/no answers you can use a pagefield or fieldtypeoptions (pagefield would be more flexible if you need more features)... So you could render the form inputfields from the repeater field on frontend. I like the sound of this. Could you possibly elaborate a bit? Do you mean literally having one page called 'Yes' and one called 'No'? Ot the questions themselves would each be a page in a repeater field? Link to comment Share on other sites More sharing options...
mr-fan Posted December 7, 2017 Share Posted December 7, 2017 First one...you could build a tree branch like: -questions_options --yes --no --don't care --could be changed...later and use a reapeaterfield for your questions...so you can "use" this kind of quiz on every page/template you need it... in the repeaterfield you setup your questions in the simplest mode with a textfield and a pagefield (using the question_options childpages...) to set the right answer - rendering on frontend is obvious with a simple foreach i think. tricky would be to save the entries from users....this would be more complex...;) 1 Link to comment Share on other sites More sharing options...
szabesz Posted December 7, 2017 Share Posted December 7, 2017 22 hours ago, rick said: There are also a few javascript based wizards you could use, such as jquery smart wizard, steps, form to wizard, etc. Depending on your needs, you can use processwire to create the appropriate data for whichever wizard, and then save and track the results. I've been googling around and found these two as well: surveyjs Multiple Choice Quiz Engine 1 Link to comment Share on other sites More sharing options...
Krlos Posted December 7, 2017 Author Share Posted December 7, 2017 This is why I love Proccesswire community, I have received a lot of useful answers. My needs are very simple, so I'm using this: http://vinceg.github.io/twitter-bootstrap-wizard I'm working in building the repeaters and the questions at this time. Thank you!! 5 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now