Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
mod_assign

Namespaces

namespace  mod_assign
  
 
namespace  mod_assign\analytics\indicator
  
 
namespace  mod_assign\cache
  
 
namespace  mod_assign\completion
  
 
namespace  mod_assign\event
  
 
namespace  mod_assign\external
  
 
namespace  mod_assign\grades
  
 
namespace  mod_assign\navigation\views
  
 
namespace  mod_assign\output
  
 
namespace  mod_assign\plugininfo
  
 
namespace  mod_assign\privacy
  
 
namespace  mod_assign\search
  
 
namespace  mod_assign\task
  
 

Classes

class  assign
 Standard base class for mod_assign (assignment types). More...
 
class  assign_admin_page_manage_assign_plugins
 Admin external page that displays a list of the installed submission plugins. More...
 
class  assign_attempt_history
 Used to output the attempt history for a particular assignment. More...
 
class  assign_attempt_history_chooser
 Used to output the attempt history chooser for a particular assignment. More...
 
class  assign_course_index_summary
 Renderable course index summary. More...
 
class  assign_feedback_plugin
 Abstract class for feedback_plugin inherited from assign_plugin abstract class. More...
 
class  assign_feedback_plugin_feedback
 Implements a renderable feedback plugin feedback. More...
 
class  assign_feedback_status
 Renderable feedback status. More...
 
class  assign_files
 An assign file class that extends rendererable class and is used by the assign module. More...
 
class  assign_form
 Implements a renderable grading options form. More...
 
class  assign_grading_summary
 Renderable grading summary. More...
 
class  assign_grading_table
 Extends table_sql to provide a table of assignment submissions. More...
 
class  assign_gradingmessage
 Implements a renderable message notification. More...
 
class  assign_override_form
 Form for editing settings overrides. More...
 
class  assign_plugin
 Abstract class for assign_plugin (submission/feedback). More...
 
class  assign_plugin_header
 Renderable header related to an individual subplugin. More...
 
class  assign_plugin_manager
 Class that handles the display and configuration of the list of submission plugins. More...
 
class  assign_portfolio_caller
 Portfolio caller class for mod_assign. More...
 
class  assign_submission_plugin
 Abstract base class for submission plugin types. More...
 
class  assign_submission_plugin_submission
 Implements a renderable submission plugin submission. More...
 
class  assign_submission_status_compact
 Renderable submission status. More...
 
class  assign_submit_for_grading_page
 This class wraps the submit for grading confirmation page. More...
 
class  assign_user_summary
 Implements a renderable user summary. More...
 
class  assignsubmission_subplugin_generator
 
class  backup_assign_activity_structure_step
 Define the complete choice structure for backup, with file and id annotations. More...
 
class  backup_assign_activity_task
 assign backup task that provides all the settings and steps to perform one complete backup of the activity More...
 
class  behat_mod_assign
 Behat custom steps and configuration for mod_assign. More...
 
class  behat_mod_assign_generator
 
class  mod_assign\analytics\indicator\activity_base
 Activity base class. More...
 
class  mod_assign\analytics\indicator\cognitive_depth
 Cognitive depth indicator - assign. More...
 
class  mod_assign\analytics\indicator\social_breadth
 Social breadth indicator - assign. More...
 
class  mod_assign\cache\overrides
 Class assign_overrides. More...
 
class  mod_assign\completion\custom_completion
 
class  mod_assign\dates
 Class for fetching the important dates in mod_assign for a given module instance and a user. More...
 
class  mod_assign\downloader
 
class  mod_assign\event\all_submissions_downloaded
 The mod_assign all submissions downloaded event class. More...
 
class  mod_assign\event\base
 The mod_assign abstract base event class. More...
 
class  mod_assign\event\course_module_instance_list_viewed
 The mod_assign instance list viewed event class. More...
 
class  mod_assign\event\course_module_viewed
 The mod_assign course module viewed event class. More...
 
class  mod_assign\event\feedback_viewed
 
class  mod_assign\event\grading_form_viewed
 
class  mod_assign\event\group_override_created
 
class  mod_assign\event\group_override_deleted
 
class  mod_assign\event\group_override_updated
 
class  mod_assign\event\identities_revealed
 The mod_assign identities revealed event class. More...
 
class  mod_assign\event\marker_updated
 
class  mod_assign\event\remove_submission_form_viewed
 The mod_assign remove submission form viewed event class. More...
 
