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

\* handled incorrectly in shortanswer question correct answer/response handling

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2.1, 2.3
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      Create a shortanswer question with an escaped asterisk

      \*

      as a first 100% grade answer. It should be just asterisk in the correct reponse.

      Go to preview and press "Fill in correct responses". You shoudn't see \ before the * there. Create a test with correct answer displayed and add a question to it. In the "Correct answer is:" section you shoudn't see \ before * too.

      Show
      Create a shortanswer question with an escaped asterisk \* as a first 100% grade answer. It should be just asterisk in the correct reponse. Go to preview and press "Fill in correct responses". You shoudn't see \ before the * there. Create a test with correct answer displayed and add a question to it. In the "Correct answer is:" section you shoudn't see \ before * too.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Shortanswer question class doesn't seems to overload standard get_correct_response method. So it display backslash before asterisk while it should have been stripped since asterisk is a wildcard.

      The logic in qtype_shortanswer_renderer::correct_response also seems wrong. It try to display ANSWER instead of RESPONSE for some reason - e.g. text with special character like asterisk (which could be shown) and escaped asterisk (which is wrong).

        Gliffy Diagrams

          Activity

          Hide
          timhunt Tim Hunt added a comment -

          Thanks for spotting this. Submitting the fix for integration now.

          Show
          timhunt Tim Hunt added a comment - Thanks for spotting this. Submitting the fix for integration now.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Some hours ago...

          the main moodle.git repository has been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Some hours ago... the main moodle.git repository has been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks! (21, 22 and master).

          Thanks for the 4x1 explanation @ HQ chat, Tim. It was driving me crazy!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (21, 22 and master). Thanks for the 4x1 explanation @ HQ chat, Tim. It was driving me crazy!
          Hide
          samhemelryk Sam Hemelryk added a comment -

          Thanks Tim, tested and passed

          Show
          samhemelryk Sam Hemelryk added a comment - Thanks Tim, tested and passed
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          FCT (fixed, closing, thanks). Ciao

          "I feel a very unusual sensation - if it is not indigestion, I think it must be gratitude!"
          ~ Benjamin Disraeli

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - FCT (fixed, closing, thanks). Ciao "I feel a very unusual sensation - if it is not indigestion, I think it must be gratitude!" ~ Benjamin Disraeli

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/May/12