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

Class: aicc

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

Class Overview

learnpath
   |
   --aicc

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_iv_objectives_array()
Return the objectives 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_objectives_count_from_db()
Return the number of objectives for the given learnpath Item View ID.
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_scorm_prereq_string()
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.
learnpath::get_scorm_xml_node()
Returns the XML DOM document's node
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_theme()
Gets the learnpath theme (remote or local)
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_type_static()
Gets the learning path type as static method
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_down()
Move a learnpath down (display_order)
learnpath::move_item()
Moves an item up and down at its level
learnpath::move_up()
Move a learnpath up (display_order)
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::set_theme()
Sets the theme 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_publish()
Publishes a learnpath. This basically means show or hide the learnpath
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_display_order()
Updates the order of learning paths (goes through all of them by order and fills the gaps)
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 17]
Defines the learnpath parent class



[ Top ]


Class Variables

$aulist = array()

[line 33]


Type:   mixed


[ Top ]

$au_order_list = array()

[line 34]


Type:   mixed


[ Top ]

$au_order_list_new_id = array()

[line 35]


Type:   mixed


[ Top ]

$config = array()

[line 19]


Type:   mixed


[ Top ]

$config_basename =  ''

[line 20]


Type:   mixed


[ Top ]

$config_encoding =  'ISO-8859-1'

[line 43]


Type:   mixed


[ Top ]

$config_exts = array(
         'crs'=>0, //Course description file (mandatory)
         'au' =>0, //Assignable Unit file (mandatory)
         'des'=>0, //Descriptor file (mandatory)
         'cst'=>0, //Course structure file (mandatory)
         'ore'=>0, //Objectives relationshops file (optional)
         'pre'=>0, //Prerequisites file (optional)
         'cmp'=>0  //Completion Requirements file (optional)
   )

[line 24]


Type:   mixed


[ Top ]

$config_files = array()

[line 23]


Type:   mixed


[ Top ]

$cstlist = array()

[line 37]


Type:   mixed


[ Top ]

$debug =  0

[line 44]


Type:   mixed
Overrides:   Array


[ Top ]

$deslist = array()

[line 36]


Type:   mixed


[ Top ]

$lastzipnameindex =  0

[line 42]


Type:   mixed


[ Top ]

$orelist = array()

[line 38]


Type:   mixed


[ Top ]

$subdir =  ''

[line 40]


Type:   mixed


[ Top ]

$zipname =  ''

[line 41]


Type:   mixed


[ Top ]



Class Methods


constructor aicc [line 51]

aicc aicc( [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 610]

void export_zip( [integer $lp_id = null])

Exports the current AICC 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 677]

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 config file course.crs


Parameters:

string   $id   Resource ID as used in resource array

[ Top ]

method get_res_type [line 691]

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 the assignable unit (.au) file


Parameters:

string   $id   Resource ID as used in resource array

[ Top ]

method get_title [line 707]

string get_title( )

Gets the default organisation's title



Tags:

return:  The organization's title


[ Top ]

method import_aicc [line 225]

bool import_aicc( string $course_code)

Import the aicc object (as a result from the parse_config_files function) into the database structure



Tags:

return:  Returns -1 on error


Parameters:

string   $course_code   Unique course code

[ Top ]

method import_local_package [line 317]

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 AICC description files 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_package [line 331]

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

Imports a zip file (presumably AICC) into the Dokeos structure



Tags:

return:  Absolute path to the AICC config files directory or empty string on error


Parameters:

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

[ Top ]

method open [line 64]

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_config_files [line 74]

array parse_config_files( [string $dir = ''])

Parses a set of AICC config files and puts everything into the $config array



Tags:

return:  Structured array representing the config files' contents


Parameters:

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

[ Top ]

method parse_csv_file [line 859]

array parse_csv_file( string $f, [string $delim = ','], [string $enclosure = '"'], [boolean $multiples = false])

Static function that parses CSV files into simple arrays, based on a function

by spam at cyber-space dot nl published on php.net (fgetcsv())




Tags:

return:  Simple structured array


Parameters:

string   $f   Filepath
string   $delim   CSV delimiter
string   $enclosure   CSV enclosure
boolean   $multiples   Might one field name happen more than once on the same line? (then split by comma in the values)

[ Top ]

method parse_ini_file_quotes_safe [line 741]

array parse_ini_file_quotes_safe( string $f)

Static function to parse AICC ini files.

Based on work by sinedeo at gmail dot com published on php.net (parse_ini_file())




Tags:

return:  Structured array


Parameters:

string   $f   File path

[ Top ]

method parse_ini_string_quotes_safe [line 794]

array parse_ini_string_quotes_safe( string $s, [array $pure_strings = array()])

Static function to parse AICC ini strings.

Based on work by sinedeo at gmail dot com published on php.net (parse_ini_file())




Tags:

return:  Structured array


Parameters:

string   $s   INI File string
array   $pure_strings   List of names of sections that should be considered as containing only hard string data (no variables), provided in lower case

[ Top ]

method reimport_aicc [line 726]

void reimport_aicc( )

//TODO @TODO implement this function to restore items data from a set of AICC config files,

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




[ Top ]

method set_maker [line 594]

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 560]

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 ]

method set_theme [line 577]

void set_theme( [string $theme = ''])

Sets the theme setting in the database



Overrides learnpath::set_theme() (Sets the theme of the LP (local/remote) (and save))

Parameters:

string   $theme   Theme setting

[ Top ]


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