Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Static Public Member Functions | Static Protected Member Functions | List of all members
mod_workshop_external Class Reference
Inheritance diagram for mod_workshop_external:
external_api

Static Public Member Functions

static add_submission ($workshopid, $title, $content='', $contentformat=FORMAT_MOODLE, $inlineattachmentsid=0, $attachmentsid=0)
 Add a new submission to a given workshop. More...
 
static add_submission_parameters ()
 Returns the description of the external function parameters. More...
 
static add_submission_returns ()
 Returns the description of the external function return value. More...
 
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 delete_submission ($submissionid)
 Deletes the given submission. More...
 
static delete_submission_parameters ()
 Returns the description of the external function parameters. More...
 
static delete_submission_returns ()
 Returns the description of the external function return value. More...
 
static evaluate_assessment ($assessmentid, $feedbacktext='', $feedbackformat=FORMAT_MOODLE, $weight=1, $gradinggradeover='')
 Evaluates an assessment (used by teachers for provide feedback to the reviewer). More...
 
static evaluate_assessment_parameters ()
 Returns the description of the external function parameters. More...
 
static evaluate_assessment_returns ()
 Returns description of method result value. More...
 
static evaluate_submission ($submissionid, $feedbacktext='', $feedbackformat=FORMAT_MOODLE, $published=1, $gradeover='')
 Evaluates a submission (used by teachers for provide feedback or override the submission grade). More...
 
static evaluate_submission_parameters ()
 Returns the description of the external function parameters. More...
 
static evaluate_submission_returns ()
 Returns description of method result value. More...
 
static external_function_info ($function, $strictness=MUST_EXIST)
 Returns detailed function information. More...
 
static get_assessment ($assessmentid)
 Retrieves the given assessment. More...
 
static get_assessment_form_definition ($assessmentid, $mode='assessment')
 Retrieves the assessment form definition (data required to be able to display the assessment form). More...
 
static get_assessment_form_definition_parameters ()
 Returns the description of the external function parameters. More...
 
static get_assessment_form_definition_returns ()
 Returns description of method result value. More...
 
static get_assessment_parameters ()
 Returns the description of the external function parameters. More...
 
static get_assessment_returns ()
 Returns description of method result value. More...
 
static get_grades ($workshopid, $userid=0)
 Returns the grades information for the given workshop and user. More...
 
static get_grades_parameters ()
 Returns the description of the external function parameters. More...
 
static get_grades_report ($workshopid, $groupid=0, $sortby='lastname', $sortdirection='ASC', $page=0, $perpage=0)
 Retrieves the assessment grades report. More...
 
static get_grades_report_parameters ()
 Returns description of method parameters. More...
 
static get_grades_report_returns ()
 Returns description of method result value. More...
 
static get_grades_returns ()
 Returns description of method result value. More...
 
static get_reviewer_assessments ($workshopid, $userid=0)
 Retrieves all the assessments reviewed by the given user. More...
 
static get_reviewer_assessments_parameters ()
 Returns the description of the external function parameters. More...
 
static get_reviewer_assessments_returns ()
 Returns description of method result value. More...
 
static get_submission ($submissionid)
 Retrieves the given submission. More...
 
static get_submission_assessments ($submissionid)
 Retrieves the given submission assessments. More...
 
static get_submission_assessments_parameters ()
 Returns the description of the external function parameters. More...
 
static get_submission_assessments_returns ()
 Returns description of method result value. More...
 
static get_submission_parameters ()
 Returns the description of the external function parameters. More...
 
static get_submission_returns ()
 Returns description of method result value. More...
 
static get_submissions ($workshopid, $userid=0, $groupid=0, $page=0, $perpage=0)
 Retrieves all the workshop submissions visible by the current user or the one done by the given user (except example submissions). More...
 
static get_submissions_parameters ()
 Returns description of method parameters. More...
 
static get_submissions_returns ()
 Returns description of method result value. More...
 
static get_user_plan ($workshopid, $userid=0)
 Return the planner information for the given user. More...
 
static get_user_plan_parameters ()
 Describes the parameters for get_user_plan. More...
 
static get_user_plan_returns ()
 Describes the get_user_plan return value. More...
 
