LDAP User Account Filtering in Moodle

Setting up LDAP in Moodle? Once you have configured the LDAP authentication plugin and it is working (you can log in), don't forget to also enable LDAP User Sync to keep your account status in sync. When first setting LDAP up, you may not realize it but you may be getting more accounts than you expected. The trick is to limit user accounts to just persons of class users.

You can limit synchronization to just user objects in Active Directory (AD) by completing the following steps:

1. Go to Site Administration > Plugins > Authentication > LDAP Server.
2. Scroll down to the User Lookup Settings section.
3. Set User Attribute to: sAMAccountName
4. Set Object class to: (&(objectCategory=person)(objectClass=user))
5. Save.

The Object class field name is a little misleading. One might initially think it that you should use it to just give Object class a value, when in fact is it actually more of filter field. In this case, specifying an object category of person and an object class of user will filter out non-user accounts like workstations, printers and other devices which may be attached and logged into your network through AD.

If you are using AD, account usernames coming though LDAP allow more types of characters than Moodle does by default. For example, you may also have AD usernames that start with a "$" (dollar sign) or "#" (hash tag/pound sign) which simply should not be there for valid usernames. You can add more filters to the the Object Class setting. For example, we can fix the above mentioned issues :

(&(objectCategory=person)(objectClass=user)(!(sAMAccountName=$*))(!(sAMAccountName=#*))(!(userAccountControl:1.2.840.113556.1.4.803:=2))(!(userAccountControl:1.2.840.113556.1.4.803:=32))(!(userAccountControl:1.2.840.113556.1.4.803:=65536)))

Broken down, this says:

  • (& means all of the following must match (AND them together).
  • (objectCategory=person) : The object category must be a "person"; AND
  • (objectClass=user) : The object class must be a "user"; AND
  • (!(sAMAccountName=$*)) : The sAMAAccountName (the username) must not (!) start with a dollar ($) symbol followed by any number of characters (*); AND
  • (!(sAMAccountName=#*)) : The sAMAAccountName (the username) must not (!) start with a hash tag (#) symbol followed by any number of characters (*) ; AND
  • (!(userAccountControl:1.2.840.113556.1.4.803:=2)) : The userAccountControl:1.2.840.113556.1.4.803 (user account) must not (!) be disabled (:=2); AND
  • (userAccountControl:1.2.840.113556.1.4.803:=32)) : The userAccountControl:1.2.840.113556.1.4.803 (user account) must not (!) not be required to have a password (:=32); AND
  • (userAccountControl:1.2.840.113556.1.4.803:=32)) : The userAccountControl:1.2.840.113556.1.4.803 (user account) must not (!) be set to Password does not expire (:=65536);
  • ) is to close the initial (&.

Feel free to modify this to suit your organizations password policy. If you run into problems, it will often be the result of unbalanced parentheses (the round brackets). It may also be that you are trying to filter out a character with a special meaning in which case you will need to escape the character by preceding it with a back slash (\).

For more information about the types and syntax of filters that you can use, see Active Directory: LDAP Syntax Filters.

The end result is that the filter will exclude user accounts that do not meet the filter's criteria. If you set the Removed ext user LDAP setting in Moodle to Suspend internal, Moodle will automatically suspend any user accounts which have been filtered out by the LDAP synchronization process thanks to the additional filters.

WARNING: Your site may become less or non-responsive during the synchronization process. Do this off hours or or work this out on a different instance of Moodle.

You should be able to run the synchronization process manually by going to Site Administration > Server > Scheduled Tasks. Scroll down to LDAP users sync job. You should see a small link called "Run now". Click this link to run the synchronization process manually. If you don't see the link, you will need to go to Site Administration > Server > System Paths and set the Path to PHP CLI field in order to enable the Run Now link.

If your legitimate user account names include characters with accents or Asian characters, you will also need to tell Moodle to allow special characters outside the normal a-z, A-Z range. You can do this by navigating to Site Administration > Security > Site Policies and enabling Allow extended characters in usernames. This should only be done if you are sure that accounts in AD which contain special characters are valid active user accounts. I've seen some Active Directory administrators rename users to johndoe(old) instead of disabling the account. By allowing extended characters in usernames, you could be propagating a security risk to your Moodle site and possibly inadvertently creating enabled user accounts that should not actually exist in Moodle

Unfortunately Moodle currently aborts the synchronization process on the first synchronization failure, regardless of the reason. A patch described in MDL-58395 will hopefully be adopted (vote for it) which does 3 very important things to help you troubleshooting sync issues:

  1. It displays the users information for the account that are causing LDAP sync issues.
  2. It changes the script behaviour to continue the process if there is a problem with a particular account so that, at least the rest of the accounts are hopefully properly synchronized.
  3. It provides a summary at the end to let you know if there was a problem so that you don't need to scroll through the whole list of accounts being created/synchronized to find the odd ones that didn't work -- if there are any. As you might imagine, failing to sync all accounts if the first in the list fails could result in serious security issue.

Hope you found this information helpful. Share your experience in implementing Moodle in the comments below.

Michael Milette

Should you create a new role in Moodle?

You have been thinking about creating a new role in Moodle. Think it might solve your challenge? Here are a few things to consider before creating one or more new roles.

Before we begin, lets cover what a role is not to eliminate misconceptions:

  • It is not a group. You don't belong to the group of teachers. You are a teacher in a course.
  • It is not a cohort. You are not elevated to the status of teacher on the site. You can be assigned the role of teacher in a course.

If a group of cohort is what you are looking for, then you are encouraged to look into those features in Moodle instead of roles.

First, clearly determine why you think that you need to create a new role that is not already available in Moodle. This is really important because Roles in Moodle don't work like they do in many other applications or that you might assume. In many applications, roles are all granted at a system level which means that you have that role from the moment you login.

In Moodle, roles are usually granted within a given context such as a manager of a category or a teacher/student of a course.

Figure out which of the base roles (called archetypes) is closest to the new role you want to create. The archetype roles in Moodle include:

  • Manager
  • Course creator
  • Teacher (editing)
  • Teacher (non-editing)
  • Student
  • Guest
  • Authenticated user
  • Authenticated user on frontpage (Home page)

When you create the new role, it will inherit the permissions of the role you based it on. Tip: Make your life easier and base your new user on archetype which is closest to what you will need.

Which permissions will you need to customize for the new role? Be extremely selective on your customizations. Sometimes changing a permission can have unintended side effects.

This brings us to the next step: Determine the scope of the role. Will it be global (system wide), at a category level or just at a course level? Really think this through. It all sounds fine to make everyone a manager until people start creating courses just any old place (and can't find them afterwards) or worse, delete someone else's course by mistake (gratitude to the developer who created the little known recycle bin in Moodle).

Have you considered just modifying one of the existing roles? This is perfectly acceptable solution if you really don't need the overhead that will come with adding new roles.

If you still think you need to create new roles, and you realize that you will need to assign these roles manually, it is time to create the new role, based on the desired archetype and add or remove permissions as desired. Finally, assign the new role to individual users who need it, in the desired context.

Keep in mind that people can have multiple roles within a context. For example, I can be a teacher and a student within a course so permissions from one role may override ones from another role.

Last but not least, you may want to think about who can assign your new role to users. Can teachers do it or do you need to be a manager or administrator to assign the role?

For more information and some examples of roles, see Creating custom roles -- MoodleDocs.

Let me know if you found something helpful in all of this.

Good luck!

Michael Milette

Developer Tools for Moodle

Getting started in Moodle Development? Here is a list of useful tools for Windows that may be of interest to Moodle Developers.

Moodle Coding Style Guidelines

In general, you can configure code editors to understand 90% of the Moodle Coding Style by configuring it to use PSR-12 and PSR-1, in that order. On top of that, Moodle has its own customizations to those standards which you can learn more about here:

To support you in your development, you will want to ensure that the following plugins are installed on your development instance of Moodle:

  • Code checker -- This tool enables you to check your code against Moodle's Coding Style Guideline. You should install the version from GitHub, not from Moodle.org as this last one can sometimes fall behind. The GitHub page includes instructions on how to integrate with eclipse, phpstorm and sublimetext.
  • Marina Glancy's Moodle PHPdoc checker -- Checks PHPDoc blocks in your Moodle source code.

Toolbox for Moodle Developers

Here is a list of useful software for Moodle development in Windows. When given a choice, always choose the 64-bit version. Don't let the "free" price tag fool you -- these are all excellent tools. If you really find one or more of them useful, consider contributing to the project. Some of the ways you can contribute can include:

  • Purchase the full/pro version if one is available -- especially if you are earning a living using the tool.
  • Make a donation to the author if they don't have a premium version.
  • Contribute bug reports, bug fixes, suggestions for enhancements.
  • Spread the word and tell your friends about the cool/useful tool you found.
  • At the very least, drop the authors of the tools a note to thank them for their development efforts and contributing their time and effort to making it available to the world. Developers like to know that people like you are enjoying the results of their work.

Remember, just because it is free doesn't mean it isn't worth anything.

Greenshot -- A light-weight free screenshot capture and annotation tool which is very useful for creating documentation and reporting issues.

ScreenToGIF -- A super simple tool to capture and edit videos. Very useful for demonstrating and reporting issues.

Colour Contrast Analyzer -- This is an accessibility testing tool to help determine the legibility of text and the contrast of visual elements, such as graphical controls and visual indicators. Also doubles as a great colour picker.

File Locator Pro -- Most of the best documentation and often source of examples for Moodle API is within its source code. This can be an invaluable tool for quickly searching though Moodle's approximate 37,000 plain text source code files including PHP, JavaScript, HTML, CSS/SCSS, XML, JSON, Mustache, etc.

WinMerge -- This is a great tool for comparing files and whole folders for differences. Does 3-way comparisons.

Visual Studio Code -- VSCode is now one of the most popular code editors in the world. Once configured with extensions like PHPCS and others, this cross-platform text editor is often considered to be like an IDE by many developers for developing in Moodle. It is also considerably less expensive (free actually) and faster than Java based IDE's like PhpStorm and Eclipse. Note: Many developers use more than one code editing tool as each tool has its own strength. You don't need to pick just use one!

During the installation, ne sure to have the installer add VSCode to your search path. It will simplify a lot of the settings.

To make VSCode even better, the following are useful extensions you should consider installing for Moodle development:

  • Git Graph -- View a Git Graph of your repository and perform Git actions from the graph.
  • GitLens -Visualize code authorship at a glance via Git blame annotations and code lens, seamlessly navigate and explore Git repositories, gain valuable insights via powerful comparison commands, and much more.
  • Moodle Snippets -- Make your life easier as a Moodle developer, using the main Moodle functionalities snipperts for VSCode.
  • Moodle -- Snippets & Autocomplete -- Adds Moodle snippets and autocomplete of functions, classes, etc.
  • Bracket Pair Colorizer 2 -- A customizable extension for colorizing matching brackets.
  • Code Spell Checker -- Spell checking for source code.
  • Duplicate section or line -- Adds the ability to duplicate text.
  • Mustache -- Syntax highlighting for mustache.
  • PHP CS Fixer Extension for VS Code -- PHP formatter, PHP code beautify tool, format HTML.
  • PHP Debug -- A debug adapter between VS Code and XDebug.
  • PHP DocBlocker -- A tool to help with the creation of PHPDoc blocks.
  • PHP Intelliphence -- Enhances PHP code intelligence for Visual Studio Code.
  • PHP Intellisense -- Advanced Autocompletion and Refactoring support for PHP
  • PHP Snippets from PHPStorm -- This extension aims to provide the PHP Live Templates that come by default in new PHPStorm installations for Visual Studio Code.
  • Rewrap -- Re-wraps comments and other text to give line length.
  • TODO Highlight -- Hilights TODOs, FIXMEs in your source code.

Composer -- Composer is a dependency manager for PHP which is used to install components used for Moodle development.

PHP CodeSniffer -- Great tool for linting PHP code. The easiest way to install PHP CS is to first install Composer and then use the following CLI command: composer global require squizlabs/php_codesniffer

Git for Windows -- Git is used to manage source code version control in Moodle. During the installation, be sure to enable Git Bash and have the installer add git to your search path. It will simplify a lot of the settings.

Here are some settings for Git:

Set your full name and email address

This will be used when you create commits:

git config –global user.name "Your first and last name"
git config –global user.email email.address@yourdomain.com

Colourize GIT (Optional)

git config --global color.ui auto
git config --global color.interactive auto

Configure GIT for use with VSCode

git config --global core.editor "code --wait"

If you want to use VSCode as your Merge Tool, use the following and skip the instructions Configuring GIT for use with WinMerge below:

git config --global merge.tool vscode
git config --replace --global mergetool.vscode.cmd code --wait $MERGED
git config --global diff.tool vscode
git config --replace --global difftool.vscode.cmd code --wait --diff $LOCAL $REMOTE 

Configure GIT for use with WinMerge

If you are using VSCode as your git merge tool, skip this section.

Note: You may need to modify some of the paths depending on where you installed WinMerge.

git config --global merge.tool winmerge
git config --replace --global mergetool.winmerge.cmd "\"C:\Program Files\WinMerge\WinMergeU.exe\" -e -u -dl \"Base\" -dr \"Mine\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\""

git config --global diff.tool winmerge
git config --replace --global difftool.winmerge.cmd "\"C:\Program Files\WinMerge\WinMergeU.exe\" -e -u -dl \"Base\" -dr \"Mine\" \"$LOCAL\" \"$REMOTE\"

Additional merge tool settings

git config --global mergetool.prompt false
git config --global mergetool.keepBackup false
git config --global mergetool.keepTemporaries false
git config --global mergetool.trustexitcode=false

On Windows, you may also find the following settings useful since the Git repo is made for Linux:

core.autocrlf=false
core.whitespace=cr-at-eol
core.filemode=false
gui.encoding=utf-8

This will change the default date format in the output of git log commands to ISO (YYYY-MM-DD) so that you can see the year of the commit:

git config --global log.date iso

MoodleMoots – Humanized Conferences

The most social conference that I have attended since COVID started in 2020 has been the MoodleMoots, specifically MoodleMoot Global 2020 and MoodleMoot U.S. 2020. What makes virtual MoodleMoots humanized conferences?

Like many virtual conferences, they include multiple concurrent sessions in various tracks of interest. They include vendor booths where you can interact and see product demos. But what makes MoodleMoot conferences special is the effort they invest to include many interactive and social activities such as a 24 hour/day virtual café where you can actually sit around tables interacting with other participants using individual text messaging, group audio and video. there are about a couple of dozen tables in a room and several floors offering spaces to meet. I often find myself informally face-to-face with up to 10 people from around the world not only discussing and showcasing each others Moodle projects and discussing Moodle development challenges and implementation strategies, but discussing politics, learning about each others cultures, countries and challenges. I love these and much prefer them, especially for Q&A sessions after my presentations. They are like open space meetings within a Moot. Several times during any Moot, you may even drop by a table to find me helping people out, troubleshooting their #moodle issues using the built-in screen sharing feature available at each table.

Who do I meet? Anyone and everyone willing to say hello. While I always look forward to chatting with Moodle CEO Martin Dougiamas and staff from Moodle HQ, I also love to meet CEOs, event organizers, managers, teachers, administrators, Moodle developers, other presenters, students, fans of my FilterCodes, Contact Form and EmailTest plugins, Moodle partners, people just getting started and people who have been using Moodle for many years. I have never really counted but I am sure that I meet at least 40-60 people at each MoodleMoot. If you attend even just a couple of these global events per year, people start to remember you and even seek you out -- like old friends, especially if you've been outgoing and interactive. And yes, I have even ended up with some new clients, tried to recruit some Moodle developers and even made some new friends.

In addition to the Virtual Café, virtual MoodleMoots have included a host of social activities including a fun night of interactive games, entertainment and even dancing (I came in the top 3 using antenna as a virtual guitar). These virtual moots include educational sessions, group meditation and more. There was even a fun team scavenger hunt where you had to search the world for answers given clues.

Is it better or worse than an in-person conferences? Neither. It is simply different. Lead by Moodle event manager Diego Fabra, the team at Moodle HQ have really done a fabulous job of humanizing virtual MoodleMoot conferences and each one is better than the last. I highly recommend them and gratefully acknowledge their efforts in playing full out during these challenging times of isolation around the world.

Sure I miss seeing people in person, sitting down and talking over a meal with them, giving friends hugs, the t-shirts and swag bags. But, I think that in many ways, it is has a lot of advantages too. For one thing, they are less expensive which means I can afford to attend multiple conferences instead of just one per year. Because they are not all during core business hours, I have the flexibility of working my regular hours and attending the conference in real-time with minimal schedule conflicts. Because all the sessions are recorded, I also don't feel as much pressure to end social interactions. I can give people my full focus and attention while rest assured that I can just watch session recordings later.

The real down side? I wish that they could find a way to deliver meals to my door. 😉

Hope to see you at the next Global or America #moodlemoot!

#michaelmilette
Moodle Developer and Implementation Specialist
Ottawa, Canada

How to feel connected during COVID-19

Feeling disconnected because of COVID-19? Are you sure you are being 100% completely and totally honest with yourself? Maybe you just need a few friendly suggestions

The first step is to make a list of 31 people you have not spoken to in over a week. Feel free to go back all the way back to high school if you want. Then pick up your phone and start making calls to talk. Be warned -you may not make it through all 31 so you might want to do a little triage sorting before you get started.

Do not just to Facebook or text these people unless it is to get their personal contact information. Make it a point to call one person per evening for a month. You might be surprised at how many people would love to re-connect with you in these days of physical isolation. Schedule what you will do next with them before finishing your call.

There are so many ways to see your family and friends these days using Skype, Zoom, Teams, Facetime, WhatsApp, etc. Put yourself out there and let them know that you miss them.

Go on a date with someone special (spouse / boyfriend / girlfriend), watch a movie (each push play at the same time). Cook together -- each in your respective kitchens of course. Suggest having a meal or just a glass of wine, eggnog or hot chocolate together. Some people may prefer to draw or paint -- do it while on speaker phone or webcam. You do not need to be physically together to enjoy each others company and do things together. Don't be afraid of extended periods of silence. If you were painting together in the same studio, you wouldn't be speaking continuously, would you? It is ok to just be sharing time together.

Play an online game together or Charades, Pictionary, Chess, Checkers or even Cards. Many board games can be played with a web camera pointing at the board. There are now so many great game ideas.

Start a project together -- like a YouTube channel or a new online main or side business. Learn individually (lots of free courses, even on YouTube) and then teach each other what you learned. Get involved in virtual meetups, mastermind group or become a mentor. Learn a new language, sing or pray together. Write a short e-book together on all the things people can do with people, ideas for topics of conversation for discussion, recommended movies, places to visit virtually, games you can play, etc. Then learn how to publish it together.

Still can't think of anything you can do with people? Ask a friend for help. Start an online discussion and invite people to share their ideas of how they connect with others. Then steal 3 of their ideas and just do them… with others.

Move away from emails and texting -- make it live, personal and interactive in real-time. The key of course is to start making plans and taking action to make them happen -- NOW would be an excellent time.

COVID is not a reason to be apart. It is a reason to celebrate that we are all still alive, an opportunity to learn, grow and contribute together… even if we cannot be in the same room together.

Hope you found something useful in all of this -- even if it is just a seed for your own extraordinary idea. And remember, this is not a permanent situation. There is nothing keeping you from making plans for 2, 3 or even 5 years from now. If nothing else, it will give you something to look forward to and something to talk about.

PHP XDEBUG’ing in Brackets

XDEBUG enables you to walk through the execution of PHP source code and debug the code as it is executed in real-time. It is one of the most important tools that a PHP developer's toolbox and is well worth the time it takes to learn how to use it.

The following instructions will guide you to setting up Xdebug in the Backets editor. It is actually pretty straight forward once you know how.

It is assumed that you have already installed Brackets text editor and XAMPP (64-bit is faster) web server in C:\XAMPP. For this article, we will be doing this on Windows. If you have not already done so, set these up first. Initially, you will need to set-up your development environment :

  • Install PHP Debugger in Brackets
  • Enable XDEBUG in php.ini
  • Install the XDEBUG Helper browser extension

Once you have your environment installed, you will be ready to start debugging PHP code anytime you need it.

Installing PHP Debugger in Brackets

The Brackets PHP Debugger extension is available for free and is easily installed from the Brackets extension library.

1. Install the PHP Debugger extension in Brackets.

2. Click DEBUG > Open Preference Files

3. In brackets.json, add the following highlighted lines (there may already be other lines):

{
     :    :    :
    "wordWrap": false,
    "php-debugger.idekey": "xdebug",
    "php": {
        "enablePhpTooling": true,
        "executablePath": "C:\\XAMPP\\php\\php.exe",
        "memoryLimit": "4095M",
        "validateOnType": "false"
    }
}

Don't forget the commas after the "false" on the wordWrap line.

4. Save.

5. Restart Brackets.

Enabling XDEBUG in php.ini

XDEBUG actually comes bundled with XAMPP. You need just activate it though the php.ini configuration file.

1. Start XAMPP

2. Click on the "Config" button for Apache and select php.ini.

3. Add the following lines at the bottom of the file. If you already had an [XDebug] section, update the values for each of the settings:

[XDebug]
zend_extension = "c:\xampp\php\ext\php_xdebug.dll"
xdebug.default_enable = 1
xdebug.idekey="xdebug" ; (note: use the same key in your web browser extension)
xdebug.remote_autostart = 0
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = "c:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_connect_back = 0
xdebug.remote_enable = 0
xdebug.remote_handler = "dbgp"
xdebug.remote_mode=req
xdebug.remote_connect_back=0
xdebug.remote_host = "127.0.0.1"
xdebug.remote_log = "c:\xampp\tmp\xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "c:\xampp\tmp"
xdebug.remote_cookie_expire_time = -9999
xdebug.show_local_vars = 0
xdebug.max_nesting_level = 1000

4. Save.

5. Stop Apache in XAMPP.

6. Start Apache in XAMPP.

Installing the Xdebug Helper browser extension

Install the Xdebug Helper extension in Chrome or Firefox. Note that you should go into the extension's settings to ensure that the IDEKEY is set to Other and xdebug

Note: If you change editor, you may also need to change the IDE Key in Xdebug Helper.

Debugging PHP code in Brackets

Although not a requirement, two screens is highly recommended when debugging code, one for the editor and the other for the web browser.

1. In Brackets, open the PHP file that you want to start debugging.

2. Click on the PHP Debugger icon on the right side of the editor. This will open the debugger at the bottom of the screen.

3. Set a breakpoint in your code by clicking on the empty space to the left of the line number. Note that you can only set breakpoints for lines that actually contain executable code.

4. Back in your web browser, click the Xdebug Helper icon and select Debug.

5. (re)Load the page which makes use of the code you want to start debugging.

Note that your page may only appear partially or not at all in your browser. Do not panic. This is perfectly normal since the execution of PHP has been paused.

6. Now switch back to Brackets. You will find that it has interrupted your code at the breakpoint and is waiting for you to take action.

Here you can inspect the value of PHP variables in the right-hand column of PHP Debugger or click on Step Into, Step Over, Step Out, Run or Stop execution of your code. You can also type PHP commands at the command prompt or just type the name of a variable there to see its value.

If you don't see the variables, use the scroll bar on the right edge of the PHP Debugger window to scroll down.

Forcing Links to Open in a New Tab or Window

Have you ever found yourself browsing the web on a smartphone and clicked on something that opened in a new tab? It is almost impossible to tell when this happens. In fact, many people don't even realize that browsers on SmartPhones can have the equivalent of multiple tabs or windows.

Now imagine someone using a screen magnifier. They click on a link somewhere in the middle of the screen. If the link opened in a new tab in the background, they would never notice it and just think something is broken. However, if it opened in the foreground, one might think everything is good. Except that they will not realize that they are now looking at content in a new tab. So when they click BACK to return to the previous page, it simply won't work since there is no previous page in that tab.

As you can tell, these are good reasons to avoid opening content in a new browser tab. However, if you really want to open content in a new tab, you can make it accessible and friendly by simply indicating that the link will open in a new tab. Example: Google (will open in a new tab). Do make the words part of the link so that screen readers will pick it up too as users tab through the links on a page.

Reminder: Most links can be manually opened in a new tab by the user in several ways. If they are aware of how to use tabs, why not leave it in their control? If they don't know how to use tabs, why impose it on them, lead them into confusion and leave them disorientated?

Best regards,

Michael Milette

Creating a Multilingual Moodle Site

I have built many multilingual Moodle sites over the years. Unfortunately you cannot make a course appear or not appear based on the user's current language. But you can create a multilingual Moodle site and multi-language Moodle course.

First you will need to install the Moodle language packs for each of the languages you want to support. Depending on the theme used, this should display a language selection menu in the Moodle navigation. If it doesn't display a language selection menu, contact the theme's author to have him or her fix it. When a user switches language, Moodle will display it's menus in that language. Don't forget to apply these tags to your site name (front page settings), category name and course names. Note that it does not do the translation for you.

Note that if you use a particular localization of a language such as French Canadian, you will need to install both the French language pack AND the French Canadian language pack. To avoid having them both appear in the menus, you will need to specify the list of languages you want to have appear in the menu.

Next, install and enable the Multi-Language Content (v2) filter Moodle plugin. Be sure to enable it for both Content and Headings. What this will do is give you the ability to tag text using a a plain text {mlang xx} tag so that only the current language text appears. You do not need to know any HTML for this to work.

For example: {mlang XX}content in language XX{mlang}{mlang YY}content in language YY{mlang}{mlang ZZ}content in language ZZ{mlang}

Your {mlang} tags will also need to specify the localized language code if you are using such a language pack. For example: So where French would normally be {mlang fr}Your text in French{mlang}, it would be {mlang fr-ca}Your text in French Canadian{mlang} for French Canadian. {mlang fr_ca}, with an underscore instead of a dash, works too.

As I mentioned, you can't really hide courses in Moodle. However you can create multi-language courses by also wrapping each piece of content (don't forget the course names) in an {mlang} set of tags. Not only will the user see the course in their current language, they will be able to switch language at any time as they make their way through the course.

Another option with Moodle native courses is to make use of the activity restriction option. You can display or hide activities within a course by telling Moodle to only display if the user interface is in a specific language. So you would need to create 4 activities, one in each language, and then restrict which of the 4 displays when the users is viewing the site in English for example. To make this work, you will need to install and activate the Moodle Restriction by Language availability plugin. Note the challenge you may have with this approach is in assessing course completion status since all learners will not end up completing the same activities.

If you are dealing with SCORM packages, it gets much more complex and will be a little different. You can still do it however you will need to build the language selection menu into the SCORM package as well as all of the languages. You may be able to have the default language controlled by Moodle but this may require some additional customization.

Applying these strategies, you end up with a single course that works in any of the languages it supports.

Side note: Using WordPress? You can find information on getting started with WordPress multi-language sites by taking a look at the 9 best translation plugins for WordPress websites and qTranslate-XT

Hope you find this information useful.

Best regards,

Michael Milette

Surviving Canadian Winters

The key to surviving Canadian winters is to dress appropriately warm and get involved in winter activities like skiing, winter camping, skating, snowshoeing, hiking and our many Winter festivals.

If you start off with the mindset that it is a miserable 4-6 months each year, you will never find a way to enjoy it.

We are very fortunately to have the opportunity to experience a diverse climate. Every season here has something special and beautiful to offer if you are open to it.

How do I know that she loves me?

Every relationship is different because we all have different values. What is meaningful sign of love to you can be completely different for another -- even between you and the person you love. Assuming that you are in a relationship with a woman, talk with her about your feelings, really listen to how she feels and take that into consideration. Have you told her that you love her? Did she tell you that she loves you?

If you are not even dating yet, you will never know if she loves you if you never ask her out on a date. Both of you need the opportunity to get to know each other.

Answer these questions

Honestly answer the following questions to help you start to figure out the stage of your relationship.

  • How long have you been dating?
  • How well does she know you?
  • Have you given her good reasons to trust you?
  • Are you best friends?
  • Have you met her family yet?
  • Have you met her friends yet?
  • How does she act towards you when you are around her friends and family?
  • How do you know you love the woman?
  • Do you feel that you can be totally and openly honest about your feelings with her?

Some of questions will be different for someone who has been in an established relationship for a while.

Get to know yourself

This is probably even more important than knowing whether she loves you or not.

What would it look like if you knew without a doubt that she loves you?

What would it look like for you to believe that a person really loves you? What would she need to do or say in order for you to feel loved? Different people have different values. If you don’t know the answer to this question, how can the woman you love ever fulfill the role of being the person who loves you? That would be like having a book of “love” rules with no rule on how to feel loved.

You will never know if a woman really loves you if you don't love yourself first. You will always doubt whether any other person does or even can love you – even if they really do.

What you are looking for in a person who would love you? Make a list of musts and nice-to-haves. Would you feel comfortable sharing that list with her?

When people are important to us, we do things like speak kindly of them and resent people who speak poorly of them. We want to spend time with them, protect them and take care of them. We trust them because we know they are always honest with us. They are worth the effort and we respect them ALL THE TIME. Are these things that you feel or do you just want to have sex with her? Do you feel that she feels this way towards you?

Communicate with her

If you want to know if she loves you, talk WITH HER about how you feel. Start by having a conversation with her about what you really want. You may be hoping that she will do or say something that is important and meaningful to you yet she has no clue. Is it really fair to keep hoping that she will guess it right? Or would it make more sense to share that with her, let her know how important it is to you and see if she is willing to do some of it for you – only if she is comfortable with it of course.

Stop trying to guess what she wants and feels. In many ways, would that not be like playing the lottery with your love life? Wouldn't your chances of success improve if you gave her the opportunity to tell you the winning moves? Support each other in the relationship.

Treat her with the same respect and share with her.
Don't live a double standard.

Listen to how she is feeling and what she wants. It is important to stop what you are doing and thinking of and be in the moment with her. If you are nervous about talking with her about such things, know that this is perfectly normal at first. Part of loving someone is trusting them enough to put yourself in a vulnerable position and knowing in your heart that she won't use it to hurt you. The first time can be a big leap of faith but can be well worth it.

If she doesn’t respond in kind, and you are a great guy, perhaps you need to let her get to know you better. Don’t jump to any conclusions. You can’t make someone love you. You can only be the best version of yourself and hope that you are what she is looking for.

Hope this helps. Take only what makes sense to you and forget the rest.

Best regards,

Michael Milette