dokeos-learnpath
[ class tree: dokeos-learnpath ] [ index: dokeos-learnpath ] [ all elements ]

Class: learnpath

Source Location: /main/newscorm/learnpath.class.php

Class Overview


Defines the learnpath parent class


Variables

Methods


Child classes:

aicc
Defines the learnpath parent class
OpenofficeDocument
Defines the "OpenofficeDocument" child of class "learnpath"
scorm
Defines the learnpath parent class

Class Details

[line 13]
Defines the learnpath parent class



[ Top ]


Class Variables

$arrMenu = array()

[line 60]


Type:   mixed


[ Top ]

$attempt =  0

[line 15]


Type:   mixed


[ Top ]

$cc =

[line 16]


Type:   mixed


[ Top ]

$current =

[line 17]


Type:   mixed


[ Top ]

$current_score =

[line 18]


Type:   mixed


[ Top ]

$current_time_start =

[line 19]


Type:   mixed


[ Top ]

$current_time_stop =

[line 20]


Type:   mixed


[ Top ]

$debug =  0

[line 62]


Type:   mixed


[ Top ]

$default_status =  'not attempted'

[line 21]


Type:   mixed


[ Top ]

$encoding =  'ISO-8859-1'

[line 22]


Type:   mixed


[ Top ]

$error =  ''

[line 23]


Type:   mixed


[ Top ]

$extra_information =  ''

[line 24]


Type:   mixed


[ Top ]

$force_commit =  false

[line 25]


Type:   mixed


[ Top ]

$index =

[line 26]


Type:   mixed


[ Top ]

$items = array()

[line 27]


Type:   mixed


[ Top ]

$last =

[line 28]


Type:   mixed


[ Top ]

$last_item_seen =  0

[line 29]


Type:   mixed


[ Top ]

$license =

[line 30]


Type:   mixed


[ Top ]

$log_file =

[line 33]


Type:   mixed


[ Top ]

$lp_id =

[line 31]


Type:   mixed


[ Top ]

$lp_view_id =

[line 32]


Type:   mixed


[ Top ]

$maker =

[line 34]


Type:   mixed


[ Top ]

$message =  ''

[line 35]


Type:   mixed


[ Top ]

$mode = 'embedded'

[line 36]


Type:   mixed


[ Top ]

$name =

[line 37]


Type:   mixed


[ Top ]

$ordered_items = array()

[line 38]


Type:   mixed


[ Top ]

$path =  ''

[line 39]


Type:   mixed


[ Top ]

$prevent_reinit =  1

[line 43]


Type:   mixed


[ Top ]

$progress_bar_mode =  '%'

[line 46]


Type:   mixed


[ Top ]

$progress_db =  '0'

[line 49]


Type:   mixed


[ Top ]

$proximity =

[line 50]


Type:   mixed


[ Top ]

$refs_list = array()

[line 51]


Type:   mixed


[ Top ]

$scorm_debug =  0

[line 58]


Type:   mixed


[ Top ]

$theme =

[line 40]


Type:   mixed


[ Top ]

$type =

[line 54]


Type:   mixed


[ Top ]

$update_queue = array()

[line 57]


Type:   mixed


[ Top ]

$user_id =

[line 56]


Type:   mixed


[ Top ]



Class Methods


constructor learnpath [line 74]

boolean learnpath( string $course, integer $lp_id, integer $user_id)

Class constructor. Needs a database handler, a course code and a learnpath id from the database.

Also builds the list of items into $this->items.




Tags:

return:  True on success, false on error


Parameters:

string   $course   Course code
integer   $lp_id   Learnpath ID
integer   $user_id   User ID

[ Top ]

method add_item [line 335]

int add_item( int $parent, int $previous, [string $type = 'dokeos_chapter'], int $id, string $title, string $description, [ $prerequisites = 0])

Function rewritten based on old_add_item() from Yannick Warnier. Due the fact that users can decide where the item should come, I had to overlook this function and I found it better to rewrite it. Old function is still available. Added also the possibility to add a description.



Parameters:

int   $parent  
int   $previous  
string   $type  
int   $id  
string   $title  
string   $description  
   $prerequisites  

[ Top ]

method add_lp [line 553]

integer add_lp( string $course, string $name, [string $description = ''], [string $learnpath = 'guess'], [string $origin = 'zip'], [string $zipname = ''])

Static admin function allowing addition of a learnpath to a course.



Tags:

return:  The new learnpath ID on success, 0 on failure


Parameters:

string   $course   Course code
string   $name   Learnpath name
string   $description   Learnpath description string, if provided
string   $learnpath   Type of learnpath (default = 'guess', others = 'dokeos', 'aicc',...)
string   $origin   Type of files origin (default = 'zip', others = 'dir','web_dir',...)
string   $zipname   Zip file containing the learnpath or directory containing the learnpath

[ Top ]

method append_message [line 623]

void append_message( string $string)

Appends a message to the message attribute



Parameters:

string   $string   Message to append.

[ Top ]

method autocomplete_parents [line 633]

void autocomplete_parents( integer $item)

Autocompletes the parents of an item in case it's been completed or passed



Parameters:

integer   $item   Optional ID of the item from which to look for parents

[ Top ]

method autosave [line 687]

void autosave( )

Autosaves the current results into the database for the whole learnpath



[ Top ]

method build_tree [line 4101]

string build_tree( )

This functions builds the LP tree based on data from the database.



Tags:

uses:  dtree.js - :: necessary javascript for building this tree


[ Top ]

method clear_message [line 696]

void clear_message( )

Clears the message attribute



[ Top ]

method close [line 710]

boolean close( )

Closes the current resource

Stops the timer Saves into the database if required Clears the current resource data from this object




Tags:

return:  True on success, false on failure


[ Top ]

method create_document [line 4190]

string create_document( array $_course)

Create a new document //still needs some finetuning



Parameters:

array   $_course  

[ Top ]

method create_js [line 6827]

string create_js( )

Creates the javascript needed for filling up the checkboxes without page reload



[ Top ]

method create_path [line 8301]

void create_path( $path)

Temp function to be moved in main_api or the best place around for this. Creates a file path

if it doesn't exist




Parameters:

   $path  

[ Top ]

method create_tree_array [line 3900]

void create_tree_array( array $array, [int $parent = 0], [int $depth = -1], [array $tmp = array()])

Creates an array with the elements of the learning path tree in it



Tags:

author:  Kevin Van Den Haute


Parameters:

array   $array  
int   $parent  
int   $depth  
array   $tmp  

[ Top ]

method delete [line 751]

boolean delete( [string $course = null], [integer $id = null], [string $delete = 'keep'])

Static admin function allowing removal of a learnpath



Tags:

return:  True on success, false on failure (might change that to return number of elements deleted)


Parameters:

string   $course   Course code
integer   $id   Learnpath ID
string   $delete   Whether to delete data or keep it (default: 'keep', others: 'remove')

[ Top ]

method delete_children_items [line 809]

integer delete_children_items( integer $id)

Removes all the children of one item - dangerous!



Tags:

return:  Total number of children removed


Parameters:

integer   $id   Element ID of which children have to be removed

[ Top ]

method delete_item [line 832]

integer delete_item( integer $id, [integer $remove = 'keep'])

Removes an item from the current learnpath



Tags:

return:  Number of elements moved
todo:  implement resource removal


Parameters:

integer   $id   Elem ID (0 if first)
integer   $remove   Whether to remove the resource/data from the system or leave it (default: 'keep', others 'remove')

[ Top ]

method display_document [line 4593]

unknown display_document( unknown_type $id, [ $show_title = false], [ $iframe = true], [ $edit_link = false])

Displays a document by id



Parameters:

unknown_type   $id  
   $show_title  
   $iframe  
   $edit_link  

[ Top ]

method display_document_form [line 5862]

unknown display_document_form( [unknown_type $action = 'add'], [unknown_type $id = 0], [unknown_type $extra_info = 'new'])

Enter description here...



Parameters:

unknown_type   $action  
unknown_type   $id  
unknown_type   $extra_info  

[ Top ]

method display_edit_item [line 4422]

string display_edit_item( int $item_id)

Shows the needed forms for editing a specific item



Parameters:

int   $item_id  

[ Top ]

method display_forum_form [line 5166]

unknown display_forum_form( [unknown_type $action = 'add'], [unknown_type $id = 0], [unknown_type $extra_info = ''])

Enter description here...



Parameters:

unknown_type   $action  
unknown_type   $id  
unknown_type   $extra_info  

[ Top ]

method display_hotpotatoes_form [line 4896]

string display_hotpotatoes_form( [string $action = 'add'], [integer $id = 0], [mixed $extra_info = ''])

Addition of Hotpotatoes tests



Tags:

return:  HTML structure to display the hotpotatoes addition formular


Parameters:

string   $action   Action
integer   $id   Internal ID of the item
mixed   $extra_info   Extra information - can be an array with title and description indexes

[ Top ]

method display_item [line 4357]

string display_item( int $item_id, [ $iframe = true], [string $msg = ''])

Displays the selected item, with a panel for manipulating the item



Parameters:

int   $item_id  
string   $msg  
   $iframe  

[ Top ]

method display_item_form [line 5676]

unknown display_item_form( unknown_type $item_type, [unknown_type $title = ''], [unknown_type $action = 'add'], [unknown_type $id = 0], [unknown_type $extra_info = 'new'])

Enter description here...



Parameters:

unknown_type   $item_type  
unknown_type   $title  
unknown_type   $action  
unknown_type   $id  
unknown_type   $extra_info  

[ Top ]

method display_item_prerequisites_form [line 7048]

unknown display_item_prerequisites_form( unknown_type $item_id)

Enter description here...



Parameters:

unknown_type   $item_id  

[ Top ]

method display_item_small_form [line 7000]

string display_item_small_form( string $item_type, [string $title = ''], array $data)

Displays a basic form on the overview page for changing the item title and the item description.



Parameters:

string   $item_type  
string   $title  
array   $data  

[ Top ]

method display_link_form [line 6220]

void display_link_form( [unknown_type $action = 'add'], [unknown_type $id = 0], [unknown_type $extra_info = ''])

Enter description here...



Parameters:

unknown_type   $action  
unknown_type   $id  
unknown_type   $extra_info  

[ Top ]

method display_manipulate [line 6728]

unknown display_manipulate( $item_id, [ $item_type = TOOL_DOCUMENT])

Displays the menu for manipulating a step



Parameters:

   $item_id  
   $item_type  

[ Top ]

method display_move_item [line 6913]

unknown display_move_item( unknown_type $item_id)

Enter description here...



Parameters:

unknown_type   $item_id  

[ Top ]

method display_quiz_form [line 4630]

unknown display_quiz_form( [unknown_type $action = 'add'], [unknown_type $id = 0], [unknown_type $extra_info = ''])

Enter description here...



Parameters:

unknown_type   $action  
unknown_type   $id  
unknown_type   $extra_info  

[ Top ]

method display_resources [line 4542]

string display_resources( )

Function that displays a list with al the resources that could be added to the learning path



[ Top ]

method display_student_publication_form [line 6484]

unknown display_student_publication_form( [unknown_type $action = 'add'], [unknown_type $id = 0], [unknown_type $extra_info = ''])

Enter description here...



Parameters:

unknown_type   $action  
unknown_type   $id  
unknown_type   $extra_info  

[ Top ]

method display_thread_form [line 5410]

void display_thread_form( [ $action = 'add'], [ $id = 0], [ $extra_info = ''])



Parameters:

   $action  
   $id  
   $extra_info  

[ Top ]

method edit_document [line 4300]

void edit_document( array $_course)

Enter description here...



Parameters:

array   $_course  

[ Top ]

method edit_item [line 871]

boolean edit_item( integer $id, string $parent, $previous, $title, $description, [ $prerequisites = 0])

Updates an item's content in place



Tags:

return:  True on success, false on error


Parameters:

integer   $id   Element ID
string   $parent   New content
   $previous  
   $title  
   $description  
   $prerequisites  

[ Top ]

method edit_item_prereq [line 1085]

boolean edit_item_prereq( integer $id, string $prerequisite_id, [string $mastery_score = 0], [string $max_score = 100], string 4)

Updates an item's prereq in place



Tags:

return:  True on success, false on error


Parameters:

string   4   Prerequisite max score
integer   $id   Element ID
string   $prerequisite_id   Prerequisite Element ID
string   $mastery_score   Prerequisite item type
string   $max_score   Prerequisite min score

[ Top ]

method escape_string [line 1138]

string escape_string( string $string)

Escapes a string with the available database escape function



Tags:

return:  String escaped


Parameters:

string   $string   String to escape

[ Top ]

method export_lp [line 1162]

string export_lp( string $type, string $course, integer $id, string $zipname)

Static admin function exporting a learnpath into a zip file



Tags:

return:  Zip file path (or false on error)


Parameters:

string   $type   Export type (scorm, zip, cd)
string   $course   Course code
integer   $id   Learnpath ID
string   $zipname   Zip file name

[ Top ]

method first [line 1367]

string first( )

Gets the first element URL.



Tags:

return:  URL to load into the viewer


[ Top ]

method get_brother_chapters [line 1206]

array get_brother_chapters( integer $id)

Gets all the chapters belonging to the same parent as the item/chapter given

Can also be called as abstract method




Tags:

return:  A list of all the "brother items" (or an empty array on failure)


Parameters:

integer   $id   Item ID

[ Top ]

method get_brother_items [line 1256]

array get_brother_items( integer $id)

Gets all the items belonging to the same parent as the item given

Can also be called as abstract method




Tags:

return:  A list of all the "brother items" (or an empty array on failure)


Parameters:

integer   $id   Item ID

[ Top ]

method get_complete_items_count [line 1302]

integer get_complete_items_count( )

Gets the number of items currently completed



Tags:

return:  The number of items currently completed


[ Top ]

method get_current_item_id [line 1330]

integer get_current_item_id( )

Gets the current item ID



Tags:

return:  The current learnpath item id


[ Top ]

method get_db_progress [line 1841]

integer get_db_progress( integer $lp_id, integer $user_id, [string $mode = '%'], [string $course_db = ''], [boolean $sincere = false])

Gets the progress value from the progress field in the database (allows use as abstract method)



Tags:

return:  Current progress value as found in the database


Parameters:

integer   $lp_id   Learnpath ID
integer   $user_id   User ID
string   $mode   Mode of display ('%','abs' or 'both')
string   $course_db   Course database name (optional, defaults to '')
boolean   $sincere   Whether to return null if no record was found (true), or 0 (false) (optional, defaults to false)

[ Top ]

method get_documents [line 7165]

string get_documents( )

Creates a list with all the documents in it



[ Top ]

method get_exercises [line 7260]

string get_exercises( )

Creates a list with all the exercises (quiz) in it



[ Top ]

method get_extension [line 4580]

unknown get_extension( unknown_type $filename)

Returns the extension of a document



Parameters:

unknown_type   $filename  

[ Top ]

method get_flat_ordered_items_list [line 2358]

mixed get_flat_ordered_items_list( integer $lp, [integer $parent = 0])

Gets a flat list of item IDs ordered for display (level by level ordered by order_display)

This method can be used as abstract and is recursive




Tags:

return:  Ordered list of item IDs or false on error


Parameters:

integer   $lp   Learnpath ID
integer   $parent   Parent ID of the items to look for

[ Top ]

method get_forums [line 7386]

void get_forums( )



[ Top ]

method get_html_toc [line 2443]

string get_html_toc( )

Uses the table generated by get_toc() and returns an HTML-formatted string ready to display



Tags:

return:  HTML TOC ready to display


[ Top ]

method get_id [line 1521]

integer get_id( )

Gets the learnpath database ID



Tags:

return:  Learnpath ID in the lp table


[ Top ]

method get_interactions_count_from_db [line 2190]

integer get_interactions_count_from_db( [integer $lp_iv_id = 0])

Return the number of interactions for the given learnpath Item View ID.

This method can be used as static.




Tags:

return:  Number of interactions


Parameters:

integer   $lp_iv_id   Item View ID

[ Top ]

method get_items_status_list [line 2175]

array get_items_status_list( )

Gets the status list for all LP's items



Tags:

return:  Array of [index] => [item ID => current status]


[ Top ]

method get_iv_interactions_array [line 2206]

array get_iv_interactions_array( [integer $lp_iv_id = 0])

Return the interactions as an array for the given lp_iv_id.

This method can be used as static.




Tags:

todo:  Translate labels


Parameters:

integer   $lp_iv_id   Learnpath Item View ID

[ Top ]

method get_iv_objectives_array [line 2260]

array get_iv_objectives_array( [integer $lp_iv_id = 0])

Return the objectives as an array for the given lp_iv_id.

This method can be used as static.




Tags:

todo:  Translate labels


Parameters:

integer   $lp_iv_id   Learnpath Item View ID

[ Top ]

method get_js_info [line 1433]

string get_js_info( [integer $item_id = ''])

Gets the information about an item in a format usable as JavaScript to update

the JS API by just printing this content into the <head> section of the message frame




Parameters:

integer   $item_id   Item ID

[ Top ]

method get_js_lib [line 1506]

string get_js_lib( )

Gets the js library from the database



Tags:

return:  The name of the javascript library to be used


[ Top ]

method get_last [line 1549]

string get_last( )

Gets the last element URL.



Tags:

return:  URL to load into the viewer


[ Top ]

method get_link [line 2597]

string get_link( [string $type = 'http'], [integer $item_id = null])

Gets a link to the resource from the present location, depending on item ID.



Tags:

return:  Link to the lp_item resource


Parameters:

string   $type   Type of link expected
integer   $item_id   Learnpath item ID

[ Top ]

method get_links [line 7325]

string get_links( )

Creates a list with all the links in it



[ Top ]

method get_maker [line 2568]

string get_maker( )

Gets the learnpath maker name - generally the editor's name



Tags:

return:  Learnpath maker name


[ Top ]

method get_message [line 2577]

string get_message( )

Gets the user-friendly message stored in $this->message



Tags:

return:  Message


[ Top ]

method get_name [line 2586]

string get_name( )

Gets the learnpath name/title



Tags:

return:  Learnpath name/title


[ Top ]

method get_navigation_bar [line 1569]

string get_navigation_bar( )

Gets the navigation bar for the learnpath display screen



Tags:

return:  The HTML string to use as a navigation bar


[ Top ]

method get_next_index [line 1661]

string get_next_index( )

Gets the next resource in queue (url).



Tags:

return:  URL to load into the viewer


[ Top ]

method get_next_item_id [line 1687]

integer get_next_item_id( )

Gets item_id for the next element



Tags:

return:  Next item (DB) ID


[ Top ]

method get_objectives_count_from_db [line 2244]

integer get_objectives_count_from_db( [integer $lp_iv_id = 0])

Return the number of objectives for the given learnpath Item View ID.

This method can be used as static.




Tags:

return:  Number of objectives


Parameters:

integer   $lp_iv_id   Item View ID

[ Top ]

method get_package_type [line 1712]

string get_package_type( string $file_path, string $file_name)

Returns the package type ('scorm','aicc','scorm2004','dokeos','ppt'...)

Generally, the package provided is in the form of a zip file, so the function has been written to test a zip file. If not a zip, the function will return the default return value: ''




Tags:

return:  'scorm','aicc','scorm2004','dokeos' or '' if the package cannot be recognized


Parameters:

string   $file_path   the path to the file
string   $file_name   the original name of the file

[ Top ]

method get_previous_index [line 1771]

string get_previous_index( )

Gets the previous resource in queue (url). Also initialises time values for this viewing



Tags:

return:  URL to load into the viewer


[ Top ]

method get_previous_item_id [line 1813]

integer get_previous_item_id( )

Gets item_id for the next element



Tags:

return:  Previous item (DB) ID


[ Top ]

method get_progress [line 1823]

integer get_progress( )

Gets the progress value from the progress_db attribute



Tags:

return:  Current progress value


[ Top ]

method get_progress_bar [line 1916]

string get_progress_bar( [string $mode = ''], [integer $percentage = -1], [string $text_add = ''])

Gets a progress bar for the learnpath by counting the number of items in it and the number of items completed so far.



Tags:

return:  HTML string containing the progress bar


Parameters:

string   $mode   Mode in which we want the values
integer   $percentage   Progress value to display (optional but mandatory if used in abstract context)
string   $text_add   Text to display near the progress value (optional but mandatory in abstract context)

[ Top ]

method get_progress_bar_mode [line 1999]

string get_progress_bar_mode( )

Gets the progress bar mode



Tags:

return:  The progress bar mode attribute


[ Top ]

method get_progress_bar_text [line 1963]

list get_progress_bar_text( [string $mode = ''], [ $add = 0])

Gets the progress bar info to display inside the progress bar. Also used by scorm_api.php



Tags:

return:  Percentage or number and symbol (% or /xx)


Parameters:

string   $mode   Mode of display (can be '%' or 'abs').abs means we display a number of completed elements per total elements //@param integer Additional steps to fake as completed
   $add  

[ Top ]

method get_proximity [line 2013]

string get_proximity( )

Gets the learnpath proximity (remote or local)



Tags:

return:  Learnpath proximity


[ Top ]

method get_scorm_prereq_string [line 2038]

string get_scorm_prereq_string( integer $item_id)

Generate a new prerequisites string for a given item. If this item was a sco and its prerequisites were strings (instead of IDs), then transform those strings into IDs, knowing that SCORM IDs are kept in the "ref" field of the lp_item table.

Prefix all item IDs that end-up in the prerequisites string by "ITEM_" to use the same rule as the scorm_export() method




Tags:

return:  Prerequisites string ready for the export as SCORM


Parameters:

integer   $item_id   Item ID

[ Top ]

method get_scorm_xml_node [line 2090]

mixed get_scorm_xml_node( resource &$children, string $id)

Returns the XML DOM document's node



Tags:

return:  The reference to the element found with that identifier. False if not found


Parameters:

resource   &$children   Reference to a list of objects to search for the given ITEM_*
string   $id   The identifier to look for

[ Top ]

method get_stats [line 2118]

array get_stats( )

Returns a usable array of stats related to the current learnpath and user



Tags:

return:  Well-formatted array containing status for the current learnpath


[ Top ]

method get_stats_course [line 2129]

array get_stats_course( string $course)

Static method. Can be re-implemented by children. Gives an array of statistics for

the given course (for all learnpaths and all users)




Tags:

return:  Well-formatted array containing status for the course's learnpaths


Parameters:

string   $course   Course code

[ Top ]

method get_stats_lp [line 2141]

array get_stats_lp( string $course, integer $lp)

Static method. Can be re-implemented by children. Gives an array of statistics for

the given course and learnpath (for all users)




Tags:

return:  Well-formatted array containing status for the specified learnpath


Parameters:

string   $course   Course code
integer   $lp   Learnpath ID

[ Top ]

method get_stats_lp_user [line 2154]

array get_stats_lp_user( string $course, integer $lp, integer $user)

Static method. Can be re-implemented by children. Gives an array of statistics for the given course, learnpath and user.



Tags:

return:  Well-formatted array containing status for the specified learnpath and user


Parameters:

string   $course   Course code
integer   $lp   Learnpath ID
integer   $user   User ID

[ Top ]

method get_stats_user [line 2166]

array get_stats_user( string $course, integer $user)

Static method. Can be re-implemented by children. Gives an array of statistics for

the given course and learnpath (for all users)




Tags:

return:  Well-formatted array containing status for the user's learnpaths


Parameters:

string   $course   Course code
integer   $user   User ID

[ Top ]

method get_student_publications [line 7365]

unknown get_student_publications( )

Creates a list with all the student publications in it



[ Top ]

method get_theme [line 2023]

string get_theme( )

Gets the learnpath theme (remote or local)



Tags:

return:  Learnpath theme


[ Top ]

method get_toc [line 2292]

array get_toc( )

Generate and return the table of contents for this learnpath. The (flat) table returned can be

used by get_html_toc() to be ready to display




Tags:

return:  TOC as a table with 4 elements per row: title, link, status and level


[ Top ]

method get_total_items_count [line 1345]

integer get_total_items_count( )

Gets the total number of items available for viewing in this SCORM



Tags:

return:  The total number of items


[ Top ]

method get_total_items_count_without_chapters [line 1354]

integer get_total_items_count_without_chapters( )

Gets the total number of items available for viewing in this SCORM but without chapters



Tags:

return:  The total no-chapters number of items


[ Top ]

method get_type [line 2319]

mixed get_type( [boolean $get_name = false])

Gets the learning path type



Tags:

return:  Type ID or name, depending on the parameter


Parameters:

boolean   $get_name   Return the name? If false, return the ID. Default is false.

[ Top ]

method get_type_static [line 2340]

mixed get_type_static( [boolean $lp_id = 0])

Gets the learning path type as static method



Tags:

return:  Type ID or name, depending on the parameter


Parameters:

boolean   $lp_id   Return the name? If false, return the ID. Default is false.

[ Top ]

method get_update_queue [line 2829]

array get_update_queue( )

Gets the update queue



Tags:

return:  Array containing IDs of items to be updated by JavaScript


[ Top ]

method get_user_id [line 2838]

integer get_user_id( )

Gets the user ID



Tags:

return:  User ID


[ Top ]

method get_view [line 2778]

integer get_view( [integer $attempt_num = 0])

Gets the latest usable view or generate a new one



Tags:

return:  DB lp_view id


Parameters:

integer   $attempt_num   Optional attempt number. If none given, takes the highest from the lp_view table

[ Top ]

method get_view_id [line 2814]

integer get_view_id( )

Gets the current view id



Tags:

return:  View ID (from lp_view)


[ Top ]

method log [line 2853]

boolean log( string $msg)

Logs a message into a file



Tags:

return:  True on success, false on error or if msg empty


Parameters:

string   $msg   Message to log

[ Top ]

method move_down [line 3026]

