I am working on a MCQ module and I need to fetch random questions from my database. The problem is that I seem to get duplicates.
If you're fetching them from database, use SQL to do your job. e.g. fetching 20 random questions (without repeating):
SELECT * FROM questions ORDER BY RAND() LIMIT 20