Idiom that I should use in my sentence (paragraph).

-in some cases

-in the name of

-end up

 

In some cases, I had to study in the name of the test despite the fact that I didn't feel well enough to study.

Of course it ends up a good grade.

 

(I'm not sure whether it's right beacuse I don't know how to use " end up".)