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

error in Lesson question shortanswer with regexp option

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.1.2
    • Fix Version/s: 2.0.7, 2.1.4
    • Component/s: Lesson
    • Labels:
      None
    • Testing Instructions:
      Hide

      #. login as admin/teacher
      #. create a lesson,
      #. set 'Provide option to try a question again' to yes
      #. set 'Display default feedback' to yes
      #. add shortanswer question
      #. tick on 'options' to use regular expression
      #. on answer 1 section, enter the following string: 'it's blue, white(,| and) red/i'
      #. save page
      #. preview the question and answer it with either one of these correct answers: 'it's blue, white, red' or 'it's blue, white and red'

      The above answers should be recognize as the correct answers.

      For more info regarding correct answer with regular expression: http://docs.moodle.org/20/en/Short_answer_analysis

      Show
      #. login as admin/teacher #. create a lesson, #. set 'Provide option to try a question again' to yes #. set 'Display default feedback' to yes #. add shortanswer question #. tick on 'options' to use regular expression #. on answer 1 section, enter the following string: 'it's blue, white(,| and) red/i' #. save page #. preview the question and answer it with either one of these correct answers: 'it's blue, white, red' or 'it's blue, white and red' The above answers should be recognize as the correct answers. For more info regarding correct answer with regular expression: http://docs.moodle.org/20/en/Short_answer_analysis
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Error in mod/lesson/pagetypes/shortanswer.php line 88

      if (substr($expectedanswer,0,-2) == '/i') {

      should be

      if ( substr($expectedanswer,strlen($expectedanswer) - 2, 2) == '/i') {

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jan/12