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

Coding error on grading lesson

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.5.5, 2.6.2
    • 2.4.7, 2.5.2, 2.6
    • Lesson
    • MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • Hide
      1. Create a lesson with "Available for group members only" unset. Add an essay to the lesson.
      2. Add 2 users, "User 1" and "User 2" to the course. Login as both users and submit an assignment.
      3. Log back in as admin. Create a group with only User 1 in it, and add to a grouping. Change the lesson settings to "Available for group members only" and use this grouping.
      4. Go to the "Grade essays" tab. You should not see the error.
      Show
      Create a lesson with "Available for group members only" unset. Add an essay to the lesson. Add 2 users, "User 1" and "User 2" to the course. Login as both users and submit an assignment. Log back in as admin. Create a group with only User 1 in it, and add to a grouping. Change the lesson settings to "Available for group members only" and use this grouping. Go to the "Grade essays" tab. You should not see the error.

    Description

      On going to the "Grade essays" tab on the lesson, it is possible to get a coding error under certain circumstances. The error is accompanied by the following notice:

      Notice: Undefined offset: 73371 in /moodle/web/mod/lesson/essay.php on line 330 Call Stack: 0.0026 968608 1. {main}() /moodle/web/mod/lesson/essay.php:0 Notice: Undefined offset: 73371 in /moodle/web/mod/lesson/essay.php on line 375 Call Stack: 0.0026 968608 1. {main}() /moodle/web/mod/lesson/essay.php:0
      

      The circumstances seem to be

      1. the lesson is limited to group members only
      2. there is an essay submission from someone who is not a group member in the target grouping

      To reproduce:

      1. Create a lesson with "Available for group members only" unset
      2. Add 2 users, "User 1" and "User 2" to the course. Login as both users and submit an assignment.
      3. Log back in as admin. Create a group with only User 1 in it, and add to a grouping. Change the lesson settings to "Available for group members only" and use this grouping.
      4. Go to the "Grade essays" tab. You should see the error.

      (NB: This error does not appear unless there is at least one submission by someone who is in a group in the chosen grouping)

      Even though the steps above describe a not particularly sensible scenario, where someone changes the target grouping after submission has started, I think (although I haven't tested this) that the same should happen if someone submits an essay assignment and then is removed from a group, which is a more reasonable scenario.

      Attachments

        Activity

          People

            maherne Michael Aherne
            maherne Michael Aherne
            Andrew Davis Andrew Davis
            Damyon Wiese Damyon Wiese
            Jérôme Mouneyrac Jérôme Mouneyrac
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10/Mar/14