Creating Report Builder sources in Moodle 4

Creating Report Builder sources in Moodle 4

ໂດຍ Eimantas Jakas -
ຈຳນວນການຕອບກັບ: 3

Hi,

is it possible to create new report builder source? in Moodle Workplace developer can create report source but how about Moodle?

ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ Eimantas Jakas

Re: Creating Report Builder sources in Moodle 4

ໂດຍ David Carrillo -
ຮູບພາບຂອງ Core developers ຮູບພາບຂອງ Moodle HQ ຮູບພາບຂອງ Moodle Workplace team ຮູບພາບຂອງ Peer reviewers ຮູບພາບຂອງ Plugin developers ຮູບພາບຂອງ Testers
Hi Eimantas,

Yes, it is possible to create report builder sources in the new Report Builder in LMS. Here you have the documentation for the new Report Builder https://docs.moodle.org/dev/Report_builder_API.

We are still in the process of adding the "Custom reports" section, but the process of adding new sources is very similar to the way it is in Moodle Workplace.
ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ David Carrillo

Re: Creating Report Builder sources in Moodle 4

ໂດຍ Onno Schuit -
Hi David,

I've browsed through the Report builder API documentation, but I couldn't find any info on where to put your own source. My assumption would be: extend the correct report class (e.g. system_report) and put the code in file named after your own class, and put that file a local plugin. Is that correct?

Thanks,
Onno
ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ Onno Schuit

Re: Creating Report Builder sources in Moodle 4

ໂດຍ Dan Marsden -
ຮູບພາບຂອງ Core developers ຮູບພາບຂອງ Particularly helpful Moodlers ຮູບພາບຂອງ Peer reviewers ຮູບພາບຂອງ Plugin developers ຮູບພາບຂອງ Plugins guardians ຮູບພາບຂອງ Testers ຮູບພາບຂອງ Translators
maybe it might help to see an example in a plugin?
Entity file:
https://github.com/danmarsden/moodle-mod_attendance/blob/MOODLE_401_STABLE/classes/local/entities/attendance.php

Reportsource using that entity:
https://github.com/danmarsden/moodle-mod_attendance/blob/MOODLE_401_STABLE/classes/reportbuilder/datasource/attendance.php

those 2 classes (plus the language strings used in the new files) are the only things you need to create a new custom report.

basically your entities go in your plugin under classes/local/entities and your reportbuilder datasource goes in the classes/reportbuilder/datasource/ folder in your plugin.
ການຈັດອັນດັບສະເລ່ຍ:Useful (2)