Hi,
I have 2 tables: questions & answers.
Each question has 4 answers (only one is the correct). I need to know the easiest way to edit those answers. Since Im using simple models, I dont want to have one page for questions and another page for answers because it can be a bit complicated for my clients to manage. I was thinking having the answer's textboxes right on the 'create' page in the Questions module, or some sort of popup to add/remove these answers.
Best way to do this?
Please advice.
Thanks!!
Comments
To get the answers of your question, you can use the Questions_model::form_fields() method's first parameter passed to it ($values), which I'm assuming will have the question's id value if you are editing (an no value if it's new). This can then be used to query the answers_model:
if (!empty($values['id'])) $answers = $CI->answers_model->find_all(array('questions_id' => $values['id']));
Does that make sense?