I am using moodle 3.4 and wanted my custom user profile fields to display on activity completion report. How can i achieve this?
Adding custom user profile fields to activity completion report
Re: Adding custom user profile fields to activity completion report
You can't without hacking core code - which I wouldn't recommend.
I've written custom course reports in the past to provide Assignment reports with output like this (although - before you ask - never exactly what you want)
Re: Adding custom user profile fields to activity completion report
If the fields exist in the database, then why hack core code and create a custom report? I have never done this, but from what I recall of the database and SQL, you should be able to query to database to get all the information in a report you need. The hard part would be formatting the report in a user friendly manner I would think. The skills needed would be PHP, SQL (possibly HTML and Javascript), and understanding enough of how Moodle works to convert the report to a PDF and printing. You could start with the documentation here to try to understand how you could do that.
You could find an existing course report that does the major things, and modify that to suit your need. You could create your own course report module for whatever report you need and not just use the standard course reports.
Re: Adding custom user profile fields to activity completion report
I said *not* to hack core code... I suggested creating a custom report. Which is what you said. Confused...
Anyway, a custom report is basically just querying the database and so on. Moodle contains lots of stuff to do this and to format the output. It makes sense (to me anyway) to build a custom report plugin.
Re: Adding custom user profile fields to activity completion report
Creating a new report is now hacking core code? mm My apologies, been away for most of the year.
Oh I see, replacing the entire reporting module you mean... mmm OK, not a clever observation... sorry, Howard, just got a bit carried away. But it could be done in a branch if the organization that is using the Moodle has the skill base to do that. Up to them really, isn't it?
I suspect the key advice is not to change core code as any such change may have unforeseen impact on other aspects of the Moodle and the hassles that users and organizations have when updating their Moodles. Would that be right? The other side of this though is that organizations also have the opportunity to submit any such change to Moodle.org and possibly see their change become part of core, or at least be encouraged to add their change in as a plugin if it could be worked that way. Would that not also be correct?
And Merry Xmas Howard..
Re: Adding custom user profile fields to activity completion report
I'm almost certain we are talking at cross purposes...
https://docs.moodle.org/dev/Reports
Reports are a pluggable thing. One can develop (or have developed) a report to do anything you like without going near core code. Always favour writing a custom plugin before touching core code. If writing something is unavoidable.
And a merry Xmas to you too!