soap_report.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Configures the WSReport SOAP service
  5. * @package chamilo.webservices
  6. */
  7. require_once(dirname(__FILE__).'/webservice_report.php');
  8. require_once(dirname(__FILE__).'/soap.php');
  9. $s = WSSoapServer::singleton();
  10. $s->wsdl->addComplexType(
  11. 'user_id',
  12. 'complexType',
  13. 'struct',
  14. 'all',
  15. '',
  16. array(
  17. 'user_id_field_name' => array('name' => 'user_id_field_name', 'type' => 'xsd:string'),
  18. 'user_id_value' => array('name' => 'user_id_value', 'type' => 'xsd:string')
  19. )
  20. );
  21. $s->wsdl->addComplexType(
  22. 'course_id',
  23. 'complexType',
  24. 'struct',
  25. 'all',
  26. '',
  27. array(
  28. 'course_id_field_name' => array('name' => 'course_id_field_name', 'type' => 'xsd:string'),
  29. 'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string')
  30. )
  31. );
  32. $s->wsdl->addComplexType(
  33. 'session_id',
  34. 'complexType',
  35. 'struct',
  36. 'all',
  37. '',
  38. array(
  39. 'session_id_field_name' => array('name' => 'session_id_field_name', 'type' => 'xsd:string'),
  40. 'session_id_value' => array('name' => 'session_id_value', 'type' => 'xsd:string')
  41. )
  42. );
  43. /*
  44. $s->wsdl->addComplexType(
  45. 'user_result',
  46. 'complexType',
  47. 'struct',
  48. 'all',
  49. '',
  50. array(
  51. 'user_id_value' => array('name' => 'user_id_value', 'type' => 'xsd:string'),
  52. 'result' => array('name' => 'result', 'type' => 'tns:result')
  53. )
  54. );*/
  55. $s->wsdl->addComplexType(
  56. 'user_result',
  57. 'complexType',
  58. 'struct',
  59. 'all',
  60. '',
  61. array(
  62. 'id' => array('name' => 'id', 'type' => 'xsd:string'),
  63. 'title' => array('name' => 'title', 'type' => 'xsd:string')
  64. )
  65. );
  66. $s->wsdl->addComplexType(
  67. 'progress_result',
  68. 'complexType',
  69. 'struct',
  70. 'all',
  71. '',
  72. array(
  73. 'progress_bar_mode' => array('name' => 'progress_bar_mode', 'type' => 'xsd:string'),
  74. 'progress_db' => array('name' => 'progress_db', 'type' => 'xsd:string')
  75. )
  76. );
  77. $s->wsdl->addComplexType(
  78. 'score_result',
  79. 'complexType',
  80. 'struct',
  81. 'all',
  82. '',
  83. array(
  84. 'min_score' => array('name' => 'min_score', 'type' => 'xsd:string'),
  85. 'max_score' => array('name' => 'max_score', 'type' => 'xsd:string'),
  86. 'mastery_score' => array('name' => 'mastery_score', 'type' => 'xsd:string'),
  87. 'current_score' => array('name' => 'current_score', 'type' => 'xsd:string'),
  88. )
  89. );
  90. $s->wsdl->addComplexType(
  91. 'user_result_array',
  92. 'complexType',
  93. 'array',
  94. '',
  95. 'SOAP-ENC:Array',
  96. array(),
  97. array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:user_result[]')),
  98. 'tns:user_result'
  99. );
  100. $s->register(
  101. 'WSReport.GetTimeSpentOnPlatform',
  102. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string'),
  103. array('return' => 'xsd:string')
  104. );
  105. $s->register(
  106. 'WSReport.GetTimeSpentOnCourse',
  107. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string'),
  108. array('return' => 'xsd:string')
  109. );
  110. $s->register(
  111. 'WSReport.GetTimeSpentOnCourseInSession',
  112. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string', 'session_id_field_name' => 'xsd:string', 'session_id_value' => 'xsd:string'),
  113. array('return' => 'xsd:string')
  114. );
  115. $s->register(
  116. 'WSReport.GetTimeSpentOnLearnpathInCourse',
  117. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string', 'learnpath_id' => 'xsd:string'),
  118. array('return' => 'xsd:string')
  119. );
  120. $s->register(
  121. 'WSReport.GetLearnpathsByCourse',
  122. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string'),
  123. array('return' => 'tns:user_result_array')
  124. );
  125. $s->register(
  126. 'WSReport.GetLearnpathProgress',
  127. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string', 'learnpath_id' => 'xsd:string'),
  128. array('return' => 'tns:progress_result')
  129. );
  130. $s->register(
  131. 'WSReport.GetLearnpathHighestLessonLocation',
  132. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string', 'learnpath_id' => 'xsd:string'),
  133. array('return' => 'xsd:string')
  134. );
  135. $s->register(
  136. 'WSReport.GetLearnpathScoreSingleItem',
  137. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string', 'learnpath_id' => 'xsd:string', 'learnpath_item_id' => 'xsd:string'),
  138. array('return' => 'tns:score_result')
  139. );
  140. $s->register(
  141. 'WSReport.GetLearnpathStatusSingleItem',
  142. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string', 'learnpath_id' => 'xsd:string', 'learnpath_item_id' => 'xsd:string'),
  143. array('return' => 'xsd:string')
  144. );
  145. $s->register(
  146. 'WSReport.test',
  147. array(),
  148. array('return' => 'xsd:string')
  149. );