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

Error in essay question preview

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.2, 2.2
    • 2.1.3
    • Questions
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_21_STABLE
    • Hide

      1. Create an Essay question
      2. Click the preview icon
      3. In the preview pop-up window, verify that the button "Fill in correct responses" is disabled.
      4. Use Firebug (or similar) to hack the DOM to enable the button.
      5. Click the button, and verify that there is no error message. (The page should reload with no changes.)

      Show
      1. Create an Essay question 2. Click the preview icon 3. In the preview pop-up window, verify that the button "Fill in correct responses" is disabled. 4. Use Firebug (or similar) to hack the DOM to enable the button. 5. Click the button, and verify that there is no error message. (The page should reload with no changes.)

    Description

      Steps to reproduce

      1. Create an Essay question
      2. Click the preview icon
      3. In the preview pop-up windows, click the button "Fill in correct responses"

      Expected behaviour

      a) Either the button is not displayed at all as the essay question does not have correct responses predefined
      b) or pressing the button does nothing

      What actually happens

      Debugging error is displayed

      • line 1041 of /question/engine/questionattempt.php: call to question_attempt_step->__construct()
      • line 539 of /question/engine/questionusage.php: call to question_attempt->process_action()
      • line 148 of /question/preview.php: call to question_usage_by_activity->process_action()

      Warning: array_key_exists() expects parameter 2 to be array, null given in .../question/engine/questionattemptstep.php on line 283

      Warning: array_key_exists() expects parameter 2 to be array, null given in .../question/engine/questionattemptstep.php on line 283

      Warning: Invalid argument supplied for foreach() in .../question/engine/questionattemptstep.php on line 270

      Attachments

        Activity

          People

            timhunt Tim Hunt
            mudrd8mz David Mudrák (@mudrd8mz)
            Charles Fulton Charles Fulton
            Aparup Banerjee Aparup Banerjee
            Rajesh Taneja Rajesh Taneja
            Safat Shahin, Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              28/Nov/11