I just encountered this problem myself and found the solution. In my particular case apache had crashed on the server hosting our moodle server. One quick restart and it was fixed. Once again the old IT Crowd addage "Have you tried turning it off and on again?" works 99% of the time.