Class SloodleCourse

Description

The Sloodle course data class

Located in /sloodle/lib/course.php (line 27)


	
			
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 ()
 array|bool get_layout_entries (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])
 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 53)

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

object $course_object = null (line 38)

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 46)

The Sloodle course data object, if it exists.

Is null if not yet set.

Methods
Constructor SloodleCourse (line 61)

Constructor

SloodleCourse SloodleCourse ()
can_user_authorise_objects (line 637)

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 163)

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

bool check_autoenrol ()
check_autoreg (line 120)

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

bool check_autoreg ()
delete_layout (line 578)

Deletes the named layout.

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

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 194)

Disables auto-enrolment for this course.

NOTE: does not affect the site setting.

void disable_autoenrol ()
disable_autoreg (line 151)

Disables auto-registration for this course.

NOTE: does not affect the site setting.

void disable_autoreg ()
enable_autoenrol (line 184)

Enables auto-enrolment for this course.

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

void enable_autoenrol ()
enable_autoreg (line 141)

Enables auto-registration for this course.

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

void enable_autoreg ()
generate_loginzone_allocation (line 331)

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 174)

Gets the auto enrolment value for this course only.

(Ignores the site setting).

bool get_autoenrol ()
get_autoreg (line 131)

Gets the autoregistration value for this course only.

(Ignores the site setting).

bool get_autoreg ()
get_course_id (line 80)

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 91)

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 110)

Gets the full name of this course in the VLE.

  • return: Fullname of this course.
string get_full_name ()
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_names (line 531)

Gets an array associating layout ID's to names

array get_layout_names ()
get_loginzone_allocation (line 371)

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 219)

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

string get_loginzone_position ()
get_loginzone_region (line 287)

Gets the region of the loginzone

string get_loginzone_region ()
get_loginzone_size (line 253)

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

string get_loginzone_size ()
get_loginzone_time_updated (line 308)

Gets the timestamp of the last time the loginzone was updated

int get_loginzone_time_updated ()
get_short_name (line 101)

Gets the short name of this course in the VLE.

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

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 206)

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 70)

Determines whether or not course data has been loaded.

bool is_loaded ()
load (line 438)

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 491)

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 394)

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 597)

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
set_loginzone_position (line 231)

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 243)

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 298)

Sets the region of the loginzone

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

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 277)

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 319)

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 518)

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 Mon, 16 Jun 2008 15:56:17 +0100 by phpDocumentor 1.4.0