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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.6.5, 2.8.2
    • Fix Version/s: None
    • Component/s: Questions
    • Labels:
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_28_STABLE

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: