Best practice forum (Archived)

Course role in reporting

 
Wouter Maenhout
Course role in reporting
by Wouter Maenhout - Wednesday, 30 May 2012, 4:47 AM
Group Partners

Hi,

Would it be possible to add course role as a column to the report builder?

Case:
For a specific setup a user can have a student role and/or a teacher role. We now want to track only the time spent in a face to face session in the role of a teacher. If we could add a course role to the global time reporting of face to faces, we can then filter on course role.

Thanks for your input.

Kind regards,

Wouter

Craig Eves
Re: Course role in reporting
by Craig Eves (Totara Support) - Monday, 4 June 2012, 7:04 PM
Group Totara

Hi Wouter

I am not sure how this would work - if a person logins with the same username that has two roles how would the report know which role they are accessing the face to face course with.

Would it be easier to create two usernames one for each role so that the split in roles is clearly defined.

Craig

Wouter Maenhout
Re: Course role in reporting
by Wouter Maenhout - Monday, 11 June 2012, 2:00 AM
Group Partners

Hi Craig,

The role is not important to indicate who can view which report. We want to add the course role to a report, so the system admin can see with which role a user is subscribed in a course.

The goal is to have a report of the attendance of all teachers for the different face to face sessions. Problem is that a teacher in one course, could be a student in a different course, causing errors in reporting, since time spent as a student is not necessary in this report and there is no option to filter on course role.

Thank you for your feedback.

Kind regards,

Wouter

Simon Coggins
Re: Course role in reporting
by Simon Coggins - Monday, 11 June 2012, 3:27 AM
Group Totara

Wouter,

It should be possible to add the column you want with a bit of coding - the best place to put it would be the add_course_tables_to_joinlist() and add_course_fields_to_columns() functions in local/reportbuilder/classes/rb_base_source.php.

That would make the new column available to any report source that includes the other standard course options.

There is some documentation on building report builder sources that might be useful here:

http://docs.moodle.org/dev/reportbuilder

The only issue I see is that you may end up with multiple records if a user has multiple roles in a course. That could be solved either by creating a join made up of an aggregated subquery, or by using the one of the text-based grouping options like rb_group_comma_list().

I'm happy to advise if you need more help - and if you get it working please share and we'll look at including it in core.

Simon

Wouter Maenhout
Re: Course role in reporting
by Wouter Maenhout - Tuesday, 12 June 2012, 5:07 AM
Group Partners

Hi Simon,

Thank you for your feedback. We will investigate asap. Multiple roles will not be an issue since a user will only have one role per course. If this works, our problem is solved. I will keep you updated.

Kind regards,

Wouter