Resources in 2.0

Resources in 2.0

by Martin Dougiamas -
Number of replies: 16
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Following on from the complete rewrite of file handling in Moodle 2.0 (see File API and Repository API docs), we need to rewrite the resource module to:

  • take advantage of the new File features and
  • improve security and portability of resources

This document outlines the current plan: Resource module file API migration

The first major thing you will notice is that the current single resource module (with various subtypes) is being broken apart into several full modules: resource, page, url, folder and imscp.

I know this will seem like a rather extreme change, but I think the rationale is there, and a major release like Moodle 2.0 is the time to do it.

We would love your feedback about this plan and your help in thinking about it. Please read the document carefully and reply here with any thoughts you have about it (or start new discussions in this forum).

Average of ratings: -
In reply to Martin Dougiamas

Re: Resources in 2.0

by Red Morris -
It's quite a change indeed, but I think now is the time to do it. People don't like change, but it's best to do it in one go than constantly move the goalposts.

I don't see anything in there that isn't positive, but I didn't see something I was hoping would be in there.

One of the first things I teach users to do when introducing Moodle is uploading a resource, and immediately I have to appologise for something they (and I) find unintuitive. When you have just uploaded a file you must then specify that you want to choose it. While sometimes you need to choose or upload another file, most of the time you don't. Will Moodle 2.0 default to choosing the just uploaded file?
In reply to Martin Dougiamas

Re: Resources in 2.0

by Robert Brenstein -
Wow! This is great. Definitely a step in the right direction. I love that local file and url resources will be (finally) separated and the individual resources will behave like other module plugins. Creating a common library for resources to make things easier for developing would be a good idea (it is mentioned now as possibility only). I feel that the repository should be its own plugin and any external repository should also be implemented as its own plugin. Modularity rules.
In reply to Robert Brenstein

Re: Resources in 2.0

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In Moodle 2.0, repositories are already their own type of plugin, and they can be used through the 'filepicker' wherever you need to get a file into Moodle.

For example when choosing the file for a file resource, when embedding a picture in the HTML editor, when choosing which file of questions to import into the question bank, ...
In reply to Tim Hunt

Re: Resources in 2.0

by Robert Brenstein -
in Development:Resource_module_file_API_migration#Resource_types_mapping the last line suggests to map repository onto mod/url
In reply to Robert Brenstein

Re: Resources in 2.0

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Repository in Resource module means HarvestRoad hive repository. This is a special type of remote repository.
In reply to Martin Dougiamas

Re: Resources in 2.0

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I think this is an excellent plan!

And the comment I have isn't even about the content of the plan, but about one bullet point in the first part... smile I'm almost sure this is not relevant but it was mentioned there so....

There is mention of media embedding in conjunction with TinyMCE.

By default, the way TinyMCE does this is that it embeds the actual <object> tag etc for that media item, which is probably not appropriate. If using TinyMCE in core Moodle, I would highly recommend removing its media embed feature and making one which relies on Moodle's own multimedia filters (ie by just adding a link), so that media files can be consistently presented (and the HTML code can be updated in future if need be, by changing the filter not every single instance) and so that there are no additional security issues.

Any integrated feature could then know about media plugin settings, so that for example it doesn't offer to embed SWF if you are a student and are not allowed to.

If there isn't time to do clever integration I would recommend just disabling the media embedding feature and relying on the 'link' one instead.

Anyhow just thought I'd pass on some of our experience of TinyMCE's media plague embedding. No comments on the substantive part of the document. smile

--sam
In reply to sam marshall

Re: Resources in 2.0

by Dale Quattrin -
I have another question/suggestion. Will 2.0 simplify the ability to edit uploaded files? I have just upgraded to 1.9.5 from 1.8, so maybe this is already done. However, I find it very convoluted that when I make a simple change (say adding a comma or a phrase in a Word document) that I have to go through about a 10 minute process of saving the changed document to a local location, working my way through Moodle to the resource location, deleting the resource hot link, going to the uploaded files list, deleting the old uploaded file, uploading the new file, and, finally, recreating and repositioning the resource in the class assignments. Sometimes I have to do this more than once because, for some reason, the new resource file is not recognized. If I have to do this for more than one changed document, it quickly becomes very time consuming and frustrating.

It would be a LOT easier if one could edit and save the resource file directly from within Moodle and save the file so that Moodle recognizes immediately.
In reply to Martin Dougiamas

Re: Resources in 2.0

by Dave Balch -
Looks like the right thing to do, and the right time to do it smile

For my own needs, I'd like to mention that Filtering of uploaded html files should work on XHTML as well as HTML - see MDL-9443.

Cheers,
Dave.
In reply to Martin Dougiamas

Re: Resources in 2.0

by Ray Lawrence -
Yes, with everythng else that is changing this would seem to be a good time to tackle this. I've commented in Doc, but for discussion here...

The term "directory" is meaningless unless explained to most teachers etc. This would be a good tim to standardise the resource/course files terminology on "folder". See MDL-11841.
In reply to Martin Dougiamas

Re: Resources in 2.0

by Matt Gibson -
Hooray!

My thoughts:
  • Hopefully this means one dropdown per topic sction instead of two
  • I think each repository should appear as a sub-type on the drop-down (combined with the third point about JS). I know they are there in the file picker, but this isn't ideal IMHO because:
    • it adds an extra click each time to shoose the right one
    • it obscures the options that the filepicker offers in case people are new or in case a new plugin has been added that they haven't seen
  • Have a progressively-enhanced JS layer that will use YUI dialogue control to allow links and files to be added without leaving the course page. This is the number one thing people want to do and it really doesn't need a whole new page - just title and file/link. The advanced options can be accessed via the editing icon(s) after it's added. The Project course format is a good start here. The JS can add extra options to the dropdown via DOM and open the file picker at the right plugin if necessary.
In reply to Matt Gibson

Re: Resources in 2.0

by Matt Gibson -
I should also add that resource pages with embedded images currently lose those images when a backup of the course is transferred to another site. This needs a fix and would be good to address now.
In reply to Matt Gibson

Re: Resources in 2.0

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Resources should not loose images during backup/restore in latest releases.

Recently there was one problem fixed - it was caused by different slashargument setting on target/source server. The linked images must be from the same course and must not be in moddata subdirectory.
In reply to Martin Dougiamas

Re: Resources in 2.0

by Dan Poltawski -

Looks good, here are my comments:

1. Migrate legacy files options on module edit screen

I understand why we need the flag, but must we really expose this to teachers? I think its a step backward to add options like this which are not relevant to teachers on the module edit screen.

2. Opening of New Windows

Completely agree with the reasons for removing the options for new windows.

However, in real usage of moodle, opening resources in a new window is still used extensively and I just don't think we can remove this functionality.

3. Post-upgrade processing

Regarding:

So the admin will have to sit there and go through all these resources and check them off to complete the upgrade. Until this process is finished none of these operations can be guaranteed to work so we might even think about disabling those operations:

  • Backup
  • Restore
  • Import of a course

Instead of disabling those functions, could we not prompt the user to do the checking process at the time of backup? That way the burden isn't solely on the admin user to verify every single resource.

In reply to Dan Poltawski

Re: Resources in 2.0

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Dan: do you mean opening of "Web page resources" in new windows? That is the only one I was proposing to remove.
In reply to Martin Dougiamas

Re: Resources in 2.0

by Mark Pearson -
I have read the resource module file API migration document all the way through. It looks like a plan whose time has come. But it seems to me that there's one aspect that's missing. Maybe I spend too much time associating with Librarians but I saw no reference to handling metadata associated with Resources. The only space where information that could be termed metadata can be recorded is free-form in the 'introduction' field. This means that searching for resources over a collection of courses is basically about searching for file names. I'd like to think of faculty building up a central collection of useful resources common to a number of courses which they can label and tag and search easily. Metadata could surely be extracted from Word files, MP3 files, JPGs etc for starters. I'm not suggesting that every resource have Dublin Core metadata associated with it, but I do think that the usefulness of Moodle resources would be greatly enhanced by a simple metadata scheme which was searchable.