Skip to content

Commit

Permalink
MDL-70153 qtype_essay: Fix max size displayed for attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
dpalou committed Nov 18, 2020
1 parent f86b5e3 commit 8f0d40a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions question/type/essay/renderer.php
Expand Up @@ -106,7 +106,7 @@ public function files_read_only(question_attempt $qa, question_display_options $
*/
public function files_input(question_attempt $qa, $numallowed,
question_display_options $options) {
global $CFG;
global $CFG, $COURSE;
require_once($CFG->dirroot . '/lib/form/filemanager.php');

$pickeroptions = new stdClass();
Expand All @@ -122,7 +122,8 @@ public function files_input(question_attempt $qa, $numallowed,
$pickeroptions->accepted_types = $qa->get_question()->filetypeslist;

$fm = new form_filemanager($pickeroptions);
$fm->options->maxbytes = $qa->get_question()->maxbytes;;
$fm->options->maxbytes = get_user_max_upload_file_size(
$this->page->context, $CFG->maxbytes, $COURSE->maxbytes, $qa->get_question()->maxbytes);
$filesrenderer = $this->page->get_renderer('core', 'files');

$text = '';
Expand Down

0 comments on commit 8f0d40a

Please sign in to comment.