soap_report.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Configures the WSReport SOAP service.
  5. *
  6. * @package chamilo.webservices
  7. */
  8. require_once __DIR__.'/webservice_report.php';
  9. require_once __DIR__.'/soap.php';
  10. $s = WSSoapServer::singleton();
  11. $s->wsdl->addComplexType(
  12. 'user_id',
  13. 'complexType',
  14. 'struct',
  15. 'all',
  16. '',
  17. [
  18. 'user_id_field_name' => [
  19. 'name' => 'user_id_field_name',
  20. 'type' => 'xsd:string',
  21. ],
  22. 'user_id_value' => [
  23. 'name' => 'user_id_value',
  24. 'type' => 'xsd:string',
  25. ],
  26. ]
  27. );
  28. $s->wsdl->addComplexType(
  29. 'course_id',
  30. 'complexType',
  31. 'struct',
  32. 'all',
  33. '',
  34. [
  35. 'course_id_field_name' => [
  36. 'name' => 'course_id_field_name',
  37. 'type' => 'xsd:string',
  38. ],
  39. 'course_id_value' => [
  40. 'name' => 'course_id_value',
  41. 'type' => 'xsd:string',
  42. ],
  43. ]
  44. );
  45. $s->wsdl->addComplexType(
  46. 'session_id',
  47. 'complexType',
  48. 'struct',
  49. 'all',
  50. '',
  51. [
  52. 'session_id_field_name' => [
  53. 'name' => 'session_id_field_name',
  54. 'type' => 'xsd:string',
  55. ],
  56. 'session_id_value' => [
  57. 'name' => 'session_id_value',
  58. 'type' => 'xsd:string',
  59. ],
  60. ]
  61. );
  62. /*
  63. $s->wsdl->addComplexType(
  64. 'user_result',
  65. 'complexType',
  66. 'struct',
  67. 'all',
  68. '',
  69. array(
  70. 'user_id_value' => array('name' => 'user_id_value', 'type' => 'xsd:string'),
  71. 'result' => array('name' => 'result', 'type' => 'tns:result')
  72. )
  73. );*/
  74. $s->wsdl->addComplexType(
  75. 'user_result',
  76. 'complexType',
  77. 'struct',
  78. 'all',
  79. '',
  80. [
  81. 'id' => ['name' => 'id', 'type' => 'xsd:string'],
  82. 'title' => ['name' => 'title', 'type' => 'xsd:string'],
  83. ]
  84. );
  85. $s->wsdl->addComplexType(
  86. 'progress_result',
  87. 'complexType',
  88. 'struct',
  89. 'all',
  90. '',
  91. [
  92. 'progress_bar_mode' => [
  93. 'name' => 'progress_bar_mode',
  94. 'type' => 'xsd:string',
  95. ],
  96. 'progress_db' => ['name' => 'progress_db', 'type' => 'xsd:string'],
  97. ]
  98. );
  99. $s->wsdl->addComplexType(
  100. 'score_result',
  101. 'complexType',
  102. 'struct',
  103. 'all',
  104. '',
  105. [
  106. 'min_score' => ['name' => 'min_score', 'type' => 'xsd:string'],
  107. 'max_score' => ['name' => 'max_score', 'type' => 'xsd:string'],
  108. 'mastery_score' => [
  109. 'name' => 'mastery_score',
  110. 'type' => 'xsd:string',
  111. ],
  112. 'current_score' => [
  113. 'name' => 'current_score',
  114. 'type' => 'xsd:string',
  115. ],
  116. ]
  117. );
  118. $s->wsdl->addComplexType(
  119. 'user_result_array',
  120. 'complexType',
  121. 'array',
  122. '',
  123. 'SOAP-ENC:Array',
  124. [],
  125. [
  126. [
  127. 'ref' => 'SOAP-ENC:arrayType',
  128. 'wsdl:arrayType' => 'tns:user_result[]',
  129. ],
  130. ],
  131. 'tns:user_result'
  132. );
  133. $s->register(
  134. 'WSReport.GetTimeSpentOnPlatform',
  135. [
  136. 'secret_key' => 'xsd:string',
  137. 'user_id_field_name' => 'xsd:string',
  138. 'user_id_value' => 'xsd:string',
  139. ],
  140. ['return' => 'xsd:string']
  141. );
  142. $s->register(
  143. 'WSReport.GetTimeSpentOnCourse',
  144. [
  145. 'secret_key' => 'xsd:string',
  146. 'user_id_field_name' => 'xsd:string',
  147. 'user_id_value' => 'xsd:string',
  148. 'course_id_field_name' => 'xsd:string',
  149. 'course_id_value' => 'xsd:string',
  150. ],
  151. ['return' => 'xsd:string']
  152. );
  153. $s->register(
  154. 'WSReport.GetTimeSpentOnCourseInSession',
  155. [
  156. 'secret_key' => 'xsd:string',
  157. 'user_id_field_name' => 'xsd:string',
  158. 'user_id_value' => 'xsd:string',
  159. 'course_id_field_name' => 'xsd:string',
  160. 'course_id_value' => 'xsd:string',
  161. 'session_id_field_name' => 'xsd:string',
  162. 'session_id_value' => 'xsd:string',
  163. ],
  164. ['return' => 'xsd:string']
  165. );
  166. $s->register(
  167. 'WSReport.GetTimeSpentOnLearnpathInCourse',
  168. [
  169. 'secret_key' => 'xsd:string',
  170. 'user_id_field_name' => 'xsd:string',
  171. 'user_id_value' => 'xsd:string',
  172. 'course_id_field_name' => 'xsd:string',
  173. 'course_id_value' => 'xsd:string',
  174. 'learnpath_id' => 'xsd:string',
  175. ],
  176. ['return' => 'xsd:string']
  177. );
  178. $s->register(
  179. 'WSReport.GetLearnpathsByCourse',
  180. [
  181. 'secret_key' => 'xsd:string',
  182. 'user_id_field_name' => 'xsd:string',
  183. 'user_id_value' => 'xsd:string',
  184. 'course_id_field_name' => 'xsd:string',
  185. 'course_id_value' => 'xsd:string',
  186. ],
  187. ['return' => 'tns:user_result_array']
  188. );
  189. $s->register(
  190. 'WSReport.GetLearnpathProgress',
  191. [
  192. 'secret_key' => 'xsd:string',
  193. 'user_id_field_name' => 'xsd:string',
  194. 'user_id_value' => 'xsd:string',
  195. 'course_id_field_name' => 'xsd:string',
  196. 'course_id_value' => 'xsd:string',
  197. 'learnpath_id' => 'xsd:string',
  198. ],
  199. ['return' => 'tns:progress_result']
  200. );
  201. $s->register(
  202. 'WSReport.GetLearnpathHighestLessonLocation',
  203. [
  204. 'secret_key' => 'xsd:string',
  205. 'user_id_field_name' => 'xsd:string',
  206. 'user_id_value' => 'xsd:string',
  207. 'course_id_field_name' => 'xsd:string',
  208. 'course_id_value' => 'xsd:string',
  209. 'learnpath_id' => 'xsd:string',
  210. ],
  211. ['return' => 'xsd:string']
  212. );
  213. $s->register(
  214. 'WSReport.GetLearnpathScoreSingleItem',
  215. [
  216. 'secret_key' => 'xsd:string',
  217. 'user_id_field_name' => 'xsd:string',
  218. 'user_id_value' => 'xsd:string',
  219. 'course_id_field_name' => 'xsd:string',
  220. 'course_id_value' => 'xsd:string',
  221. 'learnpath_id' => 'xsd:string',
  222. 'learnpath_item_id' => 'xsd:string',
  223. ],
  224. ['return' => 'tns:score_result']
  225. );
  226. $s->register(
  227. 'WSReport.GetLearnpathStatusSingleItem',
  228. [
  229. 'secret_key' => 'xsd:string',
  230. 'user_id_field_name' => 'xsd:string',
  231. 'user_id_value' => 'xsd:string',
  232. 'course_id_field_name' => 'xsd:string',
  233. 'course_id_value' => 'xsd:string',
  234. 'learnpath_id' => 'xsd:string',
  235. 'learnpath_item_id' => 'xsd:string',
  236. ],
  237. ['return' => 'xsd:string']
  238. );
  239. $s->register(
  240. 'WSReport.test',
  241. [],
  242. ['return' => 'xsd:string']
  243. );