. /** * * @package core_analytics * @copyright 2017 David Monllao {@link http://www.davidmonllao.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core_analytics; defined('MOODLE_INTERNAL') || die(); require_once(__DIR__ . '/../../lib/adminlib.php'); class admin_setting_predictor extends \admin_setting_configselect { /** * Builds HTML to display the control. * * The main purpose of this is to display a warning if the selected predictions processor is not ready. * @param string $data Unused * @param string $query * @return string HTML */ public function output_html($data, $query='') { global $CFG, $OUTPUT; $html = ''; // Calling it here without checking if it is ready because we check it below and show it as a controlled case. $selectedprocessor = \core_analytics\manager::get_predictions_processor($data, false); $isready = $selectedprocessor->is_ready(); if ($isready !== true) { $html .= $OUTPUT->notification(get_string('errorprocessornotready', 'analytics', $isready)); } $html .= parent::output_html($data, $query); return $html; } }