Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/assignment/lib.php File Reference

Go to the source code of this file.

Data Structures

class  assignment_base
class  mod_assignment_grading_form

Namespaces

namespace  mod
 

Local Library of functions for module scorm.


Enumerations

enum  ASSIGNMENT_COUNT_WORDS
enum  ASSIGNMENT_COUNT_LETTERS

Functions

 assignment_delete_instance ($id)
 OTHER STANDARD FUNCTIONS ////////////////////////////////////////////////////////.
 assignment_update_instance ($assignment)
 assignment_add_instance ($assignment)
 assignment_user_outline ($course, $user, $mod, $assignment)
 assignment_user_complete ($course, $user, $mod, $assignment)
 assignment_cron ()
 assignment_get_user_grades ($assignment, $userid=0)
 assignment_update_grades ($assignment, $userid=0, $nullifnone=true)
 assignment_upgrade_grades ()
 assignment_grade_item_update ($assignment, $grades=NULL)
 assignment_grade_item_delete ($assignment)
 assignment_get_participants ($assignmentid)
 assignment_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload)
 assignment_scale_used ($assignmentid, $scaleid)
 assignment_scale_used_anywhere ($scaleid)
 assignment_refresh_events ($courseid=0)
 assignment_print_recent_activity ($course, $viewfullnames, $timestart)
 assignment_get_recent_mod_activity (&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0)
 assignment_print_recent_mod_activity ($activity, $courseid, $detail, $modnames)
 assignment_log_info ($log)
 GENERIC SQL FUNCTIONS.
 assignment_get_unmailed_submissions ($starttime, $endtime)
 assignment_count_real_submissions ($cm, $groupid=0)
 assignment_get_all_submissions ($assignment, $sort="", $dir="DESC")
 assignment_get_coursemodule_info ($coursemodule)
 assignment_types ()
 OTHER GENERAL FUNCTIONS FOR ASSIGNMENTS ///////////////////////////////////////.
 assignment_print_overview ($courses, &$htmlarray)
 assignment_display_lateness ($timesubmitted, $timedue)
 assignment_get_view_actions ()
 assignment_get_post_actions ()
 assignment_get_types ()
 assignment_reset_gradebook ($courseid, $type='')
 assignment_reset_userdata ($data)
 assignment_reset_course_form_definition (&$mform)
 assignment_reset_course_form_defaults ($course)
 assignment_get_extra_capabilities ()
 assignment_supports ($feature)
 assignment_extend_settings_navigation (settings_navigation $settings, navigation_node $assignmentnode)
 assignment_pack_files ($filesforzipping)
 assignment_get_file_areas ($course, $cm, $context)
 mod_assignment_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename)
 assignment_page_type_list ($pagetype, $parentcontext, $currentcontext)
 assignment_grading_areas_list ()

Enumeration Type Documentation

ASSIGNMENT_COUNT_LETTERS = 2

Definition at line 38 of file lib.php.

Include eventslib.php Include formslib.php Include calendar/lib.php ASSIGNMENT_COUNT_WORDS = 1

Definition at line 36 of file lib.php.


Function Documentation

assignment_add_instance ( assignment)

Adds an assignment instance

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

Definition at line 2687 of file lib.php.

Here is the call graph for this function:

assignment_count_real_submissions ( cm,
groupid = 0 
)

Counts all real assignment submissions by ENROLLED students (not empty ones)

There are also assignment type methods count_real_submissions() which in the default implementation simply call this function.

Parameters:
$groupidint optional If nonzero then count is restricted to this group
Returns:
int The number of submissions

Definition at line 3473 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Function to be run periodically according to the moodle cron

Finds all assignment notifications that have yet to be mailed out, and mails them

first execute all crons in plugins

Notices older than 1 day will not be mailed. This is to avoid the problem where cron has not been running for a long time, and then suddenly people are flooded with mail from the past few weeks or months

One day earlier

Override the language and timezone of the "current" user, so that mail is customised for the receiver.

Hold mail notification for hidden assignments until later

Definition at line 2745 of file lib.php.

Here is the call graph for this function:

OTHER STANDARD FUNCTIONS ////////////////////////////////////////////////////////.

Deletes an assignment instance

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

Definition at line 2642 of file lib.php.

Here is the call graph for this function:

assignment_display_lateness ( timesubmitted,
timedue 
)

Definition at line 3726 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Adds module specific settings to the settings block

Parameters:
settings_navigation$settingsThe settings navigation object
navigation_node$assignmentnodeThe node to add module settings to

Definition at line 3889 of file lib.php.

Here is the call graph for this function:

assignment_get_all_submissions ( assignment,
sort = "",
dir = "DESC" 
)

Return all assignment submissions by ENROLLED students (even empty)

There are also assignment type methods get_submissions() wich in the default implementation simply call this function.

Parameters:
$sortstring optional field names for the ORDER BY in the sql query
$dirstring optional specifying the sort direction, defaults to DESC
Returns:
array The submission objects indexed by id

Return all assignment submissions by ENROLLED students (even empty)

Definition at line 3513 of file lib.php.

Here is the caller graph for this function:

assignment_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:
$coursemoduleobject The coursemodule object (record).
Returns:
cached_cm_info An object on information that the courses will know about (most noticeably, an icon).

Definition at line 3549 of file lib.php.

Here is the call graph for this function:

Returns all other caps used in module

Definition at line 3857 of file lib.php.

assignment_get_file_areas ( course,
cm,
context 
)

Lists all file areas current user may browse

Parameters:
object$course
object$cm
object$context
Returns:
array

Definition at line 3948 of file lib.php.

Here is the call graph for this function:

assignment_get_participants ( assignmentid)

Returns the users with data in one assignment (students and teachers)

Todo:
: deprecated - to be deleted in 2.2
Parameters:
$assignmentidint
Returns:
array of user objects

Definition at line 3012 of file lib.php.

Definition at line 3744 of file lib.php.

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

Returns all assignments since a given time in specified forum.

Definition at line 3257 of file lib.php.

Here is the call graph for this function:

Drop-in extra assignment types

Definition at line 3748 of file lib.php.

Here is the call graph for this function:

assignment_get_unmailed_submissions ( starttime,
endtime 
)

Return list of marked submissions that have not been mailed out for currently enrolled students

Returns:
array

Definition at line 3453 of file lib.php.

Here is the caller graph for this function:

assignment_get_user_grades ( assignment,
userid = 0 
)

Return grade for given user or all users.

Parameters:
int$assignmentidid of assignment
int$useridoptional user id, 0 means all users
Returns:
array array of grades, false if none

Definition at line 2873 of file lib.php.

Here is the caller graph for this function:

Definition at line 3740 of file lib.php.

assignment_grade_item_delete ( assignment)

Delete grade item for given assignment

Parameters:
object$assignmentobject
Returns:
object assignment

Definition at line 2993 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

assignment_grade_item_update ( assignment,
grades = NULL 
)

Create grade item for given assignment

Parameters:
object$assignmentobject with extra cmidnumber
mixedoptional array/object of grade(s); 'reset' means reset grades in gradebook
Returns:
int 0 if ok, error code otherwise

Definition at line 2956 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Lists all gradable areas for the advanced grading methods gramework

Returns:
array

Definition at line 4015 of file lib.php.

assignment_log_info ( log)

GENERIC SQL FUNCTIONS.

Fetch info from logs

Parameters:
$logobject with properties ->info (the assignment id) and ->userid
Returns:
array with assignment name and user firstname and lastname

Definition at line 3440 of file lib.php.

assignment_pack_files ( filesforzipping)

generate zip file from array of given files

Parameters:
array$filesforzipping- array of files to pass into archive_to_pathname
Returns:
path of temp file - note this returned file does not have a .zip extension - it is a temp file.

Definition at line 3928 of file lib.php.

Here is the caller graph for this function:

assignment_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

Definition at line 4001 of file lib.php.

assignment_pluginfile ( course,
cm,
context,
filearea,
args,
forcedownload 
)

Serves assignment submissions and other files.

Parameters:
object$course
object$cm
object$context
string$filearea
array$args
bool$forcedownload
Returns:
bool false if file not found, does not return if found - just send the file

Definition at line 3049 of file lib.php.

Here is the call graph for this function:

assignment_print_overview ( courses,
&$  htmlarray 
)

Definition at line 3602 of file lib.php.

Here is the call graph for this function:

assignment_print_recent_activity ( course,
viewfullnames,
timestart 
)

Print recent activity from all assignments in a given course

This is used by the recent activity block

Definition at line 3164 of file lib.php.

Here is the call graph for this function:

assignment_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

Definition at line 3399 of file lib.php.

Here is the call graph for this function:

assignment_refresh_events ( courseid = 0)

Make sure up-to-date events are created for all assignment instances

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. This function is used, in its new format, by restore_refresh_events()

Parameters:
$courseidint optional If zero then all assignments for all courses are covered
Returns:
boolean Always returns true

Definition at line 3119 of file lib.php.

Here is the call graph for this function:

Course reset form defaults.

Definition at line 3850 of file lib.php.

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

Parameters:
$mformform passed by reference

Definition at line 3842 of file lib.php.

assignment_reset_gradebook ( courseid,
type = '' 
)

Removes all grades from gradebook

Parameters:
int$courseid
stringoptional type

Definition at line 3796 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

This function is used by the reset_course_userdata function in moodlelib. This function will remove all posts from the specified assignment and clean up any related data.

Parameters:
$datathe data submitted from the reset course.
Returns:
array status array

Definition at line 3823 of file lib.php.

Here is the call graph for this function:

assignment_scale_used ( assignmentid,
scaleid 
)

Checks if a scale is being used by an assignment

This is used by the backup code to decide whether to back up a scale

Parameters:
$assignmentidint
$scaleidint
Returns:
boolean True if the scale is used by the assignment

Definition at line 3076 of file lib.php.

Checks if scale is being used by any instance of assignment

This is used to find out if scale used anywhere

Parameters:
$scaleidint
Returns:
boolean True if the scale is used by any assignment

Definition at line 3097 of file lib.php.

assignment_supports ( feature)
Parameters:
string$featureFEATURE_xx constant for requested feature
Returns:
mixed True if module supports feature, null if doesn't know

Definition at line 3865 of file lib.php.

OTHER GENERAL FUNCTIONS FOR ASSIGNMENTS ///////////////////////////////////////.

Returns an array of installed assignment types indexed and sorted by name

Returns:
array The index is the name of the assignment type, the value its full name from the language strings

Definition at line 3587 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

assignment_update_grades ( assignment,
userid = 0,
nullifnone = true 
)

Update activity grades

Parameters:
object$assignment
int$useridspecific user only, 0 means all

Definition at line 2899 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

assignment_update_instance ( assignment)

Updates an assignment instance

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

Definition at line 2670 of file lib.php.

Here is the call graph for this function:

Update all grades in gradebook.

Definition at line 2922 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

assignment_user_complete ( course,
user,
mod,
assignment 
)

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

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

Definition at line 2724 of file lib.php.

Here is the call graph for this function:

assignment_user_outline ( course,
user,
mod,
assignment 
)

Returns an outline of a user interaction with an assignment

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

Definition at line 2704 of file lib.php.

Here is the call graph for this function:

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

File browsing support for assignment module.

Parameters:
file_browser$browser
array$areas
stdClass$course
cm_info$cm
context$context
string$filearea
int$itemid
string$filepath
string$filename
Returns:
file_info_stored file_info_stored instance or null if not found

Definition at line 3970 of file lib.php.

Here is the call graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations