listing of courses with number of users in each

listing of courses with number of users in each

by Wanda Dechant -
Number of replies: 10

Hi,


In Moodle 2.5.2+ is there an easy way to get a list of courses with a list of how many participants are enrolled in each course?   We have courses with about 400 people enrolled and when I go into that course and look at "users" I see people's names listed (and about 8 pages of names), but I don't see an overall number.   I could count names on each page and estimate that way, but just wondering if there is somewhere where I can see all the courses with the listed number of participants for each course.

Thanks for any thoughts on this!

Wanda

Average of ratings: -
In reply to Wanda Dechant

Re: listing of courses with number of users in each

by ben reynolds -

Hi Wanda,

When you select "Student" in the dropdown on the participants page, you should see on the left in bold "Users with the role "Student": and a number. If you don't, try switching to a standard theme.

I would be interesting to know if there is a report that name courses and show numbers of students.

In reply to ben reynolds

Re: listing of courses with number of users in each

by Wanda Dechant -

Hi Ben!!!

I think you have helped me before - I remember your relaxed phone picture smile   Thanks for replying - much appreciated.


It would be interesting to know if there is a report that lists courses and # enrolled as I am not really looking forward to looking through all of our courses to find this data.   Thanks for your suggestion, I'm a bit hesitant to change the theme back and forth... but I have created a fake group, and if I go to enroll a user in the group it then tells me how many people in total are in the course.... a bit cumbersome to go and go this for every course, but at least it is a way to find the actual numbers (I am surprised there is not an easier way - maybe I will change the theme just to see if that is simpler).


Thanks Ben!

Wanda

In reply to Wanda Dechant

Re: listing of courses with number of users in each

by ben reynolds -

Do you have admin rights? If so Site Admin > Users > Accounts > Bulk User actions > +show more > Course role > Student. In the box below course role, enter a course's short name. Click add filter.

The top line shows x/total population. X being students enrolled.

If you don't have admin rights, your admin can give you Just the capability of viewing Site Admin > Users.

Average of ratings: Useful (1)
In reply to ben reynolds

Re: listing of courses with number of users in each

by Wanda Dechant -

Hi Ben,

I think your bulk action idea is just what I need...  to pick and course and see the number of students (this would be relatively quick for a large number of courses).   However, I can see where I choose the role of "student" but I cannot see where I specify the course  (there is a place to choose the category, but not the course).

I tried the short name (and the long name) of the course in that field to the right of where you select the category (Moodle 2.5.2), but it tells says, "Course role error: course "ERLCMATH10C" does not exist "

I think this is close though!  



In reply to Wanda Dechant

Re: listing of courses with number of users in each

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Interesting request, I like it.  

I don't know how to do this myself, but my guess is that someone who is good with SQL might be able to provide you the query that can do this.

Average of ratings: Useful (1)
In reply to Rick Jerz

Re: listing of courses with number of users in each

by Kevin Cooke -

Using configurable reports block plugin, you can run this SQL report to find out the total number of users enrolled in a course as a student.

SELECT c.fullname AS 'Course Name'
      ,COUNT(u.username) AS '# of Users'
 FROM prefix_role_assignments AS r
   JOIN prefix_user AS u on r.userid = u.id
   JOIN prefix_role AS rn on r.roleid = rn.id
   JOIN prefix_context AS ctx on r.contextid = ctx.id
   JOIN prefix_course AS c on ctx.instanceid = c.id
 WHERE rn.shortname = 'student'
 GROUP BY c.fullname, rn.shortname
Average of ratings: Useful (2)
In reply to Kevin Cooke

Re: listing of courses with number of users in each

by Wanda Dechant -

Thanks for the reply, Kevin...  I have not experimented with SQL reports, but when I do I will remember that there are some interesting possibilities.   Thanks.

In reply to Wanda Dechant

Re: listing of courses with number of users in each

by ben reynolds -

Wanda,

This is an easy block to install. I've done it at least twice on my localhost. The problem I ran into was that I don't know SQL and there weren't very many useful SQL queries out there to use. You can do this in 5 mins with no pain.

Kevin, would you plant this nice piece of work in a forum somewhere on here about "useful SQL queries"? or is it already there? I think there's also a document linked from "configurable reports block" where people are posting useful queries.

Thanks for the good work! And to Rick for summoning the SQL folks!

In reply to Rick Jerz

Re: listing of courses with number of users in each

by Wanda Dechant -

Thanks Rick, I have not at all experimented with SQL, but sounds like it might not be too painful - thanks for bringing that possibility into the question/suggestions here....

In reply to Wanda Dechant

Re: listing of courses with number of users in each

by Wanda Dechant -

Thank-you Ben!!!   It was the spaces...  I had spaces in the course short names, so once I edited those, and then followed your instructions, it worked - I can now find out how many students are in each course.  Thanks so much (again) Ben!