|
Moodle PHP Documentation 4.1
Moodle 4.1dev (Build: 20220512) (5e5e12e0)
|
Assign functions. More...
Static Public Member Functions | |
| 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 | 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, $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_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 | 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 | generate_warning (int $assignmentid, string $warningcode, string $detail) |
| Generate a warning in a standard structure for a known failure. More... | |
| 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. More... | |
| static | validate_assign (int $assignid) |
| Utility function for validating an assign. More... | |
Assign functions.
|
static |
Copy a students previous attempt to a new attempt.
| int | $assignmentid |
| array | of warnings to indicate any errors. |
|
static |
Describes the parameters for copy_previous_attempt.
| external_function_parameters |
|
static |
Describes the return value for save_submission.
| external_single_structure |
|
staticprotectedinherited |
Generate a warning in a standard structure for a known failure.
| int | $assignmentid | - The assignment |
| string | $warningcode | - The key for the warning message |
| string | $detail | - A description of the error |
| array | - Warning structure containing item, itemid, warningcode, message |
|
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.
| array | $courseids | An 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 | $capabilities | An array of additional capability checks you wish to be made on the course context. |
| bool | $includenotenrolledcourses | Wheter to return courses that the user can see even if is not enroled in. This requires the parameter $courseids to not be empty. |
| An | array of courses and warnings. |
|
static |
Returns description of method parameters.
| external_function_parameters |
|
static |
Describes the return value for get_assignments.
| external_single_structure |
|
static |
Returns grade information from assign_grades for the requested assignment ids.
| int[] | $assignmentids | |
| int | $since | only return records with timemodified >= since |
| array | of grade records for each requested assignment |
|
static |
|
static |
|
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.
| int | $assignid | the assign instance id |
| int | $userid | the user id |
| bool | $embeduser | return user details (only applicable if not blind marking) |
| array | of warnings and status result |
| moodle_exception |
|
static |
Returns description of method parameters.
| external_function_parameters |
|
static |
|
static |
Returns information about an assignment submission status for a given user.
| int | $assignid | assignment instance id |
| int | $userid | user id (empty for current user) |
| int | $groupid | filter by users in group id (used for generating the grading summary). Use 0 for all groups information. |
| array | of warnings and grading, status, feedback and previous attempts information |
| required_capability_exception |
|
static |
Describes the parameters for get_submission_status.
| external_function_parameters |
|
static |
Describes the get_submission_status return value.
| external_single_structure |
|
static |
Returns submissions for the requested assignment ids.
| int[] | $assignmentids | |
| string | $status | only return submissions with this status |
| int | $since | only return submissions with timemodified >= since |
| int | $before | only return submissions with timemodified <= before |
| array | of submissions for each requested assignment |
|
static |
Describes the parameters for get_submissions.
| external_function_parameters |
|
static |
|
static |
Returns user flag information from assign_user_flags for the requested assignment ids.
| int[] | $assignmentids |
| array | of user flag records for each requested assignment |
|
static |
Describes the parameters for get_user_flags.
| external_function_parameters |
|
static |
|
static |
Returns user mapping information from assign_user_mapping for the requested assignment ids.
| int[] | $assignmentids |
| array | of user mapping records for each requested assignment |
|
static |
Describes the parameters for get_user_mappings.
| external_function_parameters |
|
static |
Describes the get_user_mappings return value.
| external_single_structure |
|
staticprotectedinherited |
Get a submission from an assignment for a user.
Encapsulates checking whether it's a solo or team submission.
| assign | $assignment | Assignment object. |
| int | null | $userid | User id. |
| int | $groupid | Group id. |
| bool | $create | Whether a new submission should be created. |
| int | $attemptnumber | Attempt number. Use -1 for last attempt. |
| bool|stdClass |
|
static |
Retrieves the list of students to be graded for the assignment.
| int | $assignid | the assign instance id |
| int | $groupid | the current group id |
| string | $filter | search string to filter the results. |
| int | $skip | Number of records to skip |
| int | $limit | Maximum number of records to return |
| bool | $onlyids | Only return user ids. |
| bool | $includeenrolments | Return courses where the user is enrolled. |
| bool | $tablesort | Apply current user table sorting params from the grading table. |
| array | of warnings and status result |
| moodle_exception |
|
static |
Returns description of method parameters.
| external_function_parameters |
|
static |
Returns the description of the results of the mod_assign_external::list_participants() method.
| external_description |
|
static |
Locks (prevent updates to) submissions in this assignment.
| int | $assignmentid | The id of the assignment |
| array | $userids | Array of user ids to lock |
| array | of warnings for each submission that could not be locked. |
|
static |
Describes the parameters for lock_submissions.
| external_function_parameters |
|
static |
Describes the return value for lock_submissions.
| external_single_structure |
|
static |
Reveal the identities of anonymous students to markers for a single assignment.
| int | $assignmentid | The id of the assignment |
| array | of warnings to indicate any errors. |
|
static |
Describes the parameters for reveal_identities.
| external_function_parameters |
|
static |
Describes the return value for reveal_identities.
| external_single_structure |
|
static |
Reverts a list of user submissions to draft for a single assignment.
| int | $assignmentid | The id of the assignment |
| array | $userids | Array of user ids to revert |
| array | of warnings for each submission that could not be reverted. |
|
static |
Describes the parameters for revert_submissions_to_draft.
| external_function_parameters |
|
static |
Describes the return value for revert_submissions_to_draft.
| external_single_structure |
|
static |
Save a student grade for a single assignment.
| int | $assignmentid | The id of the assignment |
| int | $userid | The id of the user |
| float | $grade | The grade (ignored if the assignment uses advanced grading) |
| int | $attemptnumber | The attempt number |
| bool | $addattempt | Allow another attempt |
| string | $workflowstate | New workflow state |
| bool | $applytoall | Apply the grade to all members of the group |
| array | $plugindata | Custom data used by plugins |
| array | $advancedgradingdata | Advanced grading data |
| null |
|
static |
|
static |
|
static |
Save multiple student grades for a single assignment.
| int | $assignmentid | The id of the assignment |
| boolean | $applytoall | If set to true and this is a team assignment, apply the grade to all members of the group |
| array | $grades | grade 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 |
| invalid_parameter_exception | if multiple grades are supplied for a team assignment that has $applytoall set to true |
| null |
|
static |
Describes the parameters for save_grades.
| external_function_parameters |
|
static |
|
static |
Save a student submission for a single assignment.
| int | $assignmentid | The id of the assignment |
| array | $plugindata | - The submitted data for plugins |
| array | of warnings to indicate any errors |
|
static |
Describes the parameters for save_submission.
| external_function_parameters |
|
static |
Describes the return value for save_submission.
| external_single_structure |
|
static |
Grant extension dates to students for an assignment.
| int | $assignmentid | The id of the assignment |
| array | $userids | Array of user ids to grant extensions to |
| array | $dates | Array of extension dates |
| array | of warnings for each extension date that could not be granted |
|
static |
Describes the parameters for save_user_extensions.
| external_function_parameters |
|
static |
Describes the return value for save_user_extensions.
| external_single_structure |
|
static |
Create or update user_flags records.
| int | $assignmentid | the assignment for which the userflags are created or updated |
| array | $userflags | An array of userflags to create or update |
| array | containing success or failure information for each record |
|
static |
Describes the parameters for set_user_flags.
| external_function_parameters |
|
static |
Describes the set_user_flags return value.
| external_multiple_structure |
|
static |
Submit the logged in users assignment for grading.
| int | $assignmentid | The id of the assignment |
| array | of warnings to indicate any errors. |
|
static |
Describes the parameters for submit_for_grading.
| external_function_parameters |
|
static |
Describes the return value for submit_for_grading.
| external_single_structure |
|
static |
Submit the logged in users assignment for grading.
| int | $assignmentid | The id of the assignment |
| int | $userid | The id of the user the submission belongs to. |
| string | $jsonformdata | The data from the form, encoded as a json array. |
| array | of warnings to indicate any errors. |
|
static |
Describes the parameters for submit_grading_form webservice.
| external_function_parameters |
|
static |
Describes the return for submit_grading_form.
| external_function_parameters |
|
static |
Locks (prevent updates to) submissions in this assignment.
| int | $assignmentid | The id of the assignment |
| array | $userids | Array of user ids to lock |
| array | of warnings for each submission that could not be locked. |
|
static |
Describes the parameters for unlock_submissions.
| external_function_parameters |
|
static |
Describes the return value for unlock_submissions.
| external_single_structure |
|
staticprotectedinherited |
Utility function for validating an assign.
| int | $assignid | assign instance id |
| array | array containing the assign, course, context and course module objects |
|
static |
Update the module completion status.
| int | $assignid | assign instance id |
| array | of warnings and status result |
|
static |
Describes the parameters for view_assign.
| external_function_parameters |
|
static |
|
static |
Trigger the grading_table_viewed event.
| int | $assignid | the assign instance id |
| array | of warnings and status result |
| moodle_exception |
|
static |
Returns description of method parameters.
| external_function_parameters |
|
static |
|
static |
Trigger the submission status viewed event.
| int | $assignid | assign instance id |
| array | of warnings and status result |
|
static |
Describes the parameters for view_submission_status.
| external_function_parameters |
|
static |
Describes the view_submission_status return value.
| external_single_structure |