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

Teacher problems setting user overrides in quiz (calendar error)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: None
    • Component/s: Calendar, Quiz
    • Labels:
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Detected @ MDLQA-697, after some debugging I was able to get simple steps to reproduce it:

      • As teacher, create quiz, set start/end dates for it.
      • Navigation -> user overrides and create one.
      • Error happens:

      Sorry, but you do not currently have permissions to update calendar event
       
      More information about this error
       
      Stack trace:
      line 421 of /lib/setuplib.php: moodle_exception thrown
      line 1969 of /calendar/lib.php: call to print_error()
      line 2379 of /calendar/lib.php: call to calendar_event->update()
      line 1290 of /mod/quiz/lib.php: call to calendar_event::create()
      line 172 of /mod/quiz/overrideedit.php: call to quiz_update_events()

      It seems that the quiz is trying to create user events, (with eventyped = 'close' ???) and calendar_add_event_allowed() is returning one big false, hence the error above. This is the structure of the event:

      stdClass Object
      (
          [description] => xxxxxxxxxxxx
          [courseid] => 0
          [groupid] => 0
          [userid] => 5
          [modulename] => quiz
          [instance] => 1
          [timestart] => 1445001300
          [timeduration] => 0
          [visible] => 1
          [eventtype] => close
          [name] => One Quiz - Override (Quiz closes)
      )

      Really I'm not sure if the mistake is in the quiz, and how the event is created or in calendar and how event-creation perms are checked. It seems that there are some strange course-user dark logic (implications) there.

      Ciao

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: