i'm making a multiple-choice quiz application but i'm stuck as to how to start
[ i've just read Pro Drupal Development from cover to cover thinking that would help (with this project), but whilst i'm still stuck i probably only need pointing the right direction. at least i'm hoping ]
basically, i'll have to create a page that lets the user configure the quiz ( which categories of questions they want answering, etc. & i think i'm ok with that. i'll just create a module, implement hook_menu & implement a few Form API hooks )
the problem comes with the question pages themselves
conceptually, each (multiple choice) question page appears twice. the first time with just the question & 5 answers. the 2nd time, once you've selected an answer & clicked 'submit', is when the page is reloaded - only this time it includes some extra information. this extra information includes a tick (or cross) indicating whether you got the question right or wrong, a custom block showing how other users answered this question, & an explanation of the correct answer that appears beneath the question & answers, which is basically just a <div> element with some text in it
my problem is, how do i go about coding these question pages in drupal?
i mean, can i create a node that contains form elements, & that can appear in 2 different modes???
or, do i forget about nodes altogether & create some kind of template-page, and add form elements to it with form API? (can you even do this???)
anyway, if anyone can provide any illumination i'd be very grateful
(& cos i'm a noob to building-sites-with-custom-modules please don't feel like you should spare the waffle. i'm all ears to that kinda stuff)
Comments
Hi, You may want to look at a
Hi,
You may want to look at a module that already goes someway to doing what you want.
Tear it apart and see how it works. I always find that helps.
Take a look at the quiz module at http://drupal.org/project/quiz
You could use that as a basis for your module or just learn from it & build your own from scratch.
Hope that helps a little