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

apostrophe not recognized in lesson shortanswer question

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.1
    • Fix Version/s: 2.0.4
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide

      1. Create a lesson activity
      2. Add short answer type question.
      3. Put answer as "

      {<It work's well! :)>}

      ". Try use all html special chars to make sure answer is compared for all.

      Show
      1. Create a lesson activity 2. Add short answer type question. 3. Put answer as " {<It work's well! :)>} ". Try use all html special chars to make sure answer is compared for all.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Pull Master Branch:
      wip-mdl-26281-master

      Description

      apostrophe not recognized in lesson shortanswer question
      see http://moodle.org/mod/forum/discuss.php?d=168052

      easy fix:
      in file lesson/pagetypes/shortanswer.php
      around line 80
      replace:
      foreach ($answers as $answer) {
      $i++;
      $expectedanswer = $answer->answer; // for easier handling of $answer->answer

      with

      foreach ($answers as $answer) {
      $i++;
      $expectedanswer = s($answer->answer); // for easier handling of $answer->answer

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            rezeau Joseph Rézeau added a comment -

            BUMP !
            My easy fix has still not been applied...

            Show
            rezeau Joseph Rézeau added a comment - BUMP ! My easy fix has still not been applied...
            Hide
            salvetore Michael de Raadt added a comment -

            Increasing priority as this is the cause of a failed QA test.

            Show
            salvetore Michael de Raadt added a comment - Increasing priority as this is the cause of a failed QA test.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            User input was being modified before comparison. Now quotes are being added at the output.

            Show
            rajeshtaneja Rajesh Taneja added a comment - User input was being modified before comparison. Now quotes are being added at the output.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Uhm...

            looking for uses to that check_answer() method... it seems that it's used in this way:

            1) $result->studentanswer is sent to ouput
            2) $result->userresponse is sent to DB

            So, IMO, we should be doing the cleaning right before output and not @ check_answer() at all.

            Also, really fun... this line, hehe:

            $studentanswer = $studentanswer;

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Uhm... looking for uses to that check_answer() method... it seems that it's used in this way: 1) $result->studentanswer is sent to ouput 2) $result->userresponse is sent to DB So, IMO, we should be doing the cleaning right before output and not @ check_answer() at all. Also, really fun... this line, hehe: $studentanswer = $studentanswer; Ciao
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Removed redundant studentanswer assignment and now studentanswer is cleaned for $result->studentanswer only.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Removed redundant studentanswer assignment and now studentanswer is cleaned for $result->studentanswer only.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Great, thanks! This has been integrated!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Great, thanks! This has been integrated!
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Passing test without further action. This will be tested by MDLQA-1016 once this meets upstream.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Passing test without further action. This will be tested by MDLQA-1016 once this meets upstream.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            All git & cvs servers have been updated with these cool changes, so closing, many thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - All git & cvs servers have been updated with these cool changes, so closing, many thanks!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  1/Aug/11