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

Incorrect error thrown when switching to essay question type inside Lessons for certain cases

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.13
    • Fix Version/s: 1.9.15
    • Component/s: Lesson
    • Labels:
    • Database:
      Any
    • Testing Instructions:
      Hide

      1. Create a new lesson
      2. Add a new question page
      3. Title the question 'Essay 1' and click save, "not realizing you just saved a multiple choice question type"
      4. "See you're error" and edit the question.
      5. Switch to the 'essay' type by clicking the last tab
      6. Save the essay and receive the following error: Update page: EOB not updated
      7. Go back to the lesson and see that it really was updated.
      8. Apply the patch, repeat steps 1-6 but find no error.

      Show
      1. Create a new lesson 2. Add a new question page 3. Title the question 'Essay 1' and click save, "not realizing you just saved a multiple choice question type" 4. "See you're error" and edit the question. 5. Switch to the 'essay' type by clicking the last tab 6. Save the essay and receive the following error: Update page: EOB not updated 7. Go back to the lesson and see that it really was updated. 8. Apply the patch, repeat steps 1-6 but find no error.
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Pull from Repository:

      Description

      I realize this is an edge case scenario but we had to address it here due to repeated run-ins with it.
      If a Lesson creator Adds a new Question Page with a MultipleChoice question (the default question type when creating a new question) and clicks save without adding any answers, they will get an incorrect error if they then choose to go back, edit that question, and save it as an essay.

      The error they get is "Update page: EOB not updated". This is not correct. The page updates correctly. The code assumes that it wasn't because update_record() returns false. It returns false because its being told to update a record with and id of 0.

      Testing instructions and forthcoming patch will give more explanation.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  28/Nov/11