aiccObjective.class.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php //$id:$
  2. /**
  3. * Container for the aiccResource class that deals with elemens from AICC Objectives file
  4. * @package scorm.learnpath
  5. * @author Yannick Warnier <ywarnier@beeznest.org>
  6. * @license GNU/GPL - See Dokeos license directory for details
  7. */
  8. /**
  9. * Class defining the Block elements in an AICC Course Structure file
  10. *
  11. */
  12. require_once('learnpathItem.class.php');
  13. class aiccObjective extends learnpathItem{
  14. var $identifier = '';
  15. var $members = array();
  16. /**
  17. * Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource
  18. * object from database records or from the array given as second param
  19. * @param string Type of construction needed ('db' or 'config', default = 'config')
  20. * @param mixed Depending on the type given, DB id for the lp_item or parameters array
  21. */
  22. function aiccObjective($type='config',$params) {
  23. if(isset($params))
  24. {
  25. switch($type){
  26. case 'db':
  27. //TODO implement this way of object creation
  28. return false;
  29. case 'config': //do the same as the default
  30. default:
  31. foreach($params as $a => $value)
  32. {
  33. switch($a)
  34. {
  35. case 'system_id':
  36. $this->identifier = strtolower($value);
  37. break;
  38. case 'member':
  39. if(strstr($value,',')!==false){
  40. $temp = split(',',$value);
  41. foreach($temp as $val){
  42. if(!empty($val)){
  43. $this->members[] = $val;
  44. }
  45. }
  46. }
  47. break;
  48. }
  49. }
  50. return true;
  51. }
  52. }
  53. return false;
  54. }
  55. }
  56. ?>