Moodle
  1. Moodle
  2. MDL-26236

Random essay questions are broken

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Questions
    • Labels:
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Steps to reproduce:

      1. Create a new quiz.
      2. Create a new category "Essay questions".
      3. Create two essay questions in that category.
      4. Add one random question to the quiz, picking from that category.
      5. Preview the quiz.
      6. Type an answer into the HTML editor that includes pressing ENTER.
      7. Click next.

      Actual result:

      Can not find wrapped question random30-
      asdf

      asdf

      Notice: Trying to get property of non-object in /Users/tim/Documents/workspace/moodle_head/question/type/random/questiontype.php on line 249
      Wrapped state missing

      Notice: Trying to get property of non-object in /Users/tim/Documents/workspace/moodle_head/question/type/random/questiontype.php on line 264

      Notice: Undefined index: in /Users/tim/Documents/workspace/moodle_head/question/type/random/questiontype.php on line 264

      Fatal error: Call to a member function get_question_options() on a non-object in /Users/tim/Documents/workspace/moodle_head/question/type/random/questiontype.php on line 265

        Gliffy Diagrams

          Activity

          Show
          Tim Hunt added a comment - See http://moodle.org/mod/forum/discuss.php?d=168245
          Hide
          Tim Hunt added a comment -

          I think https://github.com/timhunt/moodle/commit/c991ecb49d67eddd0d74be7d009f82b4571f143b fixes this issue, but it is a bit of a scary change. Is anyone able to test that before I request that it gets added to the stable branch? Thanks.

          Show
          Tim Hunt added a comment - I think https://github.com/timhunt/moodle/commit/c991ecb49d67eddd0d74be7d009f82b4571f143b fixes this issue, but it is a bit of a scary change. Is anyone able to test that before I request that it gets added to the stable branch? Thanks.
          Hide
          Charles Fulton added a comment -

          Patching my dev system eliminated the crash (which I also reproduced). Newlines no longer cause a crash, nor do answers without newlines.

          Show
          Charles Fulton added a comment - Patching my dev system eliminated the crash (which I also reproduced). Newlines no longer cause a crash, nor do answers without newlines.
          Hide
          Tim Hunt added a comment -

          Thanks Charles. That confirms my testing. Of course, what I really want to know is that the change does not inadvertently break anything else anywhere in Moodle, and that is rather harder to know

          Show
          Tim Hunt added a comment - Thanks Charles. That confirms my testing. Of course, what I really want to know is that the change does not inadvertently break anything else anywhere in Moodle, and that is rather harder to know
          Hide
          Tim Hunt added a comment -

          I just reviewed the code again, and it I am confident that it is good to be integrated.

          To test: create a quiz with a mixture of random and non-random questions, of all types particularly including essays. Check for several attempts, including newlines in the essay answers. Check when the teacher goes in through the quiz reports and reviews the student responses, especially the manual grading and responses reports.

          Show
          Tim Hunt added a comment - I just reviewed the code again, and it I am confident that it is good to be integrated. To test: create a quiz with a mixture of random and non-random questions, of all types particularly including essays. Check for several attempts, including newlines in the essay answers. Check when the teacher goes in through the quiz reports and reviews the student responses, especially the manual grading and responses reports.
          Hide
          Helen Foster added a comment -

          Thanks Tim!

          Show
          Helen Foster added a comment - Thanks Tim!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: