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

error in Lesson question shortanswer with regexp option

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.0.7, 2.1.4
    • 2.0, 2.1.2
    • Lesson
    • None
    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • 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

      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') {

            rwijaya Rossiani Wijaya
            rezeau Joseph Rézeau
            Adrian Greeve Adrian Greeve
            Sam Hemelryk Sam Hemelryk
            Rajesh Taneja Rajesh Taneja
            Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.