Pop up question

Hi guys. I wanted to do something like when user click on the button the question will pop up. Then if the user gets the correct answer on first try or second try. The pop up question will close. In conclusion, the pop up question will close when the user gets the correct answer. Can someone teach me how to do this? It sounds simple but I just can’t manage to do it. =/