I used to try to give midterm exam using Moodle quiz. I found out that some of the students connected Internet to get information and some used messengers to communicate each other. Many students complained about the fairness of the exam after the test.
So the Moodle Quiz as a midterm exma bacam unhappy memory to me. I happened to find a SEB (safe exam browser) which control the internet and application access through the browser action control. Teachers can configure different files for each different examination environment or utilities.
The concept of SEB is a teacher makes a SED configuration file and can distribute it. After the SEB configuration file is set up, it can be executied in SEB installed computers. In the configuration file Moodle quiz access information is included, so they can access the Moodle quiz using SEB configuration file. Of course you have to be careful, when you configure a SEB file. The key value for each configurtaion file is provided which should be provided for Moodle quiz as an option. Please take a look at the video.
Here is the video applying SEB on real exam.