diff --git a/pix/qrcode.svg b/pix/qrcode.svg new file mode 100644 index 0000000..18dca2a --- /dev/null +++ b/pix/qrcode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/renderables.php b/renderables.php index c0dbc7f..1f4fdab 100644 --- a/renderables.php +++ b/renderables.php @@ -854,8 +854,14 @@ class attendance_password_icon implements renderable, templatable { $data->heading = ''; $data->text = $this->text; + if ($this->includeqrcode == 1) { + $pix = 'qrcode'; + } else { + $pix = 'key'; + } + $data->alt = $title; - $data->icon = (new pix_icon('key', '', 'attendance'))->export_for_template($output); + $data->icon = (new pix_icon($pix, '', 'attendance'))->export_for_template($output); $data->linktext = ''; $data->title = $title; $data->url = (new moodle_url('/mod/attendance/password.php', [ diff --git a/renderer.php b/renderer.php index ea78bd7..db4e228 100644 --- a/renderer.php +++ b/renderer.php @@ -318,6 +318,13 @@ class mod_attendance_renderer extends plugin_renderer_base { has_capability('mod/attendance:changeattendances', $sessdata->att->context))) { $icon = new attendance_password_icon($sess->studentpassword, $sess->id); + + if ($sess->includeqrcode == 1) { + $icon->includeqrcode = 1; + } else { + $icon->includeqrcode = 0; + } + $actions .= $this->render($icon); }