static get_workshop_access_information ($workshopid)
 Return access information for a given workshop. More...
 
static get_workshop_access_information_parameters ()
 Describes the parameters for get_workshop_access_information. More...
 
static get_workshop_access_information_returns ()
 Describes the get_workshop_access_information return value. More...
 
static get_workshops_by_courses ($courseids=array())
 Returns a list of workshops in a provided list of courses. More...
 
static get_workshops_by_courses_parameters ()
 Describes the parameters for get_workshops_by_courses. More...
 
static get_workshops_by_courses_returns ()
 Describes the get_workshops_by_courses return value. 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 update_assessment ($assessmentid, $data)
 Updates an assessment. More...
 
static update_assessment_parameters ()
 Returns the description of the external function parameters. More...
 
static update_assessment_returns ()
 Returns description of method result value. More...
 
static update_submission ($submissionid, $title, $content='', $contentformat=FORMAT_MOODLE, $inlineattachmentsid=0, $attachmentsid=0)
 Updates the given submission. More...
 
static update_submission_parameters ()
 Returns the description of the external function parameters. More...
 
static update_submission_returns ()
 Returns the description of the external function return value. 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_submission ($submissionid)
 Trigger the submission viewed event. More...
 
static view_submission_parameters ()
 Describes the parameters for view_submission. More...
 
static view_submission_returns ()
 Describes the view_submission return value. More...
 
static view_workshop ($workshopid)
 Trigger the course module viewed event and update the module completion status. More...
 
static view_workshop_parameters ()
 Describes the parameters for view_workshop. More...
 
static view_workshop_returns ()
 Describes the view_workshop return value. More...
 

Static Protected Member Functions

static check_view_submission_assessments ($submission, workshop $workshop)
 Helper method for validating if the current user can view the submission assessments. More...
 
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 prepare_assessment_for_external ($assessment, workshop $workshop)
 Helper method for returning the assessment data according the current user capabilities and current phase. More...
 
static prepare_submission_for_external ($submission, workshop $workshop, $canviewauthorpublished=null, $canviewauthornames=null, $canviewallsubmissions=null)
 Helper method for returning the submission data according the current user capabilities and current phase. More...
 
static validate_submission ($submission, workshop $workshop)
 Helper method for validating a submission. More...
 
static validate_workshop ($workshopid)
 Utility function for validating a workshop. More...
 

Member Function Documentation

◆ add_submission()

static mod_workshop_external::add_submission (   $workshopid,
  $title,
  $content = '',
  $contentformat = FORMAT_MOODLE,
  $inlineattachmentsid = 0,
  $attachmentsid = 0 
)
static

Add a new submission to a given workshop.

Parameters
int$workshopidthe workshop id
string$titlethe submission title
string$contentthe submission text content
int$contentformatthe format used for the content
int$inlineattachmentsidthe draft file area id for inline attachments in the content
int$attachmentsidthe draft file area id for attachments
Return values
arrayContaining the new created submission id and warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ add_submission_parameters()

static mod_workshop_external::add_submission_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ add_submission_returns()

static mod_workshop_external::add_submission_returns ( )
static

Returns the description of the external function return value.

Return values
external_description
Since
Moodle 3.4

◆ 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.

◆ check_view_submission_assessments()

static mod_workshop_external::check_view_submission_assessments (   $submission,
workshop  $workshop 
)
staticprotected

Helper method for validating if the current user can view the submission assessments.

Parameters
stdClass$submissionsubmission object
workshop$workshopworkshop instance
Return values
void
Since
Moodle 3.4

◆ 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

◆ delete_submission()

static mod_workshop_external::delete_submission (   $submissionid)
static

Deletes the given submission.

Parameters
int$submissionidthe submission id.
Return values
arraycontaining the result status and warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ delete_submission_parameters()

static mod_workshop_external::delete_submission_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ delete_submission_returns()

static mod_workshop_external::delete_submission_returns ( )
static

Returns the description of the external function return value.

Return values
external_description
Since
Moodle 3.4

◆ evaluate_assessment()

static mod_workshop_external::evaluate_assessment (   $assessmentid,
  $feedbacktext = '',
  $feedbackformat = FORMAT_MOODLE,
  $weight = 1,
  $gradinggradeover = '' 
)
static

Evaluates an assessment (used by teachers for provide feedback to the reviewer).

Parameters
int$assessmentidthe assessment id
str$feedbacktextthe feedback for the reviewer
int$feedbackformatthe feedback format for the reviewer text
int$weightthe new weight for the assessment
mixed$gradinggradeoverthe new grading grade (empty for no overriding the grade)
Return values
arraycontaining the status and warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ evaluate_assessment_parameters()

static mod_workshop_external::evaluate_assessment_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ evaluate_assessment_returns()

static mod_workshop_external::evaluate_assessment_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.4

◆ evaluate_submission()

static mod_workshop_external::evaluate_submission (   $submissionid,
  $feedbacktext = '',
  $feedbackformat = FORMAT_MOODLE,
  $published = 1,
  $gradeover = '' 
)
static

Evaluates a submission (used by teachers for provide feedback or override the submission grade).

Parameters
int$submissionidthe submission id
str$feedbacktextthe feedback for the author
int$feedbackformatthe feedback format for the reviewer text
bool$publishedwhether to publish the submission for other users
mixed$gradeoverthe new submission grade (empty for no overriding the grade)
Return values
arraycontaining the status and warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ evaluate_submission_parameters()

static mod_workshop_external::evaluate_submission_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ evaluate_submission_returns()

static mod_workshop_external::evaluate_submission_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.4

◆ 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_assessment()

static mod_workshop_external::get_assessment (   $assessmentid)
static

Retrieves the given assessment.

Parameters
int$assessmentidthe assessment id
Return values
arraycontaining the assessment and warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ get_assessment_form_definition()

static mod_workshop_external::get_assessment_form_definition (   $assessmentid,
  $mode = 'assessment' 
)
static

Retrieves the assessment form definition (data required to be able to display the assessment form).

Parameters
int$assessmentidthe assessment id
string$modethe form mode (assessment or preview)
Return values
arraycontaining the assessment and warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ get_assessment_form_definition_parameters()

static mod_workshop_external::get_assessment_form_definition_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ get_assessment_form_definition_returns()

static mod_workshop_external::get_assessment_form_definition_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.4

◆ get_assessment_parameters()

static mod_workshop_external::get_assessment_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ get_assessment_returns()

static mod_workshop_external::get_assessment_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.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_workshop_external::get_grades (   $workshopid,
  $userid = 0 
)
static

Returns the grades information for the given workshop and user.

Parameters
int$workshopidworkshop instance id
int$useriduser id
Return values
arrayof warnings and the user plan
Since
Moodle 3.4
Exceptions
moodle_exception

◆ get_grades_parameters()

static mod_workshop_external::get_grades_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_external_function_parameters
Since
Moodle 3.4

◆ get_grades_report()

static mod_workshop_external::get_grades_report (   $workshopid,
  $groupid = 0,
  $sortby = 'lastname',
  $sortdirection = 'ASC',
  $page = 0,
  $perpage = 0 
)
static

Retrieves the assessment grades report.

Parameters
int$workshopidthe workshop instance id
int$groupid(optional) group id, 0 means that the function will determine the user group
string$sortbysort by this element
string$sortdirectionsort direction: ASC or DESC
int$pagepage of records to return
int$perpagenumber of records to return per page
Return values
arrayof warnings and the report data
Since
Moodle 3.4
Exceptions
moodle_exception

◆ get_grades_report_parameters()

static mod_workshop_external::get_grades_report_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ get_grades_report_returns()

static mod_workshop_external::get_grades_report_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.4

◆ get_grades_returns()

static mod_workshop_external::get_grades_returns ( )
static

Returns description of method result value.

Return values
external_single_structure
Since
Moodle 3.4

◆ get_reviewer_assessments()

static mod_workshop_external::get_reviewer_assessments (   $workshopid,
  $userid = 0 
)
static

Retrieves all the assessments reviewed by the given user.

Parameters
int$workshopidthe workshop instance id
int$useridthe reviewer user id
Return values
arraycontaining the user assessments and warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ get_reviewer_assessments_parameters()

static mod_workshop_external::get_reviewer_assessments_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ get_reviewer_assessments_returns()

