Simple Question on Managing Media Files

Simple Question on Managing Media Files

by Philippe Decloitre -
Number of replies: 31

Hello,
I have been working in Moodle 2.2 and test driving 2.3...and ever since I've been wondering how it is poosible to do what follows (which was very simple in 1.9):

I have a series of HP files (say 10 for the sake of discussion).
They all have one same background image.
I generally insert the image like this:

<img src="image/image_01.png" alt="image_01.png" title="image" width="240" height="181"></img>

I would like at some point to change this image for all the series.


In 1.9 I used to upload the new image into Moodle, in the same folder, with the same name, and thus overwrite the previous one.

I also used the same procedure for sound and video.

But now, how am I to go about it?

If I change the image for one activity (file), the 9 others are left untouched. Am I now to change the image in all the 9 other HP activities?

Thanks for your help.

Philippe

 

Average of ratings: -
In reply to Philippe Decloitre

Re: Simple Question on Managing Media Files

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Philippe,
this issue  is the single biggest reason why TaskChain has not come out yet, namely Moodle 2.0 - 2.2 doesn't let you sync the same file used in several activities.

I hope and believe that Moodle 2.3 will address this issue, so please give the hard-working team at Moodle HQ all the encouragement you can to implement this functionality smile Go Moode core  - YAY!

regards
Gordon

In reply to Gordon Bateson

Re: Simple Question on Managing Media Files

by Philippe Decloitre -

Gordon,

Thank you so much for your answer!

I was begining to wonder if it was just me, thinking that maybe there was something I had not gotten right...

Now I'm sort of relieved, thanks for your spelling things out (in French: "mettre les points sur les "i" " smile

--------------------------

I've been working a little on the Moodle 2.3 demo site (http://qa.moodle.net/). There was nothinf new in that regard as of yesterday (but then again there is not HotPot module installed, so I'm jsut trying to figure things out from the Scrom point of view). Maybe something is the the pipelines?

At any rate, as I've said before, you've got all my encouragements, and if I can participate to the French tranlation, as I did for QZPT, don't hesitate to call on me.

Best regards,

Philippe

In reply to Philippe Decloitre

Re: Simple Question on Managing Media Files

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

HI both! Yes -if you look at the release notes mention is made there -have a look at the screenshots of "aliases" http://docs.moodle.org/dev/Moodle_2.3_release_notes

Average of ratings: Useful (3)
In reply to Mary Cooch

Re: Simple Question on Managing Media Files

by Philippe Decloitre -

Hello Mary,

thanks again for your ever right-on-the-spot link smile

Looks and sounds promising!

I'm going to look into it asap.

In reply to Mary Cooch

Re: Simple Question on Managing Media Files

by Philippe Decloitre -

Mary,

I have done my homework on Moodle 2.3 beta but must must return to the teacher smile

Warm up: Here is my wish (short version): I want to upload more than one HP activity that refer to the same media ressource (image or sound, you name it..). I want to be able to change this ressource once, and the change to affect all the HP activities.

Context:

Here is my structure:several HP files and a folder (called here "images") containing one file called 'image_01'

Here is my procedure:

1: I upload the bulk of the HP files and the ressource folder as I create a first HP activity ("activity N°1").

2: I duplicate the activity (creating "activity N°2") and choose another "main file".  This way I have not really duplicated the "images" folder, bur created a link (am I right?)

3:If I change the "image_01" file in the "images" folder of my first HP activity, no change appears in my duplicated activity. 

Here is my question:

How can I tell activity N°2 that its "images" folder is a shortcut to what I uploaded in "activity N°1"?mixed

Thank you Mary smile

Philippe

In reply to Philippe Decloitre

Re: Simple Question on Managing Media Files

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Philippe,

I've just tried your scenario and it works fine for me. I think you missed the "Create an alias" step somewhere in your scenario, at least you do not mention it (see attached screenshot). Too late today for posting a step-by-step, but will try tomorrow or after the week-end.

Joseph

