ahmedkl Posted June 10, 2010 Share Posted June 10, 2010 Hello everyone i am new here . I want to make an online quiz website . The functionality will be like: Admin can add number of questions The question User log's in (can do this part) The problem is i don't know how many questions there will be so how do i get the name of the radiobuttons from the generated quiz page? Quote Link to comment https://forums.phpfreaks.com/topic/204353-online-quiz-help/ Share on other sites More sharing options...
premiso Posted June 10, 2010 Share Posted June 10, 2010 Well you have to know the number of questions, so you just simply do a for loop of the number of questions, or if the data is being stored in a database, while loop from the DB of the number of questions. Quote Link to comment https://forums.phpfreaks.com/topic/204353-online-quiz-help/#findComment-1070200 Share on other sites More sharing options...
ignace Posted June 10, 2010 Share Posted June 10, 2010 quizzes (quiz_id, ..) quizzes_questions (question_id, quiz_id, ..) quizzes_answers (answer_id, question_id, ..) Quote Link to comment https://forums.phpfreaks.com/topic/204353-online-quiz-help/#findComment-1070250 Share on other sites More sharing options...
ahmedkl Posted June 10, 2010 Author Share Posted June 10, 2010 thanks ignace , now for the user part what should i do?get the answers from him store it in another table or first i should compare it with the answer table and then store it in another table? Quote Link to comment https://forums.phpfreaks.com/topic/204353-online-quiz-help/#findComment-1070381 Share on other sites More sharing options...
ignace Posted June 10, 2010 Share Posted June 10, 2010 quizzes_results (user_id, quiz_id, question_id, answer_id) -- where answer_id is the chosen answer Quote Link to comment https://forums.phpfreaks.com/topic/204353-online-quiz-help/#findComment-1070399 Share on other sites More sharing options...
ahmedkl Posted June 11, 2010 Author Share Posted June 11, 2010 thanks a bunch ignace i am almost done with the site , another thing i wanted to ask that how can i apply the cascade update/delete option in mysql to a relation?other then writing query i want to know if there's some visual way to do it Quote Link to comment https://forums.phpfreaks.com/topic/204353-online-quiz-help/#findComment-1070842 Share on other sites More sharing options...
ignace Posted June 11, 2010 Share Posted June 11, 2010 How do you mean visual? InnoDB does this automatically when a parent reference has been updated or deleted in which - in the case of CASCADE - updates all child's or deletes all child's. Quote Link to comment https://forums.phpfreaks.com/topic/204353-online-quiz-help/#findComment-1070853 Share on other sites More sharing options...
ahmedkl Posted June 12, 2010 Author Share Posted June 12, 2010 that doesn't seem to happen in mysql Quote Link to comment https://forums.phpfreaks.com/topic/204353-online-quiz-help/#findComment-1071005 Share on other sites More sharing options...
ignace Posted June 12, 2010 Share Posted June 12, 2010 Are you sure you have InnoDB as the engine or MyISAM for your tables? Quote Link to comment https://forums.phpfreaks.com/topic/204353-online-quiz-help/#findComment-1071063 Share on other sites More sharing options...
ahmedkl Posted June 12, 2010 Author Share Posted June 12, 2010 thanks ignace , it worked with InnoDB , all stuff solved thankyou again Quote Link to comment https://forums.phpfreaks.com/topic/204353-online-quiz-help/#findComment-1071174 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.