Class: learnpathItem
Source Location: /main/newscorm/learnpathItem.class.php
lp_item defines items belonging to a learnpath. Each item has a name, a score, a use time and additional
|
|
|
Class Details
Class Variables
Class Methods
constructor learnpathItem [line 67]
boolean learnpathItem(
integer
$db_id, integer
$user_id)
|
|
Class constructor. Prepares the learnpath_item for later launch Don't forget to use set_lp_view() if applicable after creating the item. Setting an lp_view will finalise the item_view data collection
Tags:
Parameters:
method add_child [line 110]
Adds a child to the current item
Parameters:
method add_interaction [line 126]
void add_interaction(
int
$index, array
$params)
|
|
Adds an interaction to the current item
Parameters:
method add_objective [line 152]
void add_objective(
array
$index,
$params)
|
|
Adds an objective to the current item
Parameters:
method close [line 166]
Closes/stops the item viewing. Finalises runtime values. If required, save to DB.
Tags:
method delete [line 191]
Deletes all traces of this item in the database
Tags:
method drop_child [line 209]
void drop_child(
string
$item)
|
|
Drops a child from the children array
Parameters:
method get_attempt_id [line 226]
integer get_attempt_id(
)
|
|
Gets the current attempt_id for this user on this item
Tags:
method get_children [line 241]
Gets a list of the item's children
Tags:
method get_core_exit [line 257]
Gets the core_exit value from the database
method get_credit [line 266]
Gets the credit information (rather scorm-stuff) based on current status and reinit autorization. Credit tells the sco(content) if Dokeos will record the data it is sent (credit) or not (no-credit)
Tags:
method get_current_start_time [line 286]
integer get_current_start_time(
)
|
|
Gets the current start time property
Tags:
method get_description [line 300]
string get_description(
)
|
|
Gets the item's description
Tags:
method get_file_path [line 309]
string get_file_path(
[
$path_to_scorm_dir = ''])
|
|
Gets the file path from the course's root directory, no matter what tool it is from.
Tags:
Parameters:
method get_id [line 358]
method get_interactions_count [line 371]
int get_interactions_count(
)
|
|
Gets the current count of interactions recorded in the database
Tags:
method get_launch_data [line 397]
string get_launch_data(
)
|
|
Gets the launch_data field found in imsmanifests (this is SCORM- or AICC-related, really)
Tags:
method get_lesson_location [line 408]
string get_lesson_location(
)
|
|
Gets the lesson location
Tags:
method get_lesson_mode [line 418]
string get_lesson_mode(
)
|
|
Gets the lesson_mode (scorm feature, but might be used by aicc as well as dokeos paths) The "browse" mode is not supported yet (because there is no such way of seeing a sco in Dokeos)
Tags:
method get_level [line 432]
Gets the depth level
Tags:
method get_mastery_score [line 440]
void get_mastery_score(
)
|
|
Gets the mastery score
method get_max [line 449]
Gets the maximum (score)
Tags:
method get_max_time_allowed [line 475]
string get_max_time_allowed(
)
|
|
Gets the maximum time allowed for this user in this attempt on this item
Tags:
method get_min [line 484]
Gets the minimum (score)
Tags:
method get_objectives_count [line 384]
int get_objectives_count(
)
|
|
Gets the current count of objectives recorded in the database
Tags:
method get_parent [line 492]
method get_path [line 505]
Gets the path attribute.
Tags:
method get_prereq_string [line 514]
string get_prereq_string(
)
|
|
Gets the prerequisites string
Tags:
method get_prevent_reinit [line 528]
int get_prevent_reinit(
)
|
|
Gets the prevent_reinit attribute value (and sets it if not set already)
Tags:
method get_ref [line 555]
Gets the item's reference column
Tags:
method get_resources_from_source [line 570]
array get_resources_from_source(
[string
$type = null], [string
$abs_path = null], [int
$recursivity = 1])
|
|
Gets the list of included resources as a list of absolute or relative paths of resources included in the current item. This allows for a better SCORM export. The list will generally include pictures, flash objects, java applets, or any other stuff included in the source of the current item. The current item is expected to be an HTML file. If it is not, then the function will return and empty list.
Tags:
Parameters:
method get_score [line 896]
method get_scorm_time [line 957]
void get_scorm_time(
[string
$origin = 'php'], [integer
$given_time = null])
|
|
Gets the total time spent on this item view so far
Parameters:
method get_status [line 912]
string get_status(
[boolean
$check_db = true], [boolean
$update_local = false])
|
|
Gets the item status
Tags:
Parameters:
method get_suspend_data [line 946]
method get_title [line 991]
Returns the item's title
Tags:
method get_total_time [line 1000]
integer get_total_time(
)
|
|
Returns the total time used to see that item
Tags:
method get_type [line 1017]
method get_view_count [line 1032]
Gets the view count for this item
method is_done [line 1044]
Tells if an item is done ('completed','passed','succeeded') or not
Tags:
method is_restart_allowed [line 1059]
integer is_restart_allowed(
)
|
|
Tells if a restart is allowed (take it from $this->prevent_reinit and $this->status)
Tags:
method open [line 1083]
boolean open(
[
$allow_new_attempt = false])
|
|
Opens/launches the item. Initialises runtime values.
Tags:
Parameters:
method output [line 1118]
Outputs the item contents
Tags:
method parse_HTML_attributes [line 1425]
array parse_HTML_attributes(
string
$attrString, [array
$wanted = array()])
|
|
Parses the HTML attributes given as string.
Tags:
Parameters:
method parse_prereq [line 1137]
boolean parse_prereq(
string
$prereqs_string, Array
$items, Array
$refs_list, integer
$user_id)
|
|
Parses the prerequisites string with the AICC logic language
Tags:
Parameters:
method restart [line 1503]
Reinits all local values as the learnpath is restarted
Tags:
method save [line 1541]
boolean save(
[boolean
$from_outside = true], [boolean
$prereqs_complete = false])
|
|
Saves data in the database
Tags:
Overridden in child classes as:
- aiccItem::save()
- Save function. Uses the parent save function and adds a layer for AICC.
- scormItem::save()
- Save function. Uses the parent save function and adds a layer for SCORM.
Parameters:
method set_attempt_id [line 1655]
boolean set_attempt_id(
integer
$num)
|
|
Sets the number of attempt_id to a given value
Tags:
Parameters:
method set_core_exit [line 1667]
void set_core_exit(
$value)
|
|
Sets the core_exit value to the one given
Parameters:
method set_description [line 1686]
void set_description(
[string
$string = ''])
|
|
Sets the item's description
Parameters:
method set_lesson_location [line 1695]
boolean set_lesson_location(
string
$location)
|
|
Sets the lesson_location value
Tags:
Parameters:
method set_level [line 1708]
void set_level(
[integer
$int = 0])
|
|
Sets the item's depth level in the LP tree (0 is at root)
Parameters:
method set_lp_view [line 1717]
void set_lp_view(
integer
$lp_view_id)
|
|
Sets the lp_view id this item view is registered to
Tags:
Parameters:
method set_max_score [line 1820]
boolean set_max_score(
int
$score)
|
|
Sets the maximum score for this item
Tags:
Parameters:
method set_path [line 1771]
void set_path(
[string
$string = ''])
|
|
Sets the path
Parameters:
method set_prevent_reinit [line 1780]
void set_prevent_reinit(
integer
$prevent)
|
|
Sets the prevent_reinit attribute. This is based on the LP value and is set at creation time for each learnpathItem. It is a (bad?) way of avoiding a reference to the LP when saving an item.
Parameters:
method set_score [line 1794]
boolean set_score(
float
$score)
|
|
Sets the score value. If the mastery_score is set and the score reaches it, then set the status to 'passed'.
Tags:
Parameters:
method set_status [line 1836]
boolean set_status(
string
$status)
|
|
Sets the status for this item
Tags:
Parameters:
method set_time [line 1860]
void set_time(
string
$scorm_time, [
$format = 'scorm'])
|
|
Sets the item viewing time in a usable form, given that SCORM packages often give it as 00:00:00.0000
Parameters:
method set_title [line 1890]
void set_title(
[string
$string = ''])
|
|
Sets the item's title
Parameters:
method set_type [line 1898]
void set_type(
[string
$string = ''])
|
|
Sets the item's type
Parameters:
method status_is [line 1907]
boolean status_is(
[strings_array
$list = array()])
|
|
Checks if the current status is part of the list of status given
Tags:
Parameters:
method update_time [line 1932]
void update_time(
[integer
$total_sec = 0])
|
|
Updates the time info according to the given session_time
Parameters:
method write_objectives_to_db [line 1970]
boolean write_objectives_to_db(
)
|
|
Write objectives to DB. This method is separate from write_to_db() because otherwise objectives are lost as a side effect to AJAX and session concurrent access
Tags:
method write_to_db [line 2029]
Writes the current data to the database
Tags:
|
|