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

Class: scorm

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

Class Overview

learnpath
   |
   --scorm

Defines the learnpath parent class


Variables

Methods


Inherited Variables

Inherited Methods

Class: learnpath

learnpath::learnpath()
Class constructor. Needs a database handler, a course code and a learnpath id from the database.
learnpath::add_item()
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.
learnpath::add_lp()
Static admin function allowing addition of a learnpath to a course.
learnpath::append_message()
Appends a message to the message attribute
learnpath::autocomplete_parents()
Autocompletes the parents of an item in case it's been completed or passed
learnpath::autosave()
Autosaves the current results into the database for the whole learnpath
learnpath::build_tree()
This functions builds the LP tree based on data from the database.
learnpath::clear_message()
Clears the message attribute
learnpath::close()
Closes the current resource
learnpath::create_document()
Create a new document //still needs some finetuning
learnpath::create_js()
Creates the javascript needed for filling up the checkboxes without page reload
learnpath::create_path()
Temp function to be moved in main_api or the best place around for this. Creates a file path
learnpath::create_tree_array()
Creates an array with the elements of the learning path tree in it
learnpath::delete()
Static admin function allowing removal of a learnpath
learnpath::delete_children_items()
Removes all the children of one item - dangerous!
learnpath::delete_item()
Removes an item from the current learnpath
learnpath::display_document()
Displays a document by id
learnpath::display_document_form()
Enter description here...
learnpath::display_edit_item()
Shows the needed forms for editing a specific item
learnpath::display_forum_form()
Enter description here...
learnpath::display_hotpotatoes_form()
Addition of Hotpotatoes tests
learnpath::display_item()
Displays the selected item, with a panel for manipulating the item
learnpath::display_item_form()
Enter description here...
learnpath::display_item_prerequisites_form()
Enter description here...
learnpath::display_item_small_form()
Displays a basic form on the overview page for changing the item title and the item description.
learnpath::display_link_form()
Enter description here...
learnpath::display_manipulate()
Displays the menu for manipulating a step
learnpath::display_move_item()
Enter description here...
learnpath::display_quiz_form()
Enter description here...
learnpath::display_resources()
Function that displays a list with al the resources that could be added to the learning path
learnpath::display_student_publication_form()
Enter description here...
learnpath::display_thread_form()
learnpath::edit_document()
Enter description here...
learnpath::edit_item()
Updates an item's content in place
learnpath::edit_item_prereq()
Updates an item's prereq in place
learnpath::escape_string()
Escapes a string with the available database escape function
learnpath::export_lp()
Static admin function exporting a learnpath into a zip file
learnpath::first()
Gets the first element URL.
learnpath::get_brother_chapters()
Gets all the chapters belonging to the same parent as the item/chapter given
learnpath::get_brother_items()
Gets all the items belonging to the same parent as the item given
learnpath::get_complete_items_count()
Gets the number of items currently completed
learnpath::get_current_item_id()
Gets the current item ID
learnpath::get_db_progress()
Gets the progress value from the progress field in the database (allows use as abstract method)
learnpath::get_documents()
Creates a list with all the documents in it
learnpath::get_exercises()
Creates a list with all the exercises (quiz) in it
learnpath::get_extension()
Returns the extension of a document
learnpath::get_flat_ordered_items_list()
Gets a flat list of item IDs ordered for display (level by level ordered by order_display)
learnpath::get_forums()
learnpath::get_html_toc()
Uses the table generated by get_toc() and returns an HTML-formatted string ready to display
learnpath::get_id()
Gets the learnpath database ID
learnpath::get_interactions_count_from_db()
Return the number of interactions for the given learnpath Item View ID.
learnpath::get_items_status_list()
Gets the status list for all LP's items
learnpath::get_iv_interactions_array()
Return the interactions as an array for the given lp_iv_id.
learnpath::get_js_info()
Gets the information about an item in a format usable as JavaScript to update
learnpath::get_js_lib()
Gets the js library from the database
learnpath::get_last()
Gets the last element URL.
learnpath::get_link()
Gets a link to the resource from the present location, depending on item ID.
learnpath::get_links()
Creates a list with all the links in it
learnpath::get_maker()
Gets the learnpath maker name - generally the editor's name
learnpath::get_message()
Gets the user-friendly message stored in $this->message
learnpath::get_name()
Gets the learnpath name/title
learnpath::get_navigation_bar()
Gets the navigation bar for the learnpath display screen
learnpath::get_next_index()
Gets the next resource in queue (url).
learnpath::get_next_item_id()
Gets item_id for the next element
learnpath::get_package_type()
Returns the package type ('scorm','aicc','scorm2004','dokeos','ppt'...)
learnpath::get_previous_index()
Gets the previous resource in queue (url). Also initialises time values for this viewing
learnpath::get_previous_item_id()
Gets item_id for the next element
learnpath::get_progress()
Gets the progress value from the progress_db attribute
learnpath::get_progress_bar()
Gets a progress bar for the learnpath by counting the number of items in it and the number of items completed so far.
learnpath::get_progress_bar_mode()
Gets the progress bar mode
learnpath::get_progress_bar_text()
Gets the progress bar info to display inside the progress bar. Also used by scorm_api.php
learnpath::get_proximity()
Gets the learnpath proximity (remote or local)
learnpath::get_stats()
Returns a usable array of stats related to the current learnpath and user
learnpath::get_stats_course()
Static method. Can be re-implemented by children. Gives an array of statistics for
learnpath::get_stats_lp()
Static method. Can be re-implemented by children. Gives an array of statistics for
learnpath::get_stats_lp_user()
Static method. Can be re-implemented by children. Gives an array of statistics for the given course, learnpath and user.
learnpath::get_stats_user()
Static method. Can be re-implemented by children. Gives an array of statistics for
learnpath::get_student_publications()
Creates a list with all the student publications in it
learnpath::get_toc()
Generate and return the table of contents for this learnpath. The (flat) table returned can be
learnpath::get_total_items_count()
Gets the total number of items available for viewing in this SCORM
learnpath::get_total_items_count_without_chapters()
Gets the total number of items available for viewing in this SCORM but without chapters
learnpath::get_type()
Gets the learning path type
learnpath::get_update_queue()
Gets the update queue
learnpath::get_user_id()
Gets the user ID
learnpath::get_view()
Gets the latest usable view or generate a new one
learnpath::get_view_id()
Gets the current view id
learnpath::log()
Logs a message into a file
learnpath::move_item()
Moves an item up and down at its level
learnpath::next()
Updates learnpath attributes to point to the next element
learnpath::open()
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.
learnpath::overview()
Function that creates a table structure with a learning path his modules, chapters and documents.
learnpath::prerequisites_match()
Check that all prerequisites are fulfilled. Returns true and an empty string on succes, returns false and the prerequisite string on error.
learnpath::previous()
Updates learnpath attributes to point to the previous element
learnpath::restart()
Restart the whole learnpath. Return the URL of the first element.
learnpath::save_current()
Saves the current item
learnpath::save_item()
Saves the given item
learnpath::save_last()
Saves the last item seen's ID only in case
learnpath::scorm_export()
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.
learnpath::set_current_item()
Sets the current item ID (checks if valid and authorized first)
learnpath::set_encoding()
Sets the encoding
learnpath::set_error_msg()
Sets the object's error message
learnpath::set_jslib()
Sets the JS lib setting in the database directly.
learnpath::set_maker()
Sets the name of the LP maker (publisher) (and save)
learnpath::set_name()
Sets the name of the current learnpath (and save)
learnpath::set_previous_item()
Sets the previous item ID to a given ID. Generally, this should be set to the previous 'current' item
learnpath::set_proximity()
Sets the location/proximity of the LP (local/remote) (and save)
learnpath::sort_tree_array()
Sorts a multi dimensional array by parent id and display order
learnpath::start_current_item()
Launches the current item if not 'sco' (starts timer and make sure there is a record ready in the DB)
learnpath::stop_previous_item()
Stops the processing and counters for the old item (as held in $this->last)
learnpath::toggle_visibility()
Publishes a learnpath. This basically means show or hide the learnpath to normal users.
learnpath::tree_array()
Function that makes a call to the function sort_tree_array and create_tree_array
learnpath::update_default_scorm_commit()
Updates the default behaviour about auto-commiting SCORM updates
learnpath::update_default_view_mode()
Updates the default view mode from fullscreen to embedded and inversely
learnpath::update_reinit()
Updates the "prevent_reinit" value that enables control on reinitialising items on second view
learnpath::update_scorm_debug()
Updates the "scorm_debug" value that shows or hide the debug window
learnpath::write_resources_tree()

Class Details

[line 15]
Defines the learnpath parent class



[ Top ]


Class Variables

$debug =  0

[line 29]


Type:   mixed
Overrides:   Array


[ Top ]

$idrefs = array()

[line 22]


Type:   mixed


[ Top ]

$items = array()

[line 25]


Type:   mixed
Overrides:   Array


[ Top ]

$lastzipnameindex =  0

[line 27]


Type:   mixed


[ Top ]

$manifest = array()

[line 16]


Type:   mixed


[ Top ]

$manifest_encoding =  'UTF-8'

[line 28]


Type:   mixed


[ Top ]

$metadata = array()

[line 21]


Type:   mixed


[ Top ]

$organizations = array()

[line 19]


Type:   mixed


[ Top ]

$organizations_att = array()

[line 20]


Type:   mixed


[ Top ]

$refurls = array()

[line 23]


Type:   mixed


[ Top ]

$resources = array()

[line 17]


Type:   mixed


[ Top ]

$resources_att = array()

[line 18]


Type:   mixed


[ Top ]

$subdir =  ''

[line 24]


Type:   mixed


[ Top ]

$zipname =  ''

[line 26]


Type:   mixed


[ Top ]



Class Methods


constructor scorm [line 36]

scorm scorm( [string $course_code = null], [integer $resource_id = null], [integer $user_id = null])

Class constructor. Based on the parent constructor.



Parameters:

string   $course_code   Course code
integer   $resource_id   Learnpath ID in DB
integer   $user_id   User ID

[ Top ]

method export_zip [line 697]

void export_zip( [integer $lp_id = null])

Exports the current SCORM object's files as a zip. Excerpts taken from learnpath_functions.inc.php::exportpath()



Parameters:

integer   $lp_id   Learnpath ID (optional, taken from object context if not defined)

[ Top ]

method get_res_path [line 764]

string get_res_path( string $id)

Gets a resource's path if available, otherwise return empty string



Tags:

return:  The resource's path as declared in imsmanifest.xml


Parameters:

string   $id   Resource ID as used in resource array

[ Top ]

method get_res_type [line 778]

string get_res_type( string $id)

Gets a resource's type if available, otherwise return empty string



Tags:

return:  The resource's type as declared in imsmanifest.xml


Parameters:

string   $id   Resource ID as used in resource array

[ Top ]

method get_title [line 794]

string get_title( )

Gets the default organisation's title



Tags:

return:  The organization's title


[ Top ]

method import_local_package [line 464]

string import_local_package( string $file_path, [string $current_dir = ''])

Intermediate to import_package only to allow import from local zip files



Tags:

return:  Absolute path to the imsmanifest.xml file or empty string on error


Parameters:

string   $file_path   Path to the zip file, from the dokeos sys root
string   $current_dir   Current path (optional)

[ Top ]

method import_manifest [line 354]

bool import_manifest( string $course_code)

Import the scorm object (as a result from the parse_manifest function) into the database structure



Tags:

return:  Returns -1 on error


Parameters:

string   $course_code   Unique course code

[ Top ]

method import_package [line 478]

string import_package( string $zip_file_info, [ $current_dir = ''])

Imports a zip file into the Dokeos structure



Tags:

return:  Absolute path to the imsmanifest.xml file or empty string on error


Parameters:

string   $zip_file_info   Zip file info as given by $_FILES['userFile']
   $current_dir  

[ Top ]

method open [line 49]

void open( integer $id)

Opens a resource



Overrides learnpath::open() (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.)

Parameters:

integer   $id   Database ID of the resource

[ Top ]

method parse_manifest [line 65]

array parse_manifest( [string $file = ''])

Parses an imsmanifest.xml file and puts everything into the $manifest array



Tags:

return:  Structured array representing the imsmanifest's contents


Parameters:

string   $file   Path to the imsmanifest.xml file on the system. If not defined, uses the base path of the course's scorm dir

[ Top ]

method reimport_manifest [line 818]

integer reimport_manifest( string $course, [string $lp_id = null], [string $imsmanifest_path = ''])

//TODO @TODO implement this function to restore items data from an imsmanifest,

updating the existing table... This will prove very useful in case initial data from imsmanifest were not imported well enough




Tags:

return:  New LP ID or false on failure TODO @TODO Implement imsmanifest_path parameter


Parameters:

string   $course   course Code
string   $lp_id   LP ID (in database)
string   $imsmanifest_path   Manifest file path (optional if lp_id defined)

[ Top ]

method set_maker [line 681]

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

Sets the content maker setting in the database



Overrides learnpath::set_maker() (Sets the name of the LP maker (publisher) (and save))

Parameters:

string   $maker   Proximity setting

[ Top ]

method set_proximity [line 665]

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

Sets the proximity setting in the database



Overrides learnpath::set_proximity() (Sets the location/proximity of the LP (local/remote) (and save))

Parameters:

string   $proxy   Proximity setting

[ Top ]


Documentation generated on Wed, 05 Sep 2007 06:15:05 +0200 by phpDocumentor 1.4.0