Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
refresh_flags
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 get_name
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 execute
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2// This file is part of Moodle - https://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle.  If not, see <https://www.gnu.org/licenses/>.
16
17/**
18 * Scheduled task refresh_flags.
19 *
20 * @package    local_atrisk
21 * @copyright  2026 DevLMS <contact@devlms.com>
22 * @license    https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 */
24
25namespace local_atrisk\task;
26
27/**
28 * Refresh at-risk students.
29 *
30 * @package    local_atrisk
31 * @copyright  2026 DevLMS <contact@devlms.com>
32 * @license    https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
33 */
34class refresh_flags extends \core\task\scheduled_task {
35    /**
36     * Name shown in the task list.
37     *
38     * @return string
39     */
40    public function get_name() {
41        return get_string('task_refresh_flags', 'local_atrisk');
42    }
43
44    /**
45     * Run the task.
46     */
47    public function execute() {
48        \local_atrisk\local\detector::refresh_all();
49    }
50}