claroline/claroline/inc/lib/learnPath.lib.inc.php File Reference

Go to the source code of this file.

Namespaces

namespace  CLLNP

Enumerations

enum  CTCLARODOC_
enum  CTDOCUMENT_
enum  CTEXERCISE_
enum  CTSCORM_
enum  CTLABEL_
enum  DISPLAY_
enum  UPDATE_
enum  UPDATENOTSHOWN_
enum  DELETE_
enum  ASSET_
enum  MODULE_
enum  LEARNINGPATH_
enum  LEARNINGPATHMODULE_

Functions

 commentBox ($type, $mode)
 nameBox ($type, $mode)
 selectImage ($contentType)
 selectAlt ($contentType)
 setOrderTab ($formValuesTab)
 is_num ($var)
 display_path_content ()
 get_learnPath_progress ($lpid, $lpUid)
 display_my_exercises ($dialogBox)
 display_my_documents ($dialogBox)
 find_deep ($id, $searchIn)
 build_element_list ($list, $parentField, $idField, $id=0)
 build_display_element_list ($elementList, $deepness=0)
 set_module_tree_visibility ($module_tree, $visibility)
 delete_module_tree ($module_tree)
 get_module_tree ($lpModules, $id, $field= 'module_id')
 seconds_to_scorm_time ($time)
 isScormTime ($time)
 addScormTime ($time1, $time2)
 delete_exercise_asset ($exerciseId)
 is_learnpath_accessible ($pathId)

Enumeration Type Documentation

enum ASSET_

type used by commentBox($type, $mode) and nameBox($type, $mode)

Definition at line 62 of file learnPath.lib.inc.php.

content type

Definition at line 25 of file learnPath.lib.inc.php.

content type

Definition at line 29 of file learnPath.lib.inc.php.

content type

Definition at line 33 of file learnPath.lib.inc.php.

enum CTLABEL_

content type

Definition at line 41 of file learnPath.lib.inc.php.

enum CTSCORM_

content type

Definition at line 37 of file learnPath.lib.inc.php.

enum DELETE_

mode used by commentBox($type, $mode) and nameBox($type, $mode)

Definition at line 57 of file learnPath.lib.inc.php.

enum DISPLAY_

mode used by commentBox($type, $mode) and nameBox($type, $mode)

Definition at line 47 of file learnPath.lib.inc.php.

Definition at line 67 of file learnPath.lib.inc.php.

Definition at line 68 of file learnPath.lib.inc.php.

enum MODULE_

type used by commentBox($type, $mode) and nameBox($type, $mode)

Definition at line 66 of file learnPath.lib.inc.php.

enum UPDATE_

mode used by commentBox($type, $mode) and nameBox($type, $mode)

Definition at line 51 of file learnPath.lib.inc.php.

Definition at line 52 of file learnPath.lib.inc.php.


Function Documentation

addScormTime ( time1,
time2 
)

This function allow to add times saved in the SCORM requested format : hhhh:mm:ss.cc

Parameters:
$time1 a suspected SCORM time value, total_time, in the API
$time2 a suspected SCORM time value, session_time to add, in the API
Author:
Lederer Guillaume <led@cerdecam.be>

Definition at line 1248 of file learnPath.lib.inc.php.

build_display_element_list ( elementList,
deepness = 0 
)

return a flattened tree of the modules of a learnPath after having add 'up' and 'down' fields to let know if the up and down arrows have to be displayed. (recursive function)

Parameters:
$elementList a tree array as one returned by build_element_list
$deepness 
Returns:
array containing infos of the learningpath, each module is an element of this array and each one has 'up' and 'down' boolean and deepness added in
Author:
Piraux Sébastien <pir@cerdecam.be>

Definition at line 1051 of file learnPath.lib.inc.php.

build_element_list ( list,
parentField,
idField,
id = 0 
)

Build an tree of $list from $id using the 'parent' table. (recursive function) Rows with a father id not existing in the array will be ignored

Parameters:
$list modules of the learning path list
$paramField name of the field containing the parent id
$idField name of the field containing the current id
$id learnPath_module_id of the node to build
Returns:
tree of the learning path
Author:
Piraux Sébastien <pir@cerdecam.be>

Definition at line 1003 of file learnPath.lib.inc.php.

commentBox ( type,
mode 
)

This function is used to display comments of module or learning path with admin links if needed. Admin links are 'edit' and 'delete' links.

Parameters:
string $type MODULE_ , LEARNINGPATH_ , LEARNINGPATHMODULE_
string $mode DISPLAY_ , UPDATE_ , DELETE_
Author:
Piraux Sébastien <pir@cerdecam.be>
Lederer Guillaume <led@cerdecam.be>

Definition at line 80 of file learnPath.lib.inc.php.

delete_exercise_asset ( exerciseId  ) 

Definition at line 1334 of file learnPath.lib.inc.php.

delete_module_tree ( module_tree  ) 

This function deletes all the nodes of the tree module_tree

Parameters:
$module_tree tree of modules we want to change the visibility
Author:
Piraux Sébastien <pir@cerdecam.be>

Definition at line 1127 of file learnPath.lib.inc.php.

display_my_documents ( dialogBox  ) 

This function is used to display the list of document available in the course It also displays the form used to add selected document in the learning path

Parameters:
string $dialogBox Error or confirmation text
Returns:
nothing
Author:
Piraux Sébastien <pir@cerdecam.be>
Lederer Guillaume <led@cerdecam.be>

