Search moodle.org's
Developer Documentation


  • Bug fixes for general core bugs in 2.8.x ended 9 November 2015 (12 months).
  • Bug fixes for security issues in 2.8.x ended 9 May 2016 (18 months).
  • minimum PHP 5.4.4 (always use latest PHP 5.4.x or 5.5.x on Windows - http://windows.php.net/download/), PHP 7 is NOT supported
  • Differences Between: [Versions 28 and 29] [Versions 28 and 30] [Versions 28 and 31] [Versions 28 and 32] [Versions 28 and 33] [Versions 28 and 34] [Versions 28 and 35] [Versions 28 and 36] [Versions 28 and 37]

    This file contains the definition for the class assignment This class provides all the functionality for the new assign module.

    Copyright: 2012 NetSpot {@link http://www.netspot.com.au}
    License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
    File Size: 7636 lines (314 kb)
    Included or required: 1 time
    Referenced: 33 times
    Includes or requires: 1 file
     mod/assign/locallib.php

    Defines 2 classes

    assign:: (173 methods):
      __construct()
      register_return_link()
      get_return_action()
      show_intro()
      get_return_params()
      set_instance()
      set_context()
      set_course()
      get_feedback_plugins()
      get_submission_plugins()
      is_blind_marking()
      has_submissions_or_grades()
      get_plugin_by_type()
      get_feedback_plugin_by_type()
      get_submission_plugin_by_type()
      load_plugins()
      view()
      add_instance()
      delete_grades()
      delete_instance()
      reset_userdata()
      update_plugin_instance()
      update_gradebook()
      get_admin_config()
      update_calendar()
      update_instance()
      save_intro_draft_files()
      add_plugin_grade_elements()
      add_plugin_settings()
      add_all_plugin_settings()
      plugin_data_preprocessing()
      get_module_name()
      get_module_name_plural()
      has_instance()
      get_instance()
      get_grade_item()
      get_course_context()
      get_course_module()
      get_context()
      get_course()
      count_attachments()
      has_visible_attachments()
      display_grade()
      list_participants()
      count_teams()
      count_participants()
      count_submissions_need_grading()
      count_grades()
      count_submissions()
      count_submissions_with_status()
      get_grading_userid_list()
      pack_files()
      cron()
      notify_grade_modified()
      update_user_flags()
      update_grade()
      view_grant_extension()
      get_submission_group_members()
      get_submission_group_members_who_have_not_submitted()
      get_group_submission()
      view_course_index()
      view_plugin_page()
      get_submission_group()
      view_plugin_content()
      download_rewrite_pluginfile_urls()
      render_editor_content()
      view_savegrading_result()
      view_quickgrading_result()
      view_footer()
      require_view_submission()
      require_view_grades()
      can_view_grades()
      can_grade()
      download_submissions()
      add_to_log()
      get_renderer()
      get_user_submission()
      get_submission()
      get_user_flags()
      get_user_grade()
      get_grade()
      view_single_grade_page()
      view_reveal_identities_confirm()
      view_return_links()
      view_grading_table()
      view_grading_page()
      plagiarism_print_disclosure()
      view_notices()
      fullname()
      view_edit_submission_page()
      is_graded()
      can_view_group_submission()
      can_view_submission()
      view_plugin_grading_batch_operation()
      process_grading_batch_operation()
      view_batch_set_workflow_state()
      view_batch_markingallocation()
      check_submit_for_grading()
      view_student_summary()
      show_submit_button()
      get_all_grades()
      get_all_submissions()
      view_submission_page()
      convert_grade_for_gradebook()
      convert_submission_for_gradebook()
      gradebook_item_update()
      update_team_submission()
      update_submission()
      submissions_open()
      render_area_files()
      can_edit_submission()
      get_graders()
      get_notifiable_users()
      format_notification_message_text()
      format_notification_message_html()
      send_assignment_notification()
      send_notification()
      notify_student_submission_copied()
      notify_student_submission_receipt()
      notify_graders()
      submit_for_grading()
      process_submit_other_for_grading()
      process_submit_for_grading()
      save_user_extension()
      process_save_extension()
      process_save_quick_grades()
      reveal_identities()
      process_reveal_identities()
      process_save_grading_options()
      format_grade_for_log()
      format_submission_for_log()
      process_copy_previous_attempt()
      copy_previous_attempt()
      submission_empty()
      save_submission()
      process_save_submission()
      grading_disabled()
      get_grading_instance()
      add_grade_form_elements()
      add_plugin_submission_elements()
      is_any_feedback_plugin_enabled()
      is_any_submission_plugin_enabled()
      add_submission_form_elements()
      revert_to_draft()
      process_revert_to_draft()
      lock_submission()
      process_set_batch_marking_workflow_state()
      process_set_batch_marking_allocation()
      process_lock_submission()
      unlock_submission()
      process_unlock_submission()
      apply_grade_to_user()
      process_outcomes()
      reopen_submission_if_required()
      save_grade()
      process_save_grade()
      can_upgrade_assignment()
      can_upgrade()
      copy_area_files_for_upgrade()
      process_add_attempt_group()
      process_add_attempt()
      add_attempt()
      get_user_grades_for_gradebook()
      get_uniqueid_for_user()
      allocate_unique_ids()
      get_uniqueid_for_user_static()
      get_user_id_for_uniqueid()
      get_user_id_for_uniqueid_static()
      get_marking_workflow_states_for_current_user()
      show_only_active_users()
      is_active_user()
      is_gradebook_feedback_enabled()
      get_grading_status()

    assign_portfolio_caller:: (10 methods):
      expected_callbackargs()
      __construct()
      load_data()
      prepare_package()
      get_submission_plugin()
      get_sha1()
      expected_time()
      check_permissions()
      display_name()
      base_supported_formats()


    Class: assign  - X-Ref

    Standard base class for mod_assign (assignment types).

    __construct($coursemodulecontext, $coursemodule, $course)   X-Ref
    Constructor for the base assign class.

    Note: For $coursemodule you can supply a stdclass if you like, but it
    will be more efficient to supply a cm_info object.

    param: mixed $coursemodulecontext context|null the course module context
    param: mixed $coursemodule the current course module if it was already loaded,
    param: mixed $course the current course  if it was already loaded,

    register_return_link($action, $params)   X-Ref
    Set the action and parameters that can be used to return to the current page.

    return: void
    param: string $action The action for the current page
    param: array $params An array of name value pairs which form the parameters

    get_return_action()   X-Ref
    Return an action that can be used to get back to the current page.

    return: string action

    show_intro()   X-Ref
    Based on the current assignment settings should we display the intro.

    return: bool showintro

    get_return_params()   X-Ref
    Return a list of parameters that can be used to get back to the current page.

    return: array params

    set_instance(stdClass $data)   X-Ref
    Set the submitted form data.

    param: stdClass $data The form data (instance)

    set_context(context $context)   X-Ref
    Set the context.

    param: context $context The new context

    set_course(stdClass $course)   X-Ref
    Set the course data.

    param: stdClass $course The course data

    get_feedback_plugins()   X-Ref
    Get list of feedback plugins installed.

    return: array

    get_submission_plugins()   X-Ref
    Get list of submission plugins installed.

    return: array

    is_blind_marking()   X-Ref
    Is blind marking enabled and reveal identities not set yet?

    return: bool

    has_submissions_or_grades()   X-Ref
    Does an assignment have submission(s) or grade(s) already?

    return: bool

    get_plugin_by_type($subtype, $type)   X-Ref
    Get a specific submission plugin by its type.

    return: mixed assign_plugin|null
    param: string $subtype assignsubmission | assignfeedback
    param: string $type

    get_feedback_plugin_by_type($type)   X-Ref
    Get a feedback plugin by type.

    return: mixed assign_feedback_plugin|null
    param: string $type - The type of plugin e.g comments

    get_submission_plugin_by_type($type)   X-Ref
    Get a submission plugin by type.

    return: mixed assign_submission_plugin|null
    param: string $type - The type of plugin e.g comments

    load_plugins($subtype)   X-Ref
    Load the plugins from the sub folders under subtype.

    return: array - The sorted list of plugins
    param: string $subtype - either submission or feedback

    view($action='')   X-Ref
    Display the assignment, used by view.php

    The assignment is displayed differently depending on your role,
    the settings for the assignment and the status of the assignment.

    return: string - The page output.
    param: string $action The current action if any.

    add_instance(stdClass $formdata, $callplugins)   X-Ref
    Add this instance to the database.

    return: mixed false if an error occurs or the int id of the new instance
    param: stdClass $formdata The data submitted from the form
    param: bool $callplugins This is used to skip the plugin code

    delete_grades()   X-Ref
    Delete all grades from the gradebook for this assignment.

    return: bool

    delete_instance()   X-Ref
    Delete this instance from the database.

    return: bool false if an error occurs

    reset_userdata($data)   X-Ref
    Actual implementation of the reset course functionality, delete all the
    assignment submissions for course $data->courseid.

    return: array status array
    param: stdClass $data the data submitted from the reset course.

    update_plugin_instance(assign_plugin $plugin, stdClass $formdata)   X-Ref
    Update the settings for a single plugin.

    return: bool false if an error occurs
    param: assign_plugin $plugin The plugin to update
    param: stdClass $formdata The form data

    update_gradebook($reset, $coursemoduleid)   X-Ref
    Update the gradebook information for this assignment.

    return: bool
    param: bool $reset If true, will reset all grades in the gradbook for this assignment
    param: int $coursemoduleid This is required because it might not exist in the database yet

    get_admin_config()   X-Ref
    Load and cache the admin config for this module.

    return: stdClass the plugin config

    update_calendar($coursemoduleid)   X-Ref
    Update the calendar entries for this assignment.

    return: bool
    param: int $coursemoduleid - Required to pass this in because it might

    update_instance($formdata)   X-Ref
    Update this instance in the database.

    return: bool false if an error occurs
    param: stdClass $formdata - the data submitted from the form

    save_intro_draft_files($formdata)   X-Ref
    Save the attachments in the draft areas.

    param: stdClass $formdata

    add_plugin_grade_elements($grade, MoodleQuickForm $mform, stdClass $data, $userid)   X-Ref
    Add elements in grading plugin form.

    return: void
    param: mixed $grade stdClass|null
    param: MoodleQuickForm $mform
    param: stdClass $data
    param: int $userid - The userid we are grading

    add_plugin_settings(assign_plugin $plugin, MoodleQuickForm $mform, & $pluginsenabled)   X-Ref
    Add one plugins settings to edit plugin form.

    return: void
    param: assign_plugin $plugin The plugin to add the settings from
    param: MoodleQuickForm $mform The form to add the configuration settings to.
    param: array $pluginsenabled A list of form elements to be added to a group.

    add_all_plugin_settings(MoodleQuickForm $mform)   X-Ref
    Add settings to edit plugin form.

    return: void
    param: MoodleQuickForm $mform The form to add the configuration settings to.

    plugin_data_preprocessing(&$defaultvalues)   X-Ref
    Allow each plugin an opportunity to update the defaultvalues
    passed in to the settings form (needed to set up draft areas for
    editor and filemanager elements)

    param: array $defaultvalues

    get_module_name()   X-Ref
    Get the name of the current module.

    return: string the module name (Assignment)

    get_module_name_plural()   X-Ref
    Get the plural name of the current module.

    return: string the module name plural (Assignments)

    has_instance()   X-Ref
    Has this assignment been constructed from an instance?

    return: bool

    get_instance()   X-Ref
    Get the settings for the current instance of this assignment

    return: stdClass The settings

    get_grade_item()   X-Ref
    Get the primary grade item for this assign instance.

    return: stdClass The grade_item record

    get_course_context()   X-Ref
    Get the context of the current course.

    return: mixed context|null The course context

    get_course_module()   X-Ref
    Get the current course module.

    return: cm_info|null The course module or null if not known

    get_context()   X-Ref
    Get context module.

    return: context

    get_course()   X-Ref
    Get the current course.

    return: mixed stdClass|null The course

    count_attachments()   X-Ref
    Count the number of intro attachments.

    return: int

    has_visible_attachments()   X-Ref
    Are there any intro attachments to display?

    return: boolean

    display_grade($grade, $editing, $userid=0, $modified=0)   X-Ref
    Return a grade in user-friendly form, whether it's a scale or not.

    return: string User-friendly representation of grade
    param: mixed $grade int|null
    param: boolean $editing Are we allowing changes to this grade?
    param: int $userid The user id the grade belongs to
    param: int $modified Timestamp from when the grade was last modified

    list_participants($currentgroup, $idsonly)   X-Ref
    Load a list of users enrolled in the current course with the specified permission and group.
    0 for no group.

    return: array List of user records
    param: int $currentgroup
    param: bool $idsonly

    count_teams($activitygroup = 0)   X-Ref
    Load a count of valid teams for this assignment.

    return: int number of valid teams
    param: int $activitygroup Activity active group

    count_participants($currentgroup)   X-Ref
    Load a count of active users enrolled in the current course with the specified permission and group.
    0 for no group.

    return: int number of matching users
    param: int $currentgroup

    count_submissions_need_grading()   X-Ref
    Load a count of active users submissions in the current module that require grading
    This means the submission modification time is more recent than the
    grading modification time and the status is SUBMITTED.

    return: int number of matching submissions

    count_grades()   X-Ref
    Load a count of grades.

    return: int number of grades

    count_submissions($includenew = false)   X-Ref
    Load a count of submissions.

    return: int number of submissions
    param: bool $includenew When true, also counts the submissions with status 'new'.

    count_submissions_with_status($status)   X-Ref
    Load a count of submissions with a specified status.

    return: int number of matching submissions
    param: string $status The submission status - should match one of the constants

    get_grading_userid_list()   X-Ref
    Utility function to get the userid for every row in the grading table
    so the order can be frozen while we iterate it.

    return: array An array of userids

    pack_files($filesforzipping)   X-Ref
    Generate zip file from array of given files.

    return: path of temp file - note this returned file does
    param: array $filesforzipping - array of files to pass into archive_to_pathname.

    cron()   X-Ref
    Finds all assignment notifications that have yet to be mailed out, and mails them.

    Cron function to be run periodically according to the moodle cron.

    return: bool

    notify_grade_modified($grade, $mailedoverride = false)   X-Ref
    Mark in the database that this grade record should have an update notification sent by cron.

    return: bool true for success
    param: stdClass $grade a grade record keyed on id
    param: bool $mailedoverride when true, flag notification to be sent again.

    update_user_flags($flags)   X-Ref
    Update user flags for this user in this assignment.

    return: bool true for success
    param: stdClass $flags a flags record keyed on id

    update_grade($grade, $reopenattempt = false)   X-Ref
    Update a grade in the grade table for the assignment and in the gradebook.

    return: bool true for success
    param: stdClass $grade a grade record keyed on id
    param: bool $reopenattempt If the attempt reopen method is manual, allow another attempt at this assignment.

    view_grant_extension($mform)   X-Ref
    View the grant extension date page.

    Uses url parameters 'userid'
    or from parameter 'selectedusers'

    return: string
    param: moodleform $mform - Used for validation of the submitted data

    get_submission_group_members($groupid, $onlyids, $excludesuspended = false)   X-Ref
    Get a list of the users in the same group as this user.

    return: array The users (possibly id's only)
    param: int $groupid The id of the group whose members we want or 0 for the default group
    param: bool $onlyids Whether to retrieve only the user id's
    param: bool $excludesuspended Whether to exclude suspended users

    get_submission_group_members_who_have_not_submitted($groupid, $onlyids)   X-Ref
    Get a list of the users in the same group as this user that have not submitted the assignment.

    return: array The users (possibly id's only)
    param: int $groupid The id of the group whose members we want or 0 for the default group
    param: bool $onlyids Whether to retrieve only the user id's

    get_group_submission($userid, $groupid, $create, $attemptnumber=-1)   X-Ref
    Load the group submission object for a particular user, optionally creating it if required.

    return: stdClass The submission
    param: int $userid The id of the user whose submission we want
    param: int $groupid The id of the group for this user - may be 0 in which
    param: bool $create If set to true a new submission object will be created in the database
    param: int $attemptnumber - -1 means the latest attempt

    view_course_index()   X-Ref
    View a summary listing of all assignments in the current course.

    return: string

    view_plugin_page()   X-Ref
    View a page rendered by a plugin.

    Uses url parameters 'pluginaction', 'pluginsubtype', 'plugin', and 'id'.

    return: string

    get_submission_group($userid)   X-Ref
    This is used for team assignments to get the group for the specified user.
    If the user is a member of multiple or no groups this will return false

    return: mixed The group or false
    param: int $userid The id of the user whose submission we want

    view_plugin_content($pluginsubtype)   X-Ref
    Display the submission that is used by a plugin.

    Uses url parameters 'sid', 'gid' and 'plugin'.

    return: string
    param: string $pluginsubtype

    download_rewrite_pluginfile_urls($text, $user, $plugin)   X-Ref
    Rewrite plugin file urls so they resolve correctly in an exported zip.

    param: string $text - The replacement text
    param: stdClass $user - The user record
    param: assign_plugin $plugin - The assignment plugin

    render_editor_content($filearea, $submissionid, $plugintype, $editor, $component)   X-Ref
    Render the content in editor that is often used by plugin.

    return: string
    param: string $filearea
    param: int  $submissionid
    param: string $plugintype
    param: string $editor
    param: string $component

    view_savegrading_result($message)   X-Ref
    Display a continue page after grading.

    return: string
    param: string $message - The message to display.

    view_quickgrading_result($message)   X-Ref
    Display a continue page after quickgrading.

    return: string
    param: string $message - The message to display.

    view_footer()   X-Ref
    Display the page footer.

    return: string

    require_view_submission($userid)   X-Ref
    Throw an error if the permissions to view this users submission are missing.

    return: none

    require_view_grades()   X-Ref
    Throw an error if the permissions to view grades in this assignment are missing.

    return: none

    can_view_grades()   X-Ref
    Does this user have view grade or grade permission for this assignment?

    return: bool

    can_grade()   X-Ref
    Does this user have grade permission for this assignment?

    return: bool

    download_submissions()   X-Ref
    Download a zip file of all assignment submissions.

    return: string - If an error occurs, this will contain the error page.

    add_to_log($action = '', $info = '', $url='', $return = false)   X-Ref
    Util function to add a message to the log.

    return: void|array
    param: string $action The current action
    param: string $info A detailed description of the change. But no more than 255 characters.
    param: string $url The url to the assign module instance.
    param: bool $return If true, returns the arguments, else adds to log. The purpose of this is to

    get_renderer()   X-Ref
    Lazy load the page renderer and expose the renderer to plugins.

    return: assign_renderer

    get_user_submission($userid, $create, $attemptnumber=-1)   X-Ref
    Load the submission object for a particular user, optionally creating it if required.

    For team assignments there are 2 submissions - the student submission and the team submission
    All files are associated with the team submission but the status of the students contribution is
    recorded separately.

    return: stdClass The submission
    param: int $userid The id of the user whose submission we want or 0 in which case USER->id is used
    param: bool $create optional - defaults to false. If set to true a new submission object
    param: int $attemptnumber - -1 means the latest attempt

    get_submission($submissionid)   X-Ref
    Load the submission object from it's id.

    return: stdClass The submission
    param: int $submissionid The id of the submission we want

    get_user_flags($userid, $create)   X-Ref
    This will retrieve a user flags object from the db optionally creating it if required.
    The user flags was split from the user_grades table in 2.5.

    return: stdClass The flags record
    param: int $userid The user we are getting the flags for.
    param: bool $create If true the flags record will be created if it does not exist

    get_user_grade($userid, $create, $attemptnumber=-1)   X-Ref
    This will retrieve a grade object from the db, optionally creating it if required.

    return: stdClass The grade record
    param: int $userid The user we are grading
    param: bool $create If true the grade will be created if it does not exist
    param: int $attemptnumber The attempt number to retrieve the grade for. -1 means the latest submission.

    get_grade($gradeid)   X-Ref
    This will retrieve a grade object from the db.

    return: stdClass The grade record
    param: int $gradeid The id of the grade

    view_single_grade_page($mform)   X-Ref
    Print the grading page for a single user submission.

    return: string
    param: moodleform $mform

    view_reveal_identities_confirm()   X-Ref
    Show a confirmation page to make sure they want to release student identities.

    return: string

    view_return_links()   X-Ref
    View a link to go back to the previous page. Uses url parameters returnaction and returnparams.

    return: string

    view_grading_table()   X-Ref
    View the grading table of all submissions for this assignment.

    return: string

    view_grading_page()   X-Ref
    View entire grading page.

    return: string

    plagiarism_print_disclosure()   X-Ref
    Capture the output of the plagiarism plugins disclosures and return it as a string.

    return: string

    view_notices($title, $notices)   X-Ref
    Message for students when assignment submissions have been closed.

    return: string
    param: string $title The page title
    param: array $notices The array of notices to show.

    fullname($user)   X-Ref
    Get the name for a user - hiding their real name if blind marking is on.

    return: string The name.
    param: stdClass $user The user record as required by fullname()

    view_edit_submission_page($mform, $notices)   X-Ref
    View edit submissions page.

    return: string The page output.
    param: moodleform $mform
    param: array $notices A list of notices to display at the top of the

    is_graded($userid)   X-Ref
    See if this assignment has a grade yet.

    return: bool
    param: int $userid

    can_view_group_submission($groupid)   X-Ref
    Perform an access check to see if the current $USER can view this group submission.

    return: bool
    param: int $groupid

    can_view_submission($userid)   X-Ref
    Perform an access check to see if the current $USER can view this users submission.

    return: bool
    param: int $userid

    view_plugin_grading_batch_operation($mform)   X-Ref
    Allows the plugin to show a batch grading operation page.

    return: none
    param: moodleform $mform

    process_grading_batch_operation(& $mform)   X-Ref
    Ask the user to confirm they want to perform this batch operation

    return: string - the page to view after processing these actions
    param: moodleform $mform Set to a grading batch operations form

    view_batch_set_workflow_state($mform)   X-Ref
    Shows a form that allows the workflow state for selected submissions to be changed.

    return: string - the page to view after processing these actions
    param: moodleform $mform Set to a grading batch operations form

    view_batch_markingallocation($mform)   X-Ref
    Shows a form that allows the allocated marker for selected submissions to be changed.

    return: string - the page to view after processing these actions
    param: moodleform $mform Set to a grading batch operations form

    check_submit_for_grading($mform)   X-Ref
    Ask the user to confirm they want to submit their work for grading.

    return: string
    param: moodleform $mform - null unless form validation has failed

    view_student_summary($user, $showlinks)   X-Ref
    Print 2 tables of information with no action links -
    the submission summary and the grading summary.

    return: string - the html summary
    param: stdClass $user the user to print the report for
    param: bool $showlinks - Return plain text or links to the profile

    show_submit_button($submission = null, $teamsubmission = null)   X-Ref
    Returns true if the submit subsission button should be shown to the user.

    return: bool
    param: stdClass $submission The users own submission record.
    param: stdClass $teamsubmission The users team submission record if there is one

    get_all_grades($userid)   X-Ref
    Get the grades for all previous attempts.
    For each grade - the grader is a full user record,
    and gradefordisplay is added (rendered from grading manager).

    return: array $grades All grade records for this user.
    param: int $userid If not set, $USER->id will be used.

    get_all_submissions($userid)   X-Ref
    Get the submissions for all previous attempts.

    return: array $submissions All submission records for this user (or group).
    param: int $userid If not set, $USER->id will be used.

    view_submission_page()   X-Ref
    View submissions page (contains details of current submission).

    return: string

    convert_grade_for_gradebook(stdClass $grade)   X-Ref
    Convert the final raw grade(s) in the grading table for the gradebook.

    return: array
    param: stdClass $grade

    convert_submission_for_gradebook(stdClass $submission)   X-Ref
    Convert submission details for the gradebook.

    return: array
    param: stdClass $submission

    gradebook_item_update($submission=null, $grade=null)   X-Ref
    Update grades in the gradebook.

    return: bool
    param: mixed $submission stdClass|null
    param: mixed $grade stdClass|null

    update_team_submission(stdClass $submission, $userid, $updatetime)   X-Ref
    Update team submission.

    return: bool
    param: stdClass $submission
    param: int $userid
    param: bool $updatetime

    update_submission(stdClass $submission, $userid, $updatetime, $teamsubmission)   X-Ref
    Update grades in the gradebook based on submission time.

    return: bool
    param: stdClass $submission
    param: int $userid
    param: bool $updatetime
    param: bool $teamsubmission

    submissions_open($userid = 0,$skipenrolled = false,$submission = false,$flags = false,$gradinginfo = false)   X-Ref
    Is this assignment open for submissions?

    Check the due date,
    prevent late submissions,
    has this person already submitted,
    is the assignment locked?

    return: bool
    param: int $userid - Optional userid so we can see if a different user can submit
    param: bool $skipenrolled - Skip enrollment checks (because they have been done already)
    param: stdClass $submission - Pre-fetched submission record (or false to fetch it)
    param: stdClass $flags - Pre-fetched user flags record (or false to fetch it)
    param: stdClass $gradinginfo - Pre-fetched user gradinginfo record (or false to fetch it)

    render_area_files($component, $area, $submissionid)   X-Ref
    Render the files in file area.

    return: string
    param: string $component
    param: string $area
    param: int $submissionid

    can_edit_submission($userid, $graderid = 0)   X-Ref
    Capability check to make sure this grader can edit this submission.

    return: bool
    param: int $userid - The user whose submission is to be edited
    param: int $graderid (optional) - The user who will do the editing (default to $USER->id).

    get_graders($userid)   X-Ref
    Returns a list of teachers that should be grading given submission.

    return: array
    param: int $userid The submission to grade

    get_notifiable_users($userid)   X-Ref
    Returns a list of users that should receive notification about given submission.

    return: array
    param: int $userid The submission to grade

    format_notification_message_text($messagetype,$info,$course,$context,$modulename,$assignmentname)   X-Ref
    Format a notification for plain text.

    param: string $messagetype
    param: stdClass $info
    param: stdClass $course
    param: stdClass $context
    param: string $modulename
    param: string $assignmentname

    format_notification_message_html($messagetype,$info,$course,$context,$modulename,$coursemodule,$assignmentname)   X-Ref
    Format a notification for HTML.

    param: string $messagetype
    param: stdClass $info
    param: stdClass $course
    param: stdClass $context
    param: string $modulename
    param: stdClass $coursemodule
    param: string $assignmentname

    send_assignment_notification($userfrom,$userto,$messagetype,$eventtype,$updatetime,$coursemodule,$context,$course,$modulename,$assignmentname,$blindmarking,$uniqueidforuser)   X-Ref
    Message someone about something (static so it can be called from cron).

    return: void
    param: stdClass $userfrom
    param: stdClass $userto
    param: string $messagetype
    param: string $eventtype
    param: int $updatetime
    param: stdClass $coursemodule
    param: stdClass $context
    param: stdClass $course
    param: string $modulename
    param: string $assignmentname
    param: bool $blindmarking
    param: int $uniqueidforuser

    send_notification($userfrom,$userto,$messagetype,$eventtype,$updatetime)   X-Ref
    Message someone about something.

    return: void
    param: stdClass $userfrom
    param: stdClass $userto
    param: string $messagetype
    param: string $eventtype
    param: int $updatetime

    notify_student_submission_copied(stdClass $submission)   X-Ref
    Notify student upon successful submission copy.

    return: void
    param: stdClass $submission

    notify_student_submission_receipt(stdClass $submission)   X-Ref
    Notify student upon successful submission.

    return: void
    param: stdClass $submission

    notify_graders(stdClass $submission)   X-Ref
    Send notifications to graders upon student submissions.

    return: void
    param: stdClass $submission

    submit_for_grading($data, $notices)   X-Ref
    Submit a submission for grading.

    return: bool Return false if the submission was not submitted.
    param: stdClass $data - The form data
    param: array $notices - List of error messages to display on an error condition.

    process_submit_other_for_grading($mform, $notices)   X-Ref
    A students submission is submitted for grading by a teacher.

    return: bool

    process_submit_for_grading($mform, $notices)   X-Ref
    Assignment submission is processed before grading.

    return: bool Return false if the validation fails. This affects which page is displayed next.
    param: moodleform|null $mform If validation failed when submitting this form - this is the moodleform.

    save_user_extension($userid, $extensionduedate)   X-Ref
    Save the extension date for a single user.

    return: boolean
    param: int $userid The user id
    param: mixed $extensionduedate Either an integer date or null

    process_save_extension(& $mform)   X-Ref
    Save extension date.

    return: boolean
    param: moodleform $mform The submitted form

    process_save_quick_grades()   X-Ref
    Save quick grades.

    return: string The result of the save operation

    reveal_identities()   X-Ref
    Reveal student identities to markers (and the gradebook).

    return: void

    process_reveal_identities()   X-Ref
    Reveal student identities to markers (and the gradebook).

    return: void

    process_save_grading_options()   X-Ref
    Save grading options.

    return: void

    format_grade_for_log(stdClass $grade)   X-Ref
    Take a grade object and print a short summary for the log file.
    The size limit for the log file is 255 characters, so be careful not
    to include too much information.

    return: string
    param: stdClass $grade

    format_submission_for_log(stdClass $submission)   X-Ref
    Take a submission object and print a short summary for the log file.
    The size limit for the log file is 255 characters, so be careful not
    to include too much information.

    return: string
    param: stdClass $submission

    process_copy_previous_attempt(&$notices)   X-Ref
    Require a valid sess key and then call copy_previous_attempt.

    return: bool
    param: array $notices Any error messages that should be shown

    copy_previous_attempt(&$notices)   X-Ref
    Copy the current assignment submission from the last submitted attempt.

    return: bool
    param: array $notices Any error messages that should be shown

    submission_empty($submission)   X-Ref
    Determine if the current submission is empty or not.

    return: bool
    param: submission $submission the students submission record to check.

    save_submission(stdClass $data, & $notices)   X-Ref
    Save assignment submission for the current user.

    return: bool
    param: stdClass $data
    param: array $notices Any error messages that should be shown

    process_save_submission(&$mform, &$notices)   X-Ref
    Save assignment submission.

    return: bool
    param: moodleform $mform
    param: array $notices Any error messages that should be shown

    grading_disabled($userid, $checkworkflow=true)   X-Ref
    Determine if this users grade can be edited.

    return: bool $gradingdisabled
    param: int $userid - The student userid
    param: bool $checkworkflow - whether to include a check for the workflow state.

    get_grading_instance($userid, $grade, $gradingdisabled)   X-Ref
    Get an instance of a grading form if advanced grading is enabled.
    This is specific to the assignment, marker and student.

    return: mixed gradingform_instance|null $gradinginstance
    param: int $userid - The student userid
    param: stdClass|false $grade - The grade record
    param: bool $gradingdisabled

    add_grade_form_elements(MoodleQuickForm $mform, stdClass $data, $params)   X-Ref
    Add elements to grade form.

    return: void
    param: MoodleQuickForm $mform
    param: stdClass $data
    param: array $params

    add_plugin_submission_elements($submission,MoodleQuickForm $mform,stdClass $data,$userid)   X-Ref
    Add elements in submission plugin form.

    return: void
    param: mixed $submission stdClass|null
    param: MoodleQuickForm $mform
    param: stdClass $data
    param: int $userid The current userid (same as $USER->id)

    is_any_feedback_plugin_enabled()   X-Ref
    Check if feedback plugins installed are enabled.

    return: bool

    is_any_submission_plugin_enabled()   X-Ref
    Check if submission plugins installed are enabled.

    return: bool

    add_submission_form_elements(MoodleQuickForm $mform, stdClass $data)   X-Ref
    Add elements to submission form.

    return: void
    param: MoodleQuickForm $mform
    param: stdClass $data

    revert_to_draft($userid)   X-Ref
    Revert to draft.

    return: boolean
    param: int $userid

    process_revert_to_draft($userid = 0)   X-Ref
    Revert to draft.
    Uses url parameter userid if userid not supplied as a parameter.

    return: boolean
    param: int $userid

    lock_submission($userid)   X-Ref
    Prevent student updates to this submission

    return: bool
    param: int $userid

    process_set_batch_marking_workflow_state()   X-Ref
    Set the workflow state for multiple users

    return: void

    process_set_batch_marking_allocation()   X-Ref
    Set the marking allocation for multiple users

    return: void

    process_lock_submission($userid = 0)   X-Ref
    Prevent student updates to this submission.
    Uses url parameter userid.

    return: void
    param: int $userid

    unlock_submission($userid)   X-Ref
    Unlock the student submission.

    return: bool
    param: int $userid

    process_unlock_submission($userid = 0)   X-Ref
    Unlock the student submission.
    Uses url parameter userid.

    return: bool
    param: int $userid

    apply_grade_to_user($formdata, $userid, $attemptnumber)   X-Ref
    Apply a grade from a grading form to a user (may be called multiple times for a group submission).

    return: void
    param: stdClass $formdata - the data from the form
    param: int $userid - the user to apply the grade to
    param: int $attemptnumber - The attempt number to apply the grade to.

    process_outcomes($userid, $formdata, $sourceuserid = null)   X-Ref
    Save outcomes submitted from grading form.

    param: int $userid
    param: stdClass $formdata
    param: int $sourceuserid The user ID under which the outcome data is accessible. This is relevant

    reopen_submission_if_required($userid, $submission, $addattempt)   X-Ref
    If the requirements are met - reopen the submission for another attempt.
    Only call this function when grading the latest attempt.

    return: bool - true if another attempt was added.
    param: int $userid The userid.
    param: stdClass $submission The submission (may be a group submission).
    param: bool $addattempt - True if the "allow another attempt" checkbox was checked.

    save_grade($userid, $data)   X-Ref
    Save grade update.

    return: bool - was the grade saved
    param: int $userid
    param: stdClass $data

    process_save_grade(&$mform)   X-Ref
    Save grade.

    return: bool - was the grade saved
    param: moodleform $mform

    can_upgrade_assignment($type, $version)   X-Ref
    This function is a static wrapper around can_upgrade.

    return: bool
    param: string $type The plugin type
    param: int $version The plugin version

    can_upgrade($type, $version)   X-Ref
    This function returns true if it can upgrade an assignment from the 2.2 module.

    return: bool
    param: string $type The plugin type
    param: int $version The plugin version

    copy_area_files_for_upgrade($oldcontextid,$oldcomponent,$oldfilearea,$olditemid,$newcontextid,$newcomponent,$newfilearea,$newitemid)   X-Ref
    Copy all the files from the old assignment files area to the new one.
    This is used by the plugin upgrade code.

    return: int The number of files copied
    param: int $oldcontextid The old assignment context id
    param: int $oldcomponent The old assignment component ('assignment')
    param: int $oldfilearea The old assignment filearea ('submissions')
    param: int $olditemid The old submissionid (can be null e.g. intro)
    param: int $newcontextid The new assignment context id
    param: int $newcomponent The new assignment component ('assignment')
    param: int $newfilearea The new assignment filearea ('submissions')
    param: int $newitemid The new submissionid (can be null e.g. intro)

    process_add_attempt_group($useridlist)   X-Ref
    Add a new attempt for each user in the list - but reopen each group assignment
    at most 1 time.

    return: bool
    param: array $useridlist Array of userids to reopen.

    process_add_attempt($userid)   X-Ref
    Check for a sess key and then call add_attempt.

    return: bool - true if successful.
    param: int $userid int The user to add the attempt for

    add_attempt($userid)   X-Ref
    Add a new attempt for a user.

    return: bool - true if successful.
    param: int $userid int The user to add the attempt for

    get_user_grades_for_gradebook($userid)   X-Ref
    Get an upto date list of user grades and feedback for the gradebook.

    return: array of grade data formated for the gradebook api
    param: int $userid int or 0 for all users

    get_uniqueid_for_user($userid)   X-Ref
    Call the static version of this function

    return: int The unique id
    param: int $userid The userid to lookup

    allocate_unique_ids($assignid)   X-Ref
    Foreach participant in the course - assign them a random id.

    param: int $assignid The assignid to lookup

    get_uniqueid_for_user_static($assignid, $userid)   X-Ref
    Lookup this user id and return the unique id for this assignment.

    return: int The unique id
    param: int $assignid The assignment id
    param: int $userid The userid to lookup

    get_user_id_for_uniqueid($uniqueid)   X-Ref
    Call the static version of this function.

    return: int The user id or false if they don't exist
    param: int $uniqueid The uniqueid to lookup

    get_user_id_for_uniqueid_static($assignid, $uniqueid)   X-Ref
    Lookup this unique id and return the user id for this assignment.

    return: int The user id or false if they don't exist
    param: int $assignid The id of the assignment this user mapping is in
    param: int $uniqueid The uniqueid to lookup

    get_marking_workflow_states_for_current_user()   X-Ref
    Get the list of marking_workflow states the current user has permission to transition a grade to.

    return: array of state => description

    show_only_active_users()   X-Ref
    Check is only active users in course should be shown.

    return: bool true if only active users should be shown.

    is_active_user($userid)   X-Ref
    Return true is user is active user in course else false

    return: bool true is user is active in course.
    param: int $userid

    is_gradebook_feedback_enabled()   X-Ref
    Returns true if gradebook feedback plugin is enabled

    return: bool true if gradebook feedback plugin is enabled and visible else false.

    get_grading_status($userid)   X-Ref
    Returns the grading status.

    return: string returns the grading status
    param: int $userid the user id

    Class: assign_portfolio_caller  - X-Ref

    Portfolio caller class for mod_assign.

    expected_callbackargs()   X-Ref
    Callback arg for a single file export.


    __construct($callbackargs)   X-Ref
    The constructor.

    param: array $callbackargs

    load_data()   X-Ref
    Load data needed for the portfolio export.

    If the assignment type implements portfolio_load_data(), the processing is delegated
    to it. Otherwise, the caller must provide either fileid (to export single file) or
    submissionid and filearea (to export all data attached to the given submission file area)
    via callback arguments.


    prepare_package()   X-Ref
    Prepares the package up before control is passed to the portfolio plugin.

    return: mixed

    get_submission_plugin()   X-Ref
    Fetch the plugin by its type.

    return: assign_submission_plugin

    get_sha1()   X-Ref
    Calculate a sha1 has of either a single file or a list
    of files based on the data set by load_data.

    return: string

    expected_time()   X-Ref
    Calculate the time to transfer either a single file or a list
    of files based on the data set by load_data.

    return: int

    check_permissions()   X-Ref
    Checking the permissions.

    return: bool

    display_name()   X-Ref
    Display a module name.

    return: string

    base_supported_formats()   X-Ref
    Return array of formats supported by this portfolio call back.

    return: array

    Search This Site: