Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49071

Question type Match , does not work with "<" as a answer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • 2.6.5, 2.8.2
    • Questions
    • MOODLE_26_STABLE, MOODLE_28_STABLE

      In a Quiz if we use the question type match, and we put as answer "<", the result does not work well, we can't save the question and we can't see it.

      To fix the problem we try to:

      • Modified /question/type/match/edit_match_form.php code:

      protected function get_per_answer_fields($mform, $label, $gradeoptions,
                  &$repeatedoptions, &$answersoption) {
          $mform->addElement('static', 'answersinstruct',get_string('availablechoices', 'qtype_match'),
                    get_string('filloutthreeqsandtwoas', 'qtype_match'));
          $repeated = array();
          $repeated[] = $mform->createElement('editor', 'subquestions',$label,array('rows'=>3), $this->editoroptions);
          $repeated[] = $mform->createElement('text', 'subanswers',get_string('answer', 'question'), array('size' => 50, 'maxlength' => 255));
          $repeatedoptions['subquestions']['type'] = PARAM_RAW;
          //------------------------------
          //BUG FIXED "<" 
          //ORIGINAL CODE
          //$repeatedoptions['subanswers']['type'] = PARAM_TEXT;
          //FIXED CODE:
          $repeatedoptions['subanswers']['type'] = PARAM_RAW;
          //END
          $answersoption = 'subquestions';
          return $repeated;
      }
      

      • And must be $CFG->formatstringstriptags = false.

            timhunt Tim Hunt
            dcastro David Castro (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.