added logic to get and parse quiz from database