Copy-paste images are not visible to students

Copy-paste images are not visible to students

by Steve Bond -
Number of replies: 2

Hello,

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:

Page as viewed by admin, with both images showing

Now, I log in as a different user, a student in my course. I return to the page, and this is what I see:

Page viewed by a student user, with pasted image missing

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.

Thanks all

Steve

Average of ratings: Useful (1)
In reply to Steve Bond

Copy-paste images are not visible to students

by John Provasnik -
Picture of Particularly helpful Moodlers Picture of Testers
I think some of this is browser dependent. Safari will show you that there is a broken image.
In reply to John Provasnik

Re: Copy-paste images are not visible to students

by Steve Bond -
Hi John,

Thanks for your reply. Actually, the browser doesn't make a difference, as this is a server-side problem. Moodle is completely stripping out the image at the rendering stage. So Safari shows an empty space, same as other browsers.

Best wishes

Steve
Average of ratings: Useful (1)