Code Tester

So basically I want to write a program that will help cashiers memorize codes. Take the numbers from a TXT file likes such


Choose a random line, and display a form like this

Cucumber [text box] [submit button]

The person enters the number (4040) into the text box and presses submit if they get it right it reloads with another random line, if they get it wrong they have to do it again.

Can anyone help me out with this?