Wednesday, March 14, 2012

Re: Multiple Choice Quiz

Can anyone help me with some questions I still have about this ? I
haven't had much experience with web programming, so trying to
understand this is kind of challenging.

1. I created the models Shawn suggested. And I'm now able to add a
question and possible answers to it in the admin area. Each possible
answer has a checkbox next to it with the "Correct" label from the
model. Does setting the correct response require anything more than
selecting the appropriate checkbox and saving the question ?

2. I still don't understand how I'm supposed to combine these three
models together in order to get the right output for the user. I've
been trying different approaches in views.py, forms.py and my
template. But I can't really figure out how this should be set up. I
don't like to keep asking for such direct examples.
But would anyone be able to provide kind of an abstract view based on
the model Shawn provided.


On Mar 11, 5:16 pm, jbr3 <jbr3...@gmail.com> wrote:
> Thanks for responding Shawn. I guess I was thinking that if I wanted
> to save the user's responses and the correct answers a different model
> would be needed for both.
>
> On Mar 11, 4:11 pm, Shawn Milochik <sh...@milochik.com> wrote:
>
> > I think I'd do this:
>
> > Models:
>
> >      Question
> >          question text
>
> >      Answer
> >          question foreign key
> >          answer text
> >          correct (boolean)
>
> >      Guess
> >          user foreign key
> >          answer foreign key
>
> > That should be all you need (along with the User model or your own
> > method of tracking unique users without forcing them to register).
>
> > I don't understand what your fourth model is for.

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate