Whether image embeds properly in Quiz answer box seems to depend on where it's copied from?

Jump to solution
jrs294
Community Explorer

Hello,

This is a bit of a long question on a very narrow topic...

The quizzes I'm designing for my students prompts them to embed images as their answers. I want to do it this way because when I've had students upload images in the past, students have often submitted answers before the file finished uploading.

I have a web-based app that creates URLs for embedding images. Pasting them into the Quiz answers box automatically embeds the image. (Using the "embed" feature from the menu does the same thing.) Strangely, whether the embed works or not seems to depend on what the URL was copied from. That is , when I highlight the URL in the app that creates the image, click Control+C, and then paste into the Quiz answer box, I see the URL rather than an image preview:

Screenshot 2024-06-26 5.36.56 AM.png

Screenshot 2024-06-26 5.39.46 AM.png

When I use the "COPY URL" button, for the embed URL, in the app creating the image, pasting this into the Quiz answer box works:

Screenshot 2024-06-26 5.41.49 AM.png

Screenshot 2024-06-26 5.43.45 AM.png

A very strange thing about this is that if I copy the URL from the app (see picture above), although it doesn't bring up the preview in Canvas' answer box, if I paste it in Notepad (or Word or whatever) first, then copy again, and then paste in the Canvas answer box, it does automatically bring up a preview.

Any theory of what's going on here?

The app I'm using to create these diagrams and embed codes for images of them is mine. The point of the embedd image URL feature is to be able to embed images in Canvas quizzes. So we can tweak the code to solve this if anyone knows what the problem with the highlighted and copied URL is.

Thanks!

0 Likes
1 Solution
chriscas
Community Coach
Community Coach

Hi @jrs294,

It probably comes down to what's actually being copied to the clipboard with the various methods you're experimenting with.  I know copy/paste seems like such a simple concept, but I think there's a lot more going on behind the scenes when something is copy/pasted than most realize.  You can take a look at the info on this page from Nirsoft, explaining that when something is copied, usually there ae multiple different formats of that data put into memory.  As @james_whalley mentioned, I bet for one of your methods, the URL is being copied as HTML code, which then pastes that same way into the RCE.  Another method might just be copying the raw URL text, which the RCE them translated to the embedded image you want.  The page has a utility (windows-only) you can use to view what's going on when you copy, so maybe that will help you track things down.

Hope this helps a bit!

-Chris

View solution in original post