Moodle code to add grades & course links to Profile & ILP pages

This is a short-ish posting to ensure reasonable consistency between the posts here on my blog, with posts I’ve made on the site.  Amongst other things the Personalized Learning Environment (PLE) I developed for Stanmore College, is now proving useful in helping students navigate their courses in Moodle, & tracking which BTEC criteria they have achieved *.   I have made the basic Moodle PHP code for this available on  The following files illustrate the basics of displaying grades & links in the /user/profile.php,  & might help other benefit.

In the following file, see line 346:

The above links are also at: & are illustrated by

All this should make more sense to interested parties when I post my #ALTC2013 presentation, which provides the broader context for  and includes * early evidence.  Following this I plan to make  demonstration site  & code available for these PLE enhancements  – applied to Moodle 2.6 🙂

Proposing some standard parts in all online evironments to support learning

A primary interest of mine is supporting students development, & an important aspect of this is facilitating communication.  @Stanmore college we have implemented what could be called an online “Personalised Learning Environment” (PLE) .  This YouTube screen-cast should give you some insight.  However in my experience it would do no harm if all maintained schools provided certain things as standard to staff & parents online.

In a recent book called “14-18 a new vision for secondary education” by Kenneth Baker (a former secretary of state for education), Mike Tomlinson and others makes a number of recommendations.  The fundamental recommendations being establishing more middle schools for 9-13yrs, and improving the options we offer 14-18 year olds and their families.

It makes the point that we should learn from other countries with lower youth unemployment, and create (~3) substantial, popular & respected alternative pathways to GCSEs @16yrs, and  Alevels @18yrs.  Although it suggests that all 14-18 yr old should have a broad education including English, Maths, Sport, Science… it suggests a larger part of all students learning should be making connections with the real world of work and the jobs we do.  The following PLE diagram includes a page supporting learning pathway choices at 14 & career advice . The diagram should be seen in conjunction with this screen-cast of an initial implementation

#Click image to enlarge

Personalised Learning Environment PLP Draft Proposal
Standard Parts of Personalised Learning Environment PLP Draft Proposal

Adding Grades & Feedback to the #Moodle student course Profile (PLE)

Having implemented the changes shown in the previous blog post, adding Grades & Feedback seem like a logical improvement ?
(similar to below,  is now in production in the Stanmore College Moodle & being  piloted with its users) :

Enhancing the Moodle user (course) profile with Grades and Feedback
Enhancing the Moodle user (course) profile with Grades and Feedback

This improvement can be Voted for at

Developing the USER’s personalised/profile pages within #moodle (PLE)

@stanmoreCollege we are looking at ways to improve, customise & better integrate the pages which present information about a particular student.  For example the “My Moodle Page”, the Grades “User report” page, ILP Block & other custom pages…Over time I hope to post examples of our other personalised pages for the interest to others.

#Moodle user/view enhanced & user/profile
#Moodle user/view enhanced & user/profile

More information at

Notes on migrating to #Moodle 2 with ILP 2 plugin + pruning the DB & site files

Warning (!) These notes might not mean much if you are not involved with Moodle/LMS administration in some way. However, I have found it useful to read and discuss (see footer links) how others have migrated Moodle 1 sites to moodle 2, so have assembled these notes:

Background & overview

@StanmoreCollege started to use Moodle (1.7) in 2007 and it is now used by nearly every member of staff & full time student in some capacity. The broad aim was to prepare the site for another 5 years of intensive communication, learning & creative use. By creative, I mean I wanted the database, codebase & servers setup so the college could readily exploit new services & software that could enhance teaching & learning. For example integrating with other community resources (personal blogs, mnet, hubs…) & publishing to the community. Ideally we would have installed a fresh moodle 2 site & built the 300+ courses from scratch, but this would loose the user account #IDs which links to users (ILP 1.0) Personal Learning Plan data in moodle 1.9 (PLP) & could require returning students to update their profile… This would also take hundreds of hours of teachers time to rebuild the courses, so the compromise was to upgrade the existing moodle 1.9 site to 2.2, then migrate the required courses across to a fresh moodle 2.2 installation (backup & restore), but where certain data* for example the Moodle 1.9 mdl_user table… was migrated to the fresh 2.2 installation.

Site particulars, pruning & upgrade

The site to ugrade was moodle at 1.9+ with ~ 300+ courses to be migrated. In previous years a few courses have exceeded 600Mb when backed up. This has made the course backup & restoration slow, & not worked at all in some cases…For this reason I requested that teachers clean up their courses & delete unused files. I then only kept any files over 20mb in moodledata unless there was a good reason to do so, and did other things like check the length of filenames for files that students & staff had uploaded. One reason why you might want to do this is referred to here . In the end I just used the query below to find the moodledata folder URL e.g

