I want to dynamically preload entries from different tables based on a column value.
Writing a quizzing application where Question can have multiple choices, stored in different tables. Preload should happen based on the question type column in Question table. Can anyone guide me on how to achieve this
I have a below code which extracts all questions and preloads choices, this holds good when there is only one kind of choice table. What if there are other choice tables (true/false, FIB, matching) stored in other tables. How can we dynamically preload choices based on question.type indicator. Also how Question scheme will map has_many relations with other choice tables.
If you have any other approach to tackle this problem, please do highlight. thanks