Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
mod_workshop_external Class Reference

Workshop external functions. More...

Inheritance diagram for mod_workshop_external:

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

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.
 
static prepare_assessment_for_external ($assessment, workshop $workshop)
 Helper method for returning the assessment data according the current user capabilities and current phase.
 
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.
 
static validate_submission ($submission, workshop $workshop)
 Helper method for validating a submission.
 
static validate_workshop ($workshopid)
 Utility function for validating a workshop.
 

Detailed Description

Workshop external functions.

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

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
core_external\external_description
Since
Moodle 3.4

◆ 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

◆ 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
core_external\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
core_external\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
core_external\external_description
Since
Moodle 3.4

◆ 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
core_external\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
core_external\external_description
Since
Moodle 3.4

◆ 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
core_external\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
core_external\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
core_external\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
core_external\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
core_external\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

◆ 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
core_external\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
core_external\external_description
Since
Moodle 3.4

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