Extend the base external_api class with mod_assign utility methods.
More...
|
static | generate_warning (int $assignmentid, string $warningcode, string $detail) |
| Generate a warning in a standard structure for a known failure.
|
|
static | get_user_or_group_submission (\assign $assignment, int $userid=null, int $groupid=0, bool $create=false, int $attemptnumber=-1) |
| Get a submission from an assignment for a user.
|
|
static | validate_assign (int $assignid) |
| Utility function for validating an assign.
|
|
Extend the base external_api class with mod_assign utility methods.
- Author
- Andrew Madden andre.nosp@m.wmad.nosp@m.den@c.nosp@m.atal.nosp@m.yst-a.nosp@m.u.ne.nosp@m.t
- Copyright
- 2021 Catalyst IT
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ generate_warning()
static mod_assign\external\external_api::generate_warning |
( |
int | $assignmentid, |
|
|
string | $warningcode, |
|
|
string | $detail ) |
|
staticprotected |
Generate a warning in a standard structure for a known failure.
- Parameters
-
int | $assignmentid | - The assignment |
string | $warningcode | - The key for the warning message |
string | $detail | - A description of the error |
- Return values
-
array | - Warning structure containing item, itemid, warningcode, message |
◆ get_user_or_group_submission()
static mod_assign\external\external_api::get_user_or_group_submission |
( |
\assign | $assignment, |
|
|
int | $userid = null, |
|
|
int | $groupid = 0, |
|
|
bool | $create = false, |
|
|
int | $attemptnumber = -1 ) |
|
staticprotected |
Get a submission from an assignment for a user.
Encapsulates checking whether it's a solo or team submission.
- Parameters
-
assign | $assignment | Assignment object. |
int | null | $userid | User id. |
int | $groupid | Group id. |
bool | $create | Whether a new submission should be created. |
int | $attemptnumber | Attempt number. Use -1 for last attempt. |
- Return values
-
◆ validate_assign()
static mod_assign\external\external_api::validate_assign |
( |
int | $assignid | ) |
|
|
staticprotected |
Utility function for validating an assign.
- Parameters
-
int | $assignid | assign instance id |
- Return values
-
array | array containing the assign, course, context and course module objects |
- Since
- Moodle 3.2
The documentation for this class was generated from the following file: