Merge branch 'MDL-70373' of https://github.com/timhunt/moodle
authorSara Arjona <sara@moodle.com>
Wed, 16 Dec 2020 11:40:36 +0000 (12:40 +0100)
committerSara Arjona <sara@moodle.com>
Wed, 16 Dec 2020 11:40:36 +0000 (12:40 +0100)
1  2 
question/type/essay/renderer.php

@@@ -106,7 -106,7 +106,7 @@@ class qtype_essay_renderer extends qtyp
       */
      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();
          $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 = '';
@@@ -264,7 -259,7 +264,7 @@@ class qtype_essay_format_editor_rendere
                  $this->class_name() . ' qtype_essay_response'));
  
          $output .= html_writer::tag('div', html_writer::tag('textarea', s($response),
-                 array('id' => $id, 'name' => $inputname, 'rows' => $lines, 'cols' => 60)));
+                 array('id' => $id, 'name' => $inputname, 'rows' => $lines, 'cols' => 60, 'class' => 'form-control')));
  
          $output .= html_writer::start_tag('div');
          if (count($formats) == 1) {
@@@ -455,7 -450,7 +455,7 @@@ class qtype_essay_format_plain_rendere
       * @return string the HTML for the textarea.
       */
      protected function textarea($response, $lines, $attributes) {
-         $attributes['class'] = $this->class_name() . ' qtype_essay_response';
+         $attributes['class'] = $this->class_name() . ' qtype_essay_response form-control';
          $attributes['rows'] = $lines;
          $attributes['cols'] = 60;
          return html_writer::tag('textarea', s($response), $attributes);