Attachment 08-06-2012 23-37-48.jpg
In reply to Joseph Rézeau

Re: Simple Question on Managing Media Files

by Philippe Decloitre -
Hello Joseph, Thanks for stepping in! I'll stay tuned...for the step by step smile Philippe
In reply to Joseph Rézeau

Re: Simple Question on Managing Media Files

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Here we go...

A. Creating a HP activity with a view to future updating.

  1. On your computer, create a folder e.g. "hotpots" with a smiley01.jpg file in it.
  2. Create a JCloze exercise (lorem) with one embedded image (smiley01).
  3. Save the lorem.jcl file on your computer in the same folder with its smiley01.jpg file.
  4. In your Moodle 2.3 site/course, go to your "My Private files" repository, Manage my private files and create e.g. a "hotpots" folder.
  5. Upload the lorem.jcl and smiley01.jpg files to that HP folder. Using the classical filepicker system or the new to 2.3 drag&drop feature.
  6. In your Moodle 2.3 course, Add an activity: HotPot.
  7. General / Source file name / Add (do NOT use the drag&drop feature at this stage, see bug report).
  8. Point the file picker to the My private files repository.
  9. If you think you may have to update your lorem.jcl file with a new version in the future, uncheck the "Make a copy of the file" button and check the "Create an alias/shortcut to the file" instead. If you select the Alias feature, you will notice that your file has a little blue arrow attached to it in the bottom left corner.
  10. Ditto with the smiley01.jpg file (Copy or Alias according to your future plans).
  11. Complete and save the "Lorem" HotPot activity as usual.

B. Updating the HP activity

  1. On your computer, edit the lorem.jcl activity (maybe add more blanks, etc.) You can also change your smiley01.jpg file to a new version.
  2. In your Moddle site go to your "My Private files" repository, Manage my private files "hotpots" folder.
  3. Click Add / Upload a file to upload the new versions of your lorem.jcl file (and smiley.jpg file).
  4. You will be warned that "File exists/A file with that name has already been attached". Click the Overwrite button. This will replace the old versions with the new ones.
  5. Do not forget to click the Save changes button before leaving that page (a minor ergonomic nuisance).
  6. Now go to to your Lorem HotPot activity and check that you can view the new, updated version of your exercise.

C. Duplicating an HP activity

Now that you have "prepared the ground" with aliases, you can duplicate your HP activity, and any time you update your hot potatoes files - as explained in §B - (and associated media) all your original and duplicated HP activities will be automatically updated.

Joseph

(Edited by Gordon Bateson - original submission Saturday, 9 June 2012, 04:38 PM: added "go" to point B6)

Average of ratings: Useful (3)
In reply to Joseph Rézeau

Re: Simple Question on Managing Media Files

by Glenys Hanson -

Hi Joseph,

That's incredibly useful. I've carefully copied and filed it for future reference.

Thanks a million!
Glenys

In reply to Joseph Rézeau

Re: Simple Question on Managing Media Files

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

ERRATA blush

In my "step-by-step" above, point B.6 should read "Now go to your Lorem HotPot activity ..."

Screenshot 2 should come first.
Joseph

In reply to Joseph Rézeau

Re: Simple Question on Managing Media Files

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Great explanation Joseph - thanks for that! approve

I added the "go" to point B.6 in your earlier step-by-step explanation.

Point A.10 was interesting for me ...

  1. Ditto with the smiley01.jpg file (Copy or Alias according to your future plans).

It would be great if we didn't have to copy secondary files like this, but I can see that without it, we wouldn't be granted access to the images in the teacher's "Private files" even though we have given access to the HP file, via its alias.

Personally speaking, and this is not directed at you at all Joseph, but I think the Moodle 2.3 file picker still leaves a lot to be desired. You can't drag-and-drop folders, you can't edit files, you can't unzip zip files, you can't use FTP, you can't set the default action to be to "link" instead of "copy". Apart from the drag-and-drop, I find it a very manual system, and very awkward when you are handling large numbers of files in a deep folder hierarchy, shared across several activities, or several courses.

