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,614 +0,0 @@
1
- "use strict";
2
- exports.id = 5626;
3
- exports.ids = [5626,1731,1078,7220];
4
- exports.modules = {
5
-
6
- /***/ 5626:
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 ActivitySequenceElement */
13
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7750);
14
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
15
- /* harmony import */ var _ActivitySequenceJump_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4112);
16
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1253);
17
- /**
18
- * File : bags/ActivitySequenceElement.js
19
- * Created : 05/04/2015
20
- * By : Francesc Busquets <francesc@gmail.com>
21
- *
22
- * JClic.js
23
- * An HTML5 player of JClic activities
24
- * https://projectestac.github.io/jclic.js
25
- *
26
- * @source https://github.com/projectestac/jclic.js
27
- *
28
- * @license EUPL-1.2
29
- * @licstart
30
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
31
- *
32
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
33
- * the European Commission- subsequent versions of the EUPL (the "Licence");
34
- * You may not use this work except in compliance with the Licence.
35
- *
36
- * You may obtain a copy of the Licence at:
37
- * https://joinup.ec.europa.eu/software/page/eupl
38
- *
39
- * Unless required by applicable law or agreed to in writing, software
40
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
41
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
42
- * Licence for the specific language governing permissions and limitations
43
- * under the Licence.
44
- * @licend
45
- * @module
46
- */
47
-
48
-
49
-
50
-
51
-
52
- /**
53
- *
54
- * This class is the basic component of {@link module:bags/ActivitySequence.ActivitySequence ActivitySequence} objects. It represents a specific
55
- * point in the project's sequence of JClic activities.
56
- *
57
- * For each point of the sequence, some options can be set:
58
- * - What activity must run at this point
59
- * - What to do or where to jump when the activity finishes
60
- * - The behavior of the "next" button
61
- * - The behavior of the "prev" button
62
- *
63
- * Sequence points can also have a "tag", used to refer to them with a unique name.
64
- */
65
- class ActivitySequenceElement {
66
- constructor() {
67
- }
68
-
69
- /**
70
- * Loads the object settings from a specific JQuery XML element
71
- * @param {external:jQuery} $xml
72
- */
73
- setProperties($xml) {
74
-
75
- // Iterate on all provided attributes
76
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .attrForEach */ .GM)($xml.get(0).attributes, (name, val) => {
77
- switch (name) {
78
- case 'id':
79
- this['tag'] = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .nSlash */ .c4)(val);
80
- break;
81
- case 'name':
82
- this['activity'] = val;
83
- break;
84
- case 'description':
85
- // possible navButtons values are: `none`, `fwd`, `back` or `both`
86
- case 'navButtons':
87
- this[name] = val;
88
- break;
89
- case 'delay':
90
- this[name] = Number(val);
91
- break;
92
- }
93
- });
94
-
95
- // Iterate on 'jump' elements to load fwdJump and/or backJump
96
- $xml.children('jump').each((_n, data) => {
97
- const jmp = new _ActivitySequenceJump_js__WEBPACK_IMPORTED_MODULE_1__["default"]().setProperties(jquery__WEBPACK_IMPORTED_MODULE_0___default()(data));
98
- if (jmp.id === 'forward')
99
- this.fwdJump = jmp;
100
- else if (jmp.id === 'back')
101
- this.backJump = jmp;
102
- });
103
- return this;
104
- }
105
-
106
- /**
107
- * Gets a object with the basic attributes needed to rebuild this instance excluding functions,
108
- * parent references, constants and also attributes retaining the default value.
109
- * The resulting object is commonly usued to serialize elements in JSON format.
110
- * @returns {object} - The resulting object, with minimal attrributes
111
- */
112
- getAttributes() {
113
- return (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .getAttr */ .iu)(this, ['tag', 'description', 'activity', 'fwdJump', 'backJump', 'navButtons', 'delay']);
114
- }
115
-
116
- /**
117
- * Loads sequence element settings from a data object
118
- * @param {object} data
119
- */
120
- setAttributes(data) {
121
- ['tag', 'description', 'activity', 'navButtons', 'delay'].forEach(t => {
122
- if (!(0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .isEmpty */ .Im)(data[t]))
123
- this[t] = data[t];
124
- });
125
-
126
- ['fwdJump', 'backJump'].forEach(jmp => {
127
- if (data[jmp]) {
128
- this[jmp] = new _ActivitySequenceJump_js__WEBPACK_IMPORTED_MODULE_1__["default"]().setAttributes(data[jmp]);
129
- }
130
- });
131
- return this;
132
- }
133
- }
134
-
135
- Object.assign(ActivitySequenceElement.prototype, {
136
- /**
137
- * Optional unique identifier of this element in the {@link module:bags/ActivitySequence.ActivitySequence ActivitySequence}.
138
- * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#tag
139
- * @type {string} */
140
- tag: null,
141
- /**
142
- * Optional description of this sequence element.
143
- * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#description
144
- * @type {string} */
145
- description: null,
146
- /**
147
- * Name of the {@link module:Activity.Activity Activity} pointed by this element.
148
- * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#activity
149
- * @type {string} */
150
- activity: '',
151
- /**
152
- * Jump to be processed by the 'next' button action
153
- * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#fwdJump
154
- * @type {module:bags/ActivitySequenceJump.ActivitySequenceJump} */
155
- fwdJump: null,
156
- /**
157
- * Jump to be processed by the 'prev' button action.
158
- * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#backJump
159
- * @type {module:bags/ActivitySequenceJump.ActivitySequenceJump} */
160
- backJump: null,
161
- /**
162
- * What buttons should be active at this point of the sequence. Valid values are:
163
- * - 'none'
164
- * - 'fwd'
165
- * - 'back'
166
- * - 'both'
167
- * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#navButtons
168
- * @type {string} */
169
- navButtons: 'both',
170
- /**
171
- * Time delay (in seconds) before passing to the next/prev activity
172
- * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#delay
173
- * @type {number} */
174
- delay: 0,
175
- });
176
-
177
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ActivitySequenceElement);
178
-
179
-
180
- /***/ }),
181
-
182
- /***/ 4112:
183
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
184
-
185
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
186
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
187
- /* harmony export */ });
188
- /* unused harmony export ActivitySequenceJump */
189
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7750);
190
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
191
- /* harmony import */ var _JumpInfo_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7220);
192
- /* harmony import */ var _ConditionalJumpInfo_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1078);
193
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1253);
194
- /**
195
- * File : bags/ActivitySequenceJump.js
196
- * Created : 05/04/2015
197
- * By : Francesc Busquets <francesc@gmail.com>
198
- *
199
- * JClic.js
200
- * An HTML5 player of JClic activities
201
- * https://projectestac.github.io/jclic.js
202
- *
203
- * @source https://github.com/projectestac/jclic.js
204
- *
205
- * @license EUPL-1.2
206
- * @licstart
207
- * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)
208
- *
209
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
210
- * the European Commission- subsequent versions of the EUPL (the "Licence");
211
- * You may not use this work except in compliance with the Licence.
212
- *
213
- * You may obtain a copy of the Licence at:
214
- * https://joinup.ec.europa.eu/software/page/eupl
215
- *
216
- * Unless required by applicable law or agreed to in writing, software
217
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
218
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
219
- * Licence for the specific language governing permissions and limitations
220
- * under the Licence.
221
- * @licend
222
- * @module
223
- */
224
-
225
-
226
-
227
-
228
-
229
-
230
- /**
231
- * This is a special case of {@link module:bags/JumpInfo.JumpInfo JumpInfo}, used only in {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement} objects.
232
- * Sequence elements can contain up to two ActivitySequenceJump objects: one to be processed
233
- * when the user clicks on the "next" button (or when the activity finishes, if in automatic mode),
234
- * and the other used with the "prev" button. ActivitySequenceJump objects define a default jump
235
- * or action to be performed, but can also have up to two {@link module:bags/ConditionalJumpInfo.ConditionalJumpInfo ConditionalJumpInfo} objects. These
236
- * define alternative jumps that are performed only when score or time are below or over a specific
237
- * threshold.
238
- * @extends module:bags/JumpInfo.JumpInfo
239
- */
240
- class ActivitySequenceJump extends _JumpInfo_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
241
- /**
242
- * ActivitySequenceJump constructor
243
- * @param {string} action - Must be one of the described actions.
244
- * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its
245
- * cardinal number in the list.
246
- */
247
- constructor(action, sq) {
248
- super(action, sq);
249
- }
250
-
251
- /**
252
- * Loads the object settings from a specific JQuery XML element.
253
- * @param {external:jQuery} $xml - The XML element to parse
254
- */
255
- setProperties($xml) {
256
- super.setProperties($xml);
257
-
258
- // Read conditional jumps
259
- $xml.children('jump').each((_n, child) => {
260
- const condJmp = new _ConditionalJumpInfo_js__WEBPACK_IMPORTED_MODULE_2__["default"]().setProperties(jquery__WEBPACK_IMPORTED_MODULE_0___default()(child));
261
- if (condJmp.id === 'upper')
262
- this.upperJump = condJmp;
263
- else if (condJmp.id === 'lower')
264
- this.lowerJump = condJmp;
265
- });
266
- return this;
267
- }
268
-
269
- /**
270
- * Gets a object with the basic attributes needed to rebuild this instance excluding functions,
271
- * parent references, constants and also attributes retaining the default value.
272
- * The resulting object is commonly usued to serialize elements in JSON format.
273
- * @returns {object} - The resulting object, with minimal attrributes
274
- */
275
- getAttributes() {
276
- return Object.assign(super.getAttributes(), (0,_Utils_js__WEBPACK_IMPORTED_MODULE_3__/* .getAttr */ .iu)(this, ['upperJump', 'lowerJump']));
277
- }
278
-
279
- /**
280
- * Loads the jump settings from a data object
281
- * @param {object} data - The data object to parse
282
- */
283
- setAttributes(data) {
284
- super.setAttributes(data);
285
-
286
- ['upperJump', 'lowerJump'].forEach(cj => {
287
- if (data[cj])
288
- this[cj] = new _ConditionalJumpInfo_js__WEBPACK_IMPORTED_MODULE_2__["default"]().setAttributes(data[cj]);
289
- });
290
-
291
- return this;
292
- }
293
-
294
-
295
- /**
296
- * Resolves what {@link module:bags/JumpInfo.JumpInfo JumpInfo} must be taken, based on a done time and average rating obtained
297
- * in activities.
298
- * @param {number} rating - Average rating obtained by the user in the activities done during the
299
- * last sequence stretch.
300
- * @param {number} time - Total time spend doing the activities.
301
- * @returns {module:bags/JumpInfo.JumpInfo}
302
- */
303
- resolveJump(rating, time) {
304
- let result = this;
305
- if (rating >= 0 && time >= 0) {
306
- if (this.upperJump !== null &&
307
- rating > this.upperJump.threshold &&
308
- (this.upperJump.time <= 0 || time < this.upperJump.time)) {
309
- result = this.upperJump;
310
- } else if (this.lowerJump !== null &&
311
- (rating < this.lowerJump.threshold ||
312
- this.lowerJump.time > 0 && time > this.lowerJump.time)) {
313
- result = this.lowerJump;
314
- }
315
- }
316
- return result;
317
- }
318
- }
319
-
320
- Object.assign(ActivitySequenceJump.prototype, {
321
- /**
322
- * Optional jump to be performed when the results (score and time) are above a specific threshold.
323
- * @name module:bags/ActivitySequenceJump.ActivitySequenceJump#upperJump
324
- * @type {module:bags/ConditionalJumpInfo.ConditionalJumpInfo} */
325
- upperJump: null,
326
- /**
327
- * Optional jump to be performed when the results (score or time) are below a specific threshold.
328
- * @name module:bags/ActivitySequenceJump.ActivitySequenceJump#lowerJump
329
- * @type {module:bags/ConditionalJumpInfo.ConditionalJumpInfo} */
330
- lowerJump: null,
331
- });
332
-
333
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ActivitySequenceJump);
334
-
335
-
336
- /***/ }),
337
-
338
- /***/ 1078:
339
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
340
-
341
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
342
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
343
- /* harmony export */ });
344
- /* unused harmony export ConditionalJumpInfo */
345
- /* harmony import */ var _JumpInfo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7220);
346
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1253);
347
- /**
348
- * File : bags/ConditionalJumpInfo.js
349
- * Created : 05/04/2015
350
- * By : Francesc Busquets <francesc@gmail.com>
351
- *
352
- * JClic.js
353
- * An HTML5 player of JClic activities
354
- * https://projectestac.github.io/jclic.js
355
- *
356
- * @source https://github.com/projectestac/jclic.js
357
- *
358
- * @license EUPL-1.2
359
- * @licstart
360
- * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)
361
- *
362
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
363
- * the European Commission- subsequent versions of the EUPL (the "Licence");
364
- * You may not use this work except in compliance with the Licence.
365
- *
366
- * You may obtain a copy of the Licence at:
367
- * https://joinup.ec.europa.eu/software/page/eupl
368
- *
369
- * Unless required by applicable law or agreed to in writing, software
370
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
371
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
372
- * Licence for the specific language governing permissions and limitations
373
- * under the Licence.
374
- * @licend
375
- * @module
376
- */
377
-
378
-
379
-
380
-
381
- /**
382
- * This special case of {@link module:bags/JumpInfo.JumpInfo JumpInfo} is used in {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump} objects to decide
383
- * the type of jump or action to be performed, based on the results obtained by the user when
384
- * playing previous JClic activities.
385
- *
386
- * In addition to the standard {@link module:bags/JumpInfo.JumpInfo JumpInfo} fields and methods, this class has two public
387
- * members where score and time thresholds are stored.
388
- *
389
- * The exact meaning of this members will depend on the type of `ConditionalJumpInfo` in the
390
- * {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump} (it can be `upperJump` or `lowerJump`).
391
- * @extends module:bags/JumpInfo.JumpInfo
392
- */
393
- class ConditionalJumpInfo extends _JumpInfo_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
394
- /**
395
- * ConditionalJumpInfo constructor
396
- * @param {string} action - Must be one of the described actions.
397
- * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its
398
- * cardinal number in the list.
399
- * @param {number} [threshold] - Threshold above or below which the action will be triggered,
400
- * depending on the type of JumpInfo.
401
- * @param {number} [time] - Delay to be applied in automatic jumps.
402
- */
403
- constructor(action, sq, threshold, time) {
404
- super(action, sq);
405
- this.threshold = typeof threshold === 'number' ? threshold : -1;
406
- this.time = typeof threshold === 'number' ? time : -1;
407
- }
408
-
409
- /**
410
- * Loads this object settings from a specific JQuery XML element
411
- * @param {external:jQuery} $xml - The XML element to parse
412
- */
413
- setProperties($xml) {
414
- super.setProperties($xml);
415
- if ($xml.attr('threshold') !== undefined)
416
- this.threshold = $xml.attr('threshold');
417
- if ($xml.attr('time') !== undefined)
418
- this.time = $xml.attr('time');
419
- return this;
420
- }
421
-
422
- /**
423
- * Gets a object with the basic attributes needed to rebuild this instance excluding functions,
424
- * parent references, constants and also attributes retaining the default value.
425
- * The resulting object is commonly usued to serialize elements in JSON format.
426
- * @returns {object} - The resulting object, with minimal attrributes
427
- */
428
- getAttributes() {
429
- return Object.assign(super.getAttributes(), (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .getAttr */ .iu)(this, ['threshold', 'time']));
430
- }
431
-
432
- /**
433
- * Loads this conditional jump settings from a data object
434
- * @param {object} data - The data object to parse
435
- */
436
- setAttributes(data) {
437
- super.setAttributes(data);
438
- ['threshold', 'time'].forEach(t => {
439
- if (!(0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .isEmpty */ .Im)(data[t]))
440
- this[t] = data[t];
441
- });
442
- return this;
443
- }
444
- }
445
-
446
- Object.assign(ConditionalJumpInfo.prototype, {
447
- /**
448
- * Threshold above or below which the action will be triggered, depending on the type of JumpInfo.
449
- * @name module:bags/ConditionalJumpInfo.ConditionalJumpInfo#threshold
450
- * @type {number} */
451
- threshold: -1,
452
- /**
453
- * Delay to be applied in automatic jumps.
454
- * @name module:bags/ConditionalJumpInfo.ConditionalJumpInfo#time
455
- * @type {number} */
456
- time: -1,
457
- });
458
-
459
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConditionalJumpInfo);
460
-
461
-
462
- /***/ }),
463
-
464
- /***/ 7220:
465
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
466
-
467
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
468
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
469
- /* harmony export */ });
470
- /* unused harmony export JumpInfo */
471
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1253);
472
- /**
473
- * File : bags/JumpInfo.js
474
- * Created : 05/04/2015
475
- * By : Francesc Busquets <francesc@gmail.com>
476
- *
477
- * JClic.js
478
- * An HTML5 player of JClic activities
479
- * https://projectestac.github.io/jclic.js
480
- *
481
- * @source https://github.com/projectestac/jclic.js
482
- *
483
- * @license EUPL-1.2
484
- * @licstart
485
- * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)
486
- *
487
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
488
- * the European Commission- subsequent versions of the EUPL (the "Licence");
489
- * You may not use this work except in compliance with the Licence.
490
- *
491
- * You may obtain a copy of the Licence at:
492
- * https://joinup.ec.europa.eu/software/page/eupl
493
- *
494
- * Unless required by applicable law or agreed to in writing, software
495
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
496
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
497
- * Licence for the specific language governing permissions and limitations
498
- * under the Licence.
499
- * @licend
500
- * @module
501
- */
502
-
503
-
504
-
505
- /**
506
- * This class contains information about what things JClic sequence manager has to do in certain
507
- * circumstances, such as:
508
- * - an activity finishes
509
- * - the user clicks on the "next" or "prev" buttons
510
- * - the user clicks or a cell with special "active content"
511
- *
512
- * Different kinds of actions are possible for each of these events:
513
- * - RETURN: to go back to a previous point in the sequence.
514
- * - EXIT: to exit the program (thus navigating to another URL)
515
- * - STOP: to do nothing.
516
- * - JUMP: to jump to a specific point in the sequence of activities, or to another JClic project.
517
- * @see {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump}
518
- * @see {@link module:bags/ConditionalJumpInfo.ConditionalJumpInfo ConditionalJumpInfo}
519
- */
520
- class JumpInfo {
521
- /**
522
- * JumpInfo constructor
523
- * @param {string} action - Must be one of the described actions.
524
- * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its
525
- * cardinal number in the list.
526
- */
527
- constructor(action, sq) {
528
- this.action = action;
529
- switch (typeof sq) {
530
- case 'string':
531
- this.sequence = sq;
532
- break;
533
- case 'number':
534
- this.actNum = sq;
535
- break;
536
- }
537
- }
538
-
539
- /**
540
- * Loads the object settings from a specific JQuery XML element
541
- * @param {external:jQuery} $xml - The XML element to parse
542
- */
543
- setProperties($xml) {
544
- this.id = $xml.attr('id');
545
- this.action = $xml.attr('action') || 'JUMP';
546
- if ($xml.attr('tag'))
547
- this.sequence = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__/* .nSlash */ .c4)($xml.attr('tag'));
548
- if ($xml.attr('project'))
549
- this.projectPath = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__/* .nSlash */ .c4)($xml.attr('project'));
550
- return this;
551
- }
552
-
553
- /**
554
- * Gets a object with the basic attributes needed to rebuild this instance excluding functions,
555
- * parent references, constants and also attributes retaining the default value.
556
- * The resulting object is commonly usued to serialize elements in JSON format.
557
- * @returns {object} - The resulting object, with minimal attrributes
558
- */
559
- getAttributes() {
560
- return (0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__/* .getAttr */ .iu)(this, ['id', 'action', 'actNum', 'sequence', 'projectPath']);
561
- }
562
-
563
- /**
564
- * Loads the object settings from a data object
565
- * @param {object} data - The data object to parse
566
- */
567
- setAttributes(data) {
568
- ['id', 'action', 'actNum', 'sequence', 'projectPath'].forEach(t => {
569
- if (!(0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__/* .isEmpty */ .Im)(data[t]))
570
- this[t] = data[t];
571
- });
572
- return this;
573
- }
574
- }
575
-
576
- Object.assign(JumpInfo.prototype, {
577
- /**
578
- * The JumpInfo identifier
579
- * - For regular jumps: 'forward', 'back'
580
- * - For conditional jumps: 'upper', 'lower'
581
- * @name module:bags/JumpInfo.JumpInfo#id
582
- * @type {string} */
583
- id: null,
584
- /**
585
- * The current action.
586
- * Possible values are: `JUMP`, `STOP`, `RETURN` and `EXIT`.
587
- * @name module:bags/JumpInfo.JumpInfo#action
588
- * @type {string} */
589
- action: null,
590
- /**
591
- * Activity number in the sequence list
592
- * @name module:bags/JumpInfo.JumpInfo#actNum
593
- * @type {number} */
594
- actNum: -1,
595
- /**
596
- * Current sequence tag
597
- * @name module:bags/JumpInfo.JumpInfo#sequence
598
- * @type {string} */
599
- sequence: null,
600
- /**
601
- * Path of another JClic project to jump to
602
- * @name module:bags/JumpInfo.JumpInfo#projectPath
603
- * @type {string} */
604
- projectPath: null,
605
- });
606
-
607
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JumpInfo);
608
-
609
-
610
- /***/ })
611
-
612
- };
613
- ;
614
- //# sourceMappingURL=5626.jclic-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"5626.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;;AAEuB;AACsC;AACO;;AAEpE;AACA;AACA,yCAAyC,sEAAsE;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;;AAEA;AACA,IAAI,gEAAW;AACf;AACA;AACA,wBAAwB,2DAAM;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,sBAAsB,gEAAoB,iBAAiB,6CAAC;AAC5D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,WAAW,4DAAO;AAClB;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,WAAW,4DAAO;AAClB;AACA,KAAK;;AAEL;AACA;AACA,wBAAwB,gEAAoB;AAC5C;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,wDAAwD,qEAAqE;AAC7H;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA,kBAAkB,yCAAyC;AAC3D;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,uDAAuD;AACnE;AACA;AACA;AACA;AACA,YAAY,uDAAuD;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,uBAAuB,EAAC;;;;;;;;;;;;;;;;;AChKvC;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;;AAEuB;AACc;AACsB;AACrB;;AAEtC;AACA,8BAA8B,6CAA6C,gBAAgB,2FAA2F;AACtL;AACA;AACA;AACA,2DAA2D,+EAA+E;AAC1I;AACA;AACA;AACA;AACO,mCAAmC,oDAAQ;AAClD;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,+DAAmB,iBAAiB,6CAAC;AAC/D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,gDAAgD,4DAAO;AACvD;;AAEA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,+DAAmB;AAC1C,KAAK;;AAEL;AACA;;;AAGA;AACA,oBAAoB,8CAA8C;AAClE;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,qDAAqD;AACjE;AACA;AACA;AACA;AACA,YAAY,qDAAqD;AACjE;AACA,CAAC;;AAED,iEAAe,oBAAoB,EAAC;;;;;;;;;;;;;;AC3IpC;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;;AAEqC;AACU;;AAE/C;AACA,yBAAyB,8CAA8C,YAAY,kFAAkF;AACrK;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA,IAAI,kFAAkF;AACtF;AACA;AACO,kCAAkC,oDAAQ;AACjD;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,gDAAgD,4DAAO;AACvD;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,WAAW,4DAAO;AAClB;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,mBAAmB,EAAC;;;;;;;;;;;;;AChHnC;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;;AAEuD;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,SAAS;AACT;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAM;AAC5B;AACA,yBAAyB,2DAAM;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,WAAW,4DAAO;AAClB;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,WAAW,4DAAO;AAClB;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,QAAQ,EAAC","sources":["webpack://jclic/./src/bags/ActivitySequenceElement.js","webpack://jclic/./src/bags/ActivitySequenceJump.js","webpack://jclic/./src/bags/ConditionalJumpInfo.js","webpack://jclic/./src/bags/JumpInfo.js"],"sourcesContent":["/**\n * File : bags/ActivitySequenceElement.js\n * Created : 05/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\nimport $ from 'jquery';\nimport ActivitySequenceJump from './ActivitySequenceJump.js';\nimport { attrForEach, nSlash, getAttr, isEmpty } from '../Utils.js';\n\n/**\n *\n * This class is the basic component of {@link module:bags/ActivitySequence.ActivitySequence ActivitySequence} objects. It represents a specific\n * point in the project's sequence of JClic activities.\n *\n * For each point of the sequence, some options can be set:\n * - What activity must run at this point\n * - What to do or where to jump when the activity finishes\n * - The behavior of the \"next\" button\n * - The behavior of the \"prev\" button\n *\n * Sequence points can also have a \"tag\", used to refer to them with a unique name.\n */\nexport class ActivitySequenceElement {\n constructor() {\n }\n\n /**\n * Loads the object settings from a specific JQuery XML element\n * @param {external:jQuery} $xml\n */\n setProperties($xml) {\n\n // Iterate on all provided attributes\n attrForEach($xml.get(0).attributes, (name, val) => {\n switch (name) {\n case 'id':\n this['tag'] = nSlash(val);\n break;\n case 'name':\n this['activity'] = val;\n break;\n case 'description':\n // possible navButtons values are: `none`, `fwd`, `back` or `both`\n case 'navButtons':\n this[name] = val;\n break;\n case 'delay':\n this[name] = Number(val);\n break;\n }\n });\n\n // Iterate on 'jump' elements to load fwdJump and/or backJump\n $xml.children('jump').each((_n, data) => {\n const jmp = new ActivitySequenceJump().setProperties($(data));\n if (jmp.id === 'forward')\n this.fwdJump = jmp;\n else if (jmp.id === 'back')\n this.backJump = jmp;\n });\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, ['tag', 'description', 'activity', 'fwdJump', 'backJump', 'navButtons', 'delay']);\n }\n\n /**\n * Loads sequence element settings from a data object\n * @param {object} data\n */\n setAttributes(data) {\n ['tag', 'description', 'activity', 'navButtons', 'delay'].forEach(t => {\n if (!isEmpty(data[t]))\n this[t] = data[t];\n });\n\n ['fwdJump', 'backJump'].forEach(jmp => {\n if (data[jmp]) {\n this[jmp] = new ActivitySequenceJump().setAttributes(data[jmp]);\n }\n });\n return this;\n }\n}\n\nObject.assign(ActivitySequenceElement.prototype, {\n /**\n * Optional unique identifier of this element in the {@link module:bags/ActivitySequence.ActivitySequence ActivitySequence}.\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#tag\n * @type {string} */\n tag: null,\n /**\n * Optional description of this sequence element.\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#description\n * @type {string} */\n description: null,\n /**\n * Name of the {@link module:Activity.Activity Activity} pointed by this element.\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#activity\n * @type {string} */\n activity: '',\n /**\n * Jump to be processed by the 'next' button action\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#fwdJump\n * @type {module:bags/ActivitySequenceJump.ActivitySequenceJump} */\n fwdJump: null,\n /**\n * Jump to be processed by the 'prev' button action.\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#backJump\n * @type {module:bags/ActivitySequenceJump.ActivitySequenceJump} */\n backJump: null,\n /**\n * What buttons should be active at this point of the sequence. Valid values are:\n * - 'none'\n * - 'fwd'\n * - 'back'\n * - 'both'\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#navButtons\n * @type {string} */\n navButtons: 'both',\n /**\n * Time delay (in seconds) before passing to the next/prev activity\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#delay\n * @type {number} */\n delay: 0,\n});\n\nexport default ActivitySequenceElement;\n","/**\n * File : bags/ActivitySequenceJump.js\n * Created : 05/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 Catalan Educational Telematic Network (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 $ from 'jquery';\nimport JumpInfo from './JumpInfo.js';\nimport ConditionalJumpInfo from './ConditionalJumpInfo.js';\nimport { getAttr } from '../Utils.js';\n\n/**\n * This is a special case of {@link module:bags/JumpInfo.JumpInfo JumpInfo}, used only in {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement} objects.\n * Sequence elements can contain up to two ActivitySequenceJump objects: one to be processed\n * when the user clicks on the \"next\" button (or when the activity finishes, if in automatic mode),\n * and the other used with the \"prev\" button. ActivitySequenceJump objects define a default jump\n * or action to be performed, but can also have up to two {@link module:bags/ConditionalJumpInfo.ConditionalJumpInfo ConditionalJumpInfo} objects. These\n * define alternative jumps that are performed only when score or time are below or over a specific\n * threshold.\n * @extends module:bags/JumpInfo.JumpInfo\n */\nexport class ActivitySequenceJump extends JumpInfo {\n /**\n * ActivitySequenceJump constructor\n * @param {string} action - Must be one of the described actions.\n * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its\n * cardinal number in the list.\n */\n constructor(action, sq) {\n super(action, sq);\n }\n\n /**\n * Loads the object settings from a specific JQuery XML element.\n * @param {external:jQuery} $xml - The XML element to parse\n */\n setProperties($xml) {\n super.setProperties($xml);\n\n // Read conditional jumps\n $xml.children('jump').each((_n, child) => {\n const condJmp = new ConditionalJumpInfo().setProperties($(child));\n if (condJmp.id === 'upper')\n this.upperJump = condJmp;\n else if (condJmp.id === 'lower')\n this.lowerJump = condJmp;\n });\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 Object.assign(super.getAttributes(), getAttr(this, ['upperJump', 'lowerJump']));\n }\n\n /**\n * Loads the jump settings from a data object\n * @param {object} data - The data object to parse\n */\n setAttributes(data) {\n super.setAttributes(data);\n\n ['upperJump', 'lowerJump'].forEach(cj => {\n if (data[cj])\n this[cj] = new ConditionalJumpInfo().setAttributes(data[cj]);\n });\n\n return this;\n }\n\n\n /**\n * Resolves what {@link module:bags/JumpInfo.JumpInfo JumpInfo} must be taken, based on a done time and average rating obtained\n * in activities.\n * @param {number} rating - Average rating obtained by the user in the activities done during the\n * last sequence stretch.\n * @param {number} time - Total time spend doing the activities.\n * @returns {module:bags/JumpInfo.JumpInfo}\n */\n resolveJump(rating, time) {\n let result = this;\n if (rating >= 0 && time >= 0) {\n if (this.upperJump !== null &&\n rating > this.upperJump.threshold &&\n (this.upperJump.time <= 0 || time < this.upperJump.time)) {\n result = this.upperJump;\n } else if (this.lowerJump !== null &&\n (rating < this.lowerJump.threshold ||\n this.lowerJump.time > 0 && time > this.lowerJump.time)) {\n result = this.lowerJump;\n }\n }\n return result;\n }\n}\n\nObject.assign(ActivitySequenceJump.prototype, {\n /**\n * Optional jump to be performed when the results (score and time) are above a specific threshold.\n * @name module:bags/ActivitySequenceJump.ActivitySequenceJump#upperJump\n * @type {module:bags/ConditionalJumpInfo.ConditionalJumpInfo} */\n upperJump: null,\n /**\n * Optional jump to be performed when the results (score or time) are below a specific threshold.\n * @name module:bags/ActivitySequenceJump.ActivitySequenceJump#lowerJump\n * @type {module:bags/ConditionalJumpInfo.ConditionalJumpInfo} */\n lowerJump: null,\n});\n\nexport default ActivitySequenceJump;\n","/**\n * File : bags/ConditionalJumpInfo.js\n * Created : 05/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 Catalan Educational Telematic Network (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 JumpInfo from './JumpInfo.js';\nimport { getAttr, isEmpty } from '../Utils.js';\n\n/**\n * This special case of {@link module:bags/JumpInfo.JumpInfo JumpInfo} is used in {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump} objects to decide\n * the type of jump or action to be performed, based on the results obtained by the user when\n * playing previous JClic activities.\n *\n * In addition to the standard {@link module:bags/JumpInfo.JumpInfo JumpInfo} fields and methods, this class has two public\n * members where score and time thresholds are stored.\n *\n * The exact meaning of this members will depend on the type of `ConditionalJumpInfo` in the\n * {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump} (it can be `upperJump` or `lowerJump`).\n * @extends module:bags/JumpInfo.JumpInfo\n */\nexport class ConditionalJumpInfo extends JumpInfo {\n /**\n * ConditionalJumpInfo constructor\n * @param {string} action - Must be one of the described actions.\n * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its\n * cardinal number in the list.\n * @param {number} [threshold] - Threshold above or below which the action will be triggered,\n * depending on the type of JumpInfo.\n * @param {number} [time] - Delay to be applied in automatic jumps.\n */\n constructor(action, sq, threshold, time) {\n super(action, sq);\n this.threshold = typeof threshold === 'number' ? threshold : -1;\n this.time = typeof threshold === 'number' ? time : -1;\n }\n\n /**\n * Loads this object settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element to parse\n */\n setProperties($xml) {\n super.setProperties($xml);\n if ($xml.attr('threshold') !== undefined)\n this.threshold = $xml.attr('threshold');\n if ($xml.attr('time') !== undefined)\n this.time = $xml.attr('time');\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 Object.assign(super.getAttributes(), getAttr(this, ['threshold', 'time']));\n }\n\n /**\n * Loads this conditional jump settings from a data object\n * @param {object} data - The data object to parse\n */\n setAttributes(data) {\n super.setAttributes(data);\n ['threshold', 'time'].forEach(t => {\n if (!isEmpty(data[t]))\n this[t] = data[t];\n });\n return this;\n }\n}\n\nObject.assign(ConditionalJumpInfo.prototype, {\n /**\n * Threshold above or below which the action will be triggered, depending on the type of JumpInfo.\n * @name module:bags/ConditionalJumpInfo.ConditionalJumpInfo#threshold\n * @type {number} */\n threshold: -1,\n /**\n * Delay to be applied in automatic jumps.\n * @name module:bags/ConditionalJumpInfo.ConditionalJumpInfo#time\n * @type {number} */\n time: -1,\n});\n\nexport default ConditionalJumpInfo;\n","/**\n * File : bags/JumpInfo.js\n * Created : 05/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 Catalan Educational Telematic Network (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 { nSlash, getAttr, isEmpty } from '../Utils.js';\n\n/**\n * This class contains information about what things JClic sequence manager has to do in certain\n * circumstances, such as:\n * - an activity finishes\n * - the user clicks on the \"next\" or \"prev\" buttons\n * - the user clicks or a cell with special \"active content\"\n *\n * Different kinds of actions are possible for each of these events:\n * - RETURN: to go back to a previous point in the sequence.\n * - EXIT: to exit the program (thus navigating to another URL)\n * - STOP: to do nothing.\n * - JUMP: to jump to a specific point in the sequence of activities, or to another JClic project.\n * @see {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump}\n * @see {@link module:bags/ConditionalJumpInfo.ConditionalJumpInfo ConditionalJumpInfo}\n */\nexport class JumpInfo {\n /**\n * JumpInfo constructor\n * @param {string} action - Must be one of the described actions.\n * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its\n * cardinal number in the list.\n */\n constructor(action, sq) {\n this.action = action;\n switch (typeof sq) {\n case 'string':\n this.sequence = sq;\n break;\n case 'number':\n this.actNum = sq;\n break;\n }\n }\n\n /**\n * Loads the object settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element to parse\n */\n setProperties($xml) {\n this.id = $xml.attr('id');\n this.action = $xml.attr('action') || 'JUMP';\n if ($xml.attr('tag'))\n this.sequence = nSlash($xml.attr('tag'));\n if ($xml.attr('project'))\n this.projectPath = nSlash($xml.attr('project'));\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, ['id', 'action', 'actNum', 'sequence', 'projectPath']);\n }\n\n /**\n * Loads the object settings from a data object\n * @param {object} data - The data object to parse\n */\n setAttributes(data) {\n ['id', 'action', 'actNum', 'sequence', 'projectPath'].forEach(t => {\n if (!isEmpty(data[t]))\n this[t] = data[t];\n });\n return this;\n }\n}\n\nObject.assign(JumpInfo.prototype, {\n /**\n * The JumpInfo identifier\n * - For regular jumps: 'forward', 'back'\n * - For conditional jumps: 'upper', 'lower'\n * @name module:bags/JumpInfo.JumpInfo#id\n * @type {string} */\n id: null,\n /**\n * The current action.\n * Possible values are: `JUMP`, `STOP`, `RETURN` and `EXIT`.\n * @name module:bags/JumpInfo.JumpInfo#action\n * @type {string} */\n action: null,\n /**\n * Activity number in the sequence list\n * @name module:bags/JumpInfo.JumpInfo#actNum\n * @type {number} */\n actNum: -1,\n /**\n * Current sequence tag\n * @name module:bags/JumpInfo.JumpInfo#sequence\n * @type {string} */\n sequence: null,\n /**\n * Path of another JClic project to jump to\n * @name module:bags/JumpInfo.JumpInfo#projectPath\n * @type {string} */\n projectPath: null,\n});\n\nexport default JumpInfo;\n"],"names":[],"sourceRoot":""}