She was not only a good teacher but also a great scholar.
Literal
She [topic-は] good teacher is [nothing but-ばかり] [not-でなく], great scholar was-also.
~ばかりでなく is a fixed pattern meaning 'not only X but also Y.' It builds on ばかり ('nothing but') + でなく ('not being') to create the 'not only' meaning. でもあった ('was also') provides the 'but also' counterpart. A useful set phrase for expressing dual qualities.