Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
mod_assign\external\external_api Class Reference
Inheritance diagram for mod_assign\external\external_api:
mod_assign\external\start_submission

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.
 

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: