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:
Parameters:
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:
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:
Parameters:
method append_message [line 623]
void append_message(
string
$string)
|
|
Appends a message to the message attribute
Parameters:
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:
method autosave [line 687]
Autosaves the current results into the database for the whole learnpath
method build_tree [line 4101]
This functions builds the LP tree based on data from the database.
Tags:
method clear_message [line 696]
Clears the message attribute
method close [line 710]
Closes the current resource
Stops the timer Saves into the database if required Clears the current resource data from this object
Tags:
method create_document [line 4190]
string create_document(
array
$_course)
|
|
Create a new document //still needs some finetuning
Parameters:
method create_js [line 6827]
Creates the javascript needed for filling up the checkboxes without page reload
method create_path [line 8301]
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:
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:
Parameters:
method delete [line 751]
boolean delete(
[string
$course = null], [integer
$id = null], [string
$delete = 'keep'])
|
|
Static admin function allowing removal of a learnpath
Tags:
Parameters:
method delete_children_items [line 809]
integer delete_children_items(
integer
$id)
|
|
Removes all the children of one item - dangerous!
Tags:
Parameters:
method delete_item [line 832]
integer delete_item(
integer
$id, [integer
$remove = 'keep'])
|
|
Removes an item from the current learnpath
Tags:
Parameters:
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:
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:
method display_edit_item [line 4422]
string display_edit_item(
int
$item_id)
|
|
Shows the needed forms for editing a specific item
Parameters:
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:
method display_hotpotatoes_form [line 4896]
string display_hotpotatoes_form(
[string
$action = 'add'], [integer
$id = 0], [mixed
$extra_info = ''])
|
|
Addition of Hotpotatoes tests
Tags:
Parameters:
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:
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:
method display_item_prerequisites_form [line 7048]
unknown display_item_prerequisites_form(
unknown_type
$item_id)
|
|
Enter description here...
Parameters:
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:
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:
method display_manipulate [line 6728]
unknown display_manipulate(
$item_id, [
$item_type = TOOL_DOCUMENT])
|
|
Displays the menu for manipulating a step
Parameters:
method display_move_item [line 6913]
unknown display_move_item(
unknown_type
$item_id)
|
|
Enter description here...
Parameters:
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:
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
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:
method display_thread_form [line 5410]
void display_thread_form(
[
$action = 'add'], [
$id = 0], [
$extra_info = ''])
|
|
Parameters:
method edit_document [line 4300]
void edit_document(
array
$_course)
|
|
Enter description here...
Parameters:
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:
Parameters:
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:
Parameters:
method escape_string [line 1138]
string escape_string(
string
$string)
|
|
Escapes a string with the available database escape function
Tags:
Parameters:
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:
Parameters:
method first [line 1367]
Gets the first element URL.
Tags:
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:
Parameters:
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:
Parameters:
method get_complete_items_count [line 1302]
integer get_complete_items_count(
)
|
|
Gets the number of items currently completed
Tags:
method get_current_item_id [line 1330]
integer get_current_item_id(
)
|
|
Gets the current item ID
Tags:
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:
Parameters:
method get_documents [line 7165]
Creates a list with all the documents in it
method get_exercises [line 7260]
Creates a list with all the exercises (quiz) in it
method get_extension [line 4580]
unknown get_extension(
unknown_type
$filename)
|
|
Returns the extension of a document
Parameters:
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:
Parameters:
method get_forums [line 7386]
method get_html_toc [line 2443]
Uses the table generated by get_toc() and returns an HTML-formatted string ready to display
Tags:
method get_id [line 1521]
Gets the learnpath database ID
Tags:
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:
Parameters:
method get_items_status_list [line 2175]
array get_items_status_list(
)
|
|
Gets the status list for all LP's items
Tags:
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:
Parameters:
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:
Parameters:
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:
method get_js_lib [line 1506]
Gets the js library from the database
Tags:
method get_last [line 1549]
Gets the last element URL.
Tags:
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:
Parameters:
method get_links [line 7325]
Creates a list with all the links in it
method get_maker [line 2568]
Gets the learnpath maker name - generally the editor's name
Tags:
method get_message [line 2577]
Gets the user-friendly message stored in $this->message
Tags:
method get_name [line 2586]
Gets the learnpath name/title
Tags:
method get_navigation_bar [line 1569]
string get_navigation_bar(
)
|
|
Gets the navigation bar for the learnpath display screen
Tags:
method get_next_index [line 1661]
Gets the next resource in queue (url).
Tags:
method get_next_item_id [line 1687]
integer get_next_item_id(
)
|
|
Gets item_id for the next element
Tags:
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:
Parameters:
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:
Parameters:
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:
method get_previous_item_id [line 1813]
integer get_previous_item_id(
)
|
|
Gets item_id for the next element
Tags:
method get_progress [line 1823]
Gets the progress value from the progress_db attribute
Tags:
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:
Parameters:
method get_progress_bar_mode [line 1999]
string get_progress_bar_mode(
)
|
|
Gets the progress bar mode
Tags:
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:
Parameters:
method get_proximity [line 2013]
Gets the learnpath proximity (remote or local)
Tags:
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:
Parameters:
method get_scorm_xml_node [line 2090]
mixed get_scorm_xml_node(
resource
&$children, string
$id)
|
|
Returns the XML DOM document's node
Tags:
Parameters:
method get_stats [line 2118]
Returns a usable array of stats related to the current learnpath and user
Tags:
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:
Parameters:
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:
Parameters:
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:
Parameters:
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:
Parameters:
method get_student_publications [line 7365]
unknown get_student_publications(
)
|
|
Creates a list with all the student publications in it
method get_theme [line 2023]
Gets the learnpath theme (remote or local)
Tags:
method get_toc [line 2292]
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:
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:
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:
method get_type [line 2319]
mixed get_type(
[boolean
$get_name = false])
|
|
Gets the learning path type
Tags:
Parameters:
method get_type_static [line 2340]
mixed get_type_static(
[boolean
$lp_id = 0])
|
|
Gets the learning path type as static method
Tags:
Parameters:
method get_update_queue [line 2829]
array get_update_queue(
)
|
|
Gets the update queue
Tags:
method get_user_id [line 2838]
method get_view [line 2778]
integer get_view(
[integer
$attempt_num = 0])
|
|
Gets the latest usable view or generate a new one
Tags:
Parameters:
method get_view_id [line 2814]
Gets the current view id
Tags:
method log [line 2853]
boolean log(
string
$msg)
|
|
Logs a message into a file
Tags:
Parameters:
method move_down [line 3026]
void move_down(
integer
$lp_id)
|
|
Move a learnpath down (display_order)
Parameters:
method move_item [line 2866]
integer move_item(
integer
$id, string
$direction)
|
|
Moves an item up and down at its level
Tags:
Parameters:
method move_up [line 2982]
void move_up(
integer
$lp_id)
|
|
Move a learnpath up (display_order)
Parameters:
method next [line 3072]
Updates learnpath attributes to point to the next element
The last part is similar to set_current_item but processing the other way around
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:
Overridden in child classes as:
- aicc::open()
- Opens a resource
- scorm::open()
- Opens a resource
Parameters:
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:
Parameters:
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:
Parameters:
method previous [line 3145]
Updates learnpath attributes to point to the previous element
The last part is similar to set_current_item but processing the other way around
method restart [line 3230]
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:
method save_current [line 3261]
method save_item [line 3284]
boolean save_item(
[integer
$item_id = null], [boolean
$from_outside = true])
|
|
Saves the given item
Parameters:
method save_last [line 3310]
Saves the last item seen's ID only in case
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:
Parameters:
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:
method set_encoding [line 3383]
void set_encoding(
[string
$enc = 'ISO-8859-1'])
|
|
Sets the encoding
Parameters:
method set_error_msg [line 3539]
void set_error_msg(
[string
$error = ''])
|
|
Sets the object's error message
Parameters:
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:
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:
method set_name [line 3453]
void set_name(
[string
$name = ''])
|
|
Sets the name of the current learnpath (and save)
Parameters:
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:
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:
method set_theme [line 3494]
bool set_theme(
[string
$name = ''])
|
|
Sets the theme of the LP (local/remote) (and save)
Tags:
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:
method sort_tree_array [line 3945]
array sort_tree_array(
array
$array)
|
|
Sorts a multi dimensional array by parent id and display order
Tags:
Parameters:
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:
method stop_previous_item [line 3589]
void stop_previous_item(
)
|
|
Stops the processing and counters for the old item (as held in $this->last)
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:
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:
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:
Parameters:
method update_default_scorm_commit [line 3693]
boolean update_default_scorm_commit(
)
|
|
Updates the default behaviour about auto-commiting SCORM updates
Tags:
method update_default_view_mode [line 3639]
string update_default_view_mode(
)
|
|
Updates the default view mode from fullscreen to embedded and inversely
Tags:
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:
method update_reinit [line 3781]
Updates the "prevent_reinit" value that enables control on reinitialising items on second view
Tags:
method update_scorm_debug [line 3833]
boolean update_scorm_debug(
)
|
|
Updates the "scorm_debug" value that shows or hide the debug window
Tags:
method write_resources_tree [line 7226]
void write_resources_tree(
$return,
$resources_sorted, [
$num = 0])
|
|
Parameters: