jclic 2.1.21 → 2.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/jclic-node.js +9 -8
  3. package/dist/jclic-node.js.map +1 -1
  4. package/dist/jclic.min.js +2 -2
  5. package/dist/jclic.min.js.map +1 -1
  6. package/package.json +4 -4
  7. package/src/GlobalData.js +1 -1
  8. package/src/JClicPlayer.js +2 -2
  9. package/src/bags/MediaBag.js +6 -5
  10. package/dist/1078.jclic-node.js +0 -282
  11. package/dist/1078.jclic-node.js.map +0 -1
  12. package/dist/1196.jclic-node.js +0 -808
  13. package/dist/1196.jclic-node.js.map +0 -1
  14. package/dist/1253.jclic-node.js +0 -1432
  15. package/dist/1253.jclic-node.js.map +0 -1
  16. package/dist/13.jclic-node.js +0 -103
  17. package/dist/13.jclic-node.js.map +0 -1
  18. package/dist/1567.jclic-node.js +0 -2313
  19. package/dist/1567.jclic-node.js.map +0 -1
  20. package/dist/1588.jclic-node.js +0 -602
  21. package/dist/1588.jclic-node.js.map +0 -1
  22. package/dist/1725.jclic-node.js +0 -836
  23. package/dist/1725.jclic-node.js.map +0 -1
  24. package/dist/1731.jclic-node.js +0 -438
  25. package/dist/1731.jclic-node.js.map +0 -1
  26. package/dist/1842.jclic-node.js +0 -651
  27. package/dist/1842.jclic-node.js.map +0 -1
  28. package/dist/2160.jclic-node.js +0 -1016
  29. package/dist/2160.jclic-node.js.map +0 -1
  30. package/dist/222.jclic-node.js +0 -129
  31. package/dist/222.jclic-node.js.map +0 -1
  32. package/dist/2316.jclic-node.js +0 -949
  33. package/dist/2316.jclic-node.js.map +0 -1
  34. package/dist/2355.jclic-node.js +0 -371
  35. package/dist/2355.jclic-node.js.map +0 -1
  36. package/dist/2366.jclic-node.js +0 -431
  37. package/dist/2366.jclic-node.js.map +0 -1
  38. package/dist/2379.jclic-node.js +0 -202
  39. package/dist/2379.jclic-node.js.map +0 -1
  40. package/dist/2437.jclic-node.js +0 -450
  41. package/dist/2437.jclic-node.js.map +0 -1
  42. package/dist/2531.jclic-node.js +0 -869
  43. package/dist/2531.jclic-node.js.map +0 -1
  44. package/dist/2608.jclic-node.js +0 -160
  45. package/dist/2608.jclic-node.js.map +0 -1
  46. package/dist/2715.jclic-node.js +0 -554
  47. package/dist/2715.jclic-node.js.map +0 -1
  48. package/dist/277.jclic-node.js +0 -22
  49. package/dist/277.jclic-node.js.map +0 -1
  50. package/dist/2921.jclic-node.js +0 -660
  51. package/dist/2921.jclic-node.js.map +0 -1
  52. package/dist/2952.jclic-node.js +0 -101
  53. package/dist/2952.jclic-node.js.map +0 -1
  54. package/dist/3018.jclic-node.js +0 -421
  55. package/dist/3018.jclic-node.js.map +0 -1
  56. package/dist/3019.jclic-node.js +0 -682
  57. package/dist/3019.jclic-node.js.map +0 -1
  58. package/dist/3231.jclic-node.js +0 -274
  59. package/dist/3231.jclic-node.js.map +0 -1
  60. package/dist/331.jclic-node.js +0 -115
  61. package/dist/331.jclic-node.js.map +0 -1
  62. package/dist/3391.jclic-node.js +0 -276
  63. package/dist/3391.jclic-node.js.map +0 -1
  64. package/dist/3502.jclic-node.js +0 -671
  65. package/dist/3502.jclic-node.js.map +0 -1
  66. package/dist/3653.jclic-node.js +0 -982
  67. package/dist/3653.jclic-node.js.map +0 -1
  68. package/dist/371.jclic.min.js +0 -2
  69. package/dist/371.jclic.min.js.map +0 -1
  70. package/dist/3856.jclic-node.js +0 -575
  71. package/dist/3856.jclic-node.js.map +0 -1
  72. package/dist/4112.jclic-node.js +0 -659
  73. package/dist/4112.jclic-node.js.map +0 -1
  74. package/dist/4123.jclic-node.js +0 -910
  75. package/dist/4123.jclic-node.js.map +0 -1
  76. package/dist/427.jclic-node.js +0 -894
  77. package/dist/427.jclic-node.js.map +0 -1
  78. package/dist/4483.jclic-node.js +0 -327
  79. package/dist/4483.jclic-node.js.map +0 -1
  80. package/dist/4548.jclic-node.js +0 -1078
  81. package/dist/4548.jclic-node.js.map +0 -1
  82. package/dist/466.jclic-node.js +0 -99
  83. package/dist/466.jclic-node.js.map +0 -1
  84. package/dist/485.jclic-node.js +0 -783
  85. package/dist/485.jclic-node.js.map +0 -1
  86. package/dist/4921.jclic-node.js +0 -500
  87. package/dist/4921.jclic-node.js.map +0 -1
  88. package/dist/5091.jclic-node.js +0 -239
  89. package/dist/5091.jclic-node.js.map +0 -1
  90. package/dist/520.jclic-node.js +0 -550
  91. package/dist/520.jclic-node.js.map +0 -1
  92. package/dist/5312.jclic-node.js +0 -1126
  93. package/dist/5312.jclic-node.js.map +0 -1
  94. package/dist/5338.jclic-node.js +0 -212
  95. package/dist/5338.jclic-node.js.map +0 -1
  96. package/dist/5344.jclic-node.js +0 -229
  97. package/dist/5344.jclic-node.js.map +0 -1
  98. package/dist/5550.jclic-node.js +0 -238
  99. package/dist/5550.jclic-node.js.map +0 -1
  100. package/dist/5626.jclic-node.js +0 -614
  101. package/dist/5626.jclic-node.js.map +0 -1
  102. package/dist/5977.jclic-node.js +0 -1081
  103. package/dist/5977.jclic-node.js.map +0 -1
  104. package/dist/6148.jclic-node.js +0 -345
  105. package/dist/6148.jclic-node.js.map +0 -1
  106. package/dist/6176.jclic-node.js +0 -481
  107. package/dist/6176.jclic-node.js.map +0 -1
  108. package/dist/6221.jclic-node.js +0 -1072
  109. package/dist/6221.jclic-node.js.map +0 -1
  110. package/dist/6238.jclic-node.js +0 -718
  111. package/dist/6238.jclic-node.js.map +0 -1
  112. package/dist/6454.jclic-node.js +0 -1413
  113. package/dist/6454.jclic-node.js.map +0 -1
  114. package/dist/6565.jclic-node.js +0 -294
  115. package/dist/6565.jclic-node.js.map +0 -1
  116. package/dist/6579.jclic-node.js +0 -719
  117. package/dist/6579.jclic-node.js.map +0 -1
  118. package/dist/6715.jclic-node.js +0 -148
  119. package/dist/6715.jclic-node.js.map +0 -1
  120. package/dist/6777.jclic-node.js +0 -171
  121. package/dist/6777.jclic-node.js.map +0 -1
  122. package/dist/6782.jclic-node.js +0 -1611
  123. package/dist/6782.jclic-node.js.map +0 -1
  124. package/dist/6847.jclic-node.js +0 -601
  125. package/dist/6847.jclic-node.js.map +0 -1
  126. package/dist/6856.jclic-node.js +0 -252
  127. package/dist/6856.jclic-node.js.map +0 -1
  128. package/dist/696.jclic-node.js +0 -1821
  129. package/dist/696.jclic-node.js.map +0 -1
  130. package/dist/698.jclic-node.js +0 -583
  131. package/dist/698.jclic-node.js.map +0 -1
  132. package/dist/704.jclic-node.js +0 -80
  133. package/dist/704.jclic-node.js.map +0 -1
  134. package/dist/7046.jclic-node.js +0 -735
  135. package/dist/7046.jclic-node.js.map +0 -1
  136. package/dist/7220.jclic-node.js +0 -156
  137. package/dist/7220.jclic-node.js.map +0 -1
  138. package/dist/7257.jclic-node.js +0 -931
  139. package/dist/7257.jclic-node.js.map +0 -1
  140. package/dist/743.jclic-node.js +0 -583
  141. package/dist/743.jclic-node.js.map +0 -1
  142. package/dist/757.jclic-node.js +0 -1072
  143. package/dist/757.jclic-node.js.map +0 -1
  144. package/dist/7781.jclic-node.js +0 -202
  145. package/dist/7781.jclic-node.js.map +0 -1
  146. package/dist/7912.jclic-node.js +0 -2103
  147. package/dist/7912.jclic-node.js.map +0 -1
  148. package/dist/827.jclic-node.js +0 -708
  149. package/dist/827.jclic-node.js.map +0 -1
  150. package/dist/8276.jclic-node.js +0 -409
  151. package/dist/8276.jclic-node.js.map +0 -1
  152. package/dist/8322.jclic-node.js +0 -498
  153. package/dist/8322.jclic-node.js.map +0 -1
  154. package/dist/8641.jclic-node.js +0 -360
  155. package/dist/8641.jclic-node.js.map +0 -1
  156. package/dist/8837.jclic-node.js +0 -651
  157. package/dist/8837.jclic-node.js.map +0 -1
  158. package/dist/8895.jclic-node.js +0 -151
  159. package/dist/8895.jclic-node.js.map +0 -1
  160. package/dist/9072.jclic-node.js +0 -1285
  161. package/dist/9072.jclic-node.js.map +0 -1
  162. package/dist/9078.jclic-node.js +0 -935
  163. package/dist/9078.jclic-node.js.map +0 -1
  164. package/dist/9103.jclic-node.js +0 -718
  165. package/dist/9103.jclic-node.js.map +0 -1
  166. package/dist/9359.jclic-node.js +0 -145
  167. package/dist/9359.jclic-node.js.map +0 -1
  168. package/dist/9409.jclic-node.js +0 -921
  169. package/dist/9409.jclic-node.js.map +0 -1
  170. package/dist/9513.jclic-node.js +0 -720
  171. package/dist/9513.jclic-node.js.map +0 -1
  172. package/dist/9704.jclic-node.js +0 -81
  173. package/dist/9704.jclic-node.js.map +0 -1
  174. package/dist/9950.jclic-node.js +0 -827
  175. package/dist/9950.jclic-node.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"6579.jclic-node.js","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEuB;AACoB;;AAE3C;AACA,gDAAgD,8CAA8C;AAC9F;AACA;AACO;AACP;AACA;AACA,aAAa,wCAAwC;AACrD,aAAa,+BAA+B;AAC5C,aAAa,gCAAgC;AAC7C,MAAM,8FAA8F;AACpG,gBAAgB,iDAAiD;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,uDAAW;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,6CAAC;AACnC;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,4BAA4B,6CAAC;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ,iCAAiC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ,iCAAiC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,wCAAwC;AACpD;AACA;AACA;AACA;AACA,YAAY,gCAAgC;AAC5C;AACA;AACA,uCAAuC,kDAAkD;AACzF;AACA,YAAY,kCAAkC;AAC9C;AACA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA,UAAU,mDAAmD;AAC7D;AACA,YAAY,6CAA6C;AACzD;AACA,CAAC;;AAED;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC;AACxC,0BAA0B,gFAAgF;AAC1G,UAAU,wBAAwB;AAClC;;AAEA,iEAAe,iBAAiB,EAAC;;;;;;;;;;;;;ACxSjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEkC;;AAElC;AACA;AACA;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C,2BAA2B;AACvE;;AAEA;;AAEA;;AAEA;AACA,YAAY,wDAAG,oCAAoC,IAAI;AACvD;AACA;;AAEA;AACA,YAAY,wDAAG;AACf;AACA;;AAEA;AACA,YAAY,wDAAG;AACf;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+CAA+C,wDAAG,qCAAqC,GAAG;;AAE1F;;AAEA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,UAAU,wDAAG;AACb;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,oFAAoF;AACpF;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,CAAC;;AAED;AACA;AACA,UAAU;AACV;AACA;;AAEA,iEAAe,WAAW,EAAC;;;;;;;;;;;;;;;AC1N3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEiF;AAC1B;AACV;;AAE7C;AACA;AACA;AACA,6CAA6C;AAC7C;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,UAAU,+DAAU;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA,mBAAmB,gEAAW;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,WAAW,4DAAO;AAClB,iBAAiB,wDAAO,CAAC;AACzB;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA,WAAW,4DAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,gCAAgC;AAC7C,aAAa,+BAA+B;AAC5C;AACA;AACA;AACA,wBAAwB,6DAAiB,KAAK,wDAAY;AAC1D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,WAAW,wDAAO;AAClB;AACA;AACA;AACA,YAAY,kDAAkD;AAC9D;AACA;AACA;AACA;AACA,YAAY,2BAA2B;AACvC;AACA,CAAC;;AAED,iEAAe,kBAAkB,EAAC","sources":["webpack://jclic/./src/media/ActiveMediaPlayer.js","webpack://jclic/./src/media/AudioBuffer.js","webpack://jclic/./src/media/EventSoundsElement.js"],"sourcesContent":["/**\n * File : media/ActiveMediaPlayer.js\n * Created : 28/04/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\n/* global navigator */\n\nimport $ from 'jquery';\nimport AudioBuffer from './AudioBuffer.js';\n\n/**\n * This kind of object encapsulates a realized {@link module:media/MediaContent.MediaContent} and provides methods to start,\n * stop, pause and record different types of media (audio, video, MIDI, voice recording...)\n */\nexport class ActiveMediaPlayer {\n /**\n * ActiveMediaPlayer constructor\n * @param {module:media/MediaContent.MediaContent} mc - - The content used by this player\n * @param {module:bags/MediaBag.MediaBag} mb - The project's MediaBag\n * @param {module:JClicPlayer.JClicPlayer} ps - An object implementing the\n * {@link http://projectestac.github.io/jclic/apidoc/edu/xtec/jclic/PlayStation.html PlayStation} interface,\n * usually a {@link module:JClicPlayer.JClicPlayer JClicPlayer}.\n */\n constructor(mc, mb, ps) {\n this.mc = mc;\n this.ps = ps;\n switch (mc.type) {\n case 'RECORD_AUDIO':\n if (ActiveMediaPlayer.AUDIO_BUFFERS) {\n this.clearAudioBuffer(mc.recBuffer);\n ActiveMediaPlayer.AUDIO_BUFFERS[mc.recBuffer] = new AudioBuffer(mc.length);\n }\n /* falls through */\n case 'PLAY_RECORDED_AUDIO':\n this.useAudioBuffer = true;\n break;\n case 'PLAY_AUDIO':\n case 'PLAY_VIDEO':\n case 'PLAY_MIDI':\n this.mbe = mb.getElement(mc.file, true);\n break;\n default:\n break;\n }\n }\n\n /**\n * Generates the objects that will play media\n */\n realize() {\n if (this.mbe) {\n this.mbe.build(mbe => {\n if (mbe.data && mbe.data.pause && !mbe.data.paused && !mbe.data.ended && mbe.data.currentTime)\n mbe.data.pause();\n if ((mbe.type === 'video' || mbe.type === 'anim') && mbe.data) {\n this.$visualComponent = $(mbe.data);\n this.$visualComponent.css('z-index', 20);\n }\n }, this.ps, false, this.mc.level);\n }\n }\n\n /**\n * Plays the media, realizing it if needed.\n * @param {module:boxes/ActiveBox.ActiveBox} [_setBx] - The active box where this media will be placed (when video)\n */\n playNow(_setBx) {\n // TODO: Remove unused param \"_setBx\"\n if (this.useAudioBuffer) {\n if (ActiveMediaPlayer.AUDIO_BUFFERS) {\n const $div = this.ps && this.ps.$div;\n const buffer = ActiveMediaPlayer.AUDIO_BUFFERS[this.mc.recBuffer];\n if (buffer) {\n if (this.mc.type === 'RECORD_AUDIO') {\n buffer.record($div);\n } else {\n buffer.play();\n }\n }\n }\n } else if (this.mbe) {\n this.mbe.build(() => {\n if (this.mbe.data) {\n if (this.mbe.type === 'midi') {\n this.mbe.data.playTo = this.mc.to || 0;\n } else {\n let armed = false;\n const $player = $(this.mbe.data);\n // Clear previous event handlers\n $player.off();\n // If there is a time fragment specified, prepare to stop when the `to` position is reached\n if (this.mc.to > 0) {\n $player.on('timeupdate', () => {\n if (armed && this.mbe.data.currentTime >= this.mc.to / 1000) {\n $player.off('timeupdate');\n this.mbe.data.pause();\n }\n });\n }\n // Launch the media despite of its readyState\n armed = true;\n }\n if (!this.mbe.data.paused && !this.mbe.data.ended && this.mbe.data.currentTime)\n this.mbe.data.pause();\n // Seek the media position\n this.mbe.data.currentTime = this.mc.from > 0 ? this.mc.from / 1000 : 0;\n this.mbe.data.play();\n }\n }, this.ps, true, this.mc.level);\n }\n }\n\n /**\n * Plays the media when available, without blocking the current thread.\n * @param {module:boxes/ActiveBox.ActiveBox} [setBx] - The active box where this media will be placed (when video)\n */\n play(setBx) {\n this.stopAllAudioBuffers();\n this.playNow(setBx);\n }\n\n /**\n * Stops the media playing\n */\n stop() {\n if (this.useAudioBuffer)\n this.stopAudioBuffer(this.mc.recBuffer);\n else if (this.mbe && this.mbe.data && this.mbe.data.pause && !this.mbe.data.paused && !this.mbe.data.ended && this.mbe.data.currentTime)\n this.mbe.data.pause();\n }\n\n /**\n * Frees all resources used by this player\n */\n clear() {\n this.stop();\n if (this.useAudioBuffer)\n this.clearAudioBuffer(this.mc.recBuffer);\n }\n\n /**\n * Clears the specified audio buffer\n * @param {number} buffer - Index of the buffer in {@link module:media/ActiveMediaPlayer.ActiveMediaPlayer#AUDIO_BUFFERS AUDIO_BUFFERS}\n */\n clearAudioBuffer(buffer) {\n if (ActiveMediaPlayer.AUDIO_BUFFERS &&\n buffer >= 0 && buffer < ActiveMediaPlayer.AUDIO_BUFFERS.length &&\n ActiveMediaPlayer.AUDIO_BUFFERS[buffer]) {\n ActiveMediaPlayer.AUDIO_BUFFERS[buffer].clear();\n ActiveMediaPlayer.AUDIO_BUFFERS[buffer] = null;\n }\n }\n\n /**\n * Clears all audio buffers\n */\n clearAllAudioBuffers() {\n if (ActiveMediaPlayer.AUDIO_BUFFERS)\n ActiveMediaPlayer.AUDIO_BUFFERS.forEach((_buffer, n) => this.clearAudioBuffer(n));\n }\n\n /**\n * Counts the number of active audio buffers\n * @returns {number}\n */\n countActiveBuffers() {\n return ActiveMediaPlayer.AUDIO_BUFFERS ? ActiveMediaPlayer.AUDIO_BUFFERS.reduce((c, ab) => c + ab ? 1 : 0, 0) : 0;\n }\n\n /**\n * Stops the playing or recording actions of all audio buffers\n */\n stopAllAudioBuffers() {\n if (ActiveMediaPlayer.AUDIO_BUFFERS)\n ActiveMediaPlayer.AUDIO_BUFFERS.forEach(ab => ab ? ab.stop() : null);\n }\n\n /**\n * Stops a specific audio buffer\n * @param {number} buffer - Index of the buffer in {@link module:media/ActiveMediaPlayer.ActiveMediaPlayer#AUDIO_BUFFERS AUDIO_BUFFERS}\n */\n stopAudioBuffer(buffer) {\n if (ActiveMediaPlayer.AUDIO_BUFFERS &&\n buffer >= 0 && buffer < ActiveMediaPlayer.AUDIO_BUFFERS.length &&\n ActiveMediaPlayer.AUDIO_BUFFERS[buffer])\n ActiveMediaPlayer.AUDIO_BUFFERS[buffer].stop();\n }\n\n /**\n * Checks the position of visual components after a displacement or resizing of its container\n * @param {module:boxes/ActiveBox.ActiveBox} _bxi - The container where this player is hosted\n */\n checkVisualComponentBounds(_bxi) {\n // does nothing\n }\n\n /**\n * Sets the visual component of this player visible or invisible\n * @param {boolean} _state - `true` for visible\n */\n setVisualComponentVisible(_state) {\n // TODO: Implement setVisualComponentVisible\n }\n\n /**\n * Sets the ActiveBox associated to this media player\n * @param {module:boxes/ActiveBox.ActiveBox} setBx - The new container of this media. Can be `null`.\n */\n linkTo(setBx) {\n this.bx = setBx;\n if (this.bx && this.$visualComponent)\n this.bx.setHostedComponent(this.$visualComponent);\n }\n}\n\nObject.assign(ActiveMediaPlayer.prototype, {\n /**\n * The MediaContent associated to this player.\n * @name module:media/ActiveMediaPlayer.ActiveMediaPlayer#mc\n * @type {module:media/MediaContent.MediaContent} */\n mc: null,\n /**\n * The player to which this player belongs.\n * @name module:media/ActiveMediaPlayer.ActiveMediaPlayer#ps\n * @type {module:JClicPlayer.JClicPlayer} */\n ps: null,\n /**\n * MediaPlayers should be linked to {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects.\n * @name module:media/ActiveMediaPlayer.ActiveMediaPlayer#bx\n * @type {module:boxes/ActiveBox.ActiveBox} */\n bx: null,\n /**\n * The visual component for videos, usually a `video` HTML element\n * @name module:media/ActiveMediaPlayer.ActiveMediaPlayer#$visualComponent\n * @type {external:jQuery} */\n $visualComponent: null,\n /**\n * When `true`, this player makes use of a recording audio buffer\n * @name module:media/ActiveMediaPlayer.ActiveMediaPlayer#useAudioBuffer\n * @type {boolean} */\n useAudioBuffer: false,\n /**\n * The {@link module:bads/MediaBagElement.MediaBagElement} containing the reference to the media to be played\n * @name module:media/ActiveMediaPlayer.ActiveMediaPlayer#mbe\n * @type {module:bags/MediaBagElement.MediaBagElement} */\n mbe: null,\n});\n\n/**\n * Recording of audio is enabled only when `navigator.getUserMedia` and `MediaRecorder` are defined\n * In 02-Mar-2016 this is implemented only in Firefox 41 and Chrome 49 or later.\n * See: {@link https://addpipe.com/blog/mediarecorder-api}\n * @type Boolean\n */\nActiveMediaPlayer.REC_ENABLED = typeof MediaRecorder !== 'undefined' && typeof navigator !== 'undefined';\n\nif (ActiveMediaPlayer.REC_ENABLED) {\n navigator.getUserMedia = navigator.getUserMedia ||\n navigator.webkitGetUserMedia ||\n navigator.mozGetUserMedia ||\n navigator.msGetUserMedia;\n}\n\n/**\n * Audio buffers used for recording and playing voice are stored in a static array because\n * they are common to all instances of {@link module:media/ActiveMediaPlayer.ActiveMediaPlayer ActiveMediaPlayer}\n * Only initialized when {@link module:media/ActiveMediaPlayer.ActiveMediaPlayer#REC_ENABLED REC_ENABLED} is `true`.\n * @type {external:AudioBuffer[]} */\nActiveMediaPlayer.AUDIO_BUFFERS = ActiveMediaPlayer.REC_ENABLED ? [] : null;\n\nexport default ActiveMediaPlayer;\n","/**\n * File : media/EventSoundsElement.js\n * Created : 01/04/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\n/* global navigator, window, document, Blob, URL, MediaRecorder */\n\nimport { log } from '../Utils.js';\n\n/**\n * The AudioBuffer object provides sound recording and replaying to activities.\n */\nexport class AudioBuffer {\n /**\n * AudioBuffer constructor\n * @param {number} [seconds] - The maximum amount of time allowed to be recorded by this AudioBuffer\n */\n constructor(seconds) {\n if (navigator && navigator.mediaDevices && navigator.mediaDevices.getUserMedia)\n this.enabled = true;\n if (seconds)\n this.seconds = seconds;\n this.chunks = [];\n }\n\n /**\n * Starts playing the currently recorded audio, if any.\n */\n play() {\n this.stop();\n if (this.mediaPlayer) {\n this.mediaPlayer.currentTime = 0;\n this.mediaPlayer.play();\n } else {\n this.playWhenFinished = true;\n }\n }\n\n /**\n * Stops the current operation, either recording or playing audio\n */\n stop() {\n if (this.mediaRecorder && this.mediaRecorder.state === 'recording')\n this.mediaRecorder.stop();\n else if (this.mediaPlayer && !this.mediaPlayer.paused)\n this.mediaPlayer.pause();\n }\n\n /**\n * Starts recording audio, or stops the recording if already started.\n * @param {external:jQuery} [$div] - Optional `div` element where the recording is performed, as a jQuery ref.\n */\n record($div) {\n if (this.mediaRecorder && this.mediaRecorder.state === 'recording')\n this.mediaRecorder.stop();\n else if (this.enabled) {\n this.stop();\n this.mediaPlayer = null;\n\n navigator.mediaDevices.getUserMedia({ audio: true, video: false })\n .then(mediaStream => {\n\n this.mediaRecorder = new MediaRecorder(mediaStream);\n\n this.mediaRecorder.ondataavailable = ev => this.chunks.push(ev.data);\n\n this.mediaRecorder.onerror = err => {\n log('error', `Error recording audio: ${err}`);\n this.mediaRecorder = null;\n };\n\n this.mediaRecorder.onstart = () => {\n log('debug', 'Recording audio started');\n this.visualFeedbak(true, $div);\n };\n\n this.mediaRecorder.onstop = () => {\n log('debug', 'Recording audio finished');\n this.visualFeedbak(false, $div);\n\n if (this.timeoutID) {\n window.clearTimeout(this.timeoutID);\n this.timeoutID = null;\n }\n\n const options = {};\n if (this.chunks.length > 0 && this.chunks[0].type)\n options.type = this.chunks[0].type;\n const blob = new Blob(this.chunks, options);\n this.chunks = [];\n this.mediaPlayer = document.createElement('audio');\n this.mediaPlayer.src = URL.createObjectURL(blob);\n this.mediaPlayer.pause();\n this.mediaRecorder = null;\n if (this.playWhenFinished) {\n this.playWhenFinished = false;\n this.mediaPlayer.play();\n }\n };\n\n this.mediaRecorder.onwarning = ev => log('warn', `Warning recording audio: ${ev}`);\n\n this.playWhenFinished = false;\n\n this.mediaRecorder.start();\n\n this.timeoutID = window.setTimeout(() => {\n if (this.mediaRecorder);\n this.mediaRecorder.stop();\n }, this.seconds * 1000);\n })\n .catch(err => {\n log('error', err.toString());\n this.visualFeedbak(false, $div);\n });\n }\n }\n\n /**\n * Set visual feedback to the user while the system is recording audio\n * Currently changes the cursor pointer associated to the HTML element\n * containing the recorder.\n * @param {boolean} enabled - Flag indicating if the visual feedback should be active or inactive\n * @param {external:jQuery} [$div] - Optional `div` element where the recording is performed, as a jQuery ref.\n */\n visualFeedbak(enabled, $div) {\n if ($div)\n $div.css('cursor', enabled ? 'progress' : 'inherit');\n }\n\n /**\n * Clears all data associated to this AudioBuffer\n */\n clear() {\n this.stop();\n this.mediaPlayer = null;\n }\n}\n\nObject.assign(AudioBuffer.prototype, {\n /**\n * AudioBuffer is enabled only in browsers with `navigator.MediaDevices.getuserMedia`\n * @name module:media/AudioBuffer.AudioBuffer#enabled\n * @type {boolean}\n */\n enabled: false,\n /**\n * Maximum length of recordings allowed to this AudioBuffer (in seconds)\n * @name module:media/AudioBuffer.AudioBuffer#seconds\n * @type {number}\n */\n seconds: 20,\n /**\n * The object used to record audio data and convert it to a valid stream for the {@link module:media/ActiveMediaPlayer.ActiveMediaPlayer ActiveMediaPlayer}\n * @name module:media/AudioBuffer.AudioBuffer#mediaRecorder\n * @type {external:MediaRecorder}\n */\n mediaRecorder: null,\n /**\n * Array of data chunks collected during the recording\n * @name module:media/AudioBuffer.AudioBuffer#chunks\n * @type {external:Blob[]}\n */\n chunks: null,\n /**\n * The HTML audio element used to play the recorded sound\n * @name module:media/AudioBuffer.AudioBuffer#mediaPlayer\n * @type {external:HTMLAudioElement}\n */\n mediaPlayer: null,\n /**\n * The identifier of the timer launched to stop the recording when the maximum time is exceeded.\n * This member is `null` when no timeout function is associated to this AudioBuffer\n * @name module:media/AudioBuffer.AudioBuffer#timeoutID\n * @type {number}\n */\n timeoutID: null,\n /**\n * Instructs this AudioBuffer recorder to start playing the collected audio at the end of the\n * current `mediaRecorder` task.\n * @name module:media/AudioBuffer.AudioBuffer#playWhenFinished\n * @type {boolean}\n */\n playWhenFinished: false,\n});\n\n/**\n * Maximum amount of time allowed for recordings (in seconds)\n * @type {number}\n */\nAudioBuffer.MAX_RECORD_LENGTH = 180;\n\nexport default AudioBuffer;\n","/**\n * File : media/EventSoundsElement.js\n * Created : 01/04/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\n/* global Audio */\n\nimport { startsWith, getTriState, getAttr, setAttr, DEFAULT } from '../Utils.js';\nimport ActiveMediaPlayer from './ActiveMediaPlayer.js';\nimport MediaContent from './MediaContent.js';\n\n/**\n * The EventSoundsElement object contains the description of a specific sound to be played when\n * one of the JClic events are fired.\n * For a full list of the JClic events see: {@link module:media/EventSounds.EventSounds EventSounds}\n */\nexport class EventSoundsElement {\n /**\n * EventSoundsElement constructor\n * @param {string} id - The identifier of this media sound\n * @param {string} [file] - An optional file name or URL containing the sound data\n */\n constructor(id, file) {\n this.id = id;\n if (file) {\n if (startsWith(file, 'data:'))\n this.audio = new Audio(file);\n else\n this.file = file;\n }\n }\n\n /**\n * Reads the properties of this object from an XML element\n * @param {external:jQuery} $xml - The XML element to be parsed\n */\n setProperties($xml) {\n this.file = $xml.attr('file');\n this.enabled = getTriState($xml.attr('enabled'));\n return this;\n }\n\n /**\n * Gets a object with the basic attributes needed to rebuild this instance excluding functions,\n * parent references, constants and also attributes retaining the default value.\n * The resulting object is commonly usued to serialize elements in JSON format.\n * @returns {object} - The resulting object, with minimal attrributes\n */\n getAttributes() {\n return getAttr(this, [\n `enabled|${DEFAULT}`,\n 'file',\n ]);\n }\n\n /**\n * Reads the properties of this EventSoundsElement from a data object\n * @param {object} data - The data object to be parsed\n * @returns {module:media/EventSoundsElement.EventSoundsElement}\n */\n setAttributes(data) {\n return setAttr(this, data, [\n 'enabled',\n 'file',\n ]);\n }\n\n /**\n * Instantiates this audio object\n * @param {module:JClicPlayer.JClicPlayer} ps\n * @param {module:bags/MediaBag.MediaBag} mediaBag\n */\n realize(ps, mediaBag) {\n if (!this.audio && this.player === null && this.file !== null) {\n this.player = new ActiveMediaPlayer(new MediaContent('PLAY_AUDIO', this.file), mediaBag, ps);\n this.player.realize();\n }\n }\n\n /**\n * Plays the audio associated to this event\n */\n play() {\n if (this.enabled) {\n if (this.audio) {\n this.audio.currentTime = 0;\n this.audio.play();\n } else if (this.player)\n this.player.play();\n }\n }\n\n /**\n * Stops playing the audio associated to this event\n */\n stop() {\n if (this.enabled) {\n if (this.audio)\n this.audio.pause();\n else if (this.player)\n this.player.stop();\n }\n }\n}\n\nObject.assign(EventSoundsElement.prototype, {\n /**\n * The name of the sound file used by this element\n * @name module:media/EventSoundsElement.EventSoundsElement#file\n * @type {string} */\n file: null,\n /**\n * Whether the sound for this event is enabled or not\n * @name module:media/EventSoundsElement.EventSoundsElement#enabled\n * @type {number} */\n enabled: DEFAULT,\n /**\n * Media player used to play this sound\n * @name module:media/EventSoundsElement.EventSoundsElement#player\n * @type {module:media/ActiveMediaPlayer.ActiveMediaPlayer} */\n player: null,\n /**\n * HTMLAudioElement used to play this sound\n * @name module:media/EventSoundsElement.EventSoundsElement#audio\n * @type {external:HTMLAudioElement} */\n audio: null,\n});\n\nexport default EventSoundsElement;\n"],"names":[],"sourceRoot":""}
@@ -1,148 +0,0 @@
1
- "use strict";
2
- exports.id = 6715;
3
- exports.ids = [6715];
4
- exports.modules = {
5
-
6
- /***/ 6715:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
11
- /* harmony export */ });
12
- /* unused harmony exports Complete, CompletePanel */
13
- /* harmony import */ var _Activity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1567);
14
- /* harmony import */ var _TextActivityBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(743);
15
- /**
16
- * File : activities/text/Complete.js
17
- * Created : 20/06/2015
18
- * By : Francesc Busquets <francesc@gmail.com>
19
- *
20
- * JClic.js
21
- * An HTML5 player of JClic activities
22
- * https://projectestac.github.io/jclic.js
23
- *
24
- * @source https://github.com/projectestac/jclic.js
25
- *
26
- * @license EUPL-1.2
27
- * @licstart
28
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
29
- *
30
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
31
- * the European Commission- subsequent versions of the EUPL (the "Licence");
32
- * You may not use this work except in compliance with the Licence.
33
- *
34
- * You may obtain a copy of the Licence at:
35
- * https://joinup.ec.europa.eu/software/page/eupl
36
- *
37
- * Unless required by applicable law or agreed to in writing, software
38
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
39
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
40
- * Licence for the specific language governing permissions and limitations
41
- * under the Licence.
42
- * @licend
43
- * @module
44
- */
45
-
46
-
47
-
48
-
49
- /**
50
- * This type of text activity suggests users to complete a given text, without any help on where to
51
- * write the missing words or phrases.
52
- * @extends module:activities/text/TextActivityBase.TextActivityBase
53
- */
54
- class Complete extends _TextActivityBase_js__WEBPACK_IMPORTED_MODULE_1__/* .TextActivityBase */ .q {
55
- /**
56
- * Complete constructor
57
- * @param {module:project/JClicProject.JClicProject} project - The project to which this activity belongs
58
- */
59
- constructor(project) {
60
- super(project);
61
- }
62
- }
63
-
64
- /**
65
- * The {@link module:activities/text/TextActivityBase.TextActivityBasePanel TextActivityBasePanel} where {@link module:activities/text/Complete.Complete Complete} activities are played.
66
- * @extends module:activities/text/TextActivityBasePanel.TextActivityBasePanel
67
- */
68
- class CompletePanel extends _TextActivityBase_js__WEBPACK_IMPORTED_MODULE_1__/* .TextActivityBasePanel */ .c {
69
- /**
70
- * CompletePanel constructor
71
- * @param {module:Activity.Activity} act - The {@link module:Activity.Activity Activity} to which this Panel belongs
72
- * @param {module:JClicPlayer.JClicPlayer} ps - Any object implementing the methods defined in the
73
- * [PlayStation](http://projectestac.github.io/jclic/apidoc/edu/xtec/jclic/PlayStation.html) Java interface.
74
- * @param {external:jQuery} [$div] - The jQuery DOM element where this Panel will deploy
75
- */
76
- constructor(act, ps, $div) {
77
- super(act, ps, $div);
78
- }
79
-
80
- /**
81
- * Creates a target DOM element for the provided target.
82
- * @override
83
- * @param {module:activities/text/TextActivityDocument.TextTarget} _target - The target related to the DOM object to be created
84
- * @param {external:jQuery} _$span - - An initial DOM object (usually a `span`) that can be used
85
- * to store the target, or replaced by another type of object.
86
- * @returns {external:jQuery} - The jQuery DOM element loaded with the target data.
87
- */
88
- $createTargetElement(_target, _$span) {
89
- // Targets are always hidden in this type of activities
90
- return null;
91
- }
92
-
93
- /**
94
- * Called when the activity starts playing
95
- * @override
96
- */
97
- startActivity() {
98
- super.startActivity();
99
- this.$div.find('.JClicTextDocument').attr('contenteditable', 'true').attr('spellcheck', 'false');
100
- }
101
-
102
- /**
103
- * Evaluates all the targets in this panel. This method is usually called from the `Check` button.
104
- * @override
105
- * @returns {boolean} - `true` when all targets are OK, `false` otherwise.
106
- */
107
- evaluatePanel() {
108
- // TODO: Mark errors!
109
- const
110
- currentText = this.$div.find('.JClicTextDocument').text().trim(),
111
- originalText = this.act.document.getRawText(),
112
- ok = this.act.ev.checkText(currentText, originalText);
113
-
114
- this.ps.reportNewAction(this.act, 'WRITE', currentText, originalText, ok, this.targets.length);
115
-
116
- if (ok) {
117
- this.finishActivity(true);
118
- return true;
119
- } else {
120
- this.playEvent('finishedError');
121
- }
122
- return false;
123
- }
124
-
125
- /**
126
- * Ordinary ending of the activity, usually called form `processEvent`
127
- * @param {boolean} result - `true` if the activity was successfully completed, `false` otherwise
128
- */
129
- finishActivity(result) {
130
- this.$div.find('.JClicTextDocument').attr('contenteditable', 'false');
131
- return super.finishActivity(result);
132
- }
133
- }
134
-
135
- /**
136
- * Panel class associated to this type of activity: {@link module:activities/text/Complete.CompletePanel CompletePanel}
137
- * @type {class} */
138
- Complete.Panel = CompletePanel;
139
-
140
- // Register activity class
141
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Activity_js__WEBPACK_IMPORTED_MODULE_0__["default"].registerClass('@text.Complete', Complete));
142
-
143
-
144
- /***/ })
145
-
146
- };
147
- ;
148
- //# sourceMappingURL=6715.jclic-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"6715.jclic-node.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEyC;AACuC;;AAEhF;AACA;AACA;AACA;AACA;AACO,uBAAuB,2EAAgB;AAC9C;AACA;AACA,aAAa,0CAA0C;AACvD;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ,2FAA2F,OAAO,yDAAyD;AACnK;AACA;AACO,4BAA4B,gFAAqB;AACxD;AACA;AACA,aAAa,0BAA0B,WAAW,yCAAyC;AAC3F,aAAa,gCAAgC;AAC7C;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,wDAAwD;AACrE,aAAa,iBAAiB;AAC9B;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qDAAqD;AACrD,UAAU,OAAO;AACjB;;AAEA;AACA,iEAAe,oDAAQ,0CAA0C,EAAC","sources":["webpack://jclic/./src/activities/text/Complete.js"],"sourcesContent":["/**\n * File : activities/text/Complete.js\n * Created : 20/06/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport Activity from '../../Activity.js';\nimport { TextActivityBase, TextActivityBasePanel } from './TextActivityBase.js';\n\n/**\n * This type of text activity suggests users to complete a given text, without any help on where to\n * write the missing words or phrases.\n * @extends module:activities/text/TextActivityBase.TextActivityBase\n */\nexport class Complete extends TextActivityBase {\n /**\n * Complete constructor\n * @param {module:project/JClicProject.JClicProject} project - The project to which this activity belongs\n */\n constructor(project) {\n super(project);\n }\n}\n\n/**\n * The {@link module:activities/text/TextActivityBase.TextActivityBasePanel TextActivityBasePanel} where {@link module:activities/text/Complete.Complete Complete} activities are played.\n * @extends module:activities/text/TextActivityBasePanel.TextActivityBasePanel\n */\nexport class CompletePanel extends TextActivityBasePanel {\n /**\n * CompletePanel constructor\n * @param {module:Activity.Activity} act - The {@link module:Activity.Activity Activity} to which this Panel belongs\n * @param {module:JClicPlayer.JClicPlayer} ps - Any object implementing the methods defined in the\n * [PlayStation](http://projectestac.github.io/jclic/apidoc/edu/xtec/jclic/PlayStation.html) Java interface.\n * @param {external:jQuery} [$div] - The jQuery DOM element where this Panel will deploy\n */\n constructor(act, ps, $div) {\n super(act, ps, $div);\n }\n\n /**\n * Creates a target DOM element for the provided target.\n * @override\n * @param {module:activities/text/TextActivityDocument.TextTarget} _target - The target related to the DOM object to be created\n * @param {external:jQuery} _$span - - An initial DOM object (usually a `span`) that can be used\n * to store the target, or replaced by another type of object.\n * @returns {external:jQuery} - The jQuery DOM element loaded with the target data.\n */\n $createTargetElement(_target, _$span) {\n // Targets are always hidden in this type of activities\n return null;\n }\n\n /**\n * Called when the activity starts playing\n * @override\n */\n startActivity() {\n super.startActivity();\n this.$div.find('.JClicTextDocument').attr('contenteditable', 'true').attr('spellcheck', 'false');\n }\n\n /**\n * Evaluates all the targets in this panel. This method is usually called from the `Check` button.\n * @override\n * @returns {boolean} - `true` when all targets are OK, `false` otherwise.\n */\n evaluatePanel() {\n // TODO: Mark errors!\n const\n currentText = this.$div.find('.JClicTextDocument').text().trim(),\n originalText = this.act.document.getRawText(),\n ok = this.act.ev.checkText(currentText, originalText);\n\n this.ps.reportNewAction(this.act, 'WRITE', currentText, originalText, ok, this.targets.length);\n\n if (ok) {\n this.finishActivity(true);\n return true;\n } else {\n this.playEvent('finishedError');\n }\n return false;\n }\n\n /**\n * Ordinary ending of the activity, usually called form `processEvent`\n * @param {boolean} result - `true` if the activity was successfully completed, `false` otherwise\n */\n finishActivity(result) {\n this.$div.find('.JClicTextDocument').attr('contenteditable', 'false');\n return super.finishActivity(result);\n }\n}\n\n/**\n * Panel class associated to this type of activity: {@link module:activities/text/Complete.CompletePanel CompletePanel}\n * @type {class} */\nComplete.Panel = CompletePanel;\n\n// Register activity class\nexport default Activity.registerClass('@text.Complete', Complete);\n"],"names":[],"sourceRoot":""}
@@ -1,171 +0,0 @@
1
- "use strict";
2
- exports.id = 6777;
3
- exports.ids = [6777];
4
- exports.modules = {
5
-
6
- /***/ 6777:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
11
- /* harmony export */ });
12
- /* unused harmony export Counter */
13
- /**
14
- * File : skins/Counter.js
15
- * Created : 07/05/2015
16
- * By : Francesc Busquets <francesc@gmail.com>
17
- *
18
- * JClic.js
19
- * An HTML5 player of JClic activities
20
- * https://projectestac.github.io/jclic.js
21
- *
22
- * @source https://github.com/projectestac/jclic.js
23
- *
24
- * @license EUPL-1.2
25
- * @licstart
26
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
27
- *
28
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
29
- * the European Commission- subsequent versions of the EUPL (the "Licence");
30
- * You may not use this work except in compliance with the Licence.
31
- *
32
- * You may obtain a copy of the Licence at:
33
- * https://joinup.ec.europa.eu/software/page/eupl
34
- *
35
- * Unless required by applicable law or agreed to in writing, software
36
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
37
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
38
- * Licence for the specific language governing permissions and limitations
39
- * under the Licence.
40
- * @licend
41
- * @module
42
- */
43
-
44
- /**
45
- * This class encapsulates the operation of a numeric counter, used to display the current
46
- * values of score, actions and time.
47
- */
48
- class Counter {
49
- /**
50
- * Counter constructor
51
- * @param {string} id - The type of information stored on this counter
52
- * @param {external:jQuery} [$div] - The HTML element where this counter will show values (can be _null_)
53
- */
54
- constructor(id, $div) {
55
- if (id)
56
- this.id = id;
57
- if ($div)
58
- this.$div = $div;
59
- }
60
-
61
- /**
62
- * Gets the current display value of this counter
63
- * @returns {number}
64
- */
65
- getDisplayValue() {
66
- let result = this.countDown > 0 ? this.countDown - this.value : this.value;
67
- if (this.displayDiffFrom)
68
- result = result - this.displayDiffFrom.value;
69
- return Math.max(0, Math.min(this.MAX_DISPLAY_VALUE, result));
70
- }
71
-
72
- /**
73
- * Paints the value of this counter on screen
74
- * (method to be overridden by subclasses)
75
- */
76
- refreshDisplay() {
77
- if (this.$div)
78
- this.$div.html(this.enabled ? (this.getDisplayValue() + 1000).toString().substring(1) : '000');
79
- }
80
-
81
- /**
82
- * Enables or disables this counter
83
- * @param {boolean} enabled - State been assigned to this counter
84
- */
85
- setEnabled(enabled) {
86
- if (this.enabled !== enabled) {
87
- this.enabled = enabled;
88
- if (this.$div) {
89
- this.refreshDisplay();
90
- this.$div.css('opacity', this.enabled ? 1.0 : 0.3);
91
- }
92
- }
93
- }
94
-
95
- /**
96
- * Sets the initial value of the counter
97
- * @param {number} maxValue - Value from which the countdown will start
98
- */
99
- setCountDown(maxValue) {
100
- if (this.countDown !== (this.countDown = maxValue))
101
- this.refreshDisplay();
102
- }
103
-
104
- /**
105
- * Increments by one the value of this counter
106
- */
107
- incValue() {
108
- this.value++;
109
- if (this.enabled)
110
- this.refreshDisplay();
111
- }
112
-
113
- /**
114
- * Sets a specific value to this counter
115
- * @param {number} value - The value to set
116
- */
117
- setValue(value) {
118
- if (this.enabled && this.value !== (this.value = value))
119
- this.refreshDisplay();
120
- }
121
- }
122
-
123
- Object.assign(Counter.prototype, {
124
- /**
125
- * Type of counter (usually: `score`, `actions` or `time`)
126
- * @name module:skins/Counter.Counter#id
127
- * @type {string} */
128
- id: '',
129
- /**
130
- * The HTML element where this counter shows its value
131
- * @name module:skins/Counter.Counter#$div
132
- * @type {external:jQuery}
133
- */
134
- $div: null,
135
- /**
136
- * Current value of this counter
137
- * @name module:skins/Counter.Counter#value
138
- * @type {number} */
139
- value: 0,
140
- /**
141
- * When set, the counter displays a countdown from this value to zero
142
- * @name module:skins/Counter.Counter#countDown
143
- * @type {number} */
144
- countDown: 0,
145
- /**
146
- * Flag indicating if this counter is currently enabled
147
- * @name module:skins/Counter.Counter#enabled
148
- * @type {boolean} */
149
- enabled: true,
150
- /**
151
- * Maximum value to be displayed by this counter
152
- * @name module:skins/Counter.Counter#MAX_DISPLAY_VALUE
153
- * @type {number} */
154
- MAX_DISPLAY_VALUE: 999,
155
- /**
156
- * An optional Counter used as a subtractor to display the current value.
157
- * Useful to display `errors` subtracting `score` from `actions`.
158
- * @name module:skins/Counter.Counter#displayDiffFrom
159
- * @type {module:skins/Counter.Counter}
160
- */
161
- displayDiffFrom: null,
162
- });
163
-
164
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Counter);
165
-
166
-
167
- /***/ })
168
-
169
- };
170
- ;
171
- //# sourceMappingURL=6777.jclic-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"6777.jclic-node.js","mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,CAAC;;AAED,iEAAe,OAAO,EAAC","sources":["webpack://jclic/./src/skins/Counter.js"],"sourcesContent":["/**\n * File : skins/Counter.js\n * Created : 07/05/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\n/**\n * This class encapsulates the operation of a numeric counter, used to display the current\n * values of score, actions and time.\n */\nexport class Counter {\n /**\n * Counter constructor\n * @param {string} id - The type of information stored on this counter\n * @param {external:jQuery} [$div] - The HTML element where this counter will show values (can be _null_)\n */\n constructor(id, $div) {\n if (id)\n this.id = id;\n if ($div)\n this.$div = $div;\n }\n\n /**\n * Gets the current display value of this counter\n * @returns {number}\n */\n getDisplayValue() {\n let result = this.countDown > 0 ? this.countDown - this.value : this.value;\n if (this.displayDiffFrom)\n result = result - this.displayDiffFrom.value;\n return Math.max(0, Math.min(this.MAX_DISPLAY_VALUE, result));\n }\n\n /**\n * Paints the value of this counter on screen\n * (method to be overridden by subclasses)\n */\n refreshDisplay() {\n if (this.$div)\n this.$div.html(this.enabled ? (this.getDisplayValue() + 1000).toString().substring(1) : '000');\n }\n\n /**\n * Enables or disables this counter\n * @param {boolean} enabled - State been assigned to this counter\n */\n setEnabled(enabled) {\n if (this.enabled !== enabled) {\n this.enabled = enabled;\n if (this.$div) {\n this.refreshDisplay();\n this.$div.css('opacity', this.enabled ? 1.0 : 0.3);\n }\n }\n }\n\n /**\n * Sets the initial value of the counter\n * @param {number} maxValue - Value from which the countdown will start\n */\n setCountDown(maxValue) {\n if (this.countDown !== (this.countDown = maxValue))\n this.refreshDisplay();\n }\n\n /**\n * Increments by one the value of this counter\n */\n incValue() {\n this.value++;\n if (this.enabled)\n this.refreshDisplay();\n }\n\n /**\n * Sets a specific value to this counter\n * @param {number} value - The value to set\n */\n setValue(value) {\n if (this.enabled && this.value !== (this.value = value))\n this.refreshDisplay();\n }\n}\n\nObject.assign(Counter.prototype, {\n /**\n * Type of counter (usually: `score`, `actions` or `time`)\n * @name module:skins/Counter.Counter#id\n * @type {string} */\n id: '',\n /**\n * The HTML element where this counter shows its value\n * @name module:skins/Counter.Counter#$div\n * @type {external:jQuery}\n */\n $div: null,\n /**\n * Current value of this counter\n * @name module:skins/Counter.Counter#value\n * @type {number} */\n value: 0,\n /**\n * When set, the counter displays a countdown from this value to zero\n * @name module:skins/Counter.Counter#countDown\n * @type {number} */\n countDown: 0,\n /**\n * Flag indicating if this counter is currently enabled\n * @name module:skins/Counter.Counter#enabled\n * @type {boolean} */\n enabled: true,\n /**\n * Maximum value to be displayed by this counter\n * @name module:skins/Counter.Counter#MAX_DISPLAY_VALUE\n * @type {number} */\n MAX_DISPLAY_VALUE: 999,\n /**\n * An optional Counter used as a subtractor to display the current value.\n * Useful to display `errors` subtracting `score` from `actions`.\n * @name module:skins/Counter.Counter#displayDiffFrom\n * @type {module:skins/Counter.Counter}\n */\n displayDiffFrom: null,\n});\n\nexport default Counter;\n"],"names":[],"sourceRoot":""}