Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Files | Namespaces | Classes | Functions | Variables
mod_assign

Files

file  access.php
 Capability definitions for this module.
 
file  activity.php
 Search area for mod_assign activities.
 
file  activity_base.php
 Activity base class.
 
file  adminlib.php
 This file contains the classes for the admin settings of the assign module.
 
file  all_submissions_downloaded.php
 The mod_assign all submissions downloaded event.
 
 
file  assign_plugin_request_data.php
 This file contains the mod_assign assign_plugin_request_data class.
 
file  assignfeedback.php
 Assign feedback subplugin info class.
 
file  assignfeedback_provider.php
 This file contains the assignfeedback_provider interface.
 
file  assignfeedback_user_provider.php
 This file contains the assignfeedback_user_provider interface.
 
file  assignmentplugin.php
 This file contains the functions for assign_plugin abstract class.
 
file  assignsubmission.php
 Assign submission subplugin info class.
 
file  assignsubmission_provider.php
 This file contains the assignsubmission_provider interface.
 
file  assignsubmission_subplugin_generator.php
 Online Text assignment submission subplugin data generator.
 
file  assignsubmission_user_provider.php
 This file contains the assignsubmission_user_provider interface.
 
file  backup_assign_activity_task.class.php
 This file contains the backup activity for the assign module.
 
file  backup_assign_stepslib.php
 Define all the backup steps that will be used by the backup_assign_activity_task.
 
file  base.php
 The mod_assign abstract base event.
 
file  batch_set_marker_allocation_viewed.php
 The mod_assign batch set marker allocation viewed event.
 
file  batch_set_workflow_state_viewed.php
 The mod_assign assignment batch set workflow stated viewed event.
 
file  batchsetallocatedmarkerform.php
 This file contains the forms to set the allocated marker for selected submissions.
 
file  batchsetmarkingworkflowstateform.php
 This file contains the forms to set the marking workflow for selected submissions.
 
file  behat_mod_assign_generator.php
 Behat data generator for mod_assign.
 
file  cognitive_depth.php
 Cognitive depth indicator - assign.
 
file  course_module_instance_list_viewed.php
 The mod_assign instance list viewed event.
 
file  course_module_viewed.php
 The mod_assign course module viewed event.
 
file  cron_task.php
 A schedule task for assignment cron.
 
file  events.php
 Add event handlers for the assign.
 
file  extension_granted.php
 The mod_assign extension granted event.
 
file  extensionform.php
 This file contains the forms to create and edit an instance of this module.
 
file  externallib.php
 External assign API.
 
file  feedback_legacy_polyfill.php
 This file contains the polyfill to allow a plugin to operate with Moodle 3.3 up.
 
file  feedback_viewed.php
 The mod_assign feedback viewed event.
 
file  feedbackplugin.php
 This file contains the function for feedback_plugin abstract class.
 
file  generator.php
 Base class for unit tests for mod_assign.
 
file  gradeform.php
 This file contains the forms to create and edit an instance of this module.
 
file  gradeitems.php
 Grade item mappings for the activity.
 
file  grading_app.php
 Renderable that initialises the grading "app".
 
file  grading_form_viewed.php
 The mod_assign grading form viewed event.
 
file  grading_table_viewed.php
 The mod_assign grading table viewed event.
 
file  gradingbatchoperationsform.php
 This file contains the forms to create and edit an instance of this module.
 
file  gradingoptionsform.php
 This file contains the forms to create and edit an instance of this module.
 
file  gradingtable.php
 This file contains the definition for the grading table which subclassses easy_table.
 
file  group_observers.php
 Group observers.
 
file  group_override_created.php
 The mod_assign group override created event.
 
file  group_override_deleted.php
 The mod_assign group override deleted event.
 
file  group_override_updated.php
 The mod_assign group override updated event.
 
file  identities_revealed.php
 The mod_assign identities revealed event.
 
file  lib.php
 This file contains the moodle hooks for the assign module.
 
file  lib.php
 assign module data generator class
 
file  locallib.php
 This file contains the definition for the class assignment.
 
file  log.php
 Definition of log events.
 
file  marker_updated.php
 The mod_assign marker updated event.
 
file  messages.php
 Defines message providers (types of messages being sent)
 
file  mod_form.php
 This file contains the forms to create and edit an instance of this module.
 
file  override_form.php
 Settings form for overrides in the assign module.
 
file  provider.php
 Privacy class for requesting user data.
 
file  quickgradingform.php
 This file contains the forms to create and edit an instance of this module.
 
file  remove_submission_form_viewed.php
 The mod_assign remove submission form viewed event.
 
file  renderable.php
 This file contains the definition for the renderable classes for the assignment.
 
file  renderer.php
 This file contains a renderer for the assignment class.
 
file  restore_assign_activity_task.class.php
 Define all the backup steps that will be used by the backup_assign_activity_task.
 
file  restore_assign_stepslib.php
 Define all the restore steps that will be used by the restore_assign_activity_task.
 
file  reveal_identities_confirmation_page_viewed.php
 The mod_assign reveal identities confirmation page viewed event.
 
file  services.php
 Web service for mod assign.
 
file  settings.php
 This file adds the settings pages to the navigation menu.
 
file  social_breadth.php
 Social breadth indicator - assign.
 
file  statement_accepted.php
 The mod_assign statement accepted event.
 
file  submission_confirmation_form_viewed.php
 The mod_assign submission form viewed event.
 
file  submission_created.php
 The mod_assign submission_created abstract event.
 
file  submission_duplicated.php
 The mod_assign submission duplicated event.
 
file  submission_form.php
 This file contains the submission form used by the assign module.
 
file  submission_form_viewed.php
 The mod_assign submission form viewed event.
 
file  submission_graded.php
 The mod_assign submission graded event.
 
file  submission_legacy_polyfill.php
 This file contains the polyfill to allow a plugin to operate with Moodle 3.3 up.
 
file  submission_locked.php
 The mod_assign submission locked event.
 
file  submission_status_updated.php
 The mod_assign submission status updated event.
 
file  submission_status_viewed.php
 The mod_assign submission status viewed event.
 
file  submission_unlocked.php
 The mod_assign submission unlocked event.
 
file  submission_updated.php
 The mod_assign submission updated event.
 
file  submission_viewed.php
 The mod_assign submission viewed event.
 
file  submissionconfirmform.php
 This file contains the submission confirmation form.
 
file  submissionplugin.php
 This file contains the definition for the abstract class for submission_plugin.
 
file  tasks.php
 Definition of assignment scheduled tasks.
 
file  upgrade.php
 Upgrade code for install.
 
file  upgradelib.php
 This file contains the upgrade code to upgrade from mod_assignment to mod_assign.
 
file  user_override_created.php
 The mod_assign user override created event.
 
file  user_override_deleted.php
 The mod_assign user override deleted event.
 
file  user_override_updated.php
 The mod_assign user override updated event.
 
file  useridlist.php
 This file contains the mod_assign useridlist.
 
file  version.php
 Version information.
 
file  workflow_state_updated.php
 mod_assign workflow state updated event.
 

Namespaces

namespace  mod_assign
  
 
namespace  mod_assign\analytics\indicator
  
 
namespace  mod_assign\event
  
 
namespace  mod_assign\grades
  
 
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_header
 Renderable header. 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
 Renderable submission status. 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_upgrade_manager
 Class to manage upgrades from mod_assignment to mod_assign. 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_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\event\all_submissions_downloaded
 The mod_assign all submissions downloaded event class. More...
 
class  mod_assign\event\assessable_submitted
 
class  mod_assign\event\base
 The mod_assign abstract base event class. More...
 
class  mod_assign\event\batch_set_marker_allocation_viewed
 
class  mod_assign\event\batch_set_workflow_state_viewed
 
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\extension_granted
 The mod_assign extension granted event class. More...
 
class  mod_assign\event\feedback_viewed
 
class  mod_assign\event\grading_form_viewed
 
class  mod_assign\event\grading_table_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\reveal_identities_confirmation_page_viewed
 
class  mod_assign\event\statement_accepted
 The mod_assign statement accepted event class. More...
 
class  mod_assign\event\submission_confirmation_form_viewed
 
class  mod_assign\event\submission_created
 
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_graded
 The mod_assign submission graded event class. More...
 
class  mod_assign\event\submission_locked
 The mod_assign submission locked event class. More...
 
class  mod_assign\event\submission_status_updated
 
class  mod_assign\event\submission_status_viewed
 
class  mod_assign\event\submission_unlocked
 The mod_assign submission unlocked event class. More...
 
class  mod_assign\event\submission_updated
 
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\grades\gradeitems
 Grade item mappings for the activity. More...
 
class  mod_assign\group_observers
 Group observers class. More...
 
