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

Display problem with < > characters in shortanswer question text

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.2, 1.7
    • Fix Version/s: 1.6.4, 1.7, 1.8
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE

      Description

      1- Create a question of the shortanswer type.
      a) question text: If a=2 and b=5, then write the inequality equation between a and b.
      b) correct answer: a<b

      2- Test question and enter expected correct answer: "a<b"
      a) you get the message that your answer is correct
      b) the text of the correct answer is displayed as: "Correct answer: a" rather than the expected " Correct answer: a<b".

      Diagnostic: the smaller than character < is interpreted as an HTML opening tag character.
      Severity: This is not too bad since the student's answer IS marked as correct, but the truncated feedback message is of course misleading.
      I expect this occurence might be fairly rare (Maths or science teachers using < > characters in their shortanswer questions).
      Remedy: Maybe there ought to exist in a Moodle library a function which would scan text for occurrences of < > characters and decide whether they are genuine HTML tag markers OR just greater than and lesser than characters ?

      Joseph

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            rezeau Joseph Rézeau
            Tester:
            Nicolas Martignoni
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              7/Nov/06