How to I add the course name information to this report? Also, how do I change the field "taken by" to the instructor's name? Is there a way for this information to be globalized so that I can obtain this information for a student in multiple courses? I have been trying to find out the Moodle database structure so that I can figure out what to map the information in the following tables to in the course tables, grade items tables, etc. to get the professor's name to show up as well. I have searched online but online found schema information for course and user basically. When I search for global attendance information, I really don't find a solution. The conversations appear to just stop. Please help if you can. I have copied the script below. Thanks,
SELECT prefix_user.id UserID, prefix_attendance_log.remarks,
prefix_user.firstname AS FirstName,
prefix_user.lastname AS LastName,
from_unixtime(prefix_attendance_log.timetaken) AS Date, prefix_attendance_log.takenby, prefix_attendance_statuses.description AS STATUS
FROM prefix_attendance_log, role_assignments, mdl_role, mdl_context, mdl_course
INNER JOIN
prefix_user ON
prefix_attendance_log.studentid = prefix_user.id
INNER JOIN
prefix_attendance_statuses ON prefix_attendance_log.statusid = prefix_attendance_statuses.id
ORDER BY prefix_user.firstname