Moodle flavours - GSOC 2011 Project

Moodle flavours - GSOC 2011 Project

by David Monllaó -
Number of replies: 19

Hi, I'd like your feedback on a project proposal that I'm sure you will find interesting...

I'm one of the Google Summer of Code (GSOC) students who will be working during this summer on a Moodle project. To be more specific on Moodle flavours, a project that aims to create a system to export and import packaged sets of site settings, plugins and languages packs, from one Moodle site to another; a "flavour" being the name of such a package.

With the amount of Moodle site settings and third party plugins availables it could be used in different ways, and could help administrators not experienced with Moodle to begin quickly.

The project mentor is Michael de Raadt, and during this community bonding period we will be refining the project with your feedback, so it will be much appreciated. Here are some specific questions you could answer:

  • what do you think should be included in a flavour package?
  • what do you think about the name (flavour vs flavor) there is a Moodle standard about the British/American naming?
  • what nomenclature should be used - backup and restore, export and import, packaging and deployment...?

Thanks in advance

Average of ratings: -
In reply to David Monllaó

Re: Moodle flavours - GSOC 2011 Project

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
  • what do you think should be included in a flavour package?
    • I suppose anything that you can change about the standard Moodle install without writing code yourself would be nice. Settings, plugins and language packs, as you say, seems like a good set to aim for.
  • what do you think about the name (flavour vs flavor) there is a Moodle standard about the British/American naming?
    • Depends which language pack you have installed smile
  • what nomenclature should be used - backup and restore, export and import, packaging and deployment...?
    • Backup, Restore and Import are already used in Moodle to refer to course functions, so I'd suggest picking something that doesn't conflict with those terms.
In reply to David Monllaó

Re: Moodle flavours - GSOC 2011 Project

by Bas Brands -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers

Great idea. This could be very usefull for making sure all our new installations are set up correctly.

  • what do you think should be included in a flavour package?

=> I would like to be able to backup and restore this:
custom translations,
backup settings, 
email settings,
security settings,
customized roles, 
grade scales
theme settings + non standard themes,
language packs, 
activated / deactivated modules blocks.

  • what do you think about the name (flavour vs flavor) there is a Moodle standard about the British/American naming?

The dutch translation would be: "smaak", . There used to be a strange dutch translation for the themes: "uitzicht", "smaak" would be just as weird.

  • what nomenclature should be used - backup and restore, export and import, packaging and deployment...?

Moodle configuration package or lazymoodleadminzip

In reply to David Monllaó

Re: Moodle flavours - GSOC 2011 Project

by John Beedell -

I love the idea of flavours.


As a developer I often need to be able to replicate a moodle setup as quickly as possible to be able to start working. And the idea of having just one development environment that I can switch from one project setup to another with a quick upload of a flavour file is really very attractive. And one more thing - a flavour could also becomes a form of backup for a site.