class  mod_assign\event\statement_accepted
 The mod_assign statement accepted event class. More...
 
class  mod_assign\event\submission_duplicated
 The mod_assign submission duplicated event class. More...
 
class  mod_assign\event\submission_form_viewed
 
class  mod_assign\event\submission_viewed
 
class  mod_assign\event\user_override_created
 
class  mod_assign\event\user_override_deleted
 
class  mod_assign\event\user_override_updated
 
class  mod_assign\event\workflow_state_updated
 
class  mod_assign\external\external_api
 
class  mod_assign\external\start_submission
 
class  mod_assign\externallib_advanced_testcase
 
class  mod_assign\grades\gradeitems
 Grade item mappings for the activity. More...
 
class  mod_assign\group_observers
 Group observers class. More...
 
class  mod_assign\navigation\views\secondary
 
class  mod_assign\output\actionmenu
 Output the actionbar for this activity. More...
 
class  mod_assign\output\assign_header
 This file contains the definition for the renderable assign header. More...
 
class  mod_assign\output\assign_submission_status
 This file contains the definition for the renderable assign submission status. More...
 
class  mod_assign\output\grading_actionmenu
 Output the grading actionbar for this activity. More...
 
class  mod_assign\output\grading_app
 Grading app renderable. More...
 
class  mod_assign\output\override_actionmenu
 Output the override actionbar for this activity. More...
 
class  mod_assign\output\renderer
 A custom renderer class that extends the plugin_renderer_base and is used by the assign module. More...
 
class  mod_assign\output\timelimit_panel
 Represents the timer panel. More...
 
class  mod_assign\output\user_submission_actionmenu
 Output the user submission actionbar for this activity. More...
 
class  mod_assign\plugininfo\assignfeedback
 
class  mod_assign\plugininfo\assignsubmission
 
class  mod_assign\privacy\assign_plugin_request_data
 An object for fulfilling an assign plugin data request. More...
 
interface  mod_assign\privacy\assignfeedback_provider
 
interface  mod_assign\privacy\assignfeedback_user_provider
 
interface  mod_assign\privacy\assignsubmission_provider
 
interface  mod_assign\privacy\assignsubmission_user_provider
 
class  mod_assign\privacy\provider
 Privacy class for requesting user data. More...
 
class  mod_assign\privacy\useridlist
 An object for collecting user IDs related to a teacher. More...
 
class  mod_assign\search\activity
 Search area for mod_assign activities. More...
 
class  mod_assign\task\cron_task
 
class  mod_assign_batch_set_allocatedmarker_form
 Set allocated marker form. More...
 
class  mod_assign_batch_set_marking_workflow_state_form
 Set marking workflow form. More...
 
class  mod_assign_confirm_submission_form
 Assignment submission confirmation form. More...
 
class  mod_assign_extension_form
 Assignment extension dates form. More...
 
class  mod_assign_generator
 
class  mod_assign_grade_form
 Assignment grade form. More...
 
class  mod_assign_grading_batch_operations_form
 Assignment grading options form. More...
 
class  mod_assign_grading_options_form
 Assignment grading options form. More...
 
class  mod_assign_mod_form
 Assignment settings form. More...
 
class  mod_assign_quick_grading_form
 Assignment quick grading form. More...
 
class  mod_assign_submission_form
 Assign submission form. More...
 
class  restore_assign_activity_structure_step
 Define the complete assignment structure for restore, with file and id annotations. More...
 
class  restore_assign_activity_task
 assign restore task that provides all the settings and steps to perform one complete restore of the activity More...
 

