I recently worked for a client in the food service that wanted users to view a quick overview of their company and complete a couple training exercises. So we setup a Moodle course with about 10 activities and 5 videos in the course the student had to complete. The intended time frame for completion was about 10 minutes or less.
The client asked for a streamlined user experience, eliminating confirmation screens and backtracking to the main course page. So in effect, the user could flow seamlessly between each consecutive activity in the course.
THE SOLUTION
The easiest solution for a new navigation between activities would be a new, custom course format. This would allow me to make custom changes without messing with core Moodle code. So the first thing I did was to build my new course format off of a classic: the Topics format.
- Go into the moodle source code to: moodle/course/format/
- Copy the "topics" folder and rename it to something else. I chose to name mine "simplenav"
Open up the course format folder you just renamed. Let's start at the top and work our way down.
Lang Folder
- Open the lang folder and navigate to the only file in there: format_(formatname).php. Rename this file using the new name you picked out like this: format_simplenav.php
- Open the file with a text editor, like Notepad++
- Let's rename some of the strings in there, so it matches our "simplenav" plugin. Here is an example:
$string['pluginname'] = 'Simple Navigation format'; $string['page-course-view-simplenav'] = 'Any course main page in simplenav format'; $string['page-course-view-simplenav-x'] = 'Any course page in simplenav format';
- Open this file in a text editor. You only need to change two lines.
- Search for the keyword "topics," since that is the format name we'll be replacing.
- Near the end of the file, find these line and update it:
- $renderer = $PAGE->get_renderer('format_simplenav');
- $PAGE->requires->js('/course/format/simplenav/format.js');
- Open this file in a text editor. Search for the keyword "topics"
- The first change is the class name, at the top of the file:
- class format_simplenav extends format_base {
- Continue to search and replace.
This is the same process. Make sure you rename the class at the top of the file:
class format_simplenav_renderer extends format_section_renderer_base {
css.php
Same thing again. Re-name all the css classes from "topics" to "simple nav like this:
.course-content ul.simplenav {margin:0;} .course-content ul.simplenav li.section {list-style: none;margin:0 0 5px 0;padding:0;} .course-content ul.simplenav li.section .content {margin:0 40px;}
version.php
You only need to change the last line:.
$plugin->component = 'format_simplenav';
INSTALLATION
Now that everything has been copied and renamed properly, it can be installed within moodle.
- Login to your site as the Administrator. You should be automatically redirected to a new page, where you must install updates within your site.
- If you are not automatically redirected, go to the Site Administration block, and click on "Notifications."
- You will be redirected to a page to update your site – the new “simplenav” course format will appear. Update your site to move forward.
We need to change the settings of our course to enable our
new format.
- Login to the Moodle website as an Administrator or Teacher.
- Go into your course and go to “Course Administration > Edit Settings.”
- Open up the “Course Format” section. If the simplenav format installed correctly, you’ll have a new option called “Simple Navigation.” Click on that one
Everything is ready to start customizing and using your new, custom course format! In the next blog post, we'll talk about the changes we need to make to have a linear activity flow.