I must admit that I did my own minimal version of this last year, and it is available on github (https://github.com/Beedell/moodle-report_configcopy). This is not a Flavours but it may give you a start with some code ideas. At the time the ability to replicate most admin settings from one site to another was all that I required. So this was based on the existing admin config classes, and simply creates an xml file representing most admin settings and the upload of this file to another site. The best bit of all was that it works for Moodle 1.9 and 2.0 and the xml file will move many settings between these sites! (Let me know if you want 1.9 code ... though why would you.)


I did not do all the 'nice' elements that would enhance usability as outlined in the project proposal, like the ability to 'turn off' the import of certain bits. I mention this because I found that some admin settings (particularly session settings for us), if imported could lock the site, so the ability to selectivly import would be very nice.


So good luck with this project - I think it will be well used when you have done it.

In reply to David Monllaó

Re: Moodle flavours - GSOC 2011 Project

by JM Ferring -

Hi,

what about dulicating or cloning, as it's more  or less a copy of the site you will do with flavo(u)r.

Best regards and good luck.

In reply to JM Ferring

Re: Moodle flavours - GSOC 2011 Project

by David Monllaó -

Hi,

John: it seems really useful and only with 300 lines of code! If you are interested in site settings import/export with partial import you can try this plugin, it is also based on the admin_setting classes but it's only available for Moodle 2.0; supports most of the admin_setting types and allows rollback.

JM: If you only want to clone a site probably would be faster to copy the wwwroot and dataroot folders and dump & restore the database; if I'm not wrong only the config.php must be changed.

For your answers about the flavour vs flavor question I think that I didn't explain myself correctly sad sorry about that, the question is to give a name to the folder not about i18n.

Thanks to all for your feedback, we will be collecting your comments to refine the initial proposal.

In reply to David Monllaó

Re: Moodle flavours - GSOC 2011 Project

by Shane Elliott -
Picture of Core developers Picture of Plugin developers

Hi David,

Looking forward to seeing this. I think it will be a widely used feature in organisations that have a large number of moodle deployments eg school districts, health/hospital districts, etc. Exciting stuff, all the best with it.

what do you think about the name (flavour vs flavor) there is a Moodle standard about the British/American naming?

From the moodle coding guidelines ... "The default language for all code, comments and documentation, however, is English (AU)." - http://docs.moodle.org/en/Development:Coding#Internationalisation (So "flavour" is preferred if that's the term you choose to use).

what nomenclature should be used - backup and restore, export and import, packaging and deployment...?

Probably best to steer clear of terms that are already used just to avoid confusion so my vote would be for something like package/deploy.

Cheers,
Shane.

In reply to Shane Elliott

Re: Moodle flavours - GSOC 2011 Project

by Robert Brenstein -
> what nomenclature should be used

I like "clone" as suggested by someone.. creating a flavour file to clone configuration.
In reply to David Monllaó

Re: Moodle flavours - GSOC 2011 Project

by Mark Aberdour -

Firstly, this is an absolutely brilliant idea that should prove immensely popular! A few initial thoughts below.

what do you think should be included in a flavour package?

  • probably loads but the following come to mind:
  • activity settings
  • block settings
  • installed third party activities and blocks
  • current theme
  • system roles
  • homepage settings and content
  • selected courses

what do you think about the name (flavour vs flavor) there is a Moodle standard about the British/American naming?

  • I agree with the suggestion to use language packs to define
  • however, have you considered using 'distribution' or 'distro'?

what nomenclature should be used - backup and restore, export and import, packaging and deployment...?

  • package and deploy sounds the most appropriate to me
In reply to Mark Aberdour

Re: Moodle flavours - GSOC 2011 Project

by Mark Emery -

Don't forget Local Course formats as well as themes.

Probably the contents of the Moodle/LOCAL folder tree as well.

In reply to Mark Emery

Re: Moodle flavours - GSOC 2011 Project

by David Monllaó -

Hi,

Thanks all for your comments and ingredients suggestions, the framework used to package/deploy flavours will be extensible so will be simple to add new contents in future.

The Moodle Docs page (link) was updated with more details and mockups (the one attached is one of the deploy steps) that can give and idea of the system workflow. We are trying to make it simple, light and require few steps.

Attachment Moodle_flavours_deploy_ingredients_previsualisation_mockup.png
In reply to Mark Aberdour

Re: Moodle flavours - GSOC 2011 Project

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers

Keep in mind that we have been using package to refer to a combination of Moodle plugins. I like flavour and cloning admin settings. Peace - Anthony

In reply to Anthony Borrow

Re: Moodle flavours - GSOC 2011 Project

by David Monllaó -
Hi Anthony, Thanks for the reminder, we are only using packaging and deployment to name the actions available on the flavours project.
In reply to David Monllaó

Re: Moodle flavours - GSOC 2011 Project

by David Monllaó -

Hi,

There is a first version of the flavours packaging system available in https://github.com/dmonllao/moodle-local_flavours, it's only a demo and the generated flavours will not probably be deployable because of future changes in the resulting .xml format, but it can give you an idea of what could be included in a flavour.

All feedback will be welcomed smile

In reply to David Monllaó

Re: Moodle flavours - GSOC 2011 Project

by David Monllaó -

Hi,

The GSOC 2011 Moodle flavours project is completed. The different kind of supported contents (called ingredients) can be found here, the system supports almost all the proposed contents, and if there are special needs (scales, roles...) is easy to develop new ingredient types since there is a common public interface.

The latest version can be cloned from git://github.com/dmonllao/moodle-local_flavours local/flavours or downloaded from github https://github.com/dmonllao/moodle-local_flavours/zipball/master (please read the README before install) There is also a Modules & Plugins entry (link) but will be approved during these days. Is only available for Moodle 2.1 or higher.

At this moment is only translated to English, Spanish and Catalan (my mother tongue). The Moodle Docs page: http://docs.moodle.org/dev/Moodle_flavours

According to the timeline now we are on the testing period, so all the feedback will be greatly appreciated!

Thanks in advance, thanks to all how contributed with feedback during the community bonding period and thanks to Michael de Raadt for his continued support.

Attachment flavours_screenshot_package.jpg
Average of ratings: Useful (1)
In reply to David Monllaó

Re: Moodle flavours - GSOC 2011 Project

by Dan Poltawski -

Hi David,

Congratulations and well done!

I've had a skim through the code and noticed a few things (without looking in detail) that are not inline with moodle coding conventions, which you may wish to address:

  • You are extracting data from $_POST directly rather than using the moodle _param functions (with the Moodle cleaning functions). See Moodle Security Guidelines
  • For new code, it is best practice to use Renderers to output HTML

I hope to find some more time to look at this project in more detail as it looks really useful smile

dan

In reply to Dan Poltawski

Re: Moodle flavours - GSOC 2011 Project

by David Monllaó -

Hi Dan!

Thanks for your comments, I see that I'm not the only European working in summer time ;)

I get from POST only to obtain the selected flavour ingredients of the tree, they are dynamically loaded, the user input values are omitted, the var names are filtered with a [0-9a-zA-Z_] regexp and there is no DB interaction; all the other php arguments are obtained through optional_param() or moodleform()->get_data(). I could have load the tree structure into an array and iterate doing optional_param() but it may affect the performance and it this case it does not seems to be necessary.

I'll read about output renderers, I'm still more used to 1.x smile If you find any other thing please tell me and thanks again

In reply to Dan Poltawski

Re: Moodle flavours - GSOC 2011 Project

by David Monllaó -

Hi,

There was a blocker problem which does not allowed the project to be tested, now it is solved and the testing can continue smile

Dan, I've read about the renderers and changed the logic-view relation to allow renderers overwriting (https://github.com/dmonllao/moodle-local_flavours/commit/6057039378721fca7f4dc81cf5ee0f7cda1962c3)

In reply to David Monllaó

Re: Moodle flavours - GSOC 2011 Project

by Jenny Gray -

Hi,

this looks really interesting.  I'd love to see an open courseware flavour that could be made available for any-one wanting to apply configuration to open their Moodle courses up publicly - things like opentogoogle, self-registration authentication, more open permissions.

Do you have any idea when this development will make it into the core Moodle git repository?

 

Thanks

Jenny

In reply to Jenny Gray

Re: Moodle flavours - GSOC 2011 Project

by David Monllaó -

Hi Jenny,

I don't know if it will be in the core, AFAIK it depends on the code quality and it should be useful for a significant amount of users.