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,718 +0,0 @@
1
- "use strict";
2
- exports.id = 6238;
3
- exports.ids = [6238,9359,2366];
4
- exports.modules = {
5
-
6
- /***/ 9359:
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 ActionReg */
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 _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1253);
16
- /**
17
- * File : report/ActionReg.js
18
- * Created : 17/05/2016
19
- * By : Francesc Busquets <francesc@gmail.com>
20
- *
21
- * JClic.js
22
- * An HTML5 player of JClic activities
23
- * https://projectestac.github.io/jclic.js
24
- *
25
- * @source https://github.com/projectestac/jclic.js
26
- *
27
- * @license EUPL-1.2
28
- * @licstart
29
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
30
- *
31
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
32
- * the European Commission- subsequent versions of the EUPL (the "Licence");
33
- * You may not use this work except in compliance with the Licence.
34
- *
35
- * You may obtain a copy of the Licence at:
36
- * https://joinup.ec.europa.eu/software/page/eupl
37
- *
38
- * Unless required by applicable law or agreed to in writing, software
39
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
40
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
41
- * Licence for the specific language governing permissions and limitations
42
- * under the Licence.
43
- * @licend
44
- * @module
45
- */
46
-
47
-
48
-
49
-
50
- /**
51
- * This class stores information about one specific action done by the current user while playing
52
- * an activity.
53
- *
54
- */
55
- class ActionReg {
56
- /**
57
- * ActionReg constructor
58
- * @param {string} type - Type of action (`click`, `write`, `move`, `select`...)
59
- * @param {string}+ source - Description of the object on which the action is done.
60
- * @param {string}+ dest - Description of the object that acts as a target of the action (used in pairings)
61
- * @param {boolean} ok - `true` if the action was OK, `false`, `null` or `undefined` otherwise
62
- */
63
- constructor(type, source, dest, ok) {
64
- this.type = type;
65
- this.source = source || null;
66
- this.dest = dest || null;
67
- this.ok = ok || false;
68
- this.time = (new Date()).valueOf();
69
- }
70
-
71
- /**
72
- * Provides the data associated with this action in XML format suitable for a
73
- * {@link http://clic.xtec.cat/en/jclic/reports/|JClic Reports Server}.
74
- * @returns {external:jQuery}
75
- */
76
- $getXML() {
77
- const attr = { ok: this.ok, time: this.time };
78
- if (this.type)
79
- attr.type = this.type;
80
- if (this.source)
81
- attr.source = this.source;
82
- if (this.dest)
83
- attr.dest = this.dest;
84
- return jquery__WEBPACK_IMPORTED_MODULE_0___default()('<action/>', attr);
85
- }
86
-
87
- /**
88
- * Fills this ActionReg with data provided in XML format
89
- * @param {external:jQuery} $xml - The XML element to be processed, already wrapped as jQuery object
90
- */
91
- setProperties($xml) {
92
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .attrForEach */ .GM)($xml.get(0).attributes, (name, value) => {
93
- switch (name) {
94
- case 'type':
95
- case 'source':
96
- case 'dest':
97
- this[name] = value;
98
- break;
99
- case 'time':
100
- this[name] = Number(value);
101
- break;
102
- case 'ok':
103
- this[name] = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .getBoolean */ .pW)(value, false);
104
- break;
105
- }
106
- });
107
- }
108
- }
109
-
110
- Object.assign(ActionReg.prototype, {
111
- /**
112
- * The type of action (`click`, `write`, `move`, `select`...)
113
- * @name module:report/ActionReg.ActionReg#type
114
- * @type {string} */
115
- type: 'unknown',
116
- /**
117
- * Description of the object on which the action was done
118
- * @name module:report/ActionReg.ActionReg#source
119
- * @type {string} */
120
- source: null,
121
- /**
122
- * Description of the object that has acted as a target of the action (used in pairings)
123
- * @name module:report/ActionReg.ActionReg#dest
124
- * @type {string} */
125
- dest: null,
126
- /**
127
- * Time stamp taken when the action was done
128
- * @name module:report/ActionReg.ActionReg#time
129
- * @type {number} */
130
- time: 0,
131
- /**
132
- * `true` if the action was OK
133
- * @name module:report/ActionReg.ActionReg#isOk
134
- * @type {boolean} */
135
- isOk: false,
136
- });
137
-
138
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ActionReg);
139
-
140
-
141
- /***/ }),
142
-
143
- /***/ 2366:
144
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
145
-
146
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
147
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
148
- /* harmony export */ });
149
- /* unused harmony export ActivityReg */
150
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7750);
151
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
152
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1253);
153
- /* harmony import */ var _ActionReg_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9359);
154
- /**
155
- * File : report/ActivityReg.js
156
- * Created : 17/05/2016
157
- * By : Francesc Busquets <francesc@gmail.com>
158
- *
159
- * JClic.js
160
- * An HTML5 player of JClic activities
161
- * https://projectestac.github.io/jclic.js
162
- *
163
- * @source https://github.com/projectestac/jclic.js
164
- *
165
- * @license EUPL-1.2
166
- * @licstart
167
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
168
- *
169
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
170
- * the European Commission- subsequent versions of the EUPL (the "Licence");
171
- * You may not use this work except in compliance with the Licence.
172
- *
173
- * You may obtain a copy of the Licence at:
174
- * https://joinup.ec.europa.eu/software/page/eupl
175
- *
176
- * Unless required by applicable law or agreed to in writing, software
177
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
178
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
179
- * Licence for the specific language governing permissions and limitations
180
- * under the Licence.
181
- * @licend
182
- * @module
183
- */
184
-
185
-
186
-
187
-
188
-
189
- /**
190
- * This class stores miscellaneous data obtained by the current user playing an {@link module:Activity.Activity Activity}.
191
- */
192
- class ActivityReg {
193
- /**
194
- * ActivityReg constructor
195
- * @param {module:Activity.Activity} act - The {@link module:Activity.Activity Activity} referenced by this object.
196
- */
197
- constructor(act) {
198
- this.name = act.name;
199
- this.code = act.code;
200
- this.actions = [];
201
- this.startTime = (new Date()).valueOf();
202
- this.minActions = act.getMinNumActions();
203
- this.reportActions = act.reportActions;
204
- }
205
-
206
- /**
207
- * Provides the data associated with the current activity in an XML format suitable for a
208
- * {@link http://clic.xtec.cat/en/jclic/reports/|JClic Reports Server}.
209
- * @returns {external:jQuery}
210
- */
211
- $getXML() {
212
- const attr = {
213
- start: this.startTime,
214
- time: this.totalTime,
215
- solved: this.solved,
216
- score: this.score,
217
- minActions: this.minActions,
218
- actions: this.numActions
219
- };
220
- if (this.name)
221
- attr.name = this.name;
222
- if (this.code)
223
- attr.code = this.code;
224
- if (!this.closed)
225
- attr.closed = false;
226
- if (this.reportActions)
227
- attr.reportActions = true;
228
-
229
- const $result = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<activity/>', attr);
230
- this.actions.forEach(ac => {
231
- $result.append(ac.$getXML());
232
- });
233
- return $result;
234
- }
235
-
236
- /**
237
- * Builds an object with relevant data about the results obtained by the current student in this activity
238
- * @returns {object} - The results of this activity
239
- */
240
- getData() {
241
- const result = {
242
- name: this.name,
243
- time: Math.round(this.totalTime / 10) / 100,
244
- solved: this.solved,
245
- score: this.score,
246
- minActions: this.minActions,
247
- actions: this.numActions,
248
- precision: this.getPrecision(),
249
- closed: this.closed
250
- };
251
- if (this.code)
252
- result.code = this.code;
253
- return result;
254
- }
255
-
256
- /**
257
- * Fills this ActivityReg with data provided in XML format
258
- * @param {external:jQuery} $xml -The XML element to be processed, already wrapped as jQuery object
259
- */
260
- setProperties($xml) {
261
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .attrForEach */ .GM)($xml.get(0).attributes, (name, value) => {
262
- switch (name) {
263
- case 'name':
264
- case 'code':
265
- this[name] = value;
266
- break;
267
- case 'start':
268
- case 'time':
269
- case 'score':
270
- case 'minActions':
271
- case 'actions':
272
- this[name] = Number(value);
273
- break;
274
- case 'solved':
275
- case 'closed':
276
- case 'reportActions':
277
- this[name] = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .getBoolean */ .pW)(value, false);
278
- break;
279
- }
280
- });
281
- $xml.children('action').each((_n, child) => {
282
- const action = new _ActionReg_js__WEBPACK_IMPORTED_MODULE_2__["default"]();
283
- action.setProperties(jquery__WEBPACK_IMPORTED_MODULE_0___default()(child));
284
- this.actions.push(action);
285
- });
286
- }
287
-
288
- /**
289
- * Reports a new action done by the user while playing the current activity
290
- * @param {string} type - Type of action (`click`, `write`, `move`, `select`...)
291
- * @param {string}+ source - Description of the object on which the action is done.
292
- * @param {string}+ dest - Description of the object that acts as a target of the action (used in pairings)
293
- * @param {boolean} ok - `true` if the action was OK, `false`, `null` or `undefined` otherwise
294
- */
295
- newAction(type, source, dest, ok) {
296
- if (!this.closed) {
297
- this.lastAction = new _ActionReg_js__WEBPACK_IMPORTED_MODULE_2__["default"](type, source, dest, ok);
298
- this.actions.push(this.lastAction);
299
- }
300
- }
301
-
302
- /**
303
- * Retrieves a specific {@link module:report/ActionReg.ActionReg ActionReg} element from `actions`
304
- * @param {number} index - The nth action to be retrieved
305
- * @returns {module:report/ActionReg.ActionReg}
306
- */
307
- getActionReg(index) {
308
- return index >= this.actions.length ? null : this.actions[index];
309
- }
310
-
311
- /**
312
- * Closes the current activity, adjusting total time if needed
313
- */
314
- closeActivity() {
315
- if (!this.closed) {
316
- if (this.lastAction)
317
- this.totalTime = this.lastAction.time - this.startTime;
318
- else
319
- this.totalTime = (new Date()).valueOf() - this.startTime;
320
- this.closed = true;
321
- }
322
- }
323
-
324
- /**
325
- * calculates the final score obtained by the user in this activity.
326
- * The algorithm used takes in account the minimal number of actions needed, the actions
327
- * really done by the user, and if the activity was finally solved or not.
328
- * @returns {number}
329
- */
330
- getPrecision() {
331
- let result = 0;
332
- if (this.closed && this.minActions > 0 && this.numActions > 0) {
333
- if (this.solved) {
334
- if (this.numActions < this.minActions)
335
- result = 100;
336
- else
337
- result = Math.round(this.minActions * 100 / this.numActions);
338
- } else
339
- result = Math.round(100 * (this.score * this.score) / (this.minActions * this.numActions));
340
- }
341
- return result;
342
- }
343
-
344
- /**
345
- * This method should be called when the current activity finishes. Data about user's final results
346
- * on the activity will then be saved.
347
- * @param {number} score - The final score, usually in a 0-100 scale.
348
- * @param {number} numActions - The total number of actions done by the user to solve the activity
349
- * @param {boolean} solved - `true` if the activity was finally solved, `false` otherwise.
350
- */
351
- endActivity(score, numActions, solved) {
352
- if (!this.closed) {
353
- this.solved = solved;
354
- this.numActions = numActions;
355
- this.score = score;
356
- this.closeActivity();
357
- }
358
- }
359
- }
360
-
361
- Object.assign(ActivityReg.prototype, {
362
- /**
363
- * Name of the associated activity
364
- * @name module:report/ActivityReg.ActivityReg#name
365
- * @type {string} */
366
- name: '',
367
- /**
368
- * Optional code assigned to this activity, used for later filtering
369
- * @name module:report/ActivityReg.ActivityReg#code
370
- * @type {string} */
371
- code: '',
372
- /**
373
- * Timestamp when the user starts playing the activity
374
- * @name module:report/ActivityReg.ActivityReg#startTime
375
- * @type {number} */
376
- startTime: 0,
377
- /**
378
- * Total time spent by the user in the activity, measured in milliseconds
379
- * @name module:report/ActivityReg.ActivityReg#totalTime
380
- * @type {number} */
381
- totalTime: 0,
382
- /**
383
- * Collection of actions done by the user while playing the activity
384
- * @name module:report/ActivityReg.ActivityReg#actions
385
- * @type {module:report/ActionReg.ActionReg[]} */
386
- actions: [],
387
- /**
388
- * `true` only when the user has finished and solved the activity
389
- * @name module:report/ActivityReg.ActivityReg#solved
390
- * @type {boolean} */
391
- solved: false,
392
- /**
393
- * Last {@link module:report/ActionReg.ActionReg ActionReg} performed by the user in this activity
394
- * @name module:report/ActivityReg.ActivityReg#lastAction
395
- * @type {module:report/ActionReg.ActionReg} */
396
- lastAction: null,
397
- /**
398
- * Final score obtained by the current user in this activity
399
- * @name module:report/ActivityReg.ActivityReg#score
400
- * @type {number} */
401
- score: 0,
402
- /**
403
- * Minimum number of actions needed to solve the activity
404
- * @name module:report/ActivityReg.ActivityReg#minActions
405
- * @type {number} */
406
- minActions: 0,
407
- /**
408
- * `true` when the activity has finished, `false` for the activity that is currently playing
409
- * @name module:report/ActivityReg.ActivityReg#closed
410
- * @type {boolean} */
411
- closed: false,
412
- /**
413
- * `true` when this type of activity should record specific actions done by the users
414
- * @name module:report/ActivityReg.ActivityReg#reportActions
415
- * @type {boolean} */
416
- reportActions: false,
417
- /**
418
- * Number of actions done by the user playing this activity
419
- * @name module:report/ActivityReg.ActivityReg#numActions
420
- * @type {number} */
421
- numActions: 0,
422
- });
423
-
424
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ActivityReg);
425
-
426
-
427
- /***/ }),
428
-
429
- /***/ 6238:
430
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
431
-
432
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
433
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
434
- /* harmony export */ });
435
- /* unused harmony exports SequenceReg, SequenceRegInfo */
436
- /* harmony import */ var _ActivityReg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2366);
437
- /**
438
- * File : report/SequenceReg.js
439
- * Created : 17/05/2016
440
- * By : Francesc Busquets <francesc@gmail.com>
441
- *
442
- * JClic.js
443
- * An HTML5 player of JClic activities
444
- * https://projectestac.github.io/jclic.js
445
- *
446
- * @source https://github.com/projectestac/jclic.js
447
- *
448
- * @license EUPL-1.2
449
- * @licstart
450
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
451
- *
452
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
453
- * the European Commission- subsequent versions of the EUPL (the "Licence");
454
- * You may not use this work except in compliance with the Licence.
455
- *
456
- * You may obtain a copy of the Licence at:
457
- * https://joinup.ec.europa.eu/software/page/eupl
458
- *
459
- * Unless required by applicable law or agreed to in writing, software
460
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
461
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
462
- * Licence for the specific language governing permissions and limitations
463
- * under the Licence.
464
- * @licend
465
- * @module
466
- */
467
-
468
-
469
-
470
- /**
471
- * This class stores the results of the activities related to an {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement}.
472
- * It's main component is an array of {@link module:report/ActivityReg.ActivityReg ActivityReg} elements.
473
- */
474
- class SequenceReg {
475
- /**
476
- * SequenceReg constructor
477
- * @param {module:bags/ActivitySequenceElement.ActivitySequenceElement} ase - The {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement} related to this sequence.
478
- */
479
- constructor(ase) {
480
- this.name = ase.tag;
481
- this.description = ase.description;
482
- this.activities = [];
483
- this.currentActivity = null;
484
- this.totalTime = 0;
485
- this.closed = false;
486
- this.info = new SequenceRegInfo(this);
487
- }
488
-
489
- /**
490
- * Builds a complex object with data about the results of the activities done in this sequence
491
- * @returns {object} - The sequence results
492
- */
493
- getData() {
494
- const result = {
495
- sequence: this.name,
496
- activities: []
497
- };
498
- this.activities.forEach(act => result.activities.push(act.getData()));
499
- return result;
500
- }
501
-
502
- /**
503
- * Returns the `info` element associated to this SequenceReg.
504
- * @returns {module:report/SequenceReg.SequenceRegInfo}
505
- */
506
- getInfo() {
507
- return this.info.recalc();
508
- }
509
-
510
- /**
511
- * This method should be called when the current working session finishes.
512
- */
513
- endSequence() {
514
- if (this.currentActivity && this.activities.length > 0) {
515
- if (!this.currentActivity.closed)
516
- this.currentActivity.closeActivity();
517
- this.totalTime = this.currentActivity.startTime + this.currentActivity.totalTime - this.activities[0].startTime;
518
- this.info.valid = false;
519
- }
520
- }
521
-
522
- /**
523
- * This method should be invoked when the user starts a new activity
524
- * @param {module:Activity.Activity} act - The {@link module:Activity.Activity Activity} that has just started
525
- */
526
- newActivity(act) {
527
- if (!this.closed) {
528
- this.currentActivity = new _ActivityReg_js__WEBPACK_IMPORTED_MODULE_0__["default"](act);
529
- this.activities.push(this.currentActivity);
530
- this.info.valid = false;
531
- }
532
- }
533
-
534
- /**
535
- * This method should be called when the current activity finishes. Data about user's final results
536
- * on the activity will then be saved.
537
- * @param {number} score - The final score, usually in a 0-100 scale.
538
- * @param {number} numActions - The total number of actions done by the user to solve the activity
539
- * @param {boolean} solved - `true` if the activity was finally solved, `false` otherwise.
540
- */
541
- endActivity(score, numActions, solved) {
542
- if (this.currentActivity) {
543
- this.currentActivity.endActivity(score, numActions, solved);
544
- this.info.valid = false;
545
- }
546
- }
547
-
548
- /**
549
- * Reports a new action done by the user while playing the current activity
550
- * @param {string} type - Type of action (`click`, `write`, `move`, `select`...)
551
- * @param {string}+ source - Description of the object on which the action is done.
552
- * @param {string}+ dest - Description of the object that acts as a target of the action (used in pairings)
553
- * @param {boolean} ok - `true` if the action was OK, `false`, `null` or `undefined` otherwise
554
- */
555
- newAction(type, source, dest, ok) {
556
- if (this.currentActivity) {
557
- this.currentActivity.newAction(type, source, dest, ok);
558
- this.info.valid = false;
559
- }
560
- }
561
- }
562
-
563
- Object.assign(SequenceReg.prototype, {
564
- /**
565
- * The `tag` member of the associated {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement}
566
- * @name module:report/SequenceReg.SequenceReg#name
567
- * @type {string} */
568
- name: '',
569
- /**
570
- * Optional description given to the {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement}
571
- * @name module:report/SequenceReg.SequenceReg#description
572
- * @type {string} */
573
- description: '',
574
- /**
575
- * Collection of all the {@link module:report/ActivityReg.ActivityReg ActivityReg} elements done during this sequence.
576
- * @name module:report/SequenceReg.SequenceReg#activities
577
- * @type {module:report/ActivityReg.ActivityReg[]} */
578
- activities: [],
579
- /**
580
- * Registry linked to the {@link module:Activity.Activity Activity} that is currently running
581
- * @name module:report/SequenceReg.SequenceReg#currentActivity
582
- * @type {module:report/ActivityReg.ActivityReg} */
583
- currentActivity: null,
584
- /**
585
- * Total time spent on the activities of this sequence
586
- * @name module:report/SequenceReg.SequenceReg#totalTime
587
- * @type {number} */
588
- totalTime: 0,
589
- /**
590
- * Flag indicating if the sequence is closed or already available for more activities
591
- * @name module:report/SequenceReg.SequenceReg#closed
592
- * @type {boolean} */
593
- closed: false,
594
- /**
595
- * Object with global information associated to this sequence
596
- * @name module:report/SequenceReg.SequenceReg#info
597
- * @type {module:report/SequenceReg.SequenceRegInfo} */
598
- info: null,
599
- });
600
-
601
- /**
602
- * This object stores the global results of a {@link module:report/SequenceReg.SequenceReg SequenceReg}
603
- */
604
- class SequenceRegInfo {
605
- /**
606
- * SequenceRegInfo constructor
607
- * @param {module:report/SequenceReg.SequenceReg} sqReg - The {@link module:report/SequenceReg.SequenceReg SequenceReg} associated tho this `Info` object.
608
- */
609
- constructor(sqReg) {
610
- this.sqReg = sqReg;
611
- }
612
-
613
- /**
614
- * Clears all global data associated with this sequence
615
- */
616
- clear() {
617
- this.nActivities = this.nActClosed = this.nActSolved = this.nActScore = 0;
618
- this.ratioSolved = this.nActions = this.tScore = this.tTime = 0;
619
- this.valid = false;
620
- }
621
-
622
- /**
623
- * Computes the value of all global variables based on the data stored in `activities`
624
- * @returns {module:report/SequenceReg.SequenceRegInfo} - This "info" object
625
- */
626
- recalc() {
627
- if (!this.valid) {
628
- this.clear();
629
- this.nActivities = this.sqReg.activities.length;
630
- if (this.nActivities > 0) {
631
- this.sqReg.activities.forEach(ar => {
632
- if (ar.closed) {
633
- this.nActClosed++;
634
- this.tTime += ar.totalTime;
635
- this.nActions += ar.numActions;
636
- if (ar.solved)
637
- this.nActSolved++;
638
- const r = ar.getPrecision();
639
- if (r >= 0) {
640
- this.tScore += r;
641
- this.nActScore++;
642
- }
643
- }
644
- });
645
- if (this.nActClosed > 0)
646
- this.ratioSolved = this.nActSolved / this.nActClosed;
647
- if (this.nActScore > 0)
648
- this.tScore = Math.round(this.tScore / this.nActScore);
649
- }
650
- this.valid = true;
651
- }
652
- return this;
653
- }
654
- }
655
-
656
- Object.assign(SequenceRegInfo.prototype, {
657
- /**
658
- * The {@link module:report/SequenceReg.SequenceReg SequenceReg} associated to this "info" object
659
- * @name module:report/SequenceReg.SequenceRegInfo#sqReg
660
- * @type {module:report/SequenceReg.SequenceReg} */
661
- sqReg: null,
662
- /**
663
- * When `false`, data must be recalculated
664
- * @name module:report/SequenceReg.SequenceRegInfo#valid
665
- * @type {boolean} */
666
- valid: false,
667
- /**
668
- * Number of activities played in this sequence
669
- * @name module:report/SequenceReg.SequenceRegInfo#nActivities
670
- * @type {number} */
671
- nActivities: 0,
672
- /**
673
- * Number of activities already closed
674
- * @name module:report/SequenceReg.SequenceRegInfo#nActClosed
675
- * @type {number} */
676
- nActClosed: 0,
677
- /**
678
- * Number of activities solved
679
- * @name module:report/SequenceReg.SequenceRegInfo#nActSolved
680
- * @type {number} */
681
- nActSolved: 0,
682
- /**
683
- * Number of activities with score > 0
684
- * @name module:report/SequenceReg.SequenceRegInfo#nActScore
685
- * @type {number} */
686
- nActScore: 0,
687
- /**
688
- * Percentage of solved activities
689
- * @name module:report/SequenceReg.SequenceRegInfo#ratioSolved
690
- * @type {number} */
691
- ratioSolved: 0,
692
- /**
693
- * Number of actions done by the user while in this sequence
694
- * @name module:report/SequenceReg.SequenceRegInfo#nActions
695
- * @type {number} */
696
- nActions: 0,
697
- /**
698
- * Sum of the scores of all the activities played
699
- * @name module:report/SequenceReg.SequenceRegInfo#tScore
700
- * @type {number} */
701
- tScore: 0,
702
- /**
703
- * Sum of the playing time reported by each activity (not always equals to the sequence's total time)
704
- * @name module:report/SequenceReg.SequenceRegInfo#tTime
705
- * @type {number} */
706
- tTime: 0,
707
- });
708
-
709
- SequenceReg.Info = SequenceRegInfo;
710
-
711
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SequenceReg);
712
-
713
-
714
- /***/ })
715
-
716
- };
717
- ;
718
- //# sourceMappingURL=6238.jclic-node.js.map