diff --git a/lang/en/moodle.php b/lang/en/moodle.php index f6393b2292890..5e0ec64b10891 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -2244,6 +2244,8 @@ $string['timesplitting:pastmonth_help'] = 'This analysis interval generates predictions every month. The indicators calculations will be based on the past month.'; $string['timesplitting:pastweek'] = 'Past week'; $string['timesplitting:pastweek_help'] = 'This analysis interval generates predictions every week. The indicators calculations will be based on the past week.'; +$string['timesplitting:upcoming1day'] = 'Upcoming 1 day'; +$string['timesplitting:upcoming1day_help'] = 'This analysis interval generates predictions every day. The indicators calculations will be based on the upcoming day.'; $string['timesplitting:upcoming3days'] = 'Upcoming 3 days'; $string['timesplitting:upcoming3days_help'] = 'This analysis interval generates predictions every 3 days. The indicators calculations will be based on the upcoming 3 days.'; $string['timesplitting:upcomingfortnight'] = 'Upcoming fortnight'; diff --git a/lib/classes/analytics/time_splitting/upcoming_1_day.php b/lib/classes/analytics/time_splitting/upcoming_1_day.php new file mode 100644 index 0000000000000..6ea010c8753d7 --- /dev/null +++ b/lib/classes/analytics/time_splitting/upcoming_1_day.php @@ -0,0 +1,53 @@ +. + +/** + * Time splitting method that generates insights every three days and calculates indicators using upcoming dates. + * + * @package core_analytics + * @copyright 2020 Daniel Neis Araujo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace core\analytics\time_splitting; + +defined('MOODLE_INTERNAL') || die(); + +/** + * Time splitting method that generates insights every day and calculates indicators using upcoming dates. + * + * @package core_analytics + * @copyright 2020 Daniel Neis Araujo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class upcoming_1_day extends \core_analytics\local\time_splitting\upcoming_periodic { + + /** + * The time splitting method name. + * @return \lang_string + */ + public static function get_name() : \lang_string { + return new \lang_string('timesplitting:upcoming1day'); + } + + /** + * Once every day. + * @return \DateInterval + */ + public function periodicity() { + return new \DateInterval('P1D'); + } +}