Showing posts with label technical tip. Show all posts
Showing posts with label technical tip. Show all posts

Monday, December 23, 2019

Setting up automated reminder messages in a Moodle course

If you'd like to send automated messages to learners enrolled in a Moodle course, the reengagement plugin is what you need.

I recently set up time-based, contextualised reminder messages using this plugin, and this post might be useful if you're looking to do something like that.

The course I was working with is a self-study course that learners are encouraged to complete within 4 weeks. The course consists of three quizzes, and once they achieve a passing score on all the quizzes they receive a certificate of completion (generated automatically with the custom certificate plugin).

I wanted to send the learners an automated reminder message after week 1 about the first quiz, after week 2 about the second quiz, and after week 3 about the third quiz. Importantly, the reminder message would be sent only to those who had not completed the relevant quiz.

To accomplish this, I first added 3 reengagement instances on the course homepage and kept all of them hidden.

Below are the key settings I used in the first reengagement instance to trigger a reminder message after the first week. In addition, I wrote out a fairly detailed message in the 'notification content' field (not shown below), addressing learners by their name ('Dear %userfirstname% %userlastname%'), saying why they are getting this message (eg, they have not yet completed the first quiz), and putting the message in context (eg, they must complete all the quizzes to receive a completion certificate).

The reminder messages seem to be working: 47% of the learners who made a start on the course completed it within 4 weeks, which I think is not bad for a self-study course.

The reengagement settings I've used:


















Friday, September 06, 2019

Keyboard shortcut for "replace in selection" in Brackets

I recently moved from Notepad++ to Brackets for coding some of the dynamic elements in Moodle course content. With its modern UI, live preview feature, and very useful Emmet extension, Brackets has given a boost to my workflow. Strangely, a simple feature is missing in Brackets: you can't replace characters within a selection of text. There is however an extension for this called, quite simply, "Replace in selection". Finding and installing it is straightforward using the Brackets extension manager, and the brief help text says that the keyboard shortcut is Control + R.

But that shortcut didn't work for me. What use is a find/replace function without a keyboard shortcut?

Looking at the user key bindings in Brackets (Debug -> open user key map), I realised I had to figure out the command ID for this feature. The main.js file of this extension indicated that it might be "replaceInSelection.Replace". And that it was indeed - I added the following to the key map file and the keyboard shortcut worked!

"overrides": {
         "Ctrl-R":  "replaceInSelection.Replace"
    }

Monday, April 29, 2019

How to calculate the total number of forum posts from the course logs in Moodle

The course logs in Moodle contains a treasure trove of data for learning analytics. One of the numerous data points in the logs pertains to the forums in the course. If you'd like to calculate the total number of posts learners have made on the forums, how many posts were made in each forum, or who has posted how many posts, look no further than the course logs.

1. Go to Reports -> Logs from the Course Administration menu.

2. The default settings that you see on the Logs page gives you "everything but the kitchen sink" kind of data. For a course with 1000 learners, the Logs could have more than 300,000 events! At least that's my experience. You might not want to generate a spreadsheet with so much data. I prefer to use the "All changes" option instead of the default "All actions" option to zoom in a little closer to the events of interest, in this case, forum posts. This gives me a substantially smaller number of events to work with, for example, 50,000 instead of 300,000. This is of course still a daunting number but it yields a manageable number of categories for the next stage of spreadsheet processing.

3. Click "Get these logs".

4. Scroll to the bottom of the page and download the table data as a CSV or Excel spreadsheet. I'd suggest CSV for faster data generation and downloading. You can change the file format if you'd like when you open the sheet with Excel.

5. Once the sheet gets downloaded, open it with Excel (or LibreOffice/OpenOffice). Generate a pivot table with all of the data as the base.

6. In the new tab with the pivot table, put the following in the field list: "Component" in the Filters section, "Event name" in the Rows section, and "Time" (as count) in the Values section. Leave the Columns section empty. You can use some other field instead of Time for the values - this is simply to count the events.

You'll then see something like this (the numbers below are actual figures from a course with around 800 learners):