DISPLAY

Definition at line 770 of file learnPath.lib.inc.php.

display_my_exercises ( dialogBox  ) 

This function displays the list of available exercises in this course With the form to add a selected exercise in the learning path

Parameters:
string $dialogBox Error or confirmation text
Author:
Piraux Sébastien <pir@cerdecam.be>
Lederer Guillaume <led@cerdecam.be>

Definition at line 649 of file learnPath.lib.inc.php.

display_path_content (  ) 

This function allows to display the modules content of a learning path. The function must be called from inside a learning path where the session variable path_id is known.

Definition at line 466 of file learnPath.lib.inc.php.

find_deep ( id,
searchIn 
)

Recursive Function used to find the deep of a module in a learning path DEPRECATED : no more since the display has been reorganised

Parameters:
integer $id id_of_module that we are looking for deep
array $searchInarray of parents of modules in a learning path $searchIn[id_of_module] = parent_of_this_module
Author:
Piraux Sébastien <pir@cerdecam.be>

Definition at line 982 of file learnPath.lib.inc.php.

get_learnPath_progress ( lpid,
lpUid 
)

Compute the progression into the $lpid learning path in pourcent

Parameters:
$lpid id of the learning path
$lpUid user id
Returns:
integer percentage of progression os user $mpUid in the learning path $lpid

Definition at line 565 of file learnPath.lib.inc.php.

get_module_tree ( lpModules,
id,
field = 'module_id' 
)

This function return the node with $module_id (recursive)

Parameters:
$lpModules array the tree of all modules in a learning path
$iid node we are looking for
$field type of node we are looking for (learnPath_module_id, module_id,...)
Returns:
array the requesting node (with all its children)
Author:
Piraux Sébastien <pir@cerdecam.be>

Definition at line 1175 of file learnPath.lib.inc.php.

is_learnpath_accessible ( pathId  ) 
Author:
Dimitri Rambout <dimitri.rambout@uclouvain.be
Parameters:
$pathId integer id of a learnPath
Returns:
boolean true if learnpath is blocked, false instead

Definition at line 1418 of file learnPath.lib.inc.php.

is_num ( var  ) 

Check if an input string is a number

Parameters:
string $var input to check
Returns:
bool true if $var is a number, false otherwise
Author:
Piraux Sébastien <pir@cerdecam.be>

Definition at line 445 of file learnPath.lib.inc.php.

isScormTime ( time  ) 

This function allow to see if a time string is the SCORM requested format : hhhh:mm:ss.cc

Parameters:
$time a suspected SCORM time value, returned by the javascript API
Author:
Lederer Guillaume <led@cerdecam.be>

Definition at line 1228 of file learnPath.lib.inc.php.

nameBox ( type,
mode 
)

This function is used to display name of module or learning path with admin links if needed

Parameters:
string $type MODULE_ , LEARNINGPATH_
string $mode display(DISPLAY_) or update(UPDATE_) mode, no delete for a name
Author:
Piraux Sébastien <pir@cerdecam.be>
Lederer Guillaume <led@cerdecam.be>

Definition at line 233 of file learnPath.lib.inc.php.

seconds_to_scorm_time ( time  ) 

Convert the time recorded in seconds to a scorm type

Author:
Piraux Sébastien <pir@cerdecam.be>
Parameters:
$time time in seconds to convert to a scorm type time
Returns:
string compatible scorm type (smaller format)

Definition at line 1201 of file learnPath.lib.inc.php.

selectAlt ( contentType  ) 

This function is used to display the correct alt texte for image in the modules lists. Mainly used at the same time than selectImage() to add an alternate text on the image.

Parameters:
string $contentType type of content in learning path
Returns:
string text for the alt
Author:
Piraux Sébastien <pir@cerdecam.be>
Lederer Guillaume <led@cerdecam.be>

Definition at line 372 of file learnPath.lib.inc.php.

selectImage ( contentType  ) 

This function is used to display the correct image in the modules lists It looks for the correct type in the array, and return the corresponding image name if found else it returns a default image

Parameters:
string $contentType type of content in learning path
Returns:
string name of the image with extension
Author:
Piraux Sébastien <pir@cerdecam.be>
Lederer Guillaume <led@cerdecam.be>

Definition at line 345 of file learnPath.lib.inc.php.

set_module_tree_visibility ( module_tree,
visibility 
)

This function set visibility for all the nodes of the tree module_tree

Parameters:
$module_tree tree of modules we want to change the visibility
$visibility ths visibility string as requested by the DB
Author:
Piraux Sébastien <pir@cerdecam.be>

Definition at line 1101 of file learnPath.lib.inc.php.

setOrderTab ( formValuesTab  ) 

This function receives an array like $table['idOfThingToOrder'] = $requiredOrder and will return a sorted array like $table[$i] = $idOfThingToOrder the id list is sorted according to the $requiredOrder values

Parameters:
$formValuesTab array an array like these sent by the form on learingPathAdmin.php for an exemple
Returns:
array an array of the sorted list of ids
Author:
Piraux Sébastien <pir@cerdecam.be>
Lederer Guillaume <led@cerdecam.be>

Definition at line 399 of file learnPath.lib.inc.php.

Generated on Tue Jun 8 12:28:37 2010 for Claroline API by  doxygen 1.6.3