Class SloodleCourse

Description

The Sloodle course data class

Located in /lib/course.php (line 25)


	
			
Variable Summary
Method Summary
 SloodleCourse SloodleCourse ()
 bool check_autoenrol ()
 bool check_autoreg ()
 void delete_layout (string $name)
 void disable_autoreg ()
 void enable_autoreg ()
 bool get_autoenrol ()
 bool get_autoreg ()
 mixed get_course_id ()
 string get_full_name ()
 void get_layout ( $layoutid)
 void get_layouts ()
 array|bool get_layout_entries (string $name)
 array|bool get_layout_entries_for_layout_id ( $id, string $name)
 array get_layout_names ()
 string|bool get_loginzone_allocation (SloodleUser $user)
 string get_loginzone_size ()
 string get_short_name ()
 bool is_available ()
 bool is_loaded ()
 bool load (mixed $course)
 bool load_by_controller (mixed $controllerid)
 bool load_user_by_loginzone (string $pos, SloodleUser &$user)
 bool save_layout (string $name, array $entries, [bool $add = false])
 bool save_layout_by_id (string $id, string $name, array $entries, [bool $add = false])
 void set_loginzone_position (string $pos)
 void set_loginzone_position_xyz (float $x, float $y, float $z)
 void set_loginzone_region (string $region)
 void set_loginzone_size (string $size)
 void set_loginzone_size_xyz (float $x, float $y, float $z)
 void set_loginzone_time_updated ([int $timestamp = null])
 bool write ()
Variables
SloodleController $controller = null (line 51)

The SloodleController object being used to access this course, if available.

object $course_object = null (line 36)

The database object of the course to which this object relates.

Corresponds to the "course" table in Moodle. Is null if not yet set

  • access: private
object $sloodle_course_data = null (line 44)

The Sloodle course data object, if it exists.

Is null if not yet set.

Methods
Constructor SloodleCourse (line 59)

Constructor

SloodleCourse SloodleCourse ()
can_user_authorise_objects (line 712)

Checks whether or not the CURRENTLY LOGGED-IN user can authorise objects on this course.

  • return: True if the user has object authorisation permission, or false otherwise.
bool can_user_authorise_objects ()
check_autoenrol (line 161)

Is auto enrolment permitted on this site AND course? Takes into account the site-wide setting as well.

bool check_autoenrol ()
check_autoreg (line 118)

Is auto registration permitted on this site AND course? Takes into account the site-wide setting as well.

bool check_autoreg ()
delete_layout (line 602)

Deletes the named layout.

void delete_layout (string $name)
  • string $name: The name of the layout to delete
delete_loginzone_allocation (line 414)

Deletes any loginzone allocations for the given user If there are multiple for the same user (which there should never be) it will delete them all.

void delete_loginzone_allocation (SloodleUser $user)
  • SloodleUser $user: The user whose allocation is to be deleted
disable_autoenrol (line 192)

Disables auto-enrolment for this course.

NOTE: does not affect the site setting.

void disable_autoenrol ()
disable_autoreg (line 149)

Disables auto-registration for this course.

NOTE: does not affect the site setting.

void disable_autoreg ()
enable_autoenrol (line 182)

Enables auto-enrolment for this course.

NOTE: it may still be disabled at site-level.

void enable_autoenrol ()
enable_autoreg (line 139)

Enables auto-registration for this course.

NOTE: it may still be disabled at site-level.

void enable_autoreg ()
generate_loginzone_allocation (line 330)

Generates a new LoginZone allocation for the specified user.

  • return: A SLurl for the allocation, or false if it was unsuccessful
string|false generate_loginzone_allocation (SloodleUser $user)
  • SloodleUser $user: The user for whom this allocation should be made
get_autoenrol (line 172)

Gets the auto enrolment value for this course only.

(Ignores the site setting).

bool get_autoenrol ()
get_autoreg (line 129)

Gets the autoregistration value for this course only.

(Ignores the site setting).

bool get_autoreg ()
get_course_id (line 78)

Gets the identifier of the course in the VLE.

  • return: Course identifier. Type depends on VLE. (In Moodle, it will be an integer).
mixed get_course_id ()
get_course_object (line 89)

Gets the VLE course object.

WARNING: this should only be used when ABSOLUTELY necessary. The contents are specific to the VLE.

  • return: Type and content depends upon VLE. In Moodle, it is an object representing a record from the 'course' table.
mixed get_course_object ()
get_full_name (line 108)

Gets the full name of this course in the VLE.

  • return: Fullname of this course.
string get_full_name ()
get_layout (line 701)
void get_layout ( $layoutid)
  • $layoutid
get_layouts (line 583)

Gets SloodleLayout objects for all the layouts in the course.

void get_layouts ()
get_layout_entries (line 550)

Gets all the entries in the named layout.

  • return: A numeric array of SloodleLayoutEntry objects if successful, or false if the layout does not exist
array|bool get_layout_entries (string $name)
  • string $name: The name of the layout to query
get_layout_entries_for_layout_id (line 564)

