Friday 12 September 2014

Custom Menu Tricks (Moodle)

Many moodle sites make use of the fantastic “Custom Menu” which was introduced in Moodle 2.0 and above. For the un-initiated, the custom menu is a set of dropdown menus that display across the top of a Moodle page. It’s links can be set in Amin settings accessible by Managers and Administrators

Setting up a Custom Menu

The custom menu setting in Moodle administration allows you to create a drop down menu that can be displayed by themes that support it. Currently all themes that are provided with Moodle 2.0 support this custom menu as to a large proportion of those in the Plugins database on moodle.org.
To create your first custom menu follow these steps:
  1. As an administrator, go to Administration > Site administration > Appearance > Themes > Theme Settings and scroll down to the “Custom Menu Items” field.
  2. You are able to create the custom menu by entering custom menu items one per line into the setting. A custom menu item contains, at minimum, two variables. The first is the label/text we are going to display to our users and the second is the URL we will point them towards. These two variables are separated by a vertical line, also often referred to as a “pipe”, that is typed by using (Shift + \) . For example:
    Moodle community|http://moodle.org
  3. To add sub-menu’s to our custom menu we can proceed items by a number of hyphens (-), the number of hyphens determines the depth of the item. So items that are NOT preceded by a hyphen appear on the top level of the menu (always visible), items with a single hyphen appear on a drop down menu below the previous top level item, and items with two hyphens appear on a drop down menu below the previous first level item and so on. For example.
    Moodle community|http://moodle.org
    -Moodle free support|http://moodle.org/support
    -Moodle development|http://moodle.org/development
    --Moodle Tracker|http://tracker.moodle.org
    --Moodle Docs|http://docs.moodle.org
    -Moodle News|http://moodle.org/news
    Moodle company
    -Moodle commercial hosting|http://moodle.com/hosting
    -Moodle commercial support|http://moodle.com/support
If you have followed these steps correctly you should end up with a menu looking similar to this.
A simple custom menu
A simple custom menu

Tip One – Adding Tool Tips

As mentioned above, creating a custom menu item requires a minimum of two variables, the Label and URL. But many don’t know that there 2 more you can use that add additional features to your menu.


The first advanced tip is that we can add a Tooltip to the custom menu if needed. This is an optional feature for those who want it. A tooltip displays when the mouse is hovered over the item and can be used for larger titles or for item descriptions if needed. For example:
Moodle community|http://moodle.org|The official online community for Moodle

If you have followed these steps correctly you should end up with a menu looking similar to this when you hover your mouse over the item.
Custom Menu with hovering Tooltip
Custom Menu with hovering Tooltip
Note: If no tooltip is set then Moodle uses the Label instead

Tip Two – Multiple Languages

One question I hear often and am amazed so few know about is “Can we have our custom menu adjust based on the users language?” . The answer is YES YOU CAN. All we have to do is provide the Label in the languages you wish to set. Before we can do this you need to ensure you have already installed the additional language packs through Administration > Site Administration > Languages > Language Packs.
When you install the languages you will see that each has an abbreviated form. For instance English is en, German is de, etc. Once we know this it is easy for us to add the forth variable, a Language. For example:
Moodle community|http://moodle.org|The official online community for Moodle|en
Moodle gemeinschaft|http://moodle.org|Der offizielle Online-Community für Moodle|de
Now that we have entered both Moodle will display the item appropriate for the Language pack that has been chosen by the teacher in course settings or the user in their profile or through the Language menu.
The same custom menu now displaying in two different languages
The same custom menu now displaying in different languages

Tip Three – Links in New Windows

Sometimes you have a link in your custom menu that you want to open in a new window. This is also easy to achieve with a simple bit of HTML.
Moodle Homepage|http://moodle.org\" target=\"_blank
When the custom menu is being rendered by Moodle it surrounds it in a piece of HTML called a <a href> tag. What you are seeing above is us adding a target tag telling the browser to open the link in a new window.
It is important to note that you DON’T put a closing quote mark on the end of the statement. That was not a typo.

Useful Links

  • Custom Menu MoodleDocs
  • Live Demo Website

Parental access for Moodle

7 3619
A question I hear regularly in my travel from both teachers and Moodle admins alike is “How can I give my student’s parents access to Moodle?”. Or, in a business context, “How can I give a Team Leader access to their teams progress and performance?”. Surprisingly the answer is relatively simple if not a prolonged process.
With Moodle we traditionally think of the 8 pre-defined roles. These included:
  • Administrator
  • Manager
  • Course Creator
  • Teacher
  • Non-editing Teacher
  • Student
  • Authenticated User
  • Guest
