random question generation functional