Gets all the entries in the named layout.

  • return: A numeric array of SloodleLayoutEntry objects if successful, or false if the layout does not exist
array|bool get_layout_entries_for_layout_id ( $id, string $name)
  • string $name: The name of the layout to query
  • $id
get_layout_names (line 530)

Gets an array associating layout ID's to names

array get_layout_names ()
get_loginzone_allocation (line 370)

Gets the SLurl for the specified user's loginzone alloation

  • return: The SLurl string if successful, or false if the user has no allocation or the loginzone does not exist
string|bool get_loginzone_allocation (SloodleUser $user)
  • SloodleUser $user: The user whose allocation is to be retrieved
get_loginzone_position (line 217)

Gets the position of the loginzone as a string vector <x,y,z>

string get_loginzone_position ()
get_loginzone_region (line 285)

Gets the region of the loginzone

string get_loginzone_region ()
get_loginzone_size (line 251)

Gets the size of the loginzone as a string vector <x,y,z>

string get_loginzone_size ()
get_loginzone_time_updated (line 306)

Gets the timestamp of the last time the loginzone was updated

int get_loginzone_time_updated ()
get_short_name (line 99)

Gets the short name of this course in the VLE.

  • return: Shortname of this course.
string get_short_name ()
has_loginzone_data (line 423)

Determines whether or not LoginZone data exists for this course.

  • return: True if there is complete data, or false otherwise
bool has_loginzone_data ()
is_available (line 204)

Determines whether or not the course is available.

Checks that the course has not been disabled or hidden etc..

  • return: True if the course is available
bool is_available ()
is_loaded (line 68)

Determines whether or not course data has been loaded.

bool is_loaded ()
load (line 437)

Reads fresh data into the structure from the database.

Fetches Moodle and Sloodle data about the course specified. If necessary, it creates a new Sloodle entry with default settings. Returns true if successful, or false on failure.

bool load (mixed $course)
  • mixed $course: Either a unique course ID, or a course data object. If the former, then VLE course data is read from the database. Otherwise, the data object is used as-is.
load_by_controller (line 490)

Loads course and controller data by the unqiue site-wide identifier of a Sloodle controller.

  • return: True if successful, or false on failure.
bool load_by_controller (mixed $controllerid)
  • mixed $controllerid: The unique site-wide identifier for a Sloodle Controller. (For Moodle, an integer cmi)
load_user_by_loginzone (line 393)

Finds the user identified by LoginZone allocation, and loads it into the given user object.

Note: does not delete the allocation.

  • return: True if successful, or false otherwise
bool load_user_by_loginzone (string $pos, SloodleUser &$user)
  • string $pos: Absolute position vector (relative to sim, not to LoginZone)
  • SloodleUser &$user: The user object which will be manipulated (by reference)
save_layout (line 621)

Save the given entries in the named profile.

  • return: True if successful, or false otherwise
bool save_layout (string $name, array $entries, [bool $add = false])
  • string $name: The name of the layout to query
  • array $entries: A numeric array of SloodleLayoutEntry objects to store
  • bool $add: (Default: false) If true, then the entries will be added to the layout instead of replacing existing entries
save_layout_by_id (line 641)

Save the given entries in the profile specified by id.

  • return: True if successful, or false otherwise
bool save_layout_by_id (string $id, string $name, array $entries, [bool $add = false])
  • string $id: The id of the layout to query. 0 to add a new layout.
  • string $name: The new name of the layout.
  • array $entries: A numeric array of SloodleLayoutEntry objects to store
  • bool $add: (Default: false) If true, then the entries will be added to the layout instead of replacing existing entries
set_loginzone_position (line 229)

Sets the position of the loginzone as a string vector <x,y,z>

  • todo: Update to handle arrays as well
void set_loginzone_position (string $pos)
  • string $pos: A string position vector <x,y,z>
set_loginzone_position_xyz (line 241)

Sets the position of the loginzone as a set of components

void set_loginzone_position_xyz (float $x, float $y, float $z)
  • float $x
  • float $y
  • float $z
set_loginzone_region (line 296)

Sets the region of the loginzone

void set_loginzone_region (string $region)
  • string $region: A string naming a region
set_loginzone_size (line 263)

Sets the size of the loginzone as a string vector <x,y,z>

  • todo: Update to handle arrays as well
void set_loginzone_size (string $size)
  • string $size: A string size vector <x,y,z>
set_loginzone_size_xyz (line 275)

Sets the size of the loginzone as a set of components

void set_loginzone_size_xyz (float $x, float $y, float $z)
  • float $x
  • float $y
  • float $z
set_loginzone_time_updated (line 317)

Sets the timestamp of the last time the loginzone was updated

void set_loginzone_time_updated ([int $timestamp = null])
  • int $timestamp: A unix timestamp. If null, the current timestamp is used
write (line 517)

Writes current Sloodle course data back to the database.

Requires that a course structure has already been retrieved.

  • return: True if successful, or false on failure
bool write ()

Documentation generated on Fri, 17 Jul 2009 11:01:13 +0100 by phpDocumentor 1.4.0