void move_down( integer $lp_id)

Move a learnpath down (display_order)



Parameters:

integer   $lp_id   Learnpath ID

[ Top ]

method move_item [line 2866]

integer move_item( integer $id, string $direction)

Moves an item up and down at its level



Tags:

return:  New display order, or false on error


Parameters:

integer   $id   Item to move up and down
string   $direction   Direction 'up' or 'down'

[ Top ]

method move_up [line 2982]

void move_up( integer $lp_id)

Move a learnpath up (display_order)



Parameters:

integer   $lp_id   Learnpath ID

[ Top ]

method next [line 3072]

void next( )

Updates learnpath attributes to point to the next element

The last part is similar to set_current_item but processing the other way around




[ Top ]

method open [line 3093]

boolean open( integer $id)

Open a resource = initialise all local variables relative to this resource. Depending on the child class, this might be redefined to allow several behaviours depending on the document type.



Tags:

return:  True on success, false otherwise


Overridden in child classes as:

aicc::open()
Opens a resource
scorm::open()
Opens a resource

Parameters:

integer   $id   Resource ID

[ Top ]

method overview [line 3971]

string overview( int $lp_id)

Function that creates a table structure with a learning path his modules, chapters and documents.

Also the actions for the modules, chapters and documents are in this table.




Tags:

author:  Kevin Van Den Haute


Parameters:

int   $lp_id  

[ Top ]

method prerequisites_match [line 3113]

boolean prerequisites_match( [integer $item = null])

Check that all prerequisites are fulfilled. Returns true and an empty string on succes, returns false and the prerequisite string on error.

This function is based on the rules for aicc_script language as described in the SCORM 1.2 CAM documentation page 108.




Tags:

return:  True if prerequisites are matched, false otherwise


Parameters:

integer   $item   Optional item ID. If none given, uses the current open item.

[ Top ]

method previous [line 3145]

void previous( )

Updates learnpath attributes to point to the previous element

The last part is similar to set_current_item but processing the other way around




[ Top ]

method restart [line 3230]

string restart( )

Restart the whole learnpath. Return the URL of the first element.

Make sure the results are saved with anoter method. This method should probably be redefined in children classes.




Tags:

return:  URL to load in the viewer


[ Top ]

method save_current [line 3261]

boolean save_current( )

Saves the current item



[ Top ]

method save_item [line 3284]

boolean save_item( [integer $item_id = null], [boolean $from_outside = true])

Saves the given item



Parameters:

integer   $item_id   Item ID. Optional (will take from $_REQUEST if null)
boolean   $from_outside   Save from url params (true) or from current attributes (false). Optional. Defaults to true

[ Top ]

method save_last [line 3310]

void save_last( )

Saves the last item seen's ID only in case



[ Top ]

method scorm_export [line 7454]

string scorm_export( string 0)

Exports the learning path as a SCORM package. This is the main function that gathers the content, transforms it, writes the imsmanifest.xml file, zips the whole thing and returns the zip.

This method needs to be called in PHP5, as it will fail with non-adequate XML package (like the ones for PHP4), and it is *not* a static method, so you need to call it on a learnpath object.




Tags:

return:  Returns the zip package string, or null if error
TODO:  The method might be redefined later on in the scorm class itself to avoid creating a SCORM structure if there is one already. However, if the initial SCORM path has been modified, it should use the generic method here below.
TODO:  link this function with the export_lp() function in the same class


Parameters:

string   0   Optional name of zip file. If none, title of learnpath is domesticated and trailed with ".zip"

[ Top ]

method set_current_item [line 3355]

void set_current_item( [integer $item_id = null])

Sets the current item ID (checks if valid and authorized first)



Parameters:

integer   $item_id   New item ID. If not given or not authorized, defaults to current

[ Top ]

method set_encoding [line 3383]

void set_encoding( [string $enc = 'ISO-8859-1'])

Sets the encoding



Parameters:

string   $enc   New encoding

[ Top ]

method set_error_msg [line 3539]

void set_error_msg( [string $error = ''])

Sets the object's error message



Parameters:

string   $error   Error message. If empty, reinits the error string

[ Top ]

method set_jslib [line 3403]

void set_jslib( [string $lib = ''])

Sets the JS lib setting in the database directly.

This is the JavaScript library file this lp needs to load on startup




Parameters:

string   $lib   Proximity setting

[ Top ]

method set_maker [line 3419]

void set_maker( [string $name = ''])

