I want to include the teachers name to the excel spreadsheet export. I've looked at various ways to do this an think this might be the best way to start.
Create a new item type that would be pre-filled with the resulting string from a query
SELECT mdl_user.firstname, mdl_user.lastname
FROM mdl_role_assignments, mdl_user, mdl_context, mdl_course
WHERE mdl_role_assignments.userid = mdl_user.id AND mdl_role_assignments.roleid = '4' AND mdl_role_assignments.contextid = mdl_context.id AND mdl_context.instanceid = mdl_course.id AND mdl_course.shortname = $courseid
Does this sound correct?