It is claimed that the Moodle 2.x file storage system makes backups more self contained, and increases "security", but I never had a problem with the wrong person accessing my HP files, and I much preferred keeping the backups of the database and the files separate, because I can use a number of external tools to upload, synchronize and backup my files, which then leaves the database backup nice and small. We can't go back, but I hope the Moodle 2.x file system continues being improved to the point where handling files becomes at least where we were in Moodle 1.9.

Hopefully, I have missed the point completely with Moodle 2.x files, and someone can show me how it is all now so simple.

regards
Gordon

Average of ratings: Useful (2)
In reply to Gordon Bateson

Re: Simple Question on Managing Media Files

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
If you have a lot of files like that it should be in a repository. The simplest external repository would be the Filesystem, try it out. Basically a folder on the server (which you can map to a network share, or access via FTP if you wish, etc).
In reply to Martin Dougiamas

Re: Simple Question on Managing Media Files

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Dear Martin,
thank you for the suggestion.

Spurred on by your enthusiasm, I revisited the "File system" repositories and went ahead and created one on my Moodle 2.3 system.

To give myself a point of reference, I first did some testing with a Moodle 2.3 "Private files" repository.

I first confirmed what Joseph eloquently described earlier regarding the alias functionality. When picking a file from the "Private files" repository, the alias/shortcut setting works as I expect, so that when I upload a new version of the file to my "Private file" repository, the new content appears in the activities that use that file.

I also confirmed these significant drawbacks with the "Private files" repository:

  1. you cannot upload whole folders at time
  2. you cannot unzip zip files
  3. you must create folders in the "Private files" repository by hand
  4. you must upload files one-by-laborious-one

As a result of these issues, I found the "Private files" repository to be unworkable when there are many files in a deep folder hierarchy.

I then looked at the "File system" repository. After several experiments, I established that to my surprise "alias/shortcut" does not work, and I re-confirmed that the issues that made "File system" repository extremely awkward and unintuitive for me as a file maintenance tool in Moodle 2.2, still persist in Moodle 2.3, namely:

  1. "Create an alias/shortcut" in a "File system" repository does not work as I expect it to. I expect choosing this option to mean that changes to the original file in the "repository" folder on the server will be reflected in the file content that appears in Moodle. This is not the case. I order to get changes reflected in Moodle, I have to delete the source file from the File Picker and then add it again from the "File system" repository.
  2. Secondary files, such as sounds files, images and styles-sheets have to be picked individually in the filepicker in every activity where there are used
  3. as a consequence of (2), adding a secondary file, such as an image or sound file, to the source file requires adding it individually via the "File picker" to each and every activity that will use it
  4. folders cannot be picked in the file picker. Instead you have to create a folder in the file picker and then go and add the files within it one-by-laborious-one.

The functionality that I am hoping for from the File picker is basically what we had in Moodle 1.9 where I can specify not only that one particular file is a "main file" but also that all files and folders within a specified folder on the server are available to users who are allowed to access this activity. Furthermore, any changes to the content of any of those files is immediately available to activity within Moodle.

I haven't figured out yet how to do that in Moodle 2.x, and I would be grateful for any pointers you can give me.

regards
Gordon

In reply to Gordon Bateson

Re: Simple Question on Managing Media Files

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Just a quickie - I haven't read all of your post yet Gordon - but the inability to unzip folders in private files is a bug that has been reported ( I  think by Joseph) so we are to hope this will be fixed as a matter of urgency.

Average of ratings: Useful (1)
In reply to Gordon Bateson

Re: Simple Question on Managing Media Files

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I guess we need to add the notion of a folder alias to solve the problem of micro web sites and so on. As for aliases not working for file system repository, I think that must be a bug, as it should have been implemented. Will look into that.
In reply to Martin Dougiamas

Re: Simple Question on Managing Media Files

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Dear Martin,
I love the idea of "the notion of a folder alias". This would really help HotPot users who often have numerous audio and image files embedded in the HotPot activity.

As a workaround at the moment, I have implemented "slurping" in the HotPot module for Moodle 2.3. By this I mean that if a HotPot uses a secondary file such as an image or audio file and the "hotpot_pluginfile" function (in "mod/hotpot/lib.php") doesn't find the required file in the HotPot files area, then the HotPot module will try to find the secondary file in the repository where the main file came from, and if it finds it, the secondary file will be added to the HotPot files area as an alias.

BTW, I have confirmed that zip files can be unzipped not only in the HotPot and Legacy course files, but also in a user's private files area. Thanks for fixing unzipping the private files area.

I have also confirmed that aliases are basically working on the File system repository.

Specifically, send_stored_file() will always send the latest version of the file from the File repository. For this reason HotPot html files shown via a Moodle Resource activity will always be up-to-date, and images and sound files shown via the HotPot module are always up-to-date.

However, when the HotPot module tries to retrieve the content of a file using $stored_file->get_content(), it doesn't seem to get the most recent version of the content. It seems it gets a cached version. The latest version only becomes available via the $stored_file->get_content() function after the "lifetime" (in the "files_repository" table) has elapsed. The only way I can get the latest version with $stored_file->get_content(), is to brute force the "lifetime" field to zero before calling $stored_file->get_content(). I am sure that's not really legal, and when I find the proper way to do it, I will.

When I have clarified these ideas a little more in my own mind, I will add tracker issues and discuss them further with folks.

best regards
Gordon

In reply to Gordon Bateson

Re: Simple Question on Managing Media Files

by Philippe Decloitre -

Hello to all that have participated in the "Simple Question on Managing Media Files". All input has been VERY useful to me, and if I may, I would like to thank everyone.

The procedure described by Joseph Rézeau works very well for schemes with only a few media files or images.

However, I am working with sets of of media clips that number in the tens and my exercises are generally around fifty for one series.

There is an urgent need for folder aliases as described by Gordon.

Once this step is taken, I think we're on to something.

This seems to be the only way to go, unless there is a way to link to files that are within a zipped file. Is there in Moodle?

I know it works within Nuxeo (webengine)...

Philippe

In reply to Joseph Rézeau

Re: Simple Question on Managing Media Files

by Philippe Decloitre -
Hello Joseph, Very interesting indeed! Well explained, clear anf full of essential details! I'll just say with Gordon, that the file picker is a bit choosy ...'-) but at least, there's a way now. I'll return to my homeworks and raise my hand when I get stuck again... (I've got a feeling it wont be long '-) Thanks for all Joseph
In reply to Joseph Rézeau

Re: Simple Question on Managing Media Files

by Jeff Finnan -

Hi All,

Can one organize media files, particularly images, in subfolder? I generally like to keep them organized that way. Or, it is better to have all, HotPots and media all in one folder?


Thanks,

Jeff

Presently using Moodle 2.2.

In reply to Jeff Finnan

Re: Simple Question on Managing Media Files

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Jeff,
yes, you can certainly create folders within the HotPot's source file area, and put your image files in there. The basic idea is that within the HotPot'S source file area you are aiming to re-create the file and folder structure that you use outside of Moodle.

The attached screenshot shows where the "Create folder" button is on the HotPot file picker. Once created, you click on the folder's icon within the file picker to enter the folder, and from there you can add more files or create further sub-folders.

cheers
Gordon

Attachment sourcefile.add.folder.jpg
Average of ratings: Useful (1)
In reply to Gordon Bateson

Re: Simple Question on Managing Media Files

by Jeff Finnan -

Hi Gordon,

Thanks for this. Having seen some issues with paths to files causing some problems, I was not sure.

Can I upload  a zip file of the whole shebang and unzip it? Or are there issues with compressed files and Moodle 2.x?

Thanks,

Jeff

In reply to Jeff Finnan

Re: Simple Question on Managing Media Files

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Jeff,

I believe it is now possible to upload a zip file and unzip using the files "unzip" option.

  • In Moodle 2.2, the unzip option appears when you click the menu icon at the bottom right corner of the file as it appears in the file picker.
  • In Moodle 2.3, the unzip option appears when you click on the file and view its Moodle properties info

