There are times to collaborate in school. They are called "Group Projects".
There are times when the class wishes to test individual skills and knowledge.
These are called "Individual Tests".
If the "Individual Tests" are taken by draining the answer bank into a collaboration document, then that doesn't really fit the requirements?
Each course gives you a syllabus the first day. That is your contract for the class. If you don't like it, you march yourself down to the registers office, and un-enroll and get your money back. On the first day (some schools week/s) of class, there is no fee or penalty.
Can the testing system be tightened up? Sure. Will it be 100% secure? Never.
Quick thoughts -
Step 1) Don't disclose right/wrong answers. If the teacher wishes to, he can do a test review - covering the most often answered incorrect answers without bleeding out his test bank. And, this keeps the solutions from being revealed while there are still people with the exam to take.
Step 2) Paper tests and Scan-trons.