Sets the name of the LP maker (publisher) (and save)



Overridden in child classes as:

aicc::set_maker()
Sets the content maker setting in the database
scorm::set_maker()
Sets the content maker setting in the database

Parameters:

string   $name   Optional string giving the new content_maker of this learnpath

[ Top ]

method set_name [line 3453]

void set_name( [string $name = ''])

Sets the name of the current learnpath (and save)



Parameters:

string   $name   Optional string giving the new name of this learnpath

[ Top ]

method set_previous_item [line 3529]

void set_previous_item( integer $id)

Sets the previous item ID to a given ID. Generally, this should be set to the previous 'current' item



Parameters:

integer   $id   DB ID of the item

[ Top ]

method set_proximity [line 3512]

void set_proximity( [string $name = ''])

Sets the location/proximity of the LP (local/remote) (and save)



Overridden in child classes as:

aicc::set_proximity()
Sets the proximity setting in the database
scorm::set_proximity()
Sets the proximity setting in the database

Parameters:

string   $name   Optional string giving the new location of this learnpath

[ Top ]

method set_theme [line 3494]

bool set_theme( [string $name = ''])

Sets the theme of the LP (local/remote) (and save)



Tags:

return:  returns true if theme name is not empty


Overridden in child classes as:

aicc::set_theme()
Sets the theme setting in the database
scorm::set_theme()
Sets the theme setting in the database

Parameters:

string   $name   Optional string giving the new theme of this learnpath

[ Top ]

method sort_tree_array [line 3945]

array sort_tree_array( array $array)

Sorts a multi dimensional array by parent id and display order



Tags:

author:  Kevin Van Den Haute


Parameters:

array   $array   (array with al the learning path items in it)

[ Top ]

method start_current_item [line 3552]

void start_current_item( [ $allow_new_attempt = false])

Launches the current item if not 'sco' (starts timer and make sure there is a record ready in the DB)



Parameters:

   $allow_new_attempt  

[ Top ]

method stop_previous_item [line 3589]

void stop_previous_item( )

Stops the processing and counters for the old item (as held in $this->last)



[ Top ]

method toggle_publish [line 3182]

void toggle_publish( integer $lp_id, [string $set_visibility = 'v'])

Publishes a learnpath. This basically means show or hide the learnpath

on the course homepage Can be used as abstract




Parameters:

integer   $lp_id   Learnpath ID
string   $set_visibility   New visibility

[ Top ]

method toggle_visibility [line 3164]

void toggle_visibility( integer $lp_id, [string $set_visibility = 1])

Publishes a learnpath. This basically means show or hide the learnpath to normal users.

Can be used as abstract




Parameters:

integer   $lp_id   Learnpath ID
string   $set_visibility   New visibility

[ Top ]

method tree_array [line 3884]

void tree_array( unknown_type $array)

Function that makes a call to the function sort_tree_array and create_tree_array



Tags:

author:  Kevin Van Den Haute


Parameters:

unknown_type   $array  

[ Top ]

method update_default_scorm_commit [line 3693]

boolean update_default_scorm_commit( )

Updates the default behaviour about auto-commiting SCORM updates



Tags:

return:  True if auto-commit has been set to 'on', false otherwise


[ Top ]

method update_default_view_mode [line 3639]

string update_default_view_mode( )

Updates the default view mode from fullscreen to embedded and inversely



Tags:

return:  The current default view mode ('fullscreen' or 'embedded')


[ Top ]

method update_display_order [line 3745]

bool update_display_order( )

Updates the order of learning paths (goes through all of them by order and fills the gaps)



Tags:

return:  True on success, false on failure


[ Top ]

method update_reinit [line 3781]

boolean update_reinit( )

Updates the "prevent_reinit" value that enables control on reinitialising items on second view



Tags:

return:  True if prevent_reinit has been set to 'on', false otherwise (or 1 or 0 in this case)


[ Top ]

method update_scorm_debug [line 3833]

boolean update_scorm_debug( )

Updates the "scorm_debug" value that shows or hide the debug window



Tags:

return:  True if scorm_debug has been set to 'on', false otherwise (or 1 or 0 in this case)


[ Top ]

method write_resources_tree [line 7226]

void write_resources_tree( $return, $resources_sorted, [ $num = 0])



Parameters:

   $return  
   $resources_sorted  
   $num  

[ Top ]


Documentation generated on Thu, 12 Jun 2008 13:57:11 -0500 by phpDocumentor 1.4.1