Metadata

General plugins (Local) ::: local_metadata
Maintained by Mike Churchward
The “local metadata” plugin has been created to allow extra, “metadata” to be defined and assigned to various context level elements in Moodle. It is an abstraction of the current “user profile field” functionality in Moodle and contains much of the same code. This was written for the MUA as a proof of concept for a project to add extra profile data to courses, to see whether one metadata function could be used for multiple Moodle contexts. It is currently in Beta, and is open for participation and discussion.
Latest release:
316 sites
357 downloads
28 fans
Current versions available: 5

Build CI status

The “local metadata” plugin has been created to allow extra, “metadata” to be defined and
assigned to various context level elements in Moodle. It is an abstraction of the current “user
profile field” functionality in Moodle and contains much of the same code.

The data model includes context level identifiers to allow the same data tables and API’s to be
used for all of the different context levels. The plugin has been designed with the ability to be
adopted into core, and completely replace the current user profile field feature if desired.

In its current concept state, the plugin provides metadata functionality for users, courses,
activity modules, groups, cohorts and course caregories. Other context levels can be added through
the context subplugin. NOTE, that the user metadata provided by the plugin is “in addition to” the
current profile data rather than replacing it. For now, it is really intended to show/prove that
this could replace the user profile data feature.

The plugin provides two subplugin types:
- Data contexts - These subplugins provide a Moodle context to apply metadata to.
- Data field types - These subplugins are the same as the user profile data types plugins.

Since it is a plugin, it can only provide interfaces that are available to plugins. For example,
adding specific data to defined course metadata elements must be done through a different
interface form than the main course settings form. The plugin takes advantages of Moodle
hooks and callbacks that allow screens and menus to be added to, where they exist. If brought
into core, these would be able to be more tightly integrated (this could also be better integrated
if/when the proposed “hook” system provides more hooking points).

The plugin can be retrieved from https://github.com/PoetOS/moodle-local_metadata. It
should be installed into the Moodle “/local/metadata/” directory (the “metadata” subdirectory
needs to be created). Make sure that the “/local/metadata/” directory contains the root of the
plugin.

Goto https://github.com/PoetOS/moodle-local_metadata/blob/master/walkthrough.pdf for a walkthrough
of the plugin in its current state.

Screenshots

Screenshot #0

Contributors

Mike Churchward (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Federico Bini
    Fri, 6 Mar 2020, 5:39 PM
    Hi Mike, your plugin is very usefull! I'll would need a Custum Field like "Menu" that use data give from a table into a DB (like https://moodle.org/plugins/profilefield_dynamicmenu),what do you think about this?
  • Mario Dumancic
    Thu, 6 Aug 2020, 2:22 AM
    Hi Mike.
    This plugin is perfect.
    Is it possible to automaticly populate the fields of the metadata course when you upload more courses via cvs files?
    Best regards,
    Mario
  • lourdes cid
    Wed, 16 Sept 2020, 1:37 AM
    I'm using metadata to add many more fields to courses and I see that backup/restore is not implemented, is it possible? Best regards, Lourdes
  • Federico Bini
    Wed, 16 Sept 2020, 2:29 PM
    @lourdes maybe you can solve your ploblem with this post (https://moodle.org/mod/forum/discuss.php?d=279891#)
  • Blair F.
    Fri, 18 Dec 2020, 7:21 AM
    Where do I find the "not visible" fields that are only visible to Admins? I don't see them, even though I'm an Admin.
  • Blair F.
    Wed, 20 Jan 2021, 3:46 AM
    Just checking back in a month later to see if anyone else is having the same issue I mentioned previously. I've also submitted to items here, but no response to that, either: https://github.com/PoetOS/moodle-local_metadata/issues . I'm just wondering if I'm doing something wrong, or are others experiencing this?
  • Blair F.
    Fri, 12 Feb 2021, 7:59 AM
    Is there anyone out there?
  • Blair F.
    Sat, 6 Mar 2021, 6:41 AM
    Does anyone have any idea of this plugin is still supported? There hasn't been any activity or responses to questions in quite a while.
  • Blair F.
    Wed, 7 July 2021, 11:08 PM
    Giving this another try. Since there was an update to 3.11 on May 27th 2021 it seems that this plugin is still supported in some way. However, I don't seen anymore discussion or responses to questions or issues on the bug tracker. As I mentioned, I'm incredibly excited about this plugin so I'm hoping to see some activity on it and see it come out of BETA stage. Can someone here just say "hi" to me so I know I'm not all alone here? big grin
  • Blair F.
    Thu, 8 July 2021, 12:09 AM
    I've now discovered that the reason my Teachers cannot see and update the fields I've set up for them is because they do not have the moodle/course:create capability. I guess this makes sense, but I wish there was a way to allow them update course information without giving them the ability to create new courses. Perhaps if it were tied to the moodle/course:update capability instead?
  • Blair F.
    Thu, 8 July 2021, 1:00 AM
    UPDATE: I managed to get it to work by changing line 111 of the context_handler.php from moodle/course:create to moodle/course:update. Now, An teacher can see and add course metadata without having the extra rights of creating a course.
  • Ben Girard
    Mon, 2 Aug 2021, 10:46 PM
    When adding metadata to a course, will the Moodle API return such metadata automatically? Is there any way to return such metadata via API?
  • Juan Gomez
    Thu, 7 Sept 2023, 11:26 PM
    Hello Mike,

    Thanks for this amazing contribution. I was wondering if it's on your plans to update the plugin for Moodle 4.1 and beyond. Let me know please.

    Thanks!
  • Valentin Granzikov
    Fri, 29 Sept 2023, 1:33 PM
    Hi, i have an issue that during course copy metadata of activities does not copy, how to fix it?
  • sadafe
    Tue, 16 Apr 2024, 8:09 PM
    this plugin has a bug. to reoslve that you must change the :
    in the root of this plugin lib.php
    line 76:
    local_metadata_definition
    remove default value from $instanseid. means remove " =0 " infront of $instanseid
1 2 3
Please login to post comments