Select Moodle version:

Blocks: Course Contacts Block

block_course_contacts
The Course Contacts block displays a list of users on your course, various methods for communicating with them, and their current activity status.
Maintained by: Picture of Mark Ward Mark Ward

The Course Contacts block displays a list of users on your course and various
methods for communicating with them.

The block is highly customisable and allows you to choose specific roles which
you wish to display users from. By default the block will show teachers on the
course but this can be changed however you wish.

You can also configure which communication types you wish to show, the block
can provide quick links to Email, Message or Telephone each user.

The block also shows whether the user has been active in the last five minutes.

This plugin contains potential privacy issues:
This block can publish contact details for users; be careful when using it on a course with guest access enabled.

Screenshots

screenshot

Contributors

Picture of Mark Ward
Mark Ward (Lead maintainer): Author
Picture of Mat Cannings
Mat Cannings: Tester
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Simon Hanmer
    Tue, Sep 4, 2012, 8:16 PM
    Mark, I found that if I replaced the SQL Query with the following, the block worked for me:
    SELECT DISTINCT {user}.id, {user}.lastaccess, {user}.firstname, {user}.lastname, {user}.email, {user}.phone1, {user}.picture, {user}.imagealt

    FROM {user}
    LEFT JOIN {role_assignments}
    ON {role_assignments}.userid = {user}.id
    LEFT JOIN {context}
    ON {context}.id={role_assignments}.contextid

    WHERE {context}.instanceid = ?
    AND {context}.contextlevel = 50
    AND {role_assignments}.roleid = ?

    ORDER BY {user}.lastname
  • Picture of Mark Ward
    Tue, Sep 4, 2012, 8:53 PM
    Hi Simon,

    Could you give this a try and let me know if it works ok for you:

    "SELECT {user}.*
    FROM {user}
    LEFT JOIN {role_assignments}
    ON {role_assignments}.userid = {user}.id
    LEFT JOIN {context}
    ON {context}.id={role_assignments}.contextid
    WHERE {context}.instanceid = ?
    AND {context}.contextlevel = 50
    AND {role_assignments}.roleid = ?
    GROUP BY {user}.id
    ORDER BY LOWER({user}.lastname)"
  • Picture of Simon Hanmer
    Tue, Sep 4, 2012, 9:53 PM
    Mar,
    I tried that and get the error:

    Debug info: Column 'mdl_user.auth' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
    SELECT mdl_user.*
    FROM mdl_user
    LEFT JOIN mdl_role_assignments
    ON mdl_role_assignments.userid = mdl_user.id
    LEFT JOIN mdl_context
    ON mdl_context.id=mdl_role_assignments.contextid
    WHERE mdl_context.instanceid = ?
    AND mdl_context.contextlevel = 50
    AND mdl_role_assignments.roleid = ?
    GROUP BY mdl_user.id
    ORDER BY LOWER(mdl_user.lastname)

    I think the problem with the original query was that fields were being pulled in that aren't used - the description field in the user profile is an ntext datatype which stopped distinct working; so I changed the query to explicitly state the fields which the block requires.
  • Picture of Mark Ward
    Tue, Sep 4, 2012, 10:24 PM
    Yes, and selecting just the fields the block needs for each contact will be better for now. We will need to pull more fields out of the database if we decide to do anything with the contacts which relies on a proper USER object in the future though. It's just good to know what my options are while I have someone around to try things out on MS-SQL :P

    I've cleaned up my SQL builder a little and added your SELECT tweaks. I've also made a modification to handle Mari's request and I have verified that the roles are indeed being printed in the order that is defined within "Define Roles". I'm just waiting to hear back from Mat Canings regarding something he was working on and then I will be able to release an updated version.
  • Picture of Simon Hanmer
    Tue, Sep 4, 2012, 11:25 PM
    Mark, happy to help out on testing with MS-SQL
  • Picture of Simon Hanmer
    Tue, Sep 4, 2012, 11:44 PM
    Mark, I'd add a request as well - can we put an option on the configuration screen to choose whether the user is displayed in the list or not if they have an appropriate role - took me a while to work out why I couldn't see myself smile
  • Picture of Mark Ward
    Wed, Sep 5, 2012, 12:29 AM
    Hi Simon, that was Mari's request which I referred to above. I'm not sure it needs an option but I wanted to give people a chance to raise concerns before I changed the behaviour.
  • My picture
    Hello Mat,
    I am also happy helping in the testing. We launched new online courses for the September presentation on Friday, so it has been very busy for the last two days.
    Please let me know where I could find the beta version. I work for the Medical School of the University of Dundee, we have our own learning platform in Moodle and course contacts is a very popular block among our tutors.
  • My picture
    Hello Mat,
    I am also happy helping in the testing. We launched new online courses for the September presentation on Friday, so it has been very busy for the last two days.
    Please let me know where I could find the beta version. I work for the Medical School of the University of Dundee, we have our own learning platform in Moodle and course contacts is a very popular block among our tutors.
  • Picture of Mark Ward
    Wed, Feb 6, 2013, 6:32 PM
    I've just uploaded V2 with a whole bunch of changes including a new quick email form and support for sorting contacts and displaying inherited role assignments.
  • Picture of Scott Hardwick
    Thu, Sep 26, 2013, 5:04 AM
    Has anyone gotten this to successfully install on Moodle 2.5? I tried both using the Install button and downloading it and put installing directly and both times I get "Missing English language folder" -- which is odd, in that the zip does have a lang folder with an en folder and its associated file.
  • Picture of Mark Ward
    Thu, Sep 26, 2013, 4:02 PM
    Hi Scott, we have been running this on Moodle 2.5 since mid-August without any problems. Has anyone else had any problems installing this?
  • Picture of German Valero
    Thu, Oct 3, 2013, 10:15 PM
    Hi Mark,
    I also got a "Missing English Language folder" when trying to install this add-on directly on a recent Moodle 2.5.2 local server (build 20130927), but by using the ZIP file it did install correctly, but it took 5 minutes to do it, which is way too long.

    Could you please install a local test server and test the block behavior ? Thanks in advance.
  • Picture of Alan Coats
    Wed, Jan 8, 2014, 6:49 PM
    Anyone tried this with Moodle 2.6 ?
  • Picture of John Love
    Wed, Feb 26, 2014, 5:50 AM
    Same comment as "German Valero":
    "...error "Missing English Language folder" when trying to install this add-on directly on a recent Moodle 2.5.2 local server (build 20130927)".

    Any suggestions for how to resolve this error please? Thanks!
1 2
Please login to post comments