← blogs.sussex.ac.uk

Importing user profile photos into Moodle

At Sussex we encourage the use of user profile images (avatars) in our Moodle installation because it provides a more personal learning experience, encourages interaction and improves usability of the system by having more graphic representations of data.

However many students and staff haven’t uploaded an avatar in Moodle. We have therefore initiated a Spring term project to import staff or student card photos from users web profiles, where they have permitted its use.

Current use of card photos

In Sussex’s Managed Learning Environment (MLE), Sussex Direct, you can select to show your staff or student card photo to everyone on the web. Staff can also upload an alternative photo. These options are respected within the MLE, the staff profile pages visible on the Sussex web pages, but they are not currently respected in our Moodle installation.

Development plan

In Moodle, Sussex’s Virtual Learning Environment (VLE), users can put up avatars of themselves. These avatars can be more casual than a card photo. We like this because it reflects the informal learning environment that the VLE can represent. However, where a staff or student hasn’t selected to put up an avatar we would like to use the card  photo where they have permitted everyone to see it.

A new picture_sussex database table

We created a new table in the Moodle database so

  • We have a record of all photos copied
  • If a copied photo is deleted in Moodle we don’t copy it again

The logic will work as follows:

For each current Moodle user without an avatar already and who has allowed use of their Sussex card photo we will:

  • Copy card photos from their unrestricted web address
  • Store them in a temporary directory
  • Process them for Moodle
  • Move them into the Moodle user directory
  • Update the “picture” field in their Moodle user record
  • Store a record that photo has been passed in a new table called “picture_sussex”

To prevent photos being copied again if a user deletes their copied card photo from Moodle, we record this within the new “picture_sussex” table.

If a user updates their Moodle picture and a record exists of the picture in the “picture_sussex” table the record will be deleted unless the “deleted time” field is set.

Exclusions

Because of the informal nature of Study Direct, we don’t want users avatars from Moodle passed back to the more official MLE.

There will be no facility for keeping availability flag in sync if permission settings are updated on Study Direct or Sussex Direct. The user can however delete the picture from Study Direct manually.

2 Comments

  1. Sam
    Posted January 27, 2015 at 11:41 am | Permalink

    Hello,

    We are trying to implement something similar whereby if students haven’t got a profile photo, we would be able to copy photos from what we call their ‘membership profile’ and upload them into Moodle.

    I ran into a couple of problems trying to do it and I’d appreciate some help in the form of example of code I could use.

    Many thanks in anticipation

    Sam 

  2. Posted March 15, 2016 at 7:08 pm | Permalink

    Sam, have you had any luck with this as I know someone who would be able to help you.

One Trackback

  1. […] A development for the Spring term will be to pass card photos to Moodle.  We will still allow staff and students to add a Moodle picture, but where one does not exist and they have allowed use of their card photo we will pass it. We will run a script every month to look for new Sussex account card photos. For more information see blog post on importing user profiles into Moodle. […]

Post a Comment

Your email is never shared. Required fields are marked *

*
*