Of course many situations arose where Admins wanted to create more roles that met their specific requirements. When Moodle 1.7 (how long ago was that!) was released one of the many additions it brought along with it was a new Roles architecture funded mainly by the Open University that finally gave admins the ability to create their own roles and role overrides with set permissions on demand.
Now I could write a 10 page article on roles, which to put your mind at ease I will not do now. But needless to say the ability to create on demand roles to allow specific functionality for users is a godsend. I have a role to allow a user just the ability to post news on the front-page, another role for College Directors and so forth. Todays post though will look at creating a Parent/Mentor Role.

What is a Parent/Mentor Role?

Here is the situation many of us are faced with. We have parents who want to see their child’s progress or a Team Leader needing to view their down-line staff inside the LMS. How can this be achieved while maintaining privacy. Here was my list of “Must Haves” and “Must Not Haves.
Must Have:
  • Ability to see their child’s/staff’s marks
  • Track their child’s/staff’s access of materials
  • Be able to view their child’s/staff’s activity
  • View content created by their child/staff (forum and blog posts/uploaded assignments)
Must Not Have
  • the ability to see other child’s/staff’s details
  • access to course materials. I don’t want my teachers/trainers judged by what they have online
  • The ability to change or edit the child’s/staff’s work
Great news is we can create a custom role that will allow us to facilitate this!
Before I go on I also need to talk about where we can apply roles. Most teachers and admins know that roles can be allocated at a course/category/site level. (i.e. admins are site level roles, course creators may be category level roles and teachers are course level roles). But what many admins don’t know is that we can also apply roles at activity and at the user level as well. For parent roles to function we actually add a parent role to a student. This means that parents will only see details for the student/students to which they are attached.
How do we set this up? Well the following is blatantly copied and pasted from the MoodleDocs. If you are not yet already a follower of this brilliant user-created wiki for Moodle documentation then where have you been? :P

Setting up the Role

Creating new roles and allocating permissions is something that only Moodle Administrators can do. If you only have teacher access I am afraid at this point I have to tell you to not pass Go or collect $200. If you are an admin read on. All of this is also covered in the Moodle tutorial at the bottom of this post.
  1. As an administrator, go to Administration > Site administration > Users > Permissions > Define roles and click the “Add a new role” button.
  2. Give the role a name (such as “Parent”, but it can be anything appropriate, such as tutor/mentor) and assign it to the user context.

Under the heading of Course

  1. Change moodle/user:viewdetails to allow – to access the student’s profile

Under the heading of Users

  1. Change moodle/user:viewalldetails to allow - to view all aspects of the student’s profile
  2. Change any/all of the following capabilities to allow
    • moodle/user:readuserblogs - to read the student’s blog entries
    • moodle/user:readuserposts - to read the student’s forum posts
    • moodle/user:viewuseractivitiesreport - to view the student’s activity reports and grades
    • moodle/user:editprofile - to edit the student’s profile
  3. Click the “Create this role” button.
Some permissions may already be set to “Allow”, or the permissions granted here may not be the ones required for that Role. This set of Permissions mean that this Role allows anyone assigned to a Parent Role, then linked to the Student Role, to edit the profile or read the blogs of that Student – not everyone’s profile or blogs.

Assigning the new Role to the Student

Before we go any further I must point out the obvious. The parent needs to have their own account in your Moodle. This means they have their own name and password. The process/policy discussion round this is huge and not one for this post. But lets assume you have it created ok?
  1. Access the child’s profile page, via Administration > Site administration > Users > Accounts > Browse list of users
  2. Go to ‘Profile settings for [username]‘ > ‘Roles’ >’Assign roles relative to this user’
  3. Choose the role to assign (This is the role we just created above i.e. Parent)
  4. Select the parent in the potential users list and use the Add button to add it to the existing users list.
  5. Your done! No repeat as necessary if that parent has more than one child at your institution.

Advanced Tip

If you are interested in assigning several parent roles en masse there is a contributed plugin (use at your own risk) here CONTRIB-3938 which allows you to configure automatic role assignment between users from a database (ex: mentor/mentee or parent/child). You can also read the discussion at http://moodle.org/mod/forum/discuss.php?d=70539#p345127)

The Mentees Block

The next question is, now that we have the roles assigned, how does the parent or Team Leader get to their child’s/staff’s profile? The good news is that Moodle has thought of this and has included the “Mentees Block”.
The Mentees block may be added to the site front page or to the My Moodle page. It provides a mentor/parent with quick access to their mentee(s)/child(s) profile page.
To add this block to the site front page:
  1. On the Front Page, turn editing on.
  2. Go to the Add Blocks block and select the Mentees block and when it appears, click on the Configuration icon.
  3. Edit the configuration settings to suit the needs of the site. When complete, save the changes and return to the Front Page. These settings include reaming the block to give better context and the ability to have it display across all pages of the site.

Finishing Up

Note that as mentioned above this role can be used for not just parents but also is well suited to Tutor’s, Team Leaders, Mentors and other supervisory style roles. This is just an introduction to one of the many roles that you can build in Moodle. If you have any other roles you would like to see covered please detail them in the comments and Ill see what I can do.

No comments:

Post a Comment