project: Moodle
summary: Integrate Totara Report Builder into core
description: Totara has a custom report builder that allows users to create custom reports via the GUI and save them. Docs: Example: Lets look at getting it into Moodle core: Most of the code is in /local/reportbuilder with activity modules providing some "report sources" in mod/xxxx/rb_sources/xxxx.php At a first guess, I think it could move to /report/reportbuilder with module-specific classes in mod/xxxx/reportbuilder.php

1.summary: Create and update reportbuilder unit and behat tests
description: Totaras report builder has an extensive amount of unit tests, but a lot of them are not relevant to Moodle. We need to: Keep the unit test structure that has been created. Update relevant unit tests and create new ones that relate to new "sources" that we are creating. Add behat tests.
2.summary: Make structual changes to the reportbuilder
description: The report builder from Totara is located in a totara directory. This doesnt fit with Moodles directory structure so changes need to be made. Use automatic class loading. Fix existing classes Work out what is commented out and why (git diff /git/totara/mod/scorm/rb_sources/rb_source_scorm.php mod/scorm/rb_sources/rb_source_scorm.php) Fix warnings Remove irrelevant totara data from: main plugin child classes Totara_report_manager block needs to be included (or some other way for students and teachers needs to be found to access the reports). Move language strings to plugin files Fix navigation tree for viewing reports.
3.summary: Replace calls to custom totara functions in the report builder.
description: The report builder makes numerous calls to functions that are part of the Totara library. These calls need to be replaced with calls to Moodle functions. totara_set_notification() file_postupdate_standard_editor() needs to be replaced (reportbuilder/general.php) totara_feature_visable() totara_get_manager() Other yet undiscovered functions
4.summary: Create and update report builder "sources"
description: The report builder needs additional "sources" added as well as useful existing sources updated (if necessary). Port over sources from Totara Remove totara specific fields (diff between the database schemas in Totara and Moodle to see what fields to remove) Remove totara specific functions Add more classes to useful areas of Moodle (More than just SCORM). Assign (submissions, summary, final grades) Site log (exists in Totara, but need to upgrade to new log system) Quiz Forum Make sure theses sources are indexed for performance
5.summary: Fix up formatting issues in the report builder
description: The report builder does not adhere to Moodle coding guidelines. Areas that need to be fixed up: Clean up formatting. Fix capitalisations. Doc blocks. Comments. Multiple parameters on one line. Possibly split up report forms - Not sure that they will get through all in one file. Move add button to the next row so that it s clear that you already are adding a field.
6.summary: Update javascript for the report builder.
description: Totaras report builder uses jquery. This is fine for third party plugins, but YUI must be used for core Moodle plugins. Disable javascript calls (currently jquery). Create YUI/Moodle Table (Talk to Frontend) reportbuilder/filters/ remove jquery from hierarchy.php if not the whole file. reportbuilder/showhide.php remove jquery and replace with yui.
7.summary: Create / update embedded reports in the report builder
description: A list of pre-made lists would be useful for users. Files currently located in reportbuilder/embedded/ should be reviewed to determine if they are useful. New embedded reports should be created such as
8.summary: Replace add_to_log calls to event classes in the report builder.
description: Update the following add_to_log() calls: update report view report dailyreport delete $type . report - reportbuilder/index.php line 56 (deletion of report) new report export report
9.summary: Update cron function in the report builder to use the new cron system.
description: Cron in 2.7 was updated to support scheduling and adhoc tasks. The report builder should take advantage of these updates.
10.summary: Define Report Builder API
description: Work in progress: We need to define the API that will be used to define report sources. This will determine a large section of the work that needs to be done as we integrate the report builder into core moodle.

Below is an instruction that describes a task, paired with an input that provides an epic with this format: 
"project": "Name of the project" 
"summary": "Summary of the epic user story" 
"description": "Description of the epic user story". Write a response that appropriately completes the request.### Instruction:
Break this epic user story into smaller tasks to help the developers understand the epic better, you can divide this epic into as much as you want depending on the complexity of the epic.
### Input:
project: Moodle
summary: Integrate Totara Report Builder into core
description: Totara has a custom report builder that allows users to create custom reports via the GUI and save them. Docs: Example: Lets look at getting it into Moodle core: Most of the code is in /local/reportbuilder with activity modules providing some "report sources" in mod/xxxx/rb_sources/xxxx.php At a first guess, I think it could move to /report/reportbuilder with module-specific classes in mod/xxxx/reportbuilder.php

### Response:
1.summary: Create and update reportbuilder unit and behat tests
description: Totaras report builder has an extensive amount of unit tests, but a lot of them are not relevant to Moodle. We need to: Keep the unit test structure that has been created. Update relevant unit tests and create new ones that relate to new "sources" that we are creating. Add behat tests.
2.summary: Make structual changes to the reportbuilder
description: The report builder from Totara is located in a totara directory. This doesnt fit with Moodles directory structure so changes need to be made. Use automatic class loading. Fix existing classes Work out what is commented out and why (git diff /git/totara/mod/scorm/rb_sources/rb_source_scorm.php mod/scorm/rb_sources/rb_source_scorm.php) Fix warnings Remove irrelevant totara data from: main plugin child classes Totara_report_manager block needs to be included (or some other way for students and teachers needs to be found to access the reports). Move language strings to plugin files Fix navigation tree for viewing reports.
3.summary: Replace calls to custom totara functions in the report builder.
description: The report builder makes numerous calls to functions that are part of the Totara library. These calls need to be replaced with calls to Moodle functions. totara_set_notification() file_postupdate_standard_editor() needs to be replaced (reportbuilder/general.php) totara_feature_visable() totara_get_manager() Other yet undiscovered functions
4.summary: Create and update report builder "sources"
description: The report builder needs additional "sources" added as well as useful existing sources updated (if necessary). Port over sources from Totara Remove totara specific fields (diff between the database schemas in Totara and Moodle to see what fields to remove) Remove totara specific functions Add more classes to useful areas of Moodle (More than just SCORM). Assign (submissions, summary, final grades) Site log (exists in Totara, but need to upgrade to new log system) Quiz Forum Make sure theses sources are indexed for performance
5.summary: Fix up formatting issues in the report builder
description: The report builder does not adhere to Moodle coding guidelines. Areas that need to be fixed up: Clean up formatting. Fix capitalisations. Doc blocks. Comments. Multiple parameters on one line. Possibly split up report forms - Not sure that they will get through all in one file. Move add button to the next row so that it s clear that you already are adding a field.
6.summary: Update javascript for the report builder.
description: Totaras report builder uses jquery. This is fine for third party plugins, but YUI must be used for core Moodle plugins. Disable javascript calls (currently jquery). Create YUI/Moodle Table (Talk to Frontend) reportbuilder/filters/ remove jquery from hierarchy.php if not the whole file. reportbuilder/showhide.php remove jquery and replace with yui.
7.summary: Create / update embedded reports in the report builder
description: A list of pre-made lists would be useful for users. Files currently located in reportbuilder/embedded/ should be reviewed to determine if they are useful. New embedded reports should be created such as
8.summary: Replace add_to_log calls to event classes in the report builder.
description: Update the following add_to_log() calls: update report view report dailyreport delete $type . report - reportbuilder/index.php line 56 (deletion of report) new report export report
9.summary: Update cron function in the report builder to use the new cron system.
description: Cron in 2.7 was updated to support scheduling and adhoc tasks. The report builder should take advantage of these updates.
10.summary: Define Report Builder API
description: Work in progress: We need to define the API that will be used to define report sources. This will determine a large section of the work that needs to be done as we integrate the report builder into core moodle.