static mod_workshop_external::get_reviewer_assessments_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.4

◆ get_submission()

static mod_workshop_external::get_submission (   $submissionid)
static

Retrieves the given submission.

Parameters
int$submissionidthe submission id
Return values
arraycontaining the submission and warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ get_submission_assessments()

static mod_workshop_external::get_submission_assessments (   $submissionid)
static

Retrieves the given submission assessments.

Parameters
int$submissionidthe submission id
Return values
arraycontaining the assessments and warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ get_submission_assessments_parameters()

static mod_workshop_external::get_submission_assessments_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ get_submission_assessments_returns()

static mod_workshop_external::get_submission_assessments_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.4

◆ get_submission_parameters()

static mod_workshop_external::get_submission_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ get_submission_returns()

static mod_workshop_external::get_submission_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.4

◆ get_submissions()

static mod_workshop_external::get_submissions (   $workshopid,
  $userid = 0,
  $groupid = 0,
  $page = 0,
  $perpage = 0 
)
static

Retrieves all the workshop submissions visible by the current user or the one done by the given user (except example submissions).

Parameters
int$workshopidthe workshop instance id
int$useridget submissions done by this user
int$groupid(optional) group id, 0 means that the function will determine the user group
int$pagepage of records to return
int$perpagenumber of records to return per page
Return values
arrayof warnings and the entries
Since
Moodle 3.4
Exceptions
moodle_exception

◆ get_submissions_parameters()

static mod_workshop_external::get_submissions_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ get_submissions_returns()

static mod_workshop_external::get_submissions_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.4

◆ get_user_plan()

static mod_workshop_external::get_user_plan (   $workshopid,
  $userid = 0 
)
static

Return the planner information for the given user.

Parameters
int$workshopidworkshop instance id
int$useriduser id
Return values
arrayof warnings and the user plan
Since
Moodle 3.4
Exceptions
moodle_exception

◆ get_user_plan_parameters()

static mod_workshop_external::get_user_plan_parameters ( )
static

Describes the parameters for get_user_plan.

Return values
external_external_function_parameters
Since
Moodle 3.4

◆ get_user_plan_returns()

static mod_workshop_external::get_user_plan_returns ( )
static

Describes the get_user_plan return value.

Return values
external_single_structure
Since
Moodle 3.4

◆ get_workshop_access_information()

static mod_workshop_external::get_workshop_access_information (   $workshopid)
static

Return access information for a given workshop.

Parameters
int$workshopidworkshop instance id
Return values
arrayof warnings and the access information
Since
Moodle 3.4
Exceptions
moodle_exception

◆ get_workshop_access_information_parameters()

static mod_workshop_external::get_workshop_access_information_parameters ( )
static

Describes the parameters for get_workshop_access_information.

Return values
external_external_function_parameters
Since
Moodle 3.4

◆ get_workshop_access_information_returns()

static mod_workshop_external::get_workshop_access_information_returns ( )
static

Describes the get_workshop_access_information return value.

Return values
external_single_structure
Since
Moodle 3.4

◆ get_workshops_by_courses()

static mod_workshop_external::get_workshops_by_courses (   $courseids = array())
static

Returns a list of workshops in a provided list of courses.

If no list is provided all workshops that the user can view will be returned.

Parameters
array$courseidscourse ids
Return values
arrayof warnings and workshops
Since
Moodle 3.4

◆ get_workshops_by_courses_parameters()

static mod_workshop_external::get_workshops_by_courses_parameters ( )
static

Describes the parameters for get_workshops_by_courses.

Return values
external_function_parameters
Since
Moodle 3.4

◆ get_workshops_by_courses_returns()

static mod_workshop_external::get_workshops_by_courses_returns ( )
static

Describes the get_workshops_by_courses return value.

Return values
external_single_structure
Since
Moodle 3.4

◆ prepare_assessment_for_external()

static mod_workshop_external::prepare_assessment_for_external (   $assessment,
workshop  $workshop 
)
staticprotected

Helper method for returning the assessment data according the current user capabilities and current phase.

Parameters
stdClass$assessmentthe assessment data
workshop$workshopthe workshop class
Return values
stdClassobject with the assessment data filtered or null if is not viewable yet
Since
Moodle 3.4