class  mod_assign\output\grading_app
 Grading app renderable. 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_external
 Assign functions. 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_renderer
 A custom renderer class that extends the plugin_renderer_base and is used by the assign module. 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. More...
 
 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. More...
 
 assign_delete_instance ($id)
 delete an assignment instance More...
 
 assign_extend_settings_navigation (settings_navigation $settings, navigation_node $navref)
 extend an assigment navigation settings More...
 
 assign_get_completion_state ($course, $cm, $userid, $type)
 Obtains the automatic completion state for this module based on any conditions in assign settings. More...
 
 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). More...
 
 assign_get_extra_capabilities ()
 Returns all other capabilities used by this module. More...
 
 assign_get_file_areas ($course, $cm, $context)
 List the file areas that can be browsed. More...
 
 assign_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename)
 File browsing support for assign module. More...
 
 assign_get_grade_details_for_print_overview ()
 
 assign_get_mysubmission_details_for_print_overview ()
 
 assign_get_post_actions ()
 List the actions that correspond to a post of this module. More...
 
 assign_get_recent_mod_activity (&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0)
 Returns all assignments since a given time. More...
 
 assign_get_user_grades ($assign, $userid=0)
 Return grade for given user or all users. More...
 
 assign_get_view_actions ()
 List the actions that correspond to a view of this module. More...
 
 assign_grade_item_update ($assign, $grades=null)
 Create grade item for given assignment. More...
 
 assign_page_type_list ($pagetype, $parentcontext, $currentcontext)
 Return a list of page types. More...
 
 assign_pluginfile ($course, $cm, context $context, $filearea, $args, $forcedownload, array $options=array())
 Serves intro attachment files. More...
 
 assign_prepare_update_events ($assign, $course=null, $cm=null)
 This actually updates the normal and completion calendar events. More...
 
 assign_print_overview ()
 
 assign_print_recent_activity ($course, $viewfullnames, $timestart)
 Print recent activity from all assignments in a given course. More...
 
 assign_print_recent_mod_activity ($activity, $courseid, $detail, $modnames)
 Print recent activity from all assignments in a given course. More...
 
 assign_process_group_deleted_in_course ($courseid, $groupid=null)
 Logic to happen when a/some group(s) has/have been deleted in a course. More...
 
 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. More...
 
 assign_rescale_activity_grades ($course, $cm, $oldmin, $oldmax, $newmin, $newmax)
 Rescale all grades for this activity and push the new grades to the gradebook. More...
 
 assign_reset_course_form_defaults ($course)
 Course reset form defaults. More...
 
 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. More...
 
 assign_reset_gradebook ($courseid, $type='')
 Removes all grades from gradebook. More...
 
 assign_reset_userdata ($data)
 This function is used by the reset_course_userdata function in moodlelib. More...
 
 assign_scale_used ()
 
 assign_scale_used_anywhere ($scaleid)
 Checks if scale is being used by any instance of assignment. More...
 
 assign_supports ($feature)
 Return the list if Moodle features this module supports. More...
 
 assign_update_events ($assign, $override=null)
 This function updates the events associated to the assign. More...
 
 assign_update_grades ($assign, $userid=0, $nullifnone=true)
 Update activity grades. More...
 
 assign_update_instance (stdClass $data, $form)
 Update an assignment instance. More...
 
 assign_user_complete ($course, $user, $coursemodule, $assign)
 Prints the complete info about a user's interaction with an assignment. More...
 
 assign_user_outline ($course, $user, $coursemodule, $assignment)
 Print the grade information for the assignment for this user. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 mod_assign_core_calendar_is_event_visible (calendar_event $event, $userid=0)
 Is the event visible? More...
 
 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. More...
 
 mod_assign_get_completion_active_rule_descriptions ($cm)
 Callback which returns human-readable strings describing the active completion custom rules for the module instance. More...
 
 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. More...
 
 mod_assign_output_fragment_gradingpanel ($args)
 Serve the grading panel as a fragment. More...
 
 mod_assign_user_preferences ()
 Return a list of all the user preferences used by mod_assign. More...
 
 move_group_override ($id, $move, $assignid)
 Change the sort order of an override. More...
 
 reorder_group_overrides ($assignid)
 Reorder the overrides starting at the override at the given startorder. More...
 
 xmldb_assign_upgrade ($oldversion)
 upgrade this assignment instance - this function could be skipped but it will be needed later More...
 

Variables

 $capabilities
 
global mod_assign\event::$CFG
 
global $CFG
 
 $functions
 
 $logs
 
 $messageproviders
 
 $observers
 
 $plugin = 2020060900
 
 $settings = new admin_settingpage($section, get_string('settings', 'mod_assign'), 'moodle/site:config', $module->is_enabled() === false)
 
 $tasks
 
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_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_MAX_UPGRADE_TIME_SECS 300
 
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 = 2020061501
 

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.

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_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
moodleform$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, null if doesn't know

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

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

◆ $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'
),
)

◆ $tasks

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