quiz function and ui