Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

MoodleNet/tech/Moodle integration

From MoodleDocs
Revision as of 09:11, 6 September 2018 by Mayel de Borniol (talk | contribs) (create)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MoodleNet integration with Moodle core

Document about issue MDLNET-10.

Short URL: http://bit.ly/2mBAZgq 

What we're trying to achieve

Users need to be able to easily:

  1. Share content from their Moodle (entire courses or specific activities) to MoodleNet
  2. Search and import any type of MoodleNet resources from within their Moodle
  3. Import any type of resources[a][b] they come across when browsing MoodleNet into their Moodle

It would be nice if users could:

  1. Preview Moodle-specific resources on MoodleNet, without/before having to import them into their Moodle
  2. Sign into MoodleNet with their existing Moodle account
  3. Sign into their Moodle with their MoodleNet account

Where in Moodle could MoodleNet be integrated?

  • Login / Registration (sign in to your Moodle with your MoodleNet account, and vice versa)
  • Global search
  • Create new course
  • Add an activity or resource
  • Rich text editors -> Insert media -> Browse repositories
  • Share course
  • Share activity

Options for previewing Moodle-specific content[c]

The most challenging functionality to implement is allowing users to preview Moodle-specific content (resources/activities) from MoodleNet before importing content into their Moodle course

Because of all the different types of data possible, it seems obvious that we should leverage Moodle Core for this, with dedicated plugin(s). Here are options we’ve identified:

  1. Temporary course on user’s Moodle site - Add a "preview" UX flow to Moodle's import functionality, so that when a user clicks “preview” the content is seamlessly (1 step only) imported as a new course into their Moodle site, so the user can browse the content and if they’re satisfied they can then actually “import” (copy) the sections/activities they want into their existing course, or "delete the preview".
  • Pro: Mostly involves tweaking some Moodle UX and plugins.
  • Con: Users (or admins) might not feel comfortable importing random content from the web into their production Moodle instance.
  • Con: Slower, more friction.

        Option 1 is most likely what we’re implementing for the MoodleNet MVP.

  1. Moodle HQ-run preview site - Auto-import the content to one big dedicated preview site (powered by Moodle).
  • Pro: The content could be imported in the background as soon as it’s shared, and always be instantly accessible for previewing.
  • Con: Educators would have read-only access.
  • Con: The preview site would get massive and probably slow over time (solution could be to split the content between several sites).
  • Con: Requires adding an automatic mode (controllable by command line) to the import plugin.
  1. Temporary Moodle site at subdomain of moodle.net - Auto-import the content on a temporary Moodle site (similar to https://demo.moodle.net) which gets deleted after X hours/days.
  • Pro: Educators can get read-write access.
  • Pro: There’s already a system in place to do this.
  • Con: Slower, more friction.
  • Con: Requires adding an automatic mode (controllable by command line) to the import plugin.
  1. Import to user’s MoodleCloud site[d] - Import the content to the user's personal MoodleCloud site (or a separate personal test site?)
  • Pro: User is in full control.
  • Pro: Could make this a premium feature.
  • Con: Requires the user to sign up for a MoodleCould site (solution could be to add an opt-in option that automatically does that when they join MoodleNet).
  • Con: Slower, more friction.

Options for importing content from around the web

TBD depending on the type content and where it’s coming from. Some examples:

  • YouTube or Vimeo video: embedded in Page module
  • Video file: linked (URL module) from original source?
  • PDF: linked (URL module) from original source, or copied (File module)?
  • Word document: linked (URL module) from original source, or copied (File module), or converted to HTML (Page module)?
  • etc...

Where the current Moodle.net is integrated with Moodle

Context

The existing Moodle.net allows users to share Moodle courses with the community. These courses are shared and, after moderation, appear via a searchable interface at https://moodle.net and in Moodle Core’s ‘Community Finder’ functionality.

1. Moodle.net registration

To submit a course to Moodle.net, the user’s Moodle site must be registered. An admin of the Moodle instance first needs to fill in Moodle.net registration form, which is main source of Moodle usage stats. Users are blocked from sharing content to Moodle.net before this is done (but they can search & import content). Note that sites that are not publicly-accessible on the internet, or using a non-standard port are not able to register.


Admins are told that by registering:

  • You'll be one of the first to find out about important notifications such as security alerts and new Moodle releases.
  • You can access and activate mobile push notifications from your Moodle site through our free Moodle Mobile app.
  • You are contributing to our Moodle statistics of the worldwide community, which help us improve Moodle and our community sites.
  • If you wish, your site can be included in the list of registered Moodle sites in your country. [Unlisted / Name only / Name + URL]


Required fields:

  • Country
  • Admin email address

Optional fields:

  • Name
  • Site listing in directory?
  • Description
  • Language
  • Notifications about important security and technical issues?
  • Updates about Moodle news and features?

The following information will be sent to contribute to overall statistics only. It will not be made public on any site listing.

  • Moodle release (3.5)
  • Number of courses (3)
  • Number of users (3)
  • Number of role assignments (3)
  • Number of posts (0)
  • Number of questions (0)
  • Number of resources (0)
  • Number of badges (0)
  • Number of issued badges (0)
  • Average number of participants (1.00)
  • Average number of course modules (5.00)
  • Mobile services enabled (Yes)
  • Mobile notifications enabled (No)
  • Number of users with registered mobile devices (1)
  • Number of active users with registered mobile devices which are receiving notifications (0)

Next steps regarding registration

  • Check structure of API and code that handles registration between Moodle & Moodle.net (both sides)
  • Check if we can override this functionality with a plugin (for backward compatibility with old Moodle versions)
  • Decide what changes (if any) need to be made to the data collected
  • Decide if registration could be done by any teacher-level account instead of just admins (i.e. registering with the MoodleNet core API service, to collect stats & enable MoodleNet search)
  • Add new sign-in functionality (OAuth client) for users to connect their Moodle account to their MoodleNet account (i.e. authenticating with their MoodleNet instance's API, to enable personalised MoodleNet search, and sharing & importing of resources). An OAuth client is available as a core part of Moodle.
  • Potentially turn Moodle into an OAuth server so that users can sign into MoodleNet with their existing Moodle accounts (especially useful for on-boarding, to avoid having to re-enter personal details). This would mean adding a plugin.

2. Search & import courses

The 'Community Finder' function allows searching for resources on Moodle.net and is currently available as a 'block' that needs to be added manually (not ideal).[e][f]


It can be used with simple keyword search, or with advanced filtering.


‘Visit Demo' function for resources currently is just an optional link to a public course that needs to be hosted somewhere (submitted as part of 'sharing', not ideal).


‘Install’ function has 8 steps/screens.


Next steps regarding search & import

  • Create new Moodle plugin(s) to handle search of MoodleNet content, in these places:
  • Global search
  • Create course
  • Add an activity or resource
  • Rich text editors -> Insert media -> Browse repositories


  • Unless MoodleNet provides ‘preview’ functionality for Moodle content[g][h][i], decide if instead of the user selecting which sections/resources to import before seeing them, they all get imported into a new course so the user can afterwards delete those they don’t need (or copy/move only those they need into an existing course).
  • In any case, create new import plugin with simplified UX (1 or 2 steps max) and make it explicitly about ‘importing’ rather than ‘restoring’.
  • If the import plugin doesn’t already, make it check upfront for compatibility with the Moodle version and list of plugins, and if necessary tell the user what they need to ask their admin before they can import that content. (Only admins can install plugins, and MoodleCloud doesn't allow extra plugins, but fortunately only a minority of content seems to depend on 3rd party activity plugins).


3. Share

Step 1 is for choosing if you want to export or just open up your course to the public.


Step 2 is pre-filled with metadata from the course and includes list of subjects from Australian standard (used to be hierarchical, only allows selecting on subject), and some other fields which contain the same options as seen in the search filters above.


Step 3 has the following toggles:

  • Anonymize user information
  • Include user role assignments
  • Include activities and resources
  • Include blocks
  • Include filters
  • Include comments
  • Include badges
  • Include calendar events
  • Include user completion details
  • Include course logs
  • Include grade history
  • Include question bank
  • Include groups and groupings
  • Include competencies

Step 4 allows selecting/deselecting which activities to share (this should be moved to before step 2).

Step 5 is a review of previous options (backup options, not incl. course metadata weirdly). The main button here says ‘Perform backup’ rather than ‘Share to MoodleNet’.[j]

Step 6 contents are packaged as an mbz file and uploaded to moodle.net

The mbz is a zip with xml files and other content (including subfolders for plugin content). The format doesn't seem to be documented but should contain all the info we need (eg. what Moodle version it came from, and the list of required plugins).

Step 7 - the upload then goes in moderation queue (Mary) before being published.

After sharing, there’s a status screen available


Next steps regarding sharing

  • Add sharing function at section & activity level (currently only available at course level).
  • Simplify UX (1 or 2 steps max) and make it explicitly about ‘sharing’ rather than ‘backup’.
  • Possibly move all metadata input to a screen on MoodleNet (where it can also be edited later) rather than it being part of Moodle.
  • Review all metadata fields.
  • ‘Publisher’ will be the MoodleNet user who is doing the sharing.
  • ‘Creator’ could be prefilled with the MoodleNet accounts of the Moodle users who created the course (or activities therein), if known.
  • Decide on list of licensing options, and what should be the default.

References

Relevant Documentation

Relevant Moodle plugin types

Other than modifying Moodle Core (which would make our integration not be backwards compatible with older Moodle versions), this is the plugin architecture that is available for us to plug into Moodle: