Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Static Public Member Functions | Static Protected Member Functions | List of all members
mod_assign_external Class Reference

Assign functions. More...

Inheritance diagram for mod_assign_external:
external_api

Static Public Member Functions

static call_external_function ($function, $args, $ajaxonly=false)
 Call an external function validating all params/returns correctly. More...
 
static clean_returnvalue (external_description $description, $response)
 Clean response If a response attribute is unknown from the description, we just ignore the attribute. More...
 
static copy_previous_attempt ($assignmentid)
 Copy a students previous attempt to a new attempt. More...
 
static copy_previous_attempt_parameters ()
 Describes the parameters for copy_previous_attempt. More...
 
static copy_previous_attempt_returns ()
 Describes the return value for save_submission. More...
 
static external_function_info ($function, $strictness=MUST_EXIST)
 Returns detailed function information. More...
 
static get_assignments ($courseids=array(), $capabilities=array(), $includenotenrolledcourses=false)
 Returns an array of courses the user is enrolled, and for each course all of the assignments that the user can view within that course. More...
 
static get_assignments_parameters ()
 Returns description of method parameters. More...
 
static get_assignments_returns ()
 Describes the return value for get_assignments. More...
 
static get_grades ($assignmentids, $since=0)
 Returns grade information from assign_grades for the requested assignment ids. More...
 
static get_grades_parameters ()
 Describes the parameters for get_grades. More...
 
static get_grades_returns ()
 Describes the get_grades return value. More...
 
static get_participant ($assignid, $userid, $embeduser)
 Get the user participating in the given assignment. More...
 
static get_participant_parameters ()
 Returns description of method parameters. More...
 
static get_participant_returns ()
 Returns description of method result value. More...
 
static get_submission_status ($assignid, $userid=0, $groupid=0)
 Returns information about an assignment submission status for a given user. More...
 
static get_submission_status_parameters ()
 Describes the parameters for get_submission_status. More...
 
static get_submission_status_returns ()
 Describes the get_submission_status return value. More...
 
static get_submissions ($assignmentids, $status='', $since=0, $before=0)
 Returns submissions for the requested assignment ids. More...
 
static get_submissions_parameters ()
 Describes the parameters for get_submissions. More...
 
static get_submissions_returns ()
 Describes the get_submissions return value. More...
 
static get_user_flags ($assignmentids)
 Returns user flag information from assign_user_flags for the requested assignment ids. More...
 
static get_user_flags_parameters ()
 Describes the parameters for get_user_flags. More...
 
static get_user_flags_returns ()
 Describes the get_user_flags return value. More...
 
static get_user_mappings ($assignmentids)
 Returns user mapping information from assign_user_mapping for the requested assignment ids. More...
 
static get_user_mappings_parameters ()
 Describes the parameters for get_user_mappings. More...
 
static get_user_mappings_returns ()
 Describes the get_user_mappings return value. More...
 
static list_participants ($assignid, $groupid, $filter, $skip, $limit, $onlyids, $includeenrolments, $tablesort)
 Retrieves the list of students to be graded for the assignment. More...
 
static list_participants_parameters ()
 Returns description of method parameters. More...
 
static list_participants_returns ()
 Returns the description of the results of the mod_assign_external::list_participants() method. More...
 
static lock_submissions ($assignmentid, $userids)
 Locks (prevent updates to) submissions in this assignment. More...
 
static lock_submissions_parameters ()
 Describes the parameters for lock_submissions. More...
 
static lock_submissions_returns ()
 Describes the return value for lock_submissions. More...
 
static reveal_identities ($assignmentid)
 Reveal the identities of anonymous students to markers for a single assignment. More...
 
static reveal_identities_parameters ()
 Describes the parameters for reveal_identities. More...
 
static reveal_identities_returns ()
 Describes the return value for reveal_identities. More...
 
static revert_submissions_to_draft ($assignmentid, $userids)
 Reverts a list of user submissions to draft for a single assignment. More...
 
static revert_submissions_to_draft_parameters ()
 Describes the parameters for revert_submissions_to_draft. More...
 
static revert_submissions_to_draft_returns ()
 Describes the return value for revert_submissions_to_draft. More...
 
static save_grade ($assignmentid, $userid, $grade, $attemptnumber, $addattempt, $workflowstate, $applytoall, $plugindata=array(), $advancedgradingdata=array())
 Save a student grade for a single assignment. More...
 
static save_grade_parameters ()
 Describes the parameters for save_grade. More...
 
static save_grade_returns ()
 Describes the return value for save_grade. More...
 
static save_grades ($assignmentid, $applytoall=false, $grades)
 Save multiple student grades for a single assignment. More...
 
static save_grades_parameters ()
 Describes the parameters for save_grades. More...
 
static save_grades_returns ()
 Describes the return value for save_grades. More...
 
static save_submission ($assignmentid, $plugindata)
 Save a student submission for a single assignment. More...
 
static save_submission_parameters ()
 Describes the parameters for save_submission. More...
 
static save_submission_returns ()
 Describes the return value for save_submission. More...
 
static save_user_extensions ($assignmentid, $userids, $dates)
 Grant extension dates to students for an assignment. More...
 
static save_user_extensions_parameters ()
 Describes the parameters for save_user_extensions. More...
 
static save_user_extensions_returns ()
 Describes the return value for save_user_extensions. More...
 
static set_context_restriction ($context)
 Set context restriction for all following subsequent function calls. More...
 
static set_timeout ($seconds=360)
 This method has to be called before every operation that takes a longer time to finish! More...
 
static set_user_flags ($assignmentid, $userflags=array())
 Create or update user_flags records. More...
 
static set_user_flags_parameters ()
 Describes the parameters for set_user_flags. More...
 
static set_user_flags_returns ()
 Describes the set_user_flags return value. More...
 
static submit_for_grading ($assignmentid, $acceptsubmissionstatement)
 Submit the logged in users assignment for grading. More...
 
static submit_for_grading_parameters ()
 Describes the parameters for submit_for_grading. More...
 
static submit_for_grading_returns ()
 Describes the return value for submit_for_grading. More...
 
static submit_grading_form ($assignmentid, $userid, $jsonformdata)
 Submit the logged in users assignment for grading. More...
 
static submit_grading_form_parameters ()
 Describes the parameters for submit_grading_form webservice. More...
 
static submit_grading_form_returns ()
 Describes the return for submit_grading_form. More...
 
static unlock_submissions ($assignmentid, $userids)
 Locks (prevent updates to) submissions in this assignment. More...
 
static unlock_submissions_parameters ()
 Describes the parameters for unlock_submissions. More...
 
static unlock_submissions_returns ()
 Describes the return value for unlock_submissions. More...
 
static validate_context ($context)
 Makes sure user may execute functions in this context. More...
 
static validate_parameters (external_description $description, $params)
 Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown. More...
 
static view_assign ($assignid)
 Update the module completion status. More...
 
static view_assign_parameters ()
 Describes the parameters for view_assign. More...
 
static view_assign_returns ()
 Describes the view_assign return value. More...
 
static view_grading_table ($assignid)
 Trigger the grading_table_viewed event. More...
 
static view_grading_table_parameters ()
 Returns description of method parameters. More...
 
static view_grading_table_returns ()
 Returns description of method result value. More...
 
static view_submission_status ($assignid)
 Trigger the submission status viewed event. More...
 
static view_submission_status_parameters ()
 Describes the parameters for view_submission_status. More...
 
static view_submission_status_returns ()
 Describes the view_submission_status return value. More...
 

Static Protected Member Functions

static get_context_from_params ($param)
 Get context from passed parameters. More...
 
static get_context_parameters ()
 Returns a prepared structure to use a context parameters. More...
 
static validate_assign ($assignid)
 Utility function for validating an assign. More...
 

Detailed Description

Assign functions.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ call_external_function()

static external_api::call_external_function (   $function,
  $args,
  $ajaxonly = false 
)
staticinherited

Call an external function validating all params/returns correctly.

Note that an external function may modify the state of the current page, so this wrapper saves and restores tha PAGE and COURSE global variables before/after calling the external function.

Parameters
string$functionA webservice function name.
array$argsParams array (named params)
boolean$ajaxonlyIf true, an extra check will be peformed to see if ajax is required.
Return values
arraycontaining keys for error (bool), exception and data.

◆ clean_returnvalue()

static external_api::clean_returnvalue ( external_description  $description,
  $response 
)
staticinherited

Clean response If a response attribute is unknown from the description, we just ignore the attribute.

If a response attribute is incorrect, invalid_response_exception is thrown. Note: this function is similar to validate parameters, however it is distinct because parameters validation must be distinct from cleaning return values.

Parameters
external_description$descriptiondescription of the return values
mixed$responsethe actual response
Return values
mixedresponse with added defaults for optional items, invalid_response_exception thrown if any problem found
Author
2010 Jerome Mouneyrac
Since
Moodle 2.0

◆ copy_previous_attempt()

static mod_assign_external::copy_previous_attempt (   $assignmentid)
static

Copy a students previous attempt to a new attempt.

Parameters
int$assignmentid
Return values
arrayof warnings to indicate any errors.
Since
Moodle 2.6

◆ copy_previous_attempt_parameters()

static mod_assign_external::copy_previous_attempt_parameters ( )
static

Describes the parameters for copy_previous_attempt.

Return values
external_function_parameters
Since
Moodle 2.6

◆ copy_previous_attempt_returns()

static mod_assign_external::copy_previous_attempt_returns ( )
static

Describes the return value for save_submission.

Return values
external_single_structure
Since
Moodle 2.6

◆ external_function_info()

static external_api::external_function_info (   $function,
  $strictness = MUST_EXIST 
)
staticinherited

Returns detailed function information.

Parameters
string | object$functionname of external function or record from external_function
int$strictnessIGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; MUST_EXIST means throw exception if no record or multiple records found
Return values
stdClassdescription or false if not found or exception thrown
Since
Moodle 2.0

◆ get_assignments()

static mod_assign_external::get_assignments (   $courseids = array(),
  $capabilities = array(),
  $includenotenrolledcourses = false 
)
static

Returns an array of courses the user is enrolled, and for each course all of the assignments that the user can view within that course.

Parameters
array$courseidsAn optional array of course ids. If provided only assignments within the given course will be returned. If the user is not enrolled in or can't view a given course a warning will be generated and returned.
array$capabilitiesAn array of additional capability checks you wish to be made on the course context.
bool$includenotenrolledcoursesWheter to return courses that the user can see even if is not enroled in. This requires the parameter $courseids to not be empty.
Return values
Anarray of courses and warnings.
Since
Moodle 2.4

◆ get_assignments_parameters()

static mod_assign_external::get_assignments_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.4

◆ get_assignments_returns()

static mod_assign_external::get_assignments_returns ( )
static

Describes the return value for get_assignments.

Return values
external_single_structure
Since
Moodle 2.4

◆ get_context_from_params()

static external_api::get_context_from_params (   $param)
staticprotectedinherited

Get context from passed parameters.

The passed array must either contain a contextid or a combination of context level and instance id to fetch the context. For example, the context level can be "course" and instanceid can be courseid.

See context_helper::get_all_levels() for a list of valid context levels.

Parameters
array$param
Since
Moodle 2.6
Exceptions
invalid_parameter_exception
Return values
context

◆ get_context_parameters()

static external_api::get_context_parameters ( )
staticprotectedinherited

Returns a prepared structure to use a context parameters.

Return values
external_single_structure

Reimplemented in tool_lp\external, and core_competency\external.

◆ get_grades()

static mod_assign_external::get_grades (   $assignmentids,
  $since = 0 
)
static

Returns grade information from assign_grades for the requested assignment ids.

Parameters
int[]$assignmentids
int$sinceonly return records with timemodified >= since
Return values
arrayof grade records for each requested assignment
Since
Moodle 2.4

◆ get_grades_parameters()

static mod_assign_external::get_grades_parameters ( )
static

Describes the parameters for get_grades.

Return values
external_function_parameters
Since
Moodle 2.4

◆ get_grades_returns()

static mod_assign_external::get_grades_returns ( )
static

Describes the get_grades return value.

Return values
external_single_structure
Since
Moodle 2.4

◆ get_participant()

static mod_assign_external::get_participant (   $assignid,
  $userid,
  $embeduser 
)
static

Get the user participating in the given assignment.

An error with code 'usernotincourse' is thrown is the user isn't a participant of the given assignment.

Parameters
int$assignidthe assign instance id
int$useridthe user id
bool$embeduserreturn user details (only applicable if not blind marking)
Return values
arrayof warnings and status result
Since
Moodle 3.1
Exceptions
moodle_exception

◆ get_participant_parameters()

static mod_assign_external::get_participant_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.1

◆ get_participant_returns()

static mod_assign_external::get_participant_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.1

◆ get_submission_status()

static mod_assign_external::get_submission_status (   $assignid,
  $userid = 0,
  $groupid = 0 
)
static

Returns information about an assignment submission status for a given user.

Parameters
int$assignidassignment instance id
int$useriduser id (empty for current user)
int$groupidfilter by users in group id (used for generating the grading summary). Use 0 for all groups information.
Return values
arrayof warnings and grading, status, feedback and previous attempts information
Since
Moodle 3.1
Exceptions
required_capability_exception

◆ get_submission_status_parameters()

static mod_assign_external::get_submission_status_parameters ( )
static

Describes the parameters for get_submission_status.

Return values
external_function_parameters
Since
Moodle 3.1

◆ get_submission_status_returns()

static mod_assign_external::get_submission_status_returns ( )
static

Describes the get_submission_status return value.

Return values
external_single_structure
Since
Moodle 3.1

◆ get_submissions()

static mod_assign_external::get_submissions (   $assignmentids,
  $status = '',
  $since = 0,
  $before = 0 
)
static

Returns submissions for the requested assignment ids.

Parameters
int[]$assignmentids
string$statusonly return submissions with this status
int$sinceonly return submissions with timemodified >= since
int$beforeonly return submissions with timemodified <= before
Return values
arrayof submissions for each requested assignment
Since
Moodle 2.5

◆ get_submissions_parameters()

static mod_assign_external::get_submissions_parameters ( )
static

Describes the parameters for get_submissions.

Return values
external_function_parameters
Since
Moodle 2.5

◆ get_submissions_returns()

static mod_assign_external::get_submissions_returns ( )
static

Describes the get_submissions return value.

Return values
external_single_structure
Since
Moodle 2.5

◆ get_user_flags()

static mod_assign_external::get_user_flags (   $assignmentids)
static

Returns user flag information from assign_user_flags for the requested assignment ids.

Parameters
int[]$assignmentids
Return values
arrayof user flag records for each requested assignment
Since
Moodle 2.6

◆ get_user_flags_parameters()

static mod_assign_external::get_user_flags_parameters ( )
static

Describes the parameters for get_user_flags.

Return values
external_function_parameters
Since
Moodle 2.6

◆ get_user_flags_returns()

static mod_assign_external::get_user_flags_returns ( )
static

Describes the get_user_flags return value.

Return values
external_single_structure
Since
Moodle 2.6

◆ get_user_mappings()

static mod_assign_external::get_user_mappings (   $assignmentids)
static

Returns user mapping information from assign_user_mapping for the requested assignment ids.

Parameters
int[]$assignmentids
Return values
arrayof user mapping records for each requested assignment
Since
Moodle 2.6

◆ get_user_mappings_parameters()

static mod_assign_external::get_user_mappings_parameters ( )
static

Describes the parameters for get_user_mappings.

Return values
external_function_parameters
Since
Moodle 2.6

◆ get_user_mappings_returns()

static mod_assign_external::get_user_mappings_returns ( )
static

Describes the get_user_mappings return value.

Return values
external_single_structure
Since
Moodle 2.6

◆ list_participants()

static mod_assign_external::list_participants (   $assignid,
  $groupid,
  $filter,
  $skip,
  $limit,
  $onlyids,
  $includeenrolments,
  $tablesort 
)
static

Retrieves the list of students to be graded for the assignment.

Parameters
int$assignidthe assign instance id
int$groupidthe current group id
string$filtersearch string to filter the results.
int$skipNumber of records to skip
int$limitMaximum number of records to return
bool$onlyidsOnly return user ids.
bool$includeenrolmentsReturn courses where the user is enrolled.
bool$tablesortApply current user table sorting params from the grading table.
Return values
arrayof warnings and status result
Since
Moodle 3.1
Exceptions
moodle_exception

◆ list_participants_parameters()

static mod_assign_external::list_participants_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.1

◆ list_participants_returns()

static mod_assign_external::list_participants_returns ( )
static

Returns the description of the results of the mod_assign_external::list_participants() method.

Return values
external_description
Since
Moodle 3.1

◆ lock_submissions()

static mod_assign_external::lock_submissions (   $assignmentid,
  $userids 
)
static

Locks (prevent updates to) submissions in this assignment.

Parameters
int$assignmentidThe id of the assignment
array$useridsArray of user ids to lock
Return values
arrayof warnings for each submission that could not be locked.
Since
Moodle 2.6

◆ lock_submissions_parameters()

static mod_assign_external::lock_submissions_parameters ( )
static

Describes the parameters for lock_submissions.

Return values
external_function_parameters
Since
Moodle 2.6

◆ lock_submissions_returns()

static mod_assign_external::lock_submissions_returns ( )
static

Describes the return value for lock_submissions.

Return values
external_single_structure
Since
Moodle 2.6

◆ reveal_identities()

static mod_assign_external::reveal_identities (   $assignmentid)
static

Reveal the identities of anonymous students to markers for a single assignment.

Parameters
int$assignmentidThe id of the assignment
Return values
arrayof warnings to indicate any errors.
Since
Moodle 2.6

◆ reveal_identities_parameters()

static mod_assign_external::reveal_identities_parameters ( )
static

Describes the parameters for reveal_identities.

Return values
external_function_parameters
Since
Moodle 2.6

◆ reveal_identities_returns()

static mod_assign_external::reveal_identities_returns ( )
static

Describes the return value for reveal_identities.

Return values
external_single_structure
Since
Moodle 2.6

◆ revert_submissions_to_draft()

static mod_assign_external::revert_submissions_to_draft (   $assignmentid,
  $userids 
)
static

Reverts a list of user submissions to draft for a single assignment.

Parameters
int$assignmentidThe id of the assignment
array$useridsArray of user ids to revert
Return values
arrayof warnings for each submission that could not be reverted.
Since
Moodle 2.6

◆ revert_submissions_to_draft_parameters()

static mod_assign_external::revert_submissions_to_draft_parameters ( )
static

Describes the parameters for revert_submissions_to_draft.

Return values
external_function_parameters
Since
Moodle 2.6

◆ revert_submissions_to_draft_returns()

static mod_assign_external::revert_submissions_to_draft_returns ( )
static

Describes the return value for revert_submissions_to_draft.

Return values
external_single_structure
Since
Moodle 2.6

◆ save_grade()

static mod_assign_external::save_grade (   $assignmentid,
  $userid,
  $grade,
  $attemptnumber,
  $addattempt,
  $workflowstate,
  $applytoall,
  $plugindata = array(),
  $advancedgradingdata = array() 
)
static

Save a student grade for a single assignment.

Parameters
int$assignmentidThe id of the assignment
int$useridThe id of the user
float$gradeThe grade (ignored if the assignment uses advanced grading)
int$attemptnumberThe attempt number
bool$addattemptAllow another attempt
string$workflowstateNew workflow state
bool$applytoallApply the grade to all members of the group
array$plugindataCustom data used by plugins
array$advancedgradingdataAdvanced grading data
Return values
null
Since
Moodle 2.6

◆ save_grade_parameters()

static mod_assign_external::save_grade_parameters ( )
static

Describes the parameters for save_grade.

Return values
external_function_parameters
Since
Moodle 2.6

◆ save_grade_returns()

static mod_assign_external::save_grade_returns ( )
static

Describes the return value for save_grade.

Return values
external_single_structure
Since
Moodle 2.6

◆ save_grades()

static mod_assign_external::save_grades (   $assignmentid,
  $applytoall = false,
  $grades 
)
static

Save multiple student grades for a single assignment.

Parameters
int$assignmentidThe id of the assignment
boolean$applytoallIf set to true and this is a team assignment, apply the grade to all members of the group
array$gradesgrade data for one or more students that includes userid - The id of the student being graded grade - The grade (ignored if the assignment uses advanced grading) attemptnumber - The attempt number addattempt - Allow another attempt workflowstate - New workflow state plugindata - Custom data used by plugins advancedgradingdata - Optional Advanced grading data
Exceptions
invalid_parameter_exceptionif multiple grades are supplied for a team assignment that has $applytoall set to true
Return values
null
Since
Moodle 2.7

◆ save_grades_parameters()

static mod_assign_external::save_grades_parameters ( )
static

Describes the parameters for save_grades.

Return values
external_function_parameters
Since
Moodle 2.7

◆ save_grades_returns()

static mod_assign_external::save_grades_returns ( )
static

Describes the return value for save_grades.

Return values
external_single_structure
Since
Moodle 2.7

◆ save_submission()

static mod_assign_external::save_submission (   $assignmentid,
  $plugindata 
)
static

Save a student submission for a single assignment.

Parameters
int$assignmentidThe id of the assignment
array$plugindata- The submitted data for plugins
Return values
arrayof warnings to indicate any errors
Since
Moodle 2.6

◆ save_submission_parameters()

static mod_assign_external::save_submission_parameters ( )
static

Describes the parameters for save_submission.

Return values
external_function_parameters
Since
Moodle 2.6

◆ save_submission_returns()

static mod_assign_external::save_submission_returns ( )
static

Describes the return value for save_submission.

Return values
external_single_structure
Since
Moodle 2.6

◆ save_user_extensions()

static mod_assign_external::save_user_extensions (   $assignmentid,
  $userids,
  $dates 
)
static

Grant extension dates to students for an assignment.

Parameters
int$assignmentidThe id of the assignment
array$useridsArray of user ids to grant extensions to
array$datesArray of extension dates
Return values
arrayof warnings for each extension date that could not be granted
Since
Moodle 2.6

◆ save_user_extensions_parameters()

static mod_assign_external::save_user_extensions_parameters ( )
static

Describes the parameters for save_user_extensions.

Return values
external_function_parameters
Since
Moodle 2.6

◆ save_user_extensions_returns()

static mod_assign_external::save_user_extensions_returns ( )
static

Describes the return value for save_user_extensions.

Return values
external_single_structure
Since
Moodle 2.6

◆ set_context_restriction()

static external_api::set_context_restriction (   $context)
staticinherited

Set context restriction for all following subsequent function calls.

Parameters
stdClass$contextthe context restriction
Since
Moodle 2.0

◆ set_timeout()

static external_api::set_timeout (   $seconds = 360)
staticinherited

This method has to be called before every operation that takes a longer time to finish!

Parameters
int$secondsmax expected time the next operation needs
Since
Moodle 2.0

◆ set_user_flags()

static mod_assign_external::set_user_flags (   $assignmentid,
  $userflags = array() 
)
static

Create or update user_flags records.

Parameters
int$assignmentidthe assignment for which the userflags are created or updated
array$userflagsAn array of userflags to create or update
Return values
arraycontaining success or failure information for each record
Since
Moodle 2.6

◆ set_user_flags_parameters()

static mod_assign_external::set_user_flags_parameters ( )
static

Describes the parameters for set_user_flags.

Return values
external_function_parameters
Since
Moodle 2.6

◆ set_user_flags_returns()

static mod_assign_external::set_user_flags_returns ( )
static

Describes the set_user_flags return value.

Return values
external_multiple_structure
Since
Moodle 2.6

◆ submit_for_grading()

static mod_assign_external::submit_for_grading (   $assignmentid,
  $acceptsubmissionstatement 
)
static

Submit the logged in users assignment for grading.

Parameters
int$assignmentidThe id of the assignment
Return values
arrayof warnings to indicate any errors.
Since
Moodle 2.6

◆ submit_for_grading_parameters()

static mod_assign_external::submit_for_grading_parameters ( )
static

Describes the parameters for submit_for_grading.

Return values
external_function_parameters
Since
Moodle 2.6

◆ submit_for_grading_returns()

static mod_assign_external::submit_for_grading_returns ( )
static

Describes the return value for submit_for_grading.

Return values
external_single_structure
Since
Moodle 2.6

◆ submit_grading_form()

static mod_assign_external::submit_grading_form (   $assignmentid,
  $userid,
  $jsonformdata 
)
static

Submit the logged in users assignment for grading.

Parameters
int$assignmentidThe id of the assignment
int$useridThe id of the user the submission belongs to.
string$jsonformdataThe data from the form, encoded as a json array.
Return values
arrayof warnings to indicate any errors.
Since
Moodle 3.1

◆ submit_grading_form_parameters()

static mod_assign_external::submit_grading_form_parameters ( )
static

Describes the parameters for submit_grading_form webservice.

Return values
external_function_parameters
Since
Moodle 3.1

◆ submit_grading_form_returns()

static mod_assign_external::submit_grading_form_returns ( )
static

Describes the return for submit_grading_form.

Return values
external_function_parameters
Since
Moodle 3.1

◆ unlock_submissions()

static mod_assign_external::unlock_submissions (   $assignmentid,
  $userids 
)
static

Locks (prevent updates to) submissions in this assignment.

Parameters
int$assignmentidThe id of the assignment
array$useridsArray of user ids to lock
Return values
arrayof warnings for each submission that could not be locked.
Since
Moodle 2.6

◆ unlock_submissions_parameters()

static mod_assign_external::unlock_submissions_parameters ( )
static

Describes the parameters for unlock_submissions.

Return values
external_function_parameters
Since
Moodle 2.6

◆ unlock_submissions_returns()

static mod_assign_external::unlock_submissions_returns ( )
static

Describes the return value for unlock_submissions.

Return values
external_single_structure
Since
Moodle 2.6

◆ validate_assign()

static mod_assign_external::validate_assign (   $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

◆ validate_context()

static external_api::validate_context (   $context)
staticinherited

Makes sure user may execute functions in this context.

Parameters
stdClass$context
Since
Moodle 2.0

◆ validate_parameters()

static external_api::validate_parameters ( external_description  $description,
  $params 
)
staticinherited

Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown.

This is a simple recursive method which is intended to be called from each implementation method of external API.

Parameters
external_description$descriptiondescription of parameters
mixed$paramsthe actual parameters
Return values
mixedparams with added defaults for optional items, invalid_parameters_exception thrown if any problem found
Since
Moodle 2.0

◆ view_assign()

static mod_assign_external::view_assign (   $assignid)
static

Update the module completion status.

Parameters
int$assignidassign instance id
Return values
arrayof warnings and status result
Since
Moodle 3.2

◆ view_assign_parameters()

static mod_assign_external::view_assign_parameters ( )
static

Describes the parameters for view_assign.

Return values
external_function_parameters
Since
Moodle 3.2

◆ view_assign_returns()

static mod_assign_external::view_assign_returns ( )
static

Describes the view_assign return value.

Return values
external_single_structure
Since
Moodle 3.2

◆ view_grading_table()

static mod_assign_external::view_grading_table (   $assignid)
static

Trigger the grading_table_viewed event.

Parameters
int$assignidthe assign instance id
Return values
arrayof warnings and status result
Since
Moodle 3.0
Exceptions
moodle_exception

◆ view_grading_table_parameters()

static mod_assign_external::view_grading_table_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.0

◆ view_grading_table_returns()

static mod_assign_external::view_grading_table_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.0

◆ view_submission_status()

static mod_assign_external::view_submission_status (   $assignid)
static

Trigger the submission status viewed event.

Parameters
int$assignidassign instance id
Return values
arrayof warnings and status result
Since
Moodle 3.1

◆ view_submission_status_parameters()

static mod_assign_external::view_submission_status_parameters ( )
static

Describes the parameters for view_submission_status.

Return values
external_function_parameters
Since
Moodle 3.1

◆ view_submission_status_returns()

static mod_assign_external::view_submission_status_returns ( )
static

Describes the view_submission_status return value.

Return values
external_single_structure
Since
Moodle 3.1

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