Type of plugin to embed Gooru Widget Player in a Page type of resource

Type of plugin to embed Gooru Widget Player in a Page type of resource

by Carlo Ditan -
Number of replies: 4

What kind of plugin should I use to embed Gooru Widget player in a Page type of resource?

Here's the whole HTML structure based from the docs:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
   
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="favicon.ico">

    <title>Gooru Player Test Site</title>

    <!-- Add your website CSS -->
    
    <!-- Wiget loader JS  -->
    <script src="https://playerwidget.gooru.org/player-widget.js"></script>
  </head>
  <body>
    <div id="gooru-player"
         data-role="gooru-player"
         data-collection-id="7548b798-7fac-4352-91a8-991a50ba4f35"
         data-resource-id=""
         data-show-reactions="false"
         data-show-questions="false"
         data-show-report="false"
         data-gooru-token="">
    </div>
  </body>
</html>

An example of a full page widget can be seen here.

And here's an example screenshot when I manually pasted the HTML code using the atto editor. As you can see, there are some problems with its appearance. The nav drawer does not work as well (can't toggle show/hide sidebar) when I embedded the widget manually. 



Regarding its HTML structure, the values that will be changed here is in the gooru-player div, particularly data-collection-id or data-resource-id.  

I also have an existing repository plugin that I privately created that adds a file/URL resource to a course.  The said plugin uses an external web page to search for Gooru's resources then add the desired resource using a callback script (returns the details of the resource in particular such as title, file name, author, license, date created, last modified).

With the following minimum requirements:

  • Search colelctions/resources in Gooru and return collection/resource ID using callbacks. 
  • Generate HTML code in the atto editor under page content, then change data-collection-id or data-resource-id depending on what the callback script returns.

Does it fall under any type of plugin? I think it can be a mix of an atto and a repository plugin. I just can't think on where to start.

Average of ratings: -
In reply to Carlo Ditan

Re: Type of plugin to embed Gooru Widget Player in a Page type of resource

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

What usually seems to work best, is to split the whole functionality into several smaller and well focused plugins.

  • The text filter plugin to be responsible for embedding the player, based on some keywords / syntax
  • Atto toolbar button to make it easier to search for external resources and insert the pattern for the filter.
  • etc.
In reply to Carlo Ditan

Re: Type of plugin to embed Gooru Widget Player in a Page type of resource

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Carlo,

I would think you could possibly do what you want with the Generico filter, but since I see pptx in your picture, it makes me think you are wanting to show a presentation. You might be able to do that with the iContent plugin.

Average of ratings: Useful (1)
In reply to AL Rachels

Re: Type of plugin to embed Gooru Widget Player in a Page type of resource

by Carlo Ditan -
Actually it's not just a presentation, it's a collection of various resources (webpages, images, pdf, google presentations, youtube vids, etc). Imagine that it is also like a playlist.


This is the actual look of the widget: 


The widget has an HTML equivalent for embedding according to Gooru docs

I'll try the Generico filter first as what you have suggested. It seems to be the closest to what I want to accomplish so far (although the user will still manually input the collection/resource ID)

In reply to Carlo Ditan

Re: Type of plugin to embed Gooru Widget Player in a Page type of resource

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Just following on from what Al said. If you did want to use the Generico filter/atto plugin set to embed Gooru widgets, then you could start with the template attached. Actually this might work out as a prototype if you want to do what David suggested and make a special filter/atto plugin just for Gooru.


Justin