Functions

 assign_add_instance (stdClass $data, mod_assign_mod_form $form=null)
 Adds an assignment instance.
 
 assign_check_updates_since (cm_info $cm, $from, $filter=array())
 Check if the module has any update that affects the current user since a given time.
 
 assign_delete_instance ($id)
 delete an assignment instance
 
 assign_extend_settings_navigation (settings_navigation $settings, navigation_node $navref)
 extend an assigment navigation settings
 
 assign_get_completion_state ($course, $cm, $userid, $type)
 Obtains the automatic completion state for this module based on any conditions in assign settings.
 
 assign_get_coursemodule_info ($coursemodule)
 Add a get_coursemodule_info function in case any assignment type wants to add 'extra' information for the course (see resource).
 
 assign_get_extra_capabilities ()
 Returns all other capabilities used by this module.
 
 assign_get_file_areas ($course, $cm, $context)
 List the file areas that can be browsed.
 
 assign_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename)
 File browsing support for assign module.
 
 assign_get_grade_details_for_print_overview ()
 
 assign_get_js_module ()
 Get the information about the standard assign JavaScript module.
 
 assign_get_mysubmission_details_for_print_overview ()
 
 assign_get_post_actions ()
 List the actions that correspond to a post of this module.
 
 assign_get_recent_mod_activity (&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0)
 Returns all assignments since a given time.
 
 assign_get_user_grades ($assign, $userid=0)
 Return grade for given user or all users.
 
 assign_get_view_actions ()
 List the actions that correspond to a view of this module.
 
 assign_grade_item_update ($assign, $grades=null)
 Create grade item for given assignment.
 
 assign_page_type_list ($pagetype, $parentcontext, $currentcontext)
 Return a list of page types.
 
 assign_pluginfile ($course, $cm, context $context, $filearea, $args, $forcedownload, array $options=array())
 Serves intro attachment files.
 
 assign_prepare_update_events ($assign, $course=null, $cm=null)
 This actually updates the normal and completion calendar events.
 
 assign_print_overview ()
 
 assign_print_recent_activity ($course, $viewfullnames, $timestart)
 Print recent activity from all assignments in a given course.
 
 assign_print_recent_mod_activity ($activity, $courseid, $detail, $modnames)
 Print recent activity from all assignments in a given course.
 
 assign_process_group_deleted_in_course ($courseid, $groupid=null)
 Logic to happen when a/some group(s) has/have been deleted in a course.
 
 assign_refresh_events ($courseid=0, $instance=null, $cm=null)
 This standard function will check all instances of this module and make sure there are up-to-date events created for each of them.
 
 assign_rescale_activity_grades ($course, $cm, $oldmin, $oldmax, $newmin, $newmax)
 Rescale all grades for this activity and push the new grades to the gradebook.
 
 assign_reset_course_form_defaults ($course)
 Course reset form defaults.
 
 assign_reset_course_form_definition (&$mform)
 Implementation of the function for printing the form elements that control whether the course reset functionality affects the assignment.
 
 assign_reset_gradebook ($courseid, $type='')
 Removes all grades from gradebook.
 
 assign_reset_userdata ($data)
 This function is used by the reset_course_userdata function in moodlelib.
 
 assign_scale_used ()
 
 assign_scale_used_anywhere ($scaleid)
 Checks if scale is being used by any instance of assignment.
 
 assign_supports ($feature)
 Return the list if Moodle features this module supports.
 
 assign_update_events ($assign, $override=null)
 This function updates the events associated to the assign.
 
 assign_update_grades ($assign, $userid=0, $nullifnone=true)
 Update activity grades.
 
 assign_update_instance (stdClass $data, $form)
 Update an assignment instance.
 
 assign_user_complete ($course, $user, $coursemodule, $assign)
 Prints the complete info about a user's interaction with an assignment.
 
 assign_user_outline ($course, $user, $coursemodule, $assignment)
 Print the grade information for the assignment for this user.
 
 mod_assign_cm_info_dynamic (cm_info $cm)
 Sets dynamic information about a course module.
 
 mod_assign_core_calendar_event_action_shows_item_count (calendar_event $event, $itemcount=0)
 Callback function that determines whether an action event should be showing its item count based on the event type and the item count.
 
 mod_assign_core_calendar_event_timestart_updated (\calendar_event $event, stdClass $instance)
 This function will update the assign module according to the event that has been modified.
 
 mod_assign_core_calendar_get_event_action_string (string $eventtype)
 Callback to fetch the activity event type lang string.
 
 mod_assign_core_calendar_get_valid_event_timestart_range (\calendar_event $event, stdClass $instance)
 This function calculates the minimum and maximum cutoff values for the timestart of the given event.
 
 mod_assign_core_calendar_is_event_visible (calendar_event $event, $userid=0)
 Is the event visible?
 
 mod_assign_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, $userid=0)
 This function receives a calendar event and returns the action associated with it, or null if there is none.
 
 mod_assign_get_completion_active_rule_descriptions ($cm)
 Callback which returns human-readable strings describing the active completion custom rules for the module instance.
 
 mod_assign_get_path_from_pluginfile (string $filearea, array $args)
 Given an array with a file path, it returns the itemid and the filepath for the defined filearea.
 
 mod_assign_output_fragment_gradingpanel ($args)
 Serve the grading panel as a fragment.
 
 mod_assign_user_preferences ()
 Return a list of all the user preferences used by mod_assign.
 
 move_group_override ($id, $move, $assignid)
 Change the sort order of an override.
 
 reorder_group_overrides ($assignid)
 Reorder the overrides starting at the override at the given startorder.
 
 xmldb_assign_upgrade ($oldversion)
 upgrade this assignment instance - this function could be skipped but it will be needed later
 

