Hello Guys I'm working on a Q&A using django-tastypie.
In my template in need to print all the questions related to a topic and all the answers related to a particular question, for this I passed an object to jQuery file and iterate that object there.
this is the code
$(data.quiztopics).each(function(index,element){
$(element.questions).each(function(index,question){
$(".quiz").append("<table id='question_"+question.id+">"+
"<tr><p name='question' id=question_"+question.id+">"+
(question.question_text) +
"</p></tr><tr id=answer_"+question.id+"></tr>");
$(question.answers).each(function(index,answer){
$("#answer_"+question.id).append("<td>"+
"<input type='radio' name='answer'id=answer_"+answer.id+">"+
answer.answer_text +
"</input></td>");
});
in console.log it shows everything all right i,e answer related to particular question. bt when i append it to a table row it misses answers of some of the questions i.e
10+10
120 20 30 1
10*10
100 00 20 1
10/10
10-10
please tell me the solution how can i got to place all answers under a related question