Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
mod_assign\external\external_api Class Reference

Extend the base external_api class with mod_assign utility methods. More...

Inheritance diagram for mod_assign\external\external_api:

Static Protected Member Functions

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.
 

Detailed Description

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
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ 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$assignmentAssignment object.
int | null$useridUser id.
int$groupidGroup id.
bool$createWhether a new submission should be created.
int$attemptnumberAttempt number. Use -1 for last attempt.
Return values
bool|stdClass

◆ validate_assign()

static mod_assign\external\external_api::validate_assign ( int $assignid)
staticprotected

Utility function for validating an assign.

Parameters
int$assignidassign instance id
Return values
arrayarray containing the assign, course, context and course module objects
Since
Moodle 3.2

The documentation for this class was generated from the following file: