If your girlfriend can re-take the test, offer to help her study for it. If she can’t re-take the test, help her study for future tests. You can also help her with homework or make-up options that will bring her overall class grade up. If she has to do a lot of research, offer to be her research assistant. Help her find a tutor if the subject is a difficult one for her. Knowing that you are willing to help improve her grade is in itself a priceless way to cheer your girlfriend up after a failed test.