Variables

 $capabilities
 
global $CFG
 
global mod_assign::$CFG
 
global mod_assign\event::$CFG
 
global mod_assign\external::$CFG
 
 $definitions
 
 $functions
 
 $logs
 
 $messageproviders
 
 $observers
 
 $plugin = 2023041800
 
 $renamedclasses
 
 $settings = new admin_settingpage($section, get_string('settings', 'mod_assign'), 'moodle/site:config', $module->is_enabled() === false)
 
 $tasks
 
const ASSIGN_ACTIVITYATTACHMENT_FILEAREA 'activityattachment'
 
const ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL 'manual'
 
const ASSIGN_ATTEMPT_REOPEN_METHOD_NONE 'none'
 
const ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS 'untilpass'
 
const ASSIGN_EVENT_TYPE_CLOSE 'close'
 
const ASSIGN_EVENT_TYPE_DUE 'due'
 
const ASSIGN_EVENT_TYPE_GRADINGDUE 'gradingdue'
 
const ASSIGN_EVENT_TYPE_OPEN 'open'
 
const ASSIGN_FILTER_DRAFT 'draft'
 
const ASSIGN_FILTER_GRANTED_EXTENSION 'grantedextension'
 
const ASSIGN_FILTER_NONE 'none'
 
const ASSIGN_FILTER_NOT_SUBMITTED 'notsubmitted'
 
const ASSIGN_FILTER_REQUIRE_GRADING 'requiregrading'
 
const ASSIGN_FILTER_SINGLE_USER 'singleuser'
 
const ASSIGN_FILTER_SUBMITTED 'submitted'
 
const ASSIGN_GRADE_NOT_SET -1
 
const ASSIGN_GRADING_STATUS_GRADED 'graded'
 
const ASSIGN_GRADING_STATUS_NOT_GRADED 'notgraded'
 
const ASSIGN_INTROATTACHMENT_FILEAREA 'introattachment'
 
const ASSIGN_MARKER_FILTER_NO_MARKER -1
 
const ASSIGN_MARKING_WORKFLOW_STATE_INMARKING 'inmarking'
 
const ASSIGN_MARKING_WORKFLOW_STATE_INREVIEW 'inreview'
 
const ASSIGN_MARKING_WORKFLOW_STATE_NOTMARKED 'notmarked'
 
const ASSIGN_MARKING_WORKFLOW_STATE_READYFORRELEASE 'readyforrelease'
 
const ASSIGN_MARKING_WORKFLOW_STATE_READYFORREVIEW 'readyforreview'
 
const ASSIGN_MARKING_WORKFLOW_STATE_RELEASED 'released'
 
const ASSIGN_MAX_EVENT_LENGTH "432000"
 ASSIGN_MAX_EVENT_LENGTH = 432000 ; 5 days maximum.
 
const ASSIGN_SUBMISSION_STATUS_DRAFT 'draft'
 
const ASSIGN_SUBMISSION_STATUS_NEW 'new'
 
const ASSIGN_SUBMISSION_STATUS_REOPENED 'reopened'
 
const ASSIGN_SUBMISSION_STATUS_SUBMITTED 'submitted'
 
const ASSIGN_UNLIMITED_ATTEMPTS -1
 
$plugin component = 'mod_assign'
 
$plugin version = 2023042400
 

Detailed Description

Function Documentation

◆ assign_add_instance()

assign_add_instance ( stdClass $data,
mod_assign_mod_form $form = null )

Adds an assignment instance.

This is done by calling the add_instance() method of the assignment type class

Parameters
stdClass$data
mod_assign_mod_form$form
Return values
intThe instance id of the new assignment

◆ assign_check_updates_since()

assign_check_updates_since ( cm_info $cm,
$from,
$filter = array() )

Check if the module has any update that affects the current user since a given time.