that included these – whole sentence long – filenames, where you can simply ‘Rename’ files. Alternatively you could edit the query just to find these folders. You could also download the result of this query to a spreedsheet, so teachers can identify and shorten file names themselves

 SELECT c.fullname, CONCAT('
 /course/modedit.php?update=', AS cmID,,
 SUBSTRING_INDEX( r.reference, '/' , -1 ) AS FileName,, r.type, r.reference, r.timemodified,cm.course
 FROM mdl_resource r
 JOIN mdl_course_modules cm ON = cm.instance
 JOIN mdl_course c ON cm.course =
 WHERE LENGTH( SUBSTRING_INDEX( r.reference, '/' , -1 ) ) >100
 AND r.reference NOT LIKE 'http%'
 AND r.type <> 'html'
 ORDER BY cm.course DESC ,LENGTH( FileName ) DESC

So after pruning these user files etc. I deleted logs & stats rows from the database (These would be available in yearly archive sites we create @StanmoreCollege should they be need) I transferred the moodle site from a Windows server to a Linux server & performed a command line upgrade . This was so the user files could be processed & migrated into the new way moodle 2 handles & stores files . Below are some more notes on this upgrade:

Modules upgrade notes:

  • ILP (Personal Learning Plans etc) –> inserted ILP 1.0 tables into Moodle 2.2 DB…
  • Book (used for schemes of work) –> installed this mod in moodle 2.0 & 2.1 (becomes native in later versions of Moodle)
  • Turnitin Assignment type –> Deleted all instances of this prior to migration due to issues!
  • Turnitintool (plagiarism detection) –> installed mod in moodle 2
  • Feedback –> Did not migrate data for this (its in the Archive sites anyway)
  • Lightbox gallery –> Did not migrate data for this but reinstalled module later from github

Miscellaneous upgrade notes:

  • Additional 1.9 roles created: Manager, Tutor, Senior tutor, Manual-student were not migrated
  • compared upgrade with fresh DB schemas – used collation utf8_unicode_ci
  • Made changes to grade scales that I wanted to see in the new moodle 2 site

Set up of fresh Moodle 2.2 installation

Thousands of the mdl_user rows from the upgraded table were inserted into this fresh installation. This was necessary because I wanted all returning students to be able to login without requiring them to update their moodle profiles. Also for their ILP 1.0 data to be available.

*other considerations for this fresh moodle 2.2 installation were the password salt, Guest & Admin (ID#2) accounts, user mnethost value, updating links that pointed to our old Moodle site address … Also if you are migrating in this way, before you upload user pictures into your fresh Moodle 2 installation, remember to set picture=0 in the mdl_user table:

 UPDATE mdl_user u
 JOIN mdl_context ctx ON ctx.instanceid
 LEFT JOIN mdl_files f ON = f.contextid
 SET picture = '0'
 WHERE ctx.contextlevel =30
 AND u.picture = 1
 AND f.filearea IS NULL

Migration of courses to fresh Moodle 2.2 installation

This was a case of backing up courses in the site upgraded to moodle 2.2 then restoring them to the fresh Moodle 2.2 installation. Although this was time consuming it presented an opportunity for further pruning:

  • Unused activities & resources were not backed up & restored
  • Blocks were not backed up or restored (keeping things simpler)
  • Last year student user Grades were not restored
  • Courses that were no longer needed were not restored…

This resulted in reducing the DB & moodledata by well over half, which is good as Media & Computer teachers are now needing students to be able to upload files upto 50MB.

Related links:

Moodle 2.0: Making the Leap, Senate House, 29th February 2012

Personalised Learning enhancement to Moodle ILP

We wanted Academic targets to be  more highly visible upon login to our VLE.  Before students had to click though a couple of web pages to get much detail on their Academic targets.

Develop a Moodle block that can be displayed on the front page, beside our very fast moving college news items.  The block will list all Academic targets  that have not been achieved yet, & also those targets past their deadline (in a conspicuous way). When clicked,  the Academic targets link, takes the student through to the Target Action Plan, for the student to make comments.  Click on the following image to enlarge to full size (you sometimes need to click twice), and for a better idea of how this works:

Moodle Personalisation Block plus Staff Report
Stanmore College enhancing personalised learning with Moodle and ILP package

Stanmore College:

ServingAndIncludingYourCommunites – Slides:1-3

The following 6 posts on this blog are slides which accompanied a presentation I gave at Moodle Moot UK 2011 at Senate House. The slides are a little cluttered but this helped condense all into 20 minutes. Please  click the slides to see larger versions.

At the end of last year I explored ways Stanmore College might enhance & personalise Moodle for students & staff.  I presented some of these at ULCC’s Moodle Wonderland event.  What follows is is a much broader analysis of elearning services and how they could improve to serve the wider community:

Slide 1 : Presentation title
MootUK11-ServingAndIncludingYourCommunites- JagoBrown-2/15
Slide 2/15 : Learning services overview

The following slide indicates where I think some gaps in elearning services exist for both un-enrolled local citizens (lifelong learners) & enrolled students:

Slide 3/15 : Is the learner enrolled or not enrolled?

As an example of where a gap might exist in learning services, imagine a place in the UK where for many miles there is only one school or college & the local bookshop (etc.) has closed. If you are not enrolled in this school or college & want to learn something, but don’t have the money for internet access – so can’t look something up on the internet or buy a book online – and you can’t find a person to learn from, where do you go? This is an example of a learner gap in the community, that the UK is wealth enough to bridge.

ServingAndIncludingYourCommunites – Slide:7

These are examples of technologies (available to most UK schools colleges & universities) which allow the sharing of learning resources and increase ease of access to content (USO)

Slide 7 : Other existing services which help serve & include our communities

I doubt we are taking full advantage of these technologies yet, but they are on a path where teachers don’t have to create as many resources/activities from scratch, can quickly add them to local VLE’s, and when content management is integrated (resource QA workflow: versions, commenting, moderation etc. ) can lead to higher quality resources which harness the collective intelligence of the community & scales of economy.