I've found some strange behaviour in Moodle, I wondered if the community had any thoughts.
Suppose I create a Page in Moodle, and add two images to it.
For the first image, I open the image in Preview (or equivalent Windows application), copy it to clipboard, then paste it into the text editor (Atto or TinyMCE, same results on each).
Next, I add the image again in the proper way - I click the image button, select the file, upload, add alt-text and save. I then save the page and it looks like this:
Now, I log in as a different user, a student in my course. I return to the page, and this is what I see:
The pasted image is not visible to the student.
Now I know I am not supposed to copy-paste images into the text editor. But our users on the whole do not, and of course they do paste images in, as it is the most obvious easy way to add them. And because the image shows up fine to the editor, they do not know that there is a problem - but their students never see the image.
Looking at the code, I can see that the pasted image is stored in the HTML as a Base-64 encoded string of data. That code remains intact in the HTML after saving the Page, but Moodle is stripping it out when it renders the Page to the student.
Does anyone have any insights into this? For example, any answers to the questions:
- Why does Atto/TinyMCE allow the pasting of images at all, when it will not work?
- Why doesn't Moodle at least strip out the image for the editor, so they can see that there is a problem?
- Is there anything we can do, other than user training, to stop this happening?
PS I see on Tracker that pasting will be properly supported in 3.9, which is great. So hopefully this is a temporary problem.