How to restore the Moodle frontpage forum

In versions of Moodle before 2.9 it’s not possible to use the Moodle interface to simply restore a backup of your front page course, or activities within it.

I’ve found a route around this problem which enabled me to restore my front page ‘site news’ forum. It involved a little database poking so find yourself a tame sysadmin if you’re not confident.

Make sure you backup before you start. Really.

1) Restore your forum backup. Use the usual moodle routine to restore a backup, creating a new course.
2) In the database, look for the mdl_forum table and find the ID of your site news forum, and the ID of the new forum you have just created.
3) Now, look at the mdl_forum_discussions table. Run a quick search for the IDs you found in step 2 and you’ll see posts to each of the forums. To move a discussion from your newly restored forum and add it to the front page site news forum, simply change the ID field.
4)A simple SQL query will move all discussions from the restored forum to the front page. Something like:

UPDATE `mdl_forum_discussions` SET `forum` =(frontpage forum id) WHERE `forum` = (your new forum id)

And, that’s it.


Moodle Monday: Banning users from messaging

We like the Moodle message block, but it can be open to student misuse. This simple little trick allows you to create a new role that stops certain users from using the message block. You could use this to ban particular students, or whole groups of users.

The Moodle permission system has a set of rules about what certain types of users are allowed to do. It calls these roles. There is a teacher role (allowed to create and edit content), a student role (allowed to view content), and a few others. The default system roles are well set up (you can tell this as you probably haven’t changed them), but you can also create your own. What we want to do is take an existing role and just modify it to remove the message capability.

To do this:

  1. In the site admin menu go users-permissions-define roles.
  2. Select the ‘Authenticated user’ role.
  3. Click the ‘duplicate role’ button. It will ask if you are sure you want to do this.
  4. Your duplicate role will appear on the list, click the edit button.
  5. Rename the role (something like ‘banned from messaging’)
  6. Now, search the list of permissions for the ones related to messaging. There are 2 you need to find: Read all messages on site, Send messages to any user.
  7. Change the tick box next to these two to PROHIBIT and save you changes.

These steps will have left you with a role that will allow you to ban students from messaging. The reason we used prohibit rather than prevent is that this stops them from using messaging even if they have a higher level of role somewhere else on the site. So, if they are set as students in other courses they will still be banned from messaging there too.

The last part of the job is to assign your banned students to the role. Again in your admin menu, go users-permissions-assign system roles. Select the banned from messaging role and add the students to it. This completes the job.

Moodle Monday: 6 Tips to Manage Course Sizes

A while ago I wrote about the reports available to admins to see how courses were being used. These reports very much cover staff/student access which is useful, but as a Moodle admin I’m also interested in the disc space these courses are taking up. The amount of disc use is important, particularly if you are paying for your hosting. The following are a few tips to help keep this number low without having any serious impact on your users.

Tip 1) Keep your maximum upload size down

How low do you set this limit? There is a balance between making it too low so staff can’t add the content they need and making it so high content is uploaded without consideration for the best way to add the file. We are running with a 10mb upload limit at the moment, but I’d like it to be lower. If you can help staff streamline the content they are uploading your course size will come down. Help people compress their photos/video, show that there are better ways to share that massive PowerPoint than just simply uploading it.

Tip 2) Reduce the number of backups you keep

Most of us seem to use the automated backup routine to create the zipped backups of the course. But, do you need to keep more than one old backup on your Moodle server? The more of these you have the faster your disc space will disappear. Our method is to run the automated backup nightly, keep the most recent backup as part of the Moodle course but also take a copy of these down to our backup server where we keep a few weeks worth of backups.

Tip 3) Get rid of old courses

If you’re anything like me you don’t delete things. When we finish with a course I often remove the users and then just hide it, leaving it on the site in case we need it again. I had a quick look this morning and removed courses from 3 years ago that hadn’t been touched since. Remember you don’t need to get rid completely, just keep a copy of that zipped backup file somewhere else and you can keep that hoarding instinct happy…

Tip 4) Use external repositories for big files

We haven’t really started to get into this in Moodle 2.0 yet, but there are also things in Moodle 1.x you can do here. We found certain departments adding lots of video to our Moodle a few years ago so we set the school up with a dedicated media server to host the video files, linking them to Moodle. Shifting the video elsewhere saves loads of space. You could even do this with Youtube- an account for the school where the videos aren’t available unless you know the link could act as a private store of films referenced on your Moodle site without any disc space requirement on your own institution.

Tip 5) Check which courses are using the most space

The Course Size Report module for Moodle 1.9 can help you. It adds a new admin report where you can list all courses by size. Identify the biggest ones, go investigate what makes them so large. I spent an hour doing this today, a few Gbs of space saved by making quick changes that this tool to found.

Tip 6) Encourage your staff to use more Moodle activities and less upload a file!

This is something that you’ll read on this site all the time… Uploading a file is fine, but there is so much more you can do with Moodle… Spend some time with the ‘add an activity’ dropdown- you’ll soon find that the Quiz/Lesson/whatever module is not only much more interesting for the students than uploading that 20Mb PowerPoint, it’s also a whole lot smaller…

Moodle Monday: Extra Question Types

Did you know that as well as blocks and activities the Moodle modules and plugins directory also contains extra question types for the quiz? They’re no more difficult to install than any other add-on, and can quickly add an extra dimension to your quizzes. Here are my top 3: Continue…