7. With this table, you can calculate the total number of posts made in all the forums in the course. Use either of the below formulas to get this data:

Discussion created + Post created - Post deleted
OR
Some content has been posted - Post updated - Post deleted

To find out the total number of posts made in each forum in the course, put "Event context" in the Columns section of the pivot table's field list. And to look at the posts made by each learner, put "User full name" in the Rows section - when you do this, you might want to choose either "Event name" or "Event context" for the Columns section, as using both together might make the data intractable to work with.

Wednesday, March 13, 2019

Emails from Moodle site marked as spam or not delivered to some domains

So you have cron working on your Moodle site but you have the annoying problem of emails from your site being marked as spam or not getting delivered at all to some email domains. For example, they might be delivered to a Gmail address (even if they're going to the spam folder) but not to an institutional email address.

If you see an email from your Moodle site marked as spam, download the email with full headers (in Gmail, you can do this through the “Show original” option) and check if there is a “fail” message next to SPF, DKIM or DMARC. This is a sign that something is wrong.

For example, if you see a “fail” or “softfail” message for SPF, the SPF DNS entry for your Moodle site may not be up-to-date. I encountered this problem recently after a Moodle site I administer was upgraded and it resulted in a change in the IP address as well as a transition from IPv4 to IPv6.

Google provides useful advice to deal with SPF, DKIM and DMARC.

It could also be that the IP address of your Moodle site has somehow been blacklisted. There are lots of email blacklists but only some of the blacklists influence email delivery to major providers such as Gmail and Yahoo.

None of the above - SPF, DKIM, DMARC, IP blacklisting - are Moodle-specific issues but they can affect your Moodle site, so you will need to consult a system administrator who has overall responsibility for the IT systems at your institution.

Wednesday, August 29, 2018

Making the Moodle Calendar block neater by removing the Events Key

(I've updated this post for Moodle 3.5)

I think I prefer the Moodle Calendar block to the Upcoming Events block because it has a little more visual appeal and event dates are highlighted. However, I don't like the Events Key that appears in the Calendar block. I'd rather not distract learners with links on the course homepage that are not central to the course experience. The Events Key has four or five links -- that's a lot.


I wanted to hide the Events Key in this block while retaining it in the full view of the Calendar (which you see upon clicking the month name in the Calendar block) -- I didn't want to lose this set of links altogether.

Adding this CSS line in the settings of the Clean theme worked for me (on Moodle 3.5):

.block_calendar_month .calendar_filters {display:none;}


Earlier I used the below lines for Moodle 3.1:
  
.block_calendar_month.block .filters.calendar_filters 
{display:none;}

.block_calendar_month.block .eventskey {display:none;}



Now my course calendar looks neater:


Wednesday, March 14, 2018

Making Moodle pages that are accessible site wide

If you'd like to add 'global' pages on your Moodle site that you can access anywhere, you might find the options in this post useful. These are the options I know of - I won't be surprised if there are more!

Option 1. As part of courses open to guests: You could create a course on your site that is open to guest access, and you could make pages and put publicly accessible resources here (as a kind of repository). The trouble is when you link to any page or resource here, the user will be taken to a completely different part of your Moodle site and this might break the user experience. The user might drift into the course with all the publicly accessible stuff and wonder what it's all about!

Option 2. Using the Main Menu block: On your site homepage add the 'Main Menu' block. Within this block you can add not just pages but any Moodle resource or activity that your site supports! I don't want my users to see the block itself on their homepage so I edit the block-level permissions to make it invisible to students and other roles. This does not affect the visibility of the pages I create in this block. I copy the URL and put it anywhere I like. And they appear neatly as 'Home -> Site pages -> Page title' in the breadcrumb without the confusingly long trail as in option 1.

Option 3. Using the Static Pages plugin: This plugin adds a feature to the Site Administration menu to let you create and maintain static pages. It's great but for one problem: spaces are not supported in the page title. So you are constrained to use one-word titles like 'FAQ' and 'contact', or you need to add hyphens/underscores between words in the title, which ends up looking weird in big font when the page is published.

Option 4. Adding a page directly on the site homepage: If you enable the setting 'include a topic section' in the Front Page settings of your site, you can add any resource or activity directly in the main section of your Moodle site homepage just as if it were a course section. I think the Label resource is particularly useful for the site homepage: with the right design or CSS you can add visually appealing content on the homepage. If you add any other resource/activity such as a page, the homepage develops a course-like character that you might not like! 

Thursday, February 08, 2018

Free Moodle test site with Bitnami and AWS

As a Moodler at a nonprofit I like to know how I can run a complete Moodle site on a low budget if I need to experiment. MoodleCloud is great to try stuff at the course creation level but it does not come with full rights for site admins. I'm a Moodle site admin, not a system admin, so I'm not too particular about server access.

A couple of weeks back I started on a project at work to make our Moodle site more visually appealing. I wanted to show prototypes as we went along without disturbing our production site, and I remembered that Bitnami has a Moodle stack. I opted for the Amazon Web Services (AWS) option as it seemed to offer the cheapest monthly price. Then I found out that I could sign up for the AWS Free Tier which offers 750 hours per month of compute time free of cost for 12 months! A month can have a maximum of 744 hours so I figured I should be able to run one Moodle 'instance' on the AWS Free Tier nonstop.

The process of setting up a Moodle instance on AWS through Bitnami was a bit intricate and I got stuck at the point of copying in the access key ID from my AWS account into my Bitnami account. There was something weird about the form field on Bitnami where I had to put in the access key ID. But soon it was a happy ending and I was lord of my own Moodle site in an obscure corner of the internet :)

Now I'm looking forward to tinkering on this site free of cost for up to a year!

Monday, August 28, 2017

Prevent automatic linking in Moodle

Do you (1) have auto-linking enabled on your Moodle site, (2) want to keep it enabled for a given resource or activity, and (3) want to prevent the auto-linking in specific places within this resource/activity?

I use Moodle 3.1 and the advice on this page about adding a span element with the nolink tag did not work for me: https://docs.moodle.org/31/en/Autolinking

Sadly, the additional tips given here also did not work: https://docs.moodle.org/31/en/Nolink_tags

The web address that I wanted to display as plain text rather than as a link kept appearing as a link. Argh!

So I looked for a generic HTML way (not Moodle specific) to prevent auto-linking and came upon this thread: https://meta.stackexchange.com/questions/119801/allow-suppression-of-automatic-linking-of-web-addresses

Phew, problem solved.

You just have to add the <nolink> tag after the http bit of a web address, eg, http<nolink>://www.google.com/

Friday, January 13, 2017

Getting to grips with the Moodle database

I've been a Moodler for many years and my work has been very much at the front end: web-based site administration, course creation and online facilitation. Every now and then, I do data analysis using Moodle reports and offer Moodle support to AuthorAID partner institutions. I've had a lot to do in each of these areas and I've been happily busy. But I had a nagging feeling about operating only on the surface of Moodle. So I decided to take the plunge into the world of databases with the unique 'MySQL Reporting for Moodle' course offered by HRDNZ, a Moodle Partner in New Zealand. I completed this course a couple of months back and I might write a course review at some point. For now let me just say that the main thing I got out of the course was an awareness and appreciation of the Moodle database.

Today I had the opportunity to work on the database of the Moodle site I administer. With more than 18,000 users and courses going back to 2011, it's not a small database. My goal was to get data related to forum ratings in a particular course, eg, how many posts were rated 'useful', which users received ratings, and which users gave ratings. The only way to do this, as far as I know, is to work with the Moodle database. There are no front-end reports that give you this information.

I actually made a post on a Moodle community forum yesterday asking for help, and today I posted a solution. It's not a detailed solution and definitely not the best. I'm sure there's a better way to do the whole thing using SQL queries. But for those who don't know SQL -- and those like me who have a smattering but would rather stick to CSV data for the moment -- my solution might be useful. Take a look if you're interested.

Monday, May 09, 2016

XML template for creating entries to import into Moodle Glossary

Let's say you want to write a bunch of entries for a Glossary on your Moodle and you want to do this offline -- not directly on your Moodle. In that case the best course of action is to create an XML file with all the entries and import it into a Glossary.

Here's an XML template that you might like to use. It also contains an example of an entry including hyperlinks (you have to use &lt, &gt and &quot in place of <, > and ", respectively).

To create your own entries, copy the lines between <ENTRY> and </ENTRY>. The tags after </DEFINITION> need a binary input: 0 or 1. I'm not sure what <FORMAT> means but I don't think there's any harm keeping this and the last one - <TEACHERENTRY> - as 1. The other three tags match the below settings which you'll see when you try to add a new Glossary entry in Moodle. If they're not self-explanatory see this page.












PS. This post has been featured in Moodlenews!


Tuesday, March 15, 2016

Using the Moodle Certificate plugin when you've made exceptions for some students

Consider this scenario:
  1. You have a Moodle course with a bunch of activities and students need to complete these activities. You're using condition-based activity completion (eg, getting a passing score on a quiz, receiving a grade on an assignment) to track their work.
  2. Some students don't complete some of the activities but you give them something else to do, and this work is managed outside the course in Moodle.
  3. You want to generate certificates for course completers using the Certificate plugin. This will work for those who've done everything they need to do within the course. But what about those for whom you've made exceptions?
This is one approach:
  1. Create a hidden Assignment activity somewhere in the course. Call it "Course completion indicator" or something similar. In the completion settings for this activity, indicate that students should receive a grade to complete the activity. 
  2. Download the gradebook. Add one or more temporary columns to put in formulas to figure out who has completed the course based on the normal criteria. Then find the "Course completion indicator" column and put 100 against the name of (a) every person who has completed the course based on the normal criteria and (b) every person for whom an exception was made. The only manual work is to deal with students in category (b). And this shouldn't be a lot of work because exceptions should be made for just a few students -- otherwise the course completion criteria as a whole need to be changed!
  3. Copy over the values in the "Course completion indicator" column and paste it in a new column (that is, copy the column and paste "values only" in a new column).
  4. Delete the old "Course completion indicator column".
  5. Delete the temporary column(s) created in step 2.
  6. Now you should have a spreadsheet that has a format identical to what you downloaded from your Moodle site. This is very important - there should be no missing or additional columns. The only difference is that there are values in the "Course completion indicator" column. 
  7. Save this spreadsheet as a CSV file. This is your new gradebook.
  8. Import the sheet into your course. Change both "map from" and "map to" to "email address". Set all the other mappings to "ignore" EXCEPT the mapping for "Course completion indicator". For this you should select "Course completion indicator" - or whatever else you might have renamed this to in your sheet. Complete the import process. You'll now have a gradebook in the course in which "Course completion indicator" is the only activity that needs to be checked to determine course completion.
  9. You can now set up the Certificate plugin and add only one restriction criteria: the certificate should be available only to those who have got a score of 100 in the "Course completion indicator" activity.

Tuesday, March 08, 2016

Vertical layout for matching question in Moodle Lesson

Moodle Lesson is one of the most interesting and flexible of the 14 activities that are available on a stock Moodle site. One of the things you can do in a Lesson is include questions. But I'm not very pleased with the layout of the matching type question. This is an example of how a matching question appears in a Moodle Lesson:










The first two matching pairs look okay but there's a sort of alignment problem with the third. The problem might become worse if you have an even longer item in the left column of the matching pair. And what's with the right aligned text? Maybe it works for short items in the left column but not when you have longer items.

I thought the whole thing would look cleaner and simpler in a vertical layout: question, answer, question, answer, and so on. Like this:













If you want to present matching questions in the same way on your Moodle, try adding the CSS given below in your theme settings:

.mform .fitem div.fitemtitle {text-align:left; float:none; width:100%;}
.mform .fitem .felement {margin-left: 0px;} 



(This works in Moodle 2.6. Not tested in other versions.)

Friday, February 26, 2016

Extracting user list filtered by enrolment method in a Moodle course

Imagine you want to invite two sets of people to enrol in a Moodle course. You want to place different limits on the enrolment numbers for each set. You can't use Moodle Groups in this case as it doesn't allow group-level enrolment caps (at least not in version 2.6). You can only place enrolment caps at the level of a self-enrolment method. So you'll have to create a self-enrolment method for each set of people. That's easy, but what if you want to extract users who joined the course using each method and perhaps do further analysis? It's easy to see these lists using the filters available in Users -> Enrolled users, but you can't download them (at least not in Moodle 2.6, which I use).

This is what you can do:
  1. Filter the required list of users in Users -> Enrolled users using the "Enrolment methods" filter.
  2. Hide all blocks on this page.
  3. Copy everything on this page using Control + A (on Windows). Yes, copy everything - all the stuff you need and all the messy surroundings. Quicker this way.
  4. Paste everything into Notepad or another text editor (not Word).
  5. Copy the Notepad stuff and paste into an Excel sheet. Now you should see a lot of stuff all in one column - don't worry about the mess. Just make sure it's all in one column.
  6. In the adjacent column, put this formula to extract all the email addresses and ignore cells that don't have an email address: =IF(ISERROR(FIND("@",A1,1))=TRUE,"",A1)
  7. Pull the formula down to occupy all the cells corresponding to column A. You'll then have a cleaner column with only emails but a lot of empty cells too. Copy all this and put into another sheet. Remove the duplicates (in Excel, Data -> Remove duplicates). And you should have a clean list of only email addresses.
  8. Repeat the above process for every page of enrolled participants (I see 100 people per page on my Moodle for step 1 - I'm not sure if this setting can be changed).
  9. Repeat the above process for different enrolment methods.
  10. You probably want more than just email addresses of the participants. Use the gradebook or activity completion report in your course to get a list of all users, add a column in that sheet to put in the enrolment method of each participant, paste the emails from steps 7 and 8 into a sub-sheet, and do a VLOOKUP.

Thursday, January 07, 2016

Changing the default font face and font size of content in Moodle Book

Recently a colleague asked me if we could increase the font size of the text in Moodle Book and change the font face to Calibri. She felt that these changes would make our content more visually attractive and readable, which is important for us as our content is largely text-based. The goal was to change the default font face and font size, so we wouldn't have to change them on every page using the text editor's settings. CSS to the rescue!

Friday, July 31, 2015

Interactive elements in Moodle Book content

The Book module in Moodle allows you to easily create a series of pages of online content, with text, images, embedded videos, etc.

One major limitation of the Moodle Book is that you can't include any questions to check learners' understanding or to introduce a pause for reflection.

If you want to include a lot of questions, you should consider using the Moodle Lesson module, but what if you're happy with the Book but want to include at least some simple reflection questions? You can indeed do this!

Here's an example. Click the buttons below the question.

What do you understand by the term 'quality'?




Like what you see? Below is the code you have to put in a Moodle Book page (or chapter) in HTML view to create buttons like the ones shown above and the show/hide text. I've highlighted the show/hide text that's the only thing that needs to be customized.

<div id="showtext">
</div>
<script>
function displayResult() {
    document.getElementById("showtext").innerHTML = "'Quality' is a loaded word...<br><br>";
}
</script>

<script>
function reset() {
    document.getElementById("showtext").innerHTML = "";
}
</script>

<button onclick="displayResult()">Reflect and click</button>
<button onclick="reset()">Reset</button>


If you're going to use more than one show/hide feature on the same page, you can reuse the code but you have to remember to change the names of the functions - displayResult() and reset() - as well as the <div> element "showtext" for any new instance of the feature.

Friday, June 26, 2015

Change text alignment of glossary entries from center to left

You have set up a glossary with auto-linking. You include the title of a glossary entry somewhere in your course, and ta-da, there's an automatic link to the entry. One problem though. When you click the link, the text of the glossary entry is center-aligned in the pop-up window. Not a bad thing if your entry is just a couple of lines long, but what if it's a fairly lengthy entry? It can be quite hard to read.

To left-align the glossary tip that pops up, add this line to the CSS section in the Clean theme settings or any other theme that lets you customise CSS easily.

.moodle-dialogue-confirm .confirmation-dialogue {text-align:left;}