aicc_hacp.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php // $Id: $
  2. /**
  3. ==============================================================================
  4. * API event handler functions for AICC / CMIv4 in HACP communication mode
  5. *
  6. * @author Denes Nagy <darkden@freemail.hu>
  7. * @author Yannick Warnier <ywarnier@beeznest.org>
  8. * @version v 1.0
  9. * @access public
  10. * @package dokeos.learnpath
  11. * @license GNU/GPL - See Dokeos license directory for details
  12. ==============================================================================
  13. */
  14. /**
  15. * This script is divided into three sections.
  16. * The first section (below) is the initialisation part.
  17. * The second section is the AICC object part
  18. * The third section defines the event handlers for Dokeos' internal messaging
  19. * and frames refresh
  20. *
  21. * This script implements the HACP messaging for AICC. The API messaging is
  22. * made by another set of scripts.
  23. */
  24. /*
  25. ==============================================================================
  26. INIT SECTION
  27. ==============================================================================
  28. */
  29. $debug = 0;
  30. //Use session ID as provided by the request
  31. if(!empty($_REQUEST['aicc_sid']))
  32. {
  33. session_id($_REQUEST['aicc_sid']);
  34. if($debug>1){error_log('New LP - '.__FILE__.','.__LINE__.' - reusing session ID '.$_REQUEST['aicc_sid'],0);}
  35. }
  36. //Load common libraries using a compatibility script to bridge between 1.6 and 1.8
  37. require_once('back_compat.inc.php');
  38. if($debug>2){error_log('New LP - '.__FILE__.','.__LINE__.' - Current session ID: '.session_id(),0);}
  39. //Load learning path libraries so we can use the objects to define the initial values
  40. //of the API
  41. require_once('learnpath.class.php');
  42. require_once('learnpathItem.class.php');
  43. require_once('aicc.class.php');
  44. $_uid = $_SESSION['_uid'];
  45. $_user = $_SESSION['_user'];
  46. $file = $_SESSION['file'];
  47. $oLP = unserialize($_SESSION['lpobject']);
  48. $oItem = $oLP->items[$oLP->current];
  49. if(!is_object($oItem)){
  50. error_log('New LP - scorm_api - Could not load oItem item',0);
  51. exit;
  52. }
  53. $autocomplete_when_80pct = 0;
  54. $result = array(
  55. 'core'=>array(),
  56. 'core_lesson'=>array(),
  57. 'core_vendor'=>array(),
  58. 'evaluation'=>array(),
  59. 'student_data'=>array(),
  60. );
  61. $error_code = 0;
  62. $error_text = '';
  63. $aicc_data = '';
  64. //GET REQUEST
  65. if(!empty($_REQUEST['command']))
  66. {
  67. switch(strtolower($_REQUEST['command']))
  68. {
  69. case 'getparam':
  70. foreach($_REQUEST as $name => $value){
  71. switch(strtolower($name)){
  72. case 'student_id':
  73. break;
  74. case 'student_name':
  75. break;
  76. case 'lesson_location':
  77. break;
  78. case 'credit':
  79. break;
  80. case 'lesson_status':
  81. break;
  82. case 'entry':
  83. break;
  84. case 'score':
  85. break;
  86. case 'time': //total time
  87. break;
  88. case 'lesson_mode':
  89. break;
  90. case 'core_lesson':
  91. break;
  92. case 'core_vendor':
  93. break;
  94. }
  95. }
  96. break;
  97. case 'putparam':
  98. foreach($_REQUEST as $name => $value)
  99. {
  100. switch(strtolower($name))
  101. {
  102. case 'lesson_location':
  103. break;
  104. case 'lesson_status':
  105. break;
  106. case 'exit':
  107. break;
  108. case 'score':
  109. break;
  110. case 'time': //session time
  111. break;
  112. case 'core_lesson':
  113. break;
  114. }
  115. }
  116. break;
  117. case 'putcomments':
  118. break;
  119. case 'putobjectives':
  120. break;
  121. case 'putpath':
  122. break;
  123. case 'putinteractions':
  124. break;
  125. case 'putperformance':
  126. break;
  127. default:
  128. $error_code = 1;
  129. }
  130. }
  131. echo $result;
  132. ?>