. /** * Contains definition of a renderable for an action available for an individual user attempt in the report. * * @package mod_adaptivequiz * @copyright 2022 onwards Vitaly Potenko * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_adaptivequiz\output\report\individual_user_attempts; use moodle_url; use pix_icon; use renderable; use renderer_base; use templatable; /** * Definition of a renderable for an action available for an individual user attempt in the report. * * @package mod_adaptivequiz */ final class individual_user_attempt_action implements renderable, templatable { /** * @var moodle_url $url; */ private $url; /** * @var pix_icon $icon */ private $icon; /** * @var string $title */ private $title; /** * The constructor. * * @param moodle_url $url * @param pix_icon $icon * @param string $title */ public function __construct(moodle_url $url, pix_icon $icon, string $title) { $this->url = $url; $this->icon = $icon; $this->title = $title; } /** * Exports the renderer data in a format that is suitable for a Mustache template. * * @param renderer_base $output */ public function export_for_template(renderer_base $output): array { return [ 'url' => $this->url->out(false), 'icon' => $output->render($this->icon), 'title' => $this->title, ]; } }