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

enhancement to assign::submissions_open

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.3.3
    • Fix Version/s: 2.4.1
    • Component/s: Assignment
    • Labels:

      Description

      The submissions_open method in the assign class is currently private. It also depends on the global $USER, with no way to invoke it for a user other than the current global $USER.

      We need to be able to check whether submissions are open for a particular user for a particular assignment as part of a plugin we are considering developing, so it would be nice if this function were public and general, rather than private and specific. We could then use this method, rather than rewriting the same functionality ourselves.

      Suggested implementation:

      1) Make submissions_open take an optional $userid parameter (default: 0).
      2) Default to using the current $USER if $userid is 0.
      3) Change submissions_open to be public rather than private.

      No changes to calling code are required, as the previous behaviour (no arguments, use $USER) remains supported.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jan/13