。
She got excellent grades on her finals.
Literal
She [topic-は] term-end exam [at-で] wonderful grades [object-を] took.
期末試験 ('end-of-term exam, finals') is built on 期末 ('end of period') + 試験 ('test'); a term-end fixture in Japanese schools and universities, scheduled in late July before the summer break and in early February before the spring break. 成績を取る is the standard 'to get/achieve a grade' collocation; 取る works productively for taking quantifiable results — 点を取る ('score points'), 賞を取る ('win an award'). The で here marks the setting/context where the achievement happened — 'at the finals.'