Parameters
cm_info$cmcourse module data
int$fromthe time to check updates from
array$filterif we need to check only specific updates
Return values
stdClassan object with the different type of areas indicating if they were updated or not
Since
Moodle 3.2

◆ assign_delete_instance()

assign_delete_instance ( $id)

delete an assignment instance

Parameters
int$id
Return values
bool

◆ assign_extend_settings_navigation()

assign_extend_settings_navigation ( settings_navigation $settings,
navigation_node $navref )

extend an assigment navigation settings

Parameters
settings_navigation$settings
navigation_node$navref
Return values
void

◆ assign_get_completion_state()

assign_get_completion_state ( $course,
$cm,
$userid,
$type )

Obtains the automatic completion state for this module based on any conditions in assign settings.

Deprecated
since Moodle 3.11
Todo
MDL-71196 Final deprecation in Moodle 4.3
See also
mod_assign\completion\custom_completion
Parameters
object$courseCourse
object$cmCourse-module
int$useridUser ID
bool$typeType of comparison (or/and; can be used as return value if no conditions)
Return values
boolTrue if completed, false if not, $type if conditions not set.

◆ assign_get_coursemodule_info()

assign_get_coursemodule_info ( $coursemodule)

Add a get_coursemodule_info function in case any assignment type wants to add 'extra' information for the course (see resource).

Given a course_module object, this function returns any "extra" information that may be needed when printing this activity in a course listing. See get_array_of_activities() in course/lib.php.

Parameters
stdClass$coursemoduleThe coursemodule object (record).
Return values
cached_cm_infoAn object on information that the courses will know about (most noticeably, an icon).

◆ assign_get_extra_capabilities()

assign_get_extra_capabilities ( )

Returns all other capabilities used by this module.

Return values
arrayArray of capability strings

◆ assign_get_file_areas()

assign_get_file_areas ( $course,
$cm,
$context )

List the file areas that can be browsed.

Parameters
stdClass$course
stdClass$cm
stdClass$context
Return values
array

◆ assign_get_file_info()

assign_get_file_info ( $browser,
$areas,
$course,
$cm,
$context,
$filearea,
$itemid,
$filepath,
$filename )

File browsing support for assign module.

Parameters
file_browser$browser
object$areas
object$course
object$cm
object$context
string$filearea
int$itemid
string$filepath
string$filename
Return values
objectfile_info instance or null if not found

◆ assign_get_grade_details_for_print_overview()

assign_get_grade_details_for_print_overview ( )
Deprecated
since Moodle 3.3, when the block_course_overview block was removed.

◆ assign_get_js_module()

assign_get_js_module ( )

Get the information about the standard assign JavaScript module.

Return values
arraya standard jsmodule structure.

◆ assign_get_mysubmission_details_for_print_overview()

assign_get_mysubmission_details_for_print_overview ( )
Deprecated
since Moodle 3.3, when the block_course_overview block was removed.

◆ assign_get_post_actions()

assign_get_post_actions ( )

List the actions that correspond to a post of this module.

This is used by the participation report.

Note: This is not used by new logging system. Event with crud = ('c' || 'u' || 'd') and edulevel = LEVEL_PARTICIPATING will be considered as post action.

Return values
array

◆ assign_get_recent_mod_activity()

assign_get_recent_mod_activity ( & $activities,
& $index,
$timestart,
$courseid,
$cmid,
$userid = 0,
$groupid = 0 )

Returns all assignments since a given time.

Parameters
array$activitiesThe activity information is returned in this array
int$indexThe current index in the activities array
int$timestartThe earliest activity to show
int$courseidLimit the search to this course
int$cmidThe course module id
int$useridOptional user id
int$groupidOptional group id
Return values
void

◆ assign_get_user_grades()

assign_get_user_grades ( $assign,
$userid = 0 )

Return grade for given user or all users.

Parameters
stdClass$assignrecord of assign with an additional cmidnumber
int$useridoptional user id, 0 means all users
Return values
arrayarray of grades, false if none

◆ assign_get_view_actions()

assign_get_view_actions ( )

List the actions that correspond to a view of this module.

This is used by the participation report.

Note: This is not used by new logging system. Event with crud = 'r' and edulevel = LEVEL_PARTICIPATING will be considered as view action.

Return values
array

◆ assign_grade_item_update()

assign_grade_item_update ( $assign,
$grades = null )

