File/lib.php

Description

Sloodle module core library functionality.

This script is required by Moodle to contain certain key functionality for the module.

Functions
sloodle_add_instance (line 86)

Given an object containing all the necessary data, (defined by the form in mod.html) this function will create a new instance and return the id number of the new instance.

Note: this function is not yet used by Sloodle. Will hopefully be used in version 0.3!

  • return: The id of the newly inserted sloodle record
int sloodle_add_instance ( $sloodle, object $instance)
  • object $instance: An object from the form in mod.html
  • $sloodle
sloodle_cron (line 168)

Function to be run periodically according to the moodle cron This function searches for things that need to be done, such as sending out mail, toggling flags etc ...

  • todo: Finish documenting this function
  • uses: $CFG
boolean sloodle_cron ()
sloodle_delete_instance (line 114)

Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.

Note: this function is not yet used by Sloodle. Will hopefully be used in version 0.3!

  • return: Success/Failure
boolean sloodle_delete_instance (int $id)
  • int $id: Id of the module instance
sloodle_get_participants (line 200)

Must return an array of user records (all data) who are participants for a given instance of sloodle. Must include every user involved in the instance, independient of his role (student, teacher, admin...) See other modules as example.

  • return: boolean/array of students
mixed sloodle_get_participants (int $sloodleid)
  • int $sloodleid: ID of an instance of this module
sloodle_grades (line 187)

Must return an array of grades for a given instance of this module, indexed by user. It also returns a maximum allowed grade.

Example: $return->grades = array of grades; $return->maxgrade = maximum allowed grade;

return $return;

  • return: Null or object with an array of grades and with the maximum grade
mixed sloodle_grades (int $sloodleid)
  • int $sloodleid: ID of an instance of this module
sloodle_print_recent_activity (line 153)

Given a course and a time, this module should find recent activity that has occurred in sloodle activities and print it out.

Return true if there was output, or false is there was none.

  • todo: Finish documenting this function
  • uses: $CFG
boolean sloodle_print_recent_activity ( $course,  $isteacher,  $timestart)
  • $course
  • $isteacher
  • $timestart
sloodle_process_options (line 19)
void sloodle_process_options ( &$config)
  • &$config
sloodle_scale_used (line 214)

This function returns if a scale is being used by one sloodle it it has support for grading and scales. Commented code should be modified if necessary. See forum, glossary or journal modules as reference.

  • todo: Finish documenting this function
mixed sloodle_scale_used (int $sloodleid,  $scaleid)
  • int $sloodleid: ID of an instance of this module
  • $scaleid
sloodle_update_instance (line 100)

Given an object containing all the necessary data, (defined by the form in mod.html) this function will update an existing instance with new data.

Note: this function is not yet used by Sloodle. Will hopefully be used in version 0.3!

  • return: Success/Fail
boolean sloodle_update_instance ( $sloodle, object $instance)
  • object $instance: An object from the form in mod.html
  • $sloodle
sloodle_user_complete (line 140)

Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports.

  • todo: Finish documenting this function
boolean sloodle_user_complete ( $course,  $user,  $mod,  $sloodle)
  • $course
  • $user
  • $mod
  • $sloodle
sloodle_user_outline (line 129)

Return a small object with summary information about what a user has done with a given particular instance of this module Used for user activity reports.

$return->time = the time they did it $return->info = a short text description

  • todo: Finish documenting this function
null sloodle_user_outline ( $course,  $user,  $mod,  $sloodle)
  • $course
  • $user
  • $mod
  • $sloodle

Documentation generated on Tue, 04 Mar 2008 15:08:34 +0000 by phpDocumentor 1.4.0