modeled how to conditionally generate questions in the database