Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  /**
  18   * This file contains the definition for the renderable assign submission status.
  19   *
  20   * @package   mod_assign
  21   * @copyright 2020 Matt Porritt <mattp@catalyst-au.net>
  22   * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23   */
  24  namespace mod_assign\output;
  25  
  26  /**
  27   * This file contains the definition for the renderable assign submission status.
  28   *
  29   * @package   mod_assign
  30   * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
  31   * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  32   */
  33  class assign_submission_status implements \renderable {
  34      /** @var int STUDENT_VIEW */
  35      const STUDENT_VIEW     = 10;
  36      /** @var int GRADER_VIEW */
  37      const GRADER_VIEW      = 20;
  38  
  39      /** @var int allowsubmissionsfromdate */
  40      public $allowsubmissionsfromdate = 0;
  41      /** @var bool alwaysshowdescription */
  42      public $alwaysshowdescription = false;
  43      /** @var mixed the submission info (may be null or an integer) */
  44      public $submission = null;
  45      /** @var boolean teamsubmissionenabled - true or false */
  46      public $teamsubmissionenabled = false;
  47      /** @var \stdClass teamsubmission the team submission info (may be null) */
  48      public $teamsubmission = null;
  49      /** @var mixed submissiongroup the submission group info (may be null) */
  50      public $submissiongroup = null;
  51      /** @var array submissiongroupmemberswhoneedtosubmit list of users who still need to submit */
  52      public $submissiongroupmemberswhoneedtosubmit = array();
  53      /** @var bool submissionsenabled */
  54      public $submissionsenabled = false;
  55      /** @var bool locked */
  56      public $locked = false;
  57      /** @var bool graded */
  58      public $graded = false;
  59      /** @var int duedate */
  60      public $duedate = 0;
  61      /** @var int cutoffdate */
  62      public $cutoffdate = 0;
  63      /** @var array submissionplugins - the list of submission plugins */
  64      public $submissionplugins = array();
  65      /** @var string returnaction */
  66      public $returnaction = '';
  67      /** @var string returnparams */
  68      public $returnparams = array();
  69      /** @var int courseid */
  70      public $courseid = 0;
  71      /** @var int coursemoduleid */
  72      public $coursemoduleid = 0;
  73      /** @var int the view (STUDENT_VIEW OR GRADER_VIEW) */
  74      public $view = self::STUDENT_VIEW;
  75      /** @var bool canviewfullnames */
  76      public $canviewfullnames = false;
  77      /** @var bool canedit */
  78      public $canedit = false;
  79      /** @var bool cansubmit */
  80      public $cansubmit = false;
  81      /** @var int extensionduedate */
  82      public $extensionduedate = 0;
  83      /** @var \context context */
  84      public $context = 0;
  85      /** @var bool blindmarking - Should we hide student identities from graders? */
  86      public $blindmarking = false;
  87      /** @var string gradingcontrollerpreview */
  88      public $gradingcontrollerpreview = '';
  89      /** @var string attemptreopenmethod */
  90      public $attemptreopenmethod = 'none';
  91      /** @var int maxattempts */
  92      public $maxattempts = -1;
  93      /** @var string gradingstatus */
  94      public $gradingstatus = '';
  95      /** @var bool preventsubmissionnotingroup */
  96      public $preventsubmissionnotingroup = 0;
  97      /** @var array usergroups */
  98      public $usergroups = array();
  99      /** @var int The time limit for the assignment */
 100      public $timelimit = 0;
 101  
 102      /**
 103       * Constructor
 104       *
 105       * @param int $allowsubmissionsfromdate
 106       * @param bool $alwaysshowdescription
 107       * @param mixed $submission
 108       * @param bool $teamsubmissionenabled
 109       * @param \stdClass $teamsubmission
 110       * @param mixed $submissiongroup
 111       * @param array $submissiongroupmemberswhoneedtosubmit
 112       * @param bool $submissionsenabled
 113       * @param bool $locked
 114       * @param bool $graded
 115       * @param int $duedate
 116       * @param int $cutoffdate
 117       * @param array $submissionplugins
 118       * @param string $returnaction
 119       * @param array $returnparams
 120       * @param int $coursemoduleid
 121       * @param int $courseid
 122       * @param string $view
 123       * @param bool $canedit
 124       * @param bool $cansubmit
 125       * @param bool $canviewfullnames
 126       * @param int $extensionduedate Any extension to the due date granted for this user.
 127       * @param \context $context Any extension to the due date granted for this user.
 128       * @param bool $blindmarking Should we hide student identities from graders?
 129       * @param string $gradingcontrollerpreview
 130       * @param string $attemptreopenmethod The method of reopening student attempts.
 131       * @param int $maxattempts How many attempts can a student make?
 132       * @param string $gradingstatus The submission status (ie. Graded, Not Released etc).
 133       * @param bool $preventsubmissionnotingroup Prevent submission if user is not in a group.
 134       * @param array $usergroups Array containing all groups the user is assigned to.
 135       * @param int $timelimit The time limit for the assignment.
 136       */
 137      public function __construct(
 138          $allowsubmissionsfromdate,
 139          $alwaysshowdescription,
 140          $submission,
 141          $teamsubmissionenabled,
 142          $teamsubmission,
 143          $submissiongroup,
 144          $submissiongroupmemberswhoneedtosubmit,
 145          $submissionsenabled,
 146          $locked,
 147          $graded,
 148          $duedate,
 149          $cutoffdate,
 150          $submissionplugins,
 151          $returnaction,
 152          $returnparams,
 153          $coursemoduleid,
 154          $courseid,
 155          $view,
 156          $canedit,
 157          $cansubmit,
 158          $canviewfullnames,
 159          $extensionduedate,
 160          $context,
 161          $blindmarking,
 162          $gradingcontrollerpreview,
 163          $attemptreopenmethod,
 164          $maxattempts,
 165          $gradingstatus,
 166          $preventsubmissionnotingroup,
 167          $usergroups,
 168          $timelimit
 169      ) {
 170          $this->allowsubmissionsfromdate = $allowsubmissionsfromdate;
 171          $this->alwaysshowdescription = $alwaysshowdescription;
 172          $this->submission = $submission;
 173          $this->teamsubmissionenabled = $teamsubmissionenabled;
 174          $this->teamsubmission = $teamsubmission;
 175          $this->submissiongroup = $submissiongroup;
 176          $this->submissiongroupmemberswhoneedtosubmit = $submissiongroupmemberswhoneedtosubmit;
 177          $this->submissionsenabled = $submissionsenabled;
 178          $this->locked = $locked;
 179          $this->graded = $graded;
 180          $this->duedate = $duedate;
 181          $this->cutoffdate = $cutoffdate;
 182          $this->submissionplugins = $submissionplugins;
 183          $this->returnaction = $returnaction;
 184          $this->returnparams = $returnparams;
 185          $this->coursemoduleid = $coursemoduleid;
 186          $this->courseid = $courseid;
 187          $this->view = $view;
 188          $this->canedit = $canedit;
 189          $this->cansubmit = $cansubmit;
 190          $this->canviewfullnames = $canviewfullnames;
 191          $this->extensionduedate = $extensionduedate;
 192          $this->context = $context;
 193          $this->blindmarking = $blindmarking;
 194          $this->gradingcontrollerpreview = $gradingcontrollerpreview;
 195          $this->attemptreopenmethod = $attemptreopenmethod;
 196          $this->maxattempts = $maxattempts;
 197          $this->gradingstatus = $gradingstatus;
 198          $this->preventsubmissionnotingroup = $preventsubmissionnotingroup;
 199          $this->usergroups = $usergroups;
 200          $this->timelimit = $timelimit;
 201      }
 202  }