Teacher has just calmed down the class:
...が、すぐにまたみんな口を開かずにはいられなかった。
but immediately, again everyone couldn't enter without opening their mouth.
I can't understand the phrase in bold. I'm not even sure whether it's
1) (口を開かずに)(は)(いられなかった) or
2) (口を開かずに)(はいられなかった)
I'm guessing that it's the first parsing and it's something like "Couldn't keep their mouths shut"/"Couldn't help but talk" etc. But if this is the case I can't understand how the grammar works. Could someone please break down the grammar and possibly give some other examples?