Changes to pasted content are replicated in the content it was copied from

Hello,

In content types such as Question Set, Interactive Video, Course Presentation, etc.—the ones that support a bunch of other smaller content types inside of them—I've noticed that using the copy-paste feature does something odd to the content. For instance, once I was making an interactive video with a bunch of fill-in-the-blanks buttons throughout the video, and rather than starting from scratch every time I wanted to make a new FITB button I copied the first one to the clipboard and used it as a template to paste into later parts of the video.

When I went back and re-checked the questions to make sure everything was accurate, I noticed that the first FITB button I'd made (the one I'd copied to the clipboard and used as a "template") had changed, without my doing anything, to match the last one. So I made a button asking the user to label a chair with the word "chair," copied the button to the clipboard, pasted it into a later part of the video, and changed the answer so the second button was asking the user to label an armchair with the word "armchair." Except when I went back and looked at the first button, the first answer had inexplicably been changed to "armchair" as well. In other words, changing the pasted content changed the original content it had been copied from.

This also happens when I use my own multiple-choice questions as templates in question sets and things like that. Obviously there's a workaround—not using the copy-paste feature at all—but this would be really annoying, seeing as the copy-paste feature is especially useful when I'm trying to create a quiz or an interactive video with a lot of similar questions, and this doesn't seem like it should be happening. This is on H5P.com, Google Chrome, Windows 10 desktop computer, no changes or errors in the browser that I'm aware of.

BV52's picture

Hi uwmlrc,

I am unable to reproduce this issue on my end. I tried using Chrome, Firefox and Edge creating the contents in Drupal 7, Wordpress and Moodle (haven't tried Drupal 8 I can't install it for some reason).

Have you tried using a different browser? If it works on a different browser I can only assume that there may be a plugin or cache issue on the browser that you normally use.

-BV52

All right, I guess I'll have to assume that's it. Thanks for looking into it.

otacke's picture

Hi uwmlrc! Hey BV!

Sounds like something that might be caused by the H5P core keeping a reference to the original object instead of creating a copy. It's kind of strange however that this has not occurred on someone else's system before.

Best,

Oliver