Adding usermanager in order to load constants see #6749
Minor - format code.
Fixing commit 8135a405e8b0886cad61c8555e8a3839343d1783
Fixing query error.
Moving code into a function, adding keyword filter see BT#7297

Also adding course info (teacher, session list) in the course reporting.