I've gone through the tutorial. But I would just like to get a general idea of the best way to incorporate all these elements so I can save and reuse them.
On Mar 10, 9:20 pm, "John S. Dey" <j...@jsdey.com> wrote: > You might try reading the tutorial. It provides example of a form. > > On Mar 10, 2012, at 6:16 PM, jbr3 wrote: > > > Hi, > > > I'm trying to build a quiz app. The quizzes will have varying numbers > > of questions and a radio button next to each of 4 potential answers > > (there will only be one correct answer for each question). I want to > > save the user's answers in the database and automatically grade the > > quiz by comparing it to the actual answers. I have a model for the > > question and a model to add answers so far, set up kind of like the > > poll tutorial. That way I can add both questions and answers from the > > admin (and reuse both). What I can't understand is how I can save the > > radio button responses and generate the actual form for the quiz- > > taker. I know, if I'm saving the user's quiz, it has to be saved in > > the model. It seems like I should be using a ModelForm for that. But I > > also want to generate the questions and potential answers in the same > > template with the radio buttons. Should I be populating the form with > > the question and answer objects from the two models and then > > generating radio buttons (related to a third model) in the template ? > > Sorry, I know this isn't so clear. Am I just way off in how I'm doing/ > > thinking of this problem ? Could you give a general explanation of how > > this should be done or point me to an app that already does this > > (which I can use/examine code from) ? > > > Thanks in advance > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-users@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.