◆ prepare_submission_for_external()

static mod_workshop_external::prepare_submission_for_external (   $submission,
workshop  $workshop,
  $canviewauthorpublished = null,
  $canviewauthornames = null,
  $canviewallsubmissions = null 
)
staticprotected

Helper method for returning the submission data according the current user capabilities and current phase.

Parameters
stdClass$submissionthe submission data
workshop$workshopthe workshop class
bool$canviewauthorpublishedwhether the user has the capability mod/workshop:viewauthorpublished on
bool$canviewauthornameswhether the user has the capability mod/workshop:vviewauthornames on
bool$canviewallsubmissionswhether the user has the capability mod/workshop:viewallsubmissions on
Return values
stdClassobject with the submission data filtered
Since
Moodle 3.4

◆ 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

◆ update_assessment()

static mod_workshop_external::update_assessment (   $assessmentid,
  $data 
)
static

Updates an assessment.

Parameters
int$assessmentidthe assessment id
array$datathe assessment data
Return values
arrayindicates if the assessment was updated, the new raw grade and possible warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ update_assessment_parameters()

static mod_workshop_external::update_assessment_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ update_assessment_returns()

static mod_workshop_external::update_assessment_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.4

◆ update_submission()

static mod_workshop_external::update_submission (   $submissionid,
  $title,
  $content = '',
  $contentformat = FORMAT_MOODLE,
  $inlineattachmentsid = 0,
  $attachmentsid = 0 
)
static

Updates the given submission.

Parameters
int$submissionidthe submission id
string$titlethe submission title
string$contentthe submission text content
int$contentformatthe format used for the content
int$inlineattachmentsidthe draft file area id for inline attachments in the content
int$attachmentsidthe draft file area id for attachments
Return values
arraywhether the submission was updated and warnings.
Since
Moodle 3.4
Exceptions
moodle_exception

◆ update_submission_parameters()

static mod_workshop_external::update_submission_parameters ( )
static

Returns the description of the external function parameters.

Return values
external_function_parameters
Since
Moodle 3.4

◆ update_submission_returns()

static mod_workshop_external::update_submission_returns ( )
static

Returns the description of the external function return value.

Return values
external_description
Since
Moodle 3.4

◆ 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

◆ validate_submission()

static mod_workshop_external::validate_submission (   $submission,
workshop  $workshop 
)
staticprotected

Helper method for validating a submission.

Parameters
stdClass$submissionsubmission object
workshop$workshopworkshop instance
Return values
void
Since
Moodle 3.4

◆ validate_workshop()

static mod_workshop_external::validate_workshop (   $workshopid)
staticprotected

Utility function for validating a workshop.

Parameters
int$workshopidworkshop instance id
Return values
arrayarray containing the workshop object, course, context and course module objects
Since
Moodle 3.4

◆ view_submission()

static mod_workshop_external::view_submission (   $submissionid)
static

Trigger the submission viewed event.

Parameters
int$submissionidsubmission id
Return values
arrayof warnings and status result
Since
Moodle 3.4
Exceptions
moodle_exception

◆ view_submission_parameters()

static mod_workshop_external::view_submission_parameters ( )
static

Describes the parameters for view_submission.

Return values
external_function_parameters
Since
Moodle 3.4

◆ view_submission_returns()

static mod_workshop_external::view_submission_returns ( )
static

Describes the view_submission return value.

Return values
external_single_structure
Since
Moodle 3.4

◆ view_workshop()

static mod_workshop_external::view_workshop (   $workshopid)
static

Trigger the course module viewed event and update the module completion status.

Parameters
int$workshopidworkshop instance id
Return values
arrayof warnings and status result
Since
Moodle 3.4
Exceptions
moodle_exception

◆ view_workshop_parameters()

static mod_workshop_external::view_workshop_parameters ( )
static

Describes the parameters for view_workshop.

Return values
external_function_parameters
Since
Moodle 3.4

◆ view_workshop_returns()

static mod_workshop_external::view_workshop_returns ( )
static

Describes the view_workshop return value.

Return values
external_single_structure
Since
Moodle 3.4

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