On the old version of Moodle that we were using, we could see the course expiry date, under Enrolled Users (listed under the heading 'Enrolment Methods', however this is not visible in the new version.
We need to be able to view (and, if possible, download) a list of users with their course expiry dates.
Is this possible?
It looks like this was changed in Moodle 3.4 as part of MDL-59290.
But if you click on 🛈 in the Status column for the user you can see these details:
You can also download a list of enrolled users (Select all, With selected users..., Download table data as) but this only contains the firstname, lastname and email address. I don't think there's any way to download a report with the end date currently.
Thanks Leon. The 'i' link is helpful.
I wonder if anyone knows of a plug-in to either display the expiry date to users, or to include it as a heading in the user list?
To show the expiry date to users it looks like MDL-63029 is suggesting this in which case you could vote for that issue.
For site admins, if you used Configurable Reports (or Ad-hoc Database Queries) then I think the following will report this information:
SELECT u.firstname, u.lastname, r.shortname AS role,
FROM_UNIXTIME(ue.timestart) AS timestart,
IF (ue.timeend = 0, '', FROM_UNIXTIME(ue.timeend)) AS timeend
FROM prefix_user_enrolments ue
INNER JOIN prefix_enrol e ON e.id = ue.enrolid
INNER JOIN prefix_user u ON ue.userid = u.id
INNER JOIN prefix_course c ON e.courseid = c.id
INNER JOIN prefix_context ctx ON c.id = ctx.instanceid AND ctx.contextlevel = 50
INNER JOIN prefix_role_assignments ra ON ra.contextid = ctx.id
INNER JOIN prefix_role r ON ra.roleid = r.id AND u.id = ra.userid
WHERE c.id = %%COURSEID%%
Add a new Configurable Reports block to the course and create a report using Custom SQL with this query.
This uses the MySQL/MariaDB FROM_UNIXTIME() function. If you're using PostgreSQL you'll need to use to_timestamp() instead. If you're using SQL Server I'm not sure if you can convert the date/time values.
Example: