Description

This only happens to Chrome browser in my tests. I only tested it on 2.1.1 and 2.2.2, but I think it happens to all other versions of Moodle 2 as well.

When editing a matching type of question, if the existing questions contain an image from Moodle data folder (i.e. images with URL like "http://URL.TO.MOODLE/draftfiles.php/..... e.g. using an existing image file picked from file picker or uploading a new image file through file picker), and you click the button "Blanks for 3 more choices", WYSIWYG editor won't load on the refreshed page, only plain text editor will show on the page.

Chrome error console gives different errors in different versions:
in 2.1.1, it gives:
Refused to execute a JavaScript script. Source code of script found within request.
Resource interpreted as Script but transferred with MIME type text/html: "about:blank".
question.php:714Uncaught TypeError: Object #<Object> has no method 'add_module'
Refused to execute a JavaScript script. Source code of script found within request.
question.php:732Uncaught ReferenceError: YUI is not defined

in 2.2.2, it gives:
Refused to execute a JavaScript script. Source code of script found within request.
Resource interpreted as Script but transferred with MIME type text/html: "about:blank".
question.php:628Uncaught TypeError: Object #<Object> has no method 'add_module'
Refused to execute a JavaScript script. Source code of script found within request.
yui-min.js:8Uncaught TypeError: Cannot call method 'load_flowplayer' of undefined

This doesn't happen to Firefox browser in my tests. If the existing questions don't contain images or only contain external images, this doesn't happen either.