For checking if your problem is the configuration of the local network, I Would Start checking the httpd.conf in apache webserver. Checking if the parameters of DNS are correctly set. Asuming you are using an IPV4 network, and not using DNS, you have to configure your webserver to not to resolve names Directive 'CanonicalName' for example in the apache config files.
You have to tune all the netwok parameters for the local network, and not to route to the Internet. In Linux servers in the network-scripts under etc you have all the parameters you have to setup.
Also check your resolv.conf file and point it to resolv first your hosts file and will easy your setup.
You can setup a local DNS server with bind and edit zones in your isolated LAN, but it's some work to do and beyond the topic.
Finally i think you could setup yor examination system on a network conected to the internet, and isolate completely the acces of your clients by doing restrictive setup to your apache webserver, seting a ssl certificate, and configuring the security properties of the same moodle tools, and could be much easier.. And is totally safe.