Skip to content

Commit c46ecc5

Browse files
committed
resize qr code and logo for better scannability
1 parent 5565fdf commit c46ecc5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

classes/output/renderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function display_image($courseid, $instanceid) {
4444
'courseid' => $courseid,
4545
'download' => false,
4646
'format' => 1,
47-
'size' => 150,
47+
'size' => 300,
4848
'instance' => $instanceid]);
4949

5050
return \html_writer::img(
@@ -64,7 +64,7 @@ public function display_download_section($courseid, $instanceid) {
6464
'download' => true,
6565
'instance' => $instanceid]);
6666
$mform = new \block_qrcode\block_qrcode_form(
67-
$download, ['format' => 1, 'size' => 150], 'post', '',
67+
$download, ['format' => 1, 'size' => 300], 'post', '',
6868
['data-double-submit-protection' => 'off']);
6969
return $mform->render();
7070
}

classes/output_image.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function create_image() {
181181
}
182182
$logo = new Logo(
183183
$logopath,
184-
intval($this->size * 0.4),
184+
intval($this->size * 0.25),
185185
null,
186186
false
187187
);
@@ -193,8 +193,8 @@ public function create_image() {
193193
: $CFG->dirroot . '/blocks/qrcode/pix/moodlelogo.svg';
194194
$logo = new Logo(
195195
$logopath,
196-
intval($this->size * 0.4),
197-
intval($this->size * 0.4 / $this->get_logo_aspect_ratio($logopath)),
196+
intval($this->size * 0.25),
197+
intval($this->size * 0.25 / $this->get_logo_aspect_ratio($logopath)),
198198
false
199199
);
200200
}

download.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
$download = required_param('download', PARAM_BOOL);
3030
$format = required_param('format', PARAM_TEXT);
3131
$instanceid = required_param('instance', PARAM_INT);
32-
$size = optional_param('size', 150, PARAM_INT);
32+
$size = optional_param('size', 300, PARAM_INT);
3333

3434
if ($download) {
3535
require_capability('block/qrcode:download', context_course::instance($courseid));

0 commit comments

Comments
 (0)