I assume from what you're saying that Ace never loads correctly, is that right?
Please tell me a bit about your server (CPU type, number of cores, memory size, disk size). AFAIK most users don't have this problem so there must be something unusual about your server - can you think of anything yourself? [**EDIT** Please also tell me what versions of both Moodle and CodeRunner you're running.]
I also assume the problem occurs with multiple different browsers (at least Chrome and Firefox), while either editing or previewing a question. Please confirm.
Since I can't replicate the problem myself, you'll need to tell me more about the exact symptoms if I'm to help. So please do the following:
- Using the Chrome browser, open a Preview window for a CodeRunner question. It will presumably display the "Ace editor not ready" message. Then open a DevTools window for that preview page by typing SHIFT+CTRL+I. Select the Network pane in the DevTools window then go back to the Preview window and reload the page (CTRL+R). Make a screen dump of the entire DevTools window. It should look something like the first of the attached files.
- Click the ace.js line in the DevTools window and in the right-hand pane, select the Timing panel (from the Headers/Preview/Response/Cookies/Timing menu along the top). Make a screen copy of the relevant information as in the second of the attached files.
If what you're seeing is a timeout in the loading of ace.js, you could also try switching to the Firefox browser and increasing the value of network.http.connection-timeout in about:config. It defaults to 90 seconds. Try doubling it and reloading the page.