cheers
Gordon

In reply to Joseph Rézeau

Re: Simple Question on Managing Media Files

by Patrick Verguet -

Hello everybody

I apologize for adding to a relatively old discussion, but I realised after I posted a comment in another discussion linked file updating problem that it may also be relevant here.

Patrick Verguet

In reply to Patrick Verguet

Re: Simple Question on Managing Media Files

by Philippe Decloitre -

Greetings to all,

I have been working on the latest Test Moodle at  "demo.moodle.net" lately. I have found a bug  which I described here (MDL-36133): MDL-36133?focusedCommentId=184261&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-184261" target="_blank" rel="noreferrer noopener">DIRECT LINK: impossible to update a linked file .

To sum it up, the bug makes it impossible to upgrade (i.e overwrite) media files once you've set up a HP/SCORM activity linked to the said files.

If you have found the same issue, it would not be a bad idea to vote on it or at least "watch" it (in the "more action" tab) so as to have it "stand out", it being an essential bug.

On the other hand it may just be that I have overlooked something (though I have run the operation several times, on different occasions,  with the same results)...

Comments greatly appreciated.

Philippe

In reply to Philippe Decloitre

Re: Simple Question on Managing Media Files

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Philippe,
I would like to see that issue fixed too.

It occurs to me that the folks at Moodle HQ may find the issue easier to approach if you can replicate the problem in the the Resource module. The Resource module is a simpler module that gets more tender-loving-care from HQ than SCORM or HotPot, and therefore the Resource module is probably more familiar to more programmers, and hence more likely to get attention.

best wishes
Gordon

Average of ratings: Useful (1)
In reply to Gordon Bateson

Re: Simple Question on Managing Media Files

by Philippe Decloitre -

Hello Gordon, and everyone

I posted the "problematic" bug in the bug tracker as a "ressource" problem after having confirmed it behaves the same way within the "Ressources" realm which it does). The post is here for you to "watch" ( MDL-36166). It's a good idea to show you care (this comment is for the bulk of us) by clicking on "watching".

I've also posted an echo of it here, in the Ressoruce forum, just in case. In that post I've tried to give an in-depth explanation of what is at stake.

Cheers to all, and thanks to you Gordon smile
Philippe

 

In reply to Philippe Decloitre

Re: Simple Question on Managing Media Files

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Bonjour Philippe - thanks for your message and hi all. I just saw Michael D had said this had been fixed - I'm teaching  9 year olds this morning (needs all my attention! ) but later today I will look more at the issue and see what I can find.

Average of ratings: Useful (1)
In reply to Mary Cooch

Re: Simple Question on Managing Media Files

by Philippe Decloitre -

Bonjour Mary,

Thanks for your kind answer!

I saw Michael's and I must say I was disturbed. I did not expect a solution right away, but as far as I can see, I and those who use the same tools are in a cul-de-sac smile

I can't wait for your advice!!!

A très bientôt,
Philippe

In reply to Philippe Decloitre

Re: Simple Question on Managing Media Files

by Philippe Decloitre -

Addendum

I just received this from Michael:

"linked to MDL-35376 in your issues, but perhaps I should have directed you to that. That issue reports the same problems and it has been resolved so the fix should be in the latest weekly and in Moodle  2.3.4 and 2.4."

So it's great news, just a little patience and we should be able to get things rolling smile

Thanks again to all,
Philippe

In reply to Philippe Decloitre

Re: Simple Question on Managing Media Files

by Philippe Decloitre -

I have checked the alias/shortcut job in 2.3+.
It is just excellent!

Just a word to express my congratulation to those who worked at it.

It's now running in a superb way!

Moodle 2.3+ has become THE tool for e-learning!

Can't wait now, for Quizport (Taskchain). The new working feature should now unleash Gordon's genius.

Cheers to all and Gordon

Philippe

Average of ratings: Useful (1)