Create grade item for given assignment.

Parameters
stdClass$assignrecord with extra cmidnumber
array$gradesoptional array/object of grade(s); 'reset' means reset grades in gradebook
Return values
int0 if ok, error code otherwise

◆ assign_page_type_list()

assign_page_type_list ( $pagetype,
$parentcontext,
$currentcontext )

Return a list of page types.

Parameters
string$pagetypecurrent page type
stdClass$parentcontextBlock's parent context
stdClass$currentcontextCurrent context of block

◆ assign_pluginfile()

assign_pluginfile ( $course,
$cm,
context $context,
$filearea,
$args,
$forcedownload,
array $options = array() )

Serves intro attachment files.

Parameters
mixed$coursecourse or id of the course
mixed$cmcourse module or id of the course module
context$context
string$filearea
array$args
bool$forcedownload
array$optionsadditional options affecting the file serving
Return values
boolfalse if file not found, does not return if found - just send the file

◆ assign_prepare_update_events()

assign_prepare_update_events ( $assign,
$course = null,
$cm = null )

This actually updates the normal and completion calendar events.

Parameters
stdClass$assignAssignment object (from DB).
stdClass$courseCourse object.
stdClass$cmCourse module object.

◆ assign_print_overview()

assign_print_overview ( )
Deprecated
since Moodle 3.3, when the block_course_overview block was removed.

◆ assign_print_recent_activity()

assign_print_recent_activity ( $course,
$viewfullnames,
$timestart )

Print recent activity from all assignments in a given course.

This is used by the recent activity block

Parameters
mixed$coursethe course to print activity for
bool$viewfullnamesboolean to determine whether to show full names or not
int$timestartthe time the rendering started
Return values
booltrue if activity was printed, false otherwise.

◆ assign_print_recent_mod_activity()

assign_print_recent_mod_activity ( $activity,
$courseid,
$detail,
$modnames )

Print recent activity from all assignments in a given course.

This is used by course/recent.php

Parameters
stdClass$activity
int$courseid
bool$detail
array$modnames

◆ assign_process_group_deleted_in_course()

assign_process_group_deleted_in_course ( $courseid,
$groupid = null )

Logic to happen when a/some group(s) has/have been deleted in a course.

Parameters
int$courseidThe course ID.
int$groupidThe group id if it is known
Return values
void

◆ assign_refresh_events()

assign_refresh_events ( $courseid = 0,
$instance = null,
$cm = null )

This standard function will check all instances of this module and make sure there are up-to-date events created for each of them.

If courseid = 0, then every assignment event in the site is checked, else only assignment events belonging to the course specified are checked.

Parameters
int$courseid
int | stdClass$instanceAssign module instance or ID.
int | stdClass$cmCourse module object or ID (not used in this module).
Return values
bool

◆ assign_rescale_activity_grades()

assign_rescale_activity_grades ( $course,
$cm,
$oldmin,
$oldmax,
$newmin,
$newmax )

Rescale all grades for this activity and push the new grades to the gradebook.

Parameters
stdClass$courseCourse db record
stdClass$cmCourse module db record
float$oldmin
float$oldmax
float$newmin
float$newmax

◆ assign_reset_course_form_defaults()

assign_reset_course_form_defaults ( $course)

Course reset form defaults.

Parameters
object$course
Return values
array

◆ assign_reset_course_form_definition()

assign_reset_course_form_definition ( & $mform)

Implementation of the function for printing the form elements that control whether the course reset functionality affects the assignment.

Parameters
MoodleQuickForm$mformform passed by reference

◆ assign_reset_gradebook()

assign_reset_gradebook ( $courseid,
$type = '' )

Removes all grades from gradebook.

Parameters
int$courseidThe ID of the course to reset
string$typeOptional type of assignment to limit the reset to a particular assignment type

◆ assign_reset_userdata()

assign_reset_userdata ( $data)

This function is used by the reset_course_userdata function in moodlelib.

This function will remove all assignment submissions and feedbacks in the database and clean up any related data.

Parameters
stdClass$datathe data submitted from the reset course.
Return values
array

◆ assign_scale_used()

assign_scale_used ( )
Deprecated
since Moodle 3.8

◆ assign_scale_used_anywhere()

assign_scale_used_anywhere ( $scaleid)

Checks if scale is being used by any instance of assignment.

This is used to find out if scale used anywhere

Parameters
int$scaleid
Return values
booleanTrue if the scale is used by any assignment

◆ assign_supports()

assign_supports ( $feature)

Return the list if Moodle features this module supports.

Parameters
string$featureFEATURE_xx constant for requested feature
Return values
mixedTrue if module supports feature, false if not, null if doesn't know or string for the module purpose.

◆ assign_update_events()

assign_update_events ( $assign,
$override = null )

This function updates the events associated to the assign.

If $override is non-zero, then it updates only the events associated with the specified override.

Parameters
assign$assignthe assign object.
object$override(optional) limit to a specific override

◆ assign_update_grades()

assign_update_grades ( $assign,
$userid = 0,
$nullifnone = true )

Update activity grades.

Parameters
stdClass$assigndatabase record
int$useridspecific user only, 0 means all
bool$nullifnone- not used

◆ assign_update_instance()

assign_update_instance ( stdClass $data,
$form )

Update an assignment instance.

This is done by calling the update_instance() method of the assignment type class

Parameters
stdClass$data
stdClass$form- unused
Return values
object

◆ assign_user_complete()

assign_user_complete ( $course,
$user,
$coursemodule,
$assign )

Prints the complete info about a user's interaction with an assignment.

Parameters
stdClass$course
stdClass$user
stdClass$coursemodule
stdClass$assignthe database assign record

This prints the submission summary and feedback summary for this student.

◆ assign_user_outline()

assign_user_outline ( $course,
$user,
$coursemodule,
$assignment )

Print the grade information for the assignment for this user.

Parameters
stdClass$course
stdClass$user
stdClass$coursemodule
stdClass$assignment

◆ mod_assign_cm_info_dynamic()

mod_assign_cm_info_dynamic ( cm_info $cm)

Sets dynamic information about a course module.

This function is called from cm_info when displaying the module

Parameters
cm_info$cm

◆ mod_assign_core_calendar_event_action_shows_item_count()

mod_assign_core_calendar_event_action_shows_item_count ( calendar_event $event,
$itemcount = 0 )

Callback function that determines whether an action event should be showing its item count based on the event type and the item count.

Parameters
calendar_event$eventThe calendar event.
int$itemcountThe item count associated with the action event.
Return values
bool

◆ mod_assign_core_calendar_event_timestart_updated()

mod_assign_core_calendar_event_timestart_updated ( \calendar_event $event,
stdClass $instance )

This function will update the assign module according to the event that has been modified.

Exceptions
moodle_exception
Parameters
calendar_event$event
stdClass$instanceThe module instance to get the range from

◆ mod_assign_core_calendar_get_event_action_string()

mod_assign_core_calendar_get_event_action_string ( string $eventtype)

Callback to fetch the activity event type lang string.

Parameters
string$eventtypeThe event type.
Return values
lang_stringThe event type lang string.

◆ mod_assign_core_calendar_get_valid_event_timestart_range()

mod_assign_core_calendar_get_valid_event_timestart_range ( \calendar_event $event,
stdClass $instance )

This function calculates the minimum and maximum cutoff values for the timestart of the given event.

It will return an array with two values, the first being the minimum cutoff value and the second being the maximum cutoff value. Either or both values can be null, which indicates there is no minimum or maximum, respectively.

If a cutoff is required then the function must return an array containing the cutoff timestamp and error string to display to the user if the cutoff value is violated.

A minimum and maximum cutoff return value will look like: [ [1505704373, 'The due date must be after the sbumission start date'], [1506741172, 'The due date must be before the cutoff date'] ]

If the event does not have a valid timestart range then [false, false] will be returned.

Parameters
calendar_event$eventThe calendar event to get the time range for
stdClass$instanceThe module instance to get the range from
Return values
array

◆ mod_assign_core_calendar_is_event_visible()

mod_assign_core_calendar_is_event_visible ( calendar_event $event,
$userid = 0 )

Is the event visible?

This is used to determine global visibility of an event in all places throughout Moodle. For example, the ASSIGN_EVENT_TYPE_GRADINGDUE event will not be shown to students on their calendar.

Parameters
calendar_event$event
int$useridUser id to use for all capability checks, etc. Set to 0 for current user (default).
Return values
boolReturns true if the event is visible to the current user, false otherwise.

◆ mod_assign_core_calendar_provide_event_action()

mod_assign_core_calendar_provide_event_action ( calendar_event $event,
core_calendar\action_factory $factory,
$userid = 0 )

This function receives a calendar event and returns the action associated with it, or null if there is none.

This is used by block_myoverview in order to display the event appropriately. If null is returned then the event is not displayed on the block.

Parameters
calendar_event$event
core_calendar\action_factory$factory
int$useridUser id to use for all capability checks, etc. Set to 0 for current user (default).
Return values
core_calendar\local\event\entities\action_interface|null

◆ mod_assign_get_completion_active_rule_descriptions()

mod_assign_get_completion_active_rule_descriptions ( $cm)

Callback which returns human-readable strings describing the active completion custom rules for the module instance.

Parameters
cm_info | stdClass$cmobject with fields ->completion and ->customdata['customcompletionrules']
Return values
array\$descriptionsthe array of descriptions for the custom rules.

◆ mod_assign_get_path_from_pluginfile()

mod_assign_get_path_from_pluginfile ( string $filearea,
array $args )

Given an array with a file path, it returns the itemid and the filepath for the defined filearea.

Parameters
string$fileareaThe filearea.
array$argsThe path (the part after the filearea and before the filename).
Return values
arrayThe itemid and the filepath inside the $args path, for the defined filearea.

◆ mod_assign_output_fragment_gradingpanel()

mod_assign_output_fragment_gradingpanel ( $args)

Serve the grading panel as a fragment.

Parameters
array$argsList of named arguments for the fragment loader.
Return values
string

◆ mod_assign_user_preferences()

mod_assign_user_preferences ( )

Return a list of all the user preferences used by mod_assign.

@uses core_user\is_current_user

Return values
array[]

◆ move_group_override()

move_group_override ( $id,
$move,
$assignid )

Change the sort order of an override.

Parameters
int$idof the override
string$movedirection of move
int$assignidof the assignment
Return values
boolsuccess of operation

◆ reorder_group_overrides()

reorder_group_overrides ( $assignid)

Reorder the overrides starting at the override at the given startorder.

Parameters
int$assignidof the assigment

◆ xmldb_assign_upgrade()

xmldb_assign_upgrade ( $oldversion)

upgrade this assignment instance - this function could be skipped but it will be needed later

Parameters
int$oldversionThe old version of the assign module
Return values
bool

Variable Documentation

◆ $definitions

$definitions
Initial value:
= [
'overrides' => [
'mode' => cache_store::MODE_APPLICATION,
'simplekeys' => true,
'datasource' => '\mod_assign\cache\overrides',
],
]

◆ $logs

$logs
Initial value:
= array(
array('module'=>'assign', 'action'=>'add', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'delete mod', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'download all submissions', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'grade submission', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'lock submission', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'reveal identities', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'revert submission to draft', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'set marking workflow state', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'submission statement accepted', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'submit', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'submit for grading', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'unlock submission', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'update', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'upload', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'view', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'view all', 'mtable'=>'course', 'field'=>'fullname'),
array('module'=>'assign', 'action'=>'view confirm submit assignment form', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'view grading form', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'view submission', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'view submission grading table', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'view submit assignment form', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'view feedback', 'mtable'=>'assign', 'field'=>'name'),
array('module'=>'assign', 'action'=>'view batch set marking workflow state', 'mtable'=>'assign', 'field'=>'name'),
)

◆ $messageproviders

$messageproviders
Initial value:
= array (
'assign_notification' => array(
)
)

◆ $observers

$observers
Initial value:
= array(
array(
'eventname' => '\core\event\course_reset_started',
'callback' => '\mod_assign\group_observers::course_reset_started',
),
array(
'eventname' => '\core\event\course_reset_ended',
'callback' => '\mod_assign\group_observers::course_reset_ended',
),
array(
'eventname' => '\core\event\group_deleted',
'callback' => '\mod_assign\group_observers::group_deleted'
),
)

◆ $renamedclasses

$renamedclasses
Initial value:
= [
'assign_header' => 'mod_assign\output\assign_header',
'assign_submission_status' => 'mod_assign\output\assign_submission_status',
'mod_assign\local\views\secondary' => 'mod_assign\navigation\views\secondary',
]

◆ $tasks

$tasks
Initial value:
= array(
array(
'classname' => '\mod_assign\task\cron_task',
'blocking' => 0,
'minute' => '*',
'hour' => '*',
'day' => '*',
'month' => '*',
'dayofweek' => '*'
)
)