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.
- package/CHANGELOG.md +13 -0
- package/dist/jclic-node.js +9 -8
- package/dist/jclic-node.js.map +1 -1
- package/dist/jclic.min.js +2 -2
- package/dist/jclic.min.js.map +1 -1
- package/package.json +4 -4
- package/src/GlobalData.js +1 -1
- package/src/JClicPlayer.js +2 -2
- package/src/bags/MediaBag.js +6 -5
- package/dist/1078.jclic-node.js +0 -282
- package/dist/1078.jclic-node.js.map +0 -1
- package/dist/1196.jclic-node.js +0 -808
- package/dist/1196.jclic-node.js.map +0 -1
- package/dist/1253.jclic-node.js +0 -1432
- package/dist/1253.jclic-node.js.map +0 -1
- package/dist/13.jclic-node.js +0 -103
- package/dist/13.jclic-node.js.map +0 -1
- package/dist/1567.jclic-node.js +0 -2313
- package/dist/1567.jclic-node.js.map +0 -1
- package/dist/1588.jclic-node.js +0 -602
- package/dist/1588.jclic-node.js.map +0 -1
- package/dist/1725.jclic-node.js +0 -836
- package/dist/1725.jclic-node.js.map +0 -1
- package/dist/1731.jclic-node.js +0 -438
- package/dist/1731.jclic-node.js.map +0 -1
- package/dist/1842.jclic-node.js +0 -651
- package/dist/1842.jclic-node.js.map +0 -1
- package/dist/2160.jclic-node.js +0 -1016
- package/dist/2160.jclic-node.js.map +0 -1
- package/dist/222.jclic-node.js +0 -129
- package/dist/222.jclic-node.js.map +0 -1
- package/dist/2316.jclic-node.js +0 -949
- package/dist/2316.jclic-node.js.map +0 -1
- package/dist/2355.jclic-node.js +0 -371
- package/dist/2355.jclic-node.js.map +0 -1
- package/dist/2366.jclic-node.js +0 -431
- package/dist/2366.jclic-node.js.map +0 -1
- package/dist/2379.jclic-node.js +0 -202
- package/dist/2379.jclic-node.js.map +0 -1
- package/dist/2437.jclic-node.js +0 -450
- package/dist/2437.jclic-node.js.map +0 -1
- package/dist/2531.jclic-node.js +0 -869
- package/dist/2531.jclic-node.js.map +0 -1
- package/dist/2608.jclic-node.js +0 -160
- package/dist/2608.jclic-node.js.map +0 -1
- package/dist/2715.jclic-node.js +0 -554
- package/dist/2715.jclic-node.js.map +0 -1
- package/dist/277.jclic-node.js +0 -22
- package/dist/277.jclic-node.js.map +0 -1
- package/dist/2921.jclic-node.js +0 -660
- package/dist/2921.jclic-node.js.map +0 -1
- package/dist/2952.jclic-node.js +0 -101
- package/dist/2952.jclic-node.js.map +0 -1
- package/dist/3018.jclic-node.js +0 -421
- package/dist/3018.jclic-node.js.map +0 -1
- package/dist/3019.jclic-node.js +0 -682
- package/dist/3019.jclic-node.js.map +0 -1
- package/dist/3231.jclic-node.js +0 -274
- package/dist/3231.jclic-node.js.map +0 -1
- package/dist/331.jclic-node.js +0 -115
- package/dist/331.jclic-node.js.map +0 -1
- package/dist/3391.jclic-node.js +0 -276
- package/dist/3391.jclic-node.js.map +0 -1
- package/dist/3502.jclic-node.js +0 -671
- package/dist/3502.jclic-node.js.map +0 -1
- package/dist/3653.jclic-node.js +0 -982
- package/dist/3653.jclic-node.js.map +0 -1
- package/dist/371.jclic.min.js +0 -2
- package/dist/371.jclic.min.js.map +0 -1
- package/dist/3856.jclic-node.js +0 -575
- package/dist/3856.jclic-node.js.map +0 -1
- package/dist/4112.jclic-node.js +0 -659
- package/dist/4112.jclic-node.js.map +0 -1
- package/dist/4123.jclic-node.js +0 -910
- package/dist/4123.jclic-node.js.map +0 -1
- package/dist/427.jclic-node.js +0 -894
- package/dist/427.jclic-node.js.map +0 -1
- package/dist/4483.jclic-node.js +0 -327
- package/dist/4483.jclic-node.js.map +0 -1
- package/dist/4548.jclic-node.js +0 -1078
- package/dist/4548.jclic-node.js.map +0 -1
- package/dist/466.jclic-node.js +0 -99
- package/dist/466.jclic-node.js.map +0 -1
- package/dist/485.jclic-node.js +0 -783
- package/dist/485.jclic-node.js.map +0 -1
- package/dist/4921.jclic-node.js +0 -500
- package/dist/4921.jclic-node.js.map +0 -1
- package/dist/5091.jclic-node.js +0 -239
- package/dist/5091.jclic-node.js.map +0 -1
- package/dist/520.jclic-node.js +0 -550
- package/dist/520.jclic-node.js.map +0 -1
- package/dist/5312.jclic-node.js +0 -1126
- package/dist/5312.jclic-node.js.map +0 -1
- package/dist/5338.jclic-node.js +0 -212
- package/dist/5338.jclic-node.js.map +0 -1
- package/dist/5344.jclic-node.js +0 -229
- package/dist/5344.jclic-node.js.map +0 -1
- package/dist/5550.jclic-node.js +0 -238
- package/dist/5550.jclic-node.js.map +0 -1
- package/dist/5626.jclic-node.js +0 -614
- package/dist/5626.jclic-node.js.map +0 -1
- package/dist/5977.jclic-node.js +0 -1081
- package/dist/5977.jclic-node.js.map +0 -1
- package/dist/6148.jclic-node.js +0 -345
- package/dist/6148.jclic-node.js.map +0 -1
- package/dist/6176.jclic-node.js +0 -481
- package/dist/6176.jclic-node.js.map +0 -1
- package/dist/6221.jclic-node.js +0 -1072
- package/dist/6221.jclic-node.js.map +0 -1
- package/dist/6238.jclic-node.js +0 -718
- package/dist/6238.jclic-node.js.map +0 -1
- package/dist/6454.jclic-node.js +0 -1413
- package/dist/6454.jclic-node.js.map +0 -1
- package/dist/6565.jclic-node.js +0 -294
- package/dist/6565.jclic-node.js.map +0 -1
- package/dist/6579.jclic-node.js +0 -719
- package/dist/6579.jclic-node.js.map +0 -1
- package/dist/6715.jclic-node.js +0 -148
- package/dist/6715.jclic-node.js.map +0 -1
- package/dist/6777.jclic-node.js +0 -171
- package/dist/6777.jclic-node.js.map +0 -1
- package/dist/6782.jclic-node.js +0 -1611
- package/dist/6782.jclic-node.js.map +0 -1
- package/dist/6847.jclic-node.js +0 -601
- package/dist/6847.jclic-node.js.map +0 -1
- package/dist/6856.jclic-node.js +0 -252
- package/dist/6856.jclic-node.js.map +0 -1
- package/dist/696.jclic-node.js +0 -1821
- package/dist/696.jclic-node.js.map +0 -1
- package/dist/698.jclic-node.js +0 -583
- package/dist/698.jclic-node.js.map +0 -1
- package/dist/704.jclic-node.js +0 -80
- package/dist/704.jclic-node.js.map +0 -1
- package/dist/7046.jclic-node.js +0 -735
- package/dist/7046.jclic-node.js.map +0 -1
- package/dist/7220.jclic-node.js +0 -156
- package/dist/7220.jclic-node.js.map +0 -1
- package/dist/7257.jclic-node.js +0 -931
- package/dist/7257.jclic-node.js.map +0 -1
- package/dist/743.jclic-node.js +0 -583
- package/dist/743.jclic-node.js.map +0 -1
- package/dist/757.jclic-node.js +0 -1072
- package/dist/757.jclic-node.js.map +0 -1
- package/dist/7781.jclic-node.js +0 -202
- package/dist/7781.jclic-node.js.map +0 -1
- package/dist/7912.jclic-node.js +0 -2103
- package/dist/7912.jclic-node.js.map +0 -1
- package/dist/827.jclic-node.js +0 -708
- package/dist/827.jclic-node.js.map +0 -1
- package/dist/8276.jclic-node.js +0 -409
- package/dist/8276.jclic-node.js.map +0 -1
- package/dist/8322.jclic-node.js +0 -498
- package/dist/8322.jclic-node.js.map +0 -1
- package/dist/8641.jclic-node.js +0 -360
- package/dist/8641.jclic-node.js.map +0 -1
- package/dist/8837.jclic-node.js +0 -651
- package/dist/8837.jclic-node.js.map +0 -1
- package/dist/8895.jclic-node.js +0 -151
- package/dist/8895.jclic-node.js.map +0 -1
- package/dist/9072.jclic-node.js +0 -1285
- package/dist/9072.jclic-node.js.map +0 -1
- package/dist/9078.jclic-node.js +0 -935
- package/dist/9078.jclic-node.js.map +0 -1
- package/dist/9103.jclic-node.js +0 -718
- package/dist/9103.jclic-node.js.map +0 -1
- package/dist/9359.jclic-node.js +0 -145
- package/dist/9359.jclic-node.js.map +0 -1
- package/dist/9409.jclic-node.js +0 -921
- package/dist/9409.jclic-node.js.map +0 -1
- package/dist/9513.jclic-node.js +0 -720
- package/dist/9513.jclic-node.js.map +0 -1
- package/dist/9704.jclic-node.js +0 -81
- package/dist/9704.jclic-node.js.map +0 -1
- package/dist/9950.jclic-node.js +0 -827
- package/dist/9950.jclic-node.js.map +0 -1
package/dist/2366.jclic-node.js
DELETED
|
@@ -1,431 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.id = 2366;
|
|
3
|
-
exports.ids = [2366,9359];
|
|
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
|
-
};
|
|
430
|
-
;
|
|
431
|
-
//# sourceMappingURL=2366.jclic-node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"2366.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;AAC+B;;AAEtD;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM,kEAAkE;AACxE,eAAe;AACf;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,6CAAC;AACZ;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA,IAAI,gEAAW;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+DAAU;AACjC;AACA;AACA,KAAK;AACL;AACA;;AAEA;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;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA,CAAC;;AAED,iEAAe,SAAS,EAAC;;;;;;;;;;;;;;;;AC1HzB;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;AAC+B;AACf;;AAEvC;AACA,iFAAiF,wCAAwC;AACzH;AACO;AACP;AACA;AACA,aAAa,0BAA0B,WAAW,yCAAyC;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM,kEAAkE;AACxE,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,6CAAC;AACrB;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA,IAAI,gEAAW;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+DAAU;AACjC;AACA;AACA,KAAK;AACL;AACA,yBAAyB,qDAAS;AAClC,2BAA2B,6CAAC;AAC5B;AACA,KAAK;AACL;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,SAAS;AACtB;AACA;AACA;AACA,4BAA4B,qDAAS;AACrC;AACA;AACA;;AAEA;AACA,2BAA2B,mDAAmD;AAC9E,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;AACA;AACA;AACA,YAAY,qCAAqC;AACjD;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA,WAAW,mDAAmD;AAC9D;AACA,YAAY,mCAAmC;AAC/C;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,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,WAAW,EAAC","sources":["webpack://jclic/./src/report/ActionReg.js","webpack://jclic/./src/report/ActivityReg.js"],"sourcesContent":["/**\n * File : report/ActionReg.js\n * Created : 17/05/2016\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 { attrForEach, getBoolean } from '../Utils.js';\n\n/**\n * This class stores information about one specific action done by the current user while playing\n * an activity.\n *\n */\nexport class ActionReg {\n /**\n * ActionReg constructor\n * @param {string} type - Type of action (`click`, `write`, `move`, `select`...)\n * @param {string}+ source - Description of the object on which the action is done.\n * @param {string}+ dest - Description of the object that acts as a target of the action (used in pairings)\n * @param {boolean} ok - `true` if the action was OK, `false`, `null` or `undefined` otherwise\n */\n constructor(type, source, dest, ok) {\n this.type = type;\n this.source = source || null;\n this.dest = dest || null;\n this.ok = ok || false;\n this.time = (new Date()).valueOf();\n }\n\n /**\n * Provides the data associated with this action in XML format suitable for a\n * {@link http://clic.xtec.cat/en/jclic/reports/|JClic Reports Server}.\n * @returns {external:jQuery}\n */\n $getXML() {\n const attr = { ok: this.ok, time: this.time };\n if (this.type)\n attr.type = this.type;\n if (this.source)\n attr.source = this.source;\n if (this.dest)\n attr.dest = this.dest;\n return $('<action/>', attr);\n }\n\n /**\n * Fills this ActionReg with data provided in XML format\n * @param {external:jQuery} $xml - The XML element to be processed, already wrapped as jQuery object\n */\n setProperties($xml) {\n attrForEach($xml.get(0).attributes, (name, value) => {\n switch (name) {\n case 'type':\n case 'source':\n case 'dest':\n this[name] = value;\n break;\n case 'time':\n this[name] = Number(value);\n break;\n case 'ok':\n this[name] = getBoolean(value, false);\n break;\n }\n });\n }\n}\n\nObject.assign(ActionReg.prototype, {\n /**\n * The type of action (`click`, `write`, `move`, `select`...)\n * @name module:report/ActionReg.ActionReg#type\n * @type {string} */\n type: 'unknown',\n /**\n * Description of the object on which the action was done\n * @name module:report/ActionReg.ActionReg#source\n * @type {string} */\n source: null,\n /**\n * Description of the object that has acted as a target of the action (used in pairings)\n * @name module:report/ActionReg.ActionReg#dest\n * @type {string} */\n dest: null,\n /**\n * Time stamp taken when the action was done\n * @name module:report/ActionReg.ActionReg#time\n * @type {number} */\n time: 0,\n /**\n * `true` if the action was OK\n * @name module:report/ActionReg.ActionReg#isOk\n * @type {boolean} */\n isOk: false,\n});\n\nexport default ActionReg;\n","/**\n * File : report/ActivityReg.js\n * Created : 17/05/2016\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 { attrForEach, getBoolean } from '../Utils.js';\nimport ActionReg from './ActionReg.js';\n\n/**\n * This class stores miscellaneous data obtained by the current user playing an {@link module:Activity.Activity Activity}.\n */\nexport class ActivityReg {\n /**\n * ActivityReg constructor\n * @param {module:Activity.Activity} act - The {@link module:Activity.Activity Activity} referenced by this object.\n */\n constructor(act) {\n this.name = act.name;\n this.code = act.code;\n this.actions = [];\n this.startTime = (new Date()).valueOf();\n this.minActions = act.getMinNumActions();\n this.reportActions = act.reportActions;\n }\n\n /**\n * Provides the data associated with the current activity in an XML format suitable for a\n * {@link http://clic.xtec.cat/en/jclic/reports/|JClic Reports Server}.\n * @returns {external:jQuery}\n */\n $getXML() {\n const attr = {\n start: this.startTime,\n time: this.totalTime,\n solved: this.solved,\n score: this.score,\n minActions: this.minActions,\n actions: this.numActions\n };\n if (this.name)\n attr.name = this.name;\n if (this.code)\n attr.code = this.code;\n if (!this.closed)\n attr.closed = false;\n if (this.reportActions)\n attr.reportActions = true;\n\n const $result = $('<activity/>', attr);\n this.actions.forEach(ac => {\n $result.append(ac.$getXML());\n });\n return $result;\n }\n\n /**\n * Builds an object with relevant data about the results obtained by the current student in this activity\n * @returns {object} - The results of this activity\n */\n getData() {\n const result = {\n name: this.name,\n time: Math.round(this.totalTime / 10) / 100,\n solved: this.solved,\n score: this.score,\n minActions: this.minActions,\n actions: this.numActions,\n precision: this.getPrecision(),\n closed: this.closed\n };\n if (this.code)\n result.code = this.code;\n return result;\n }\n\n /**\n * Fills this ActivityReg with data provided in XML format\n * @param {external:jQuery} $xml -The XML element to be processed, already wrapped as jQuery object\n */\n setProperties($xml) {\n attrForEach($xml.get(0).attributes, (name, value) => {\n switch (name) {\n case 'name':\n case 'code':\n this[name] = value;\n break;\n case 'start':\n case 'time':\n case 'score':\n case 'minActions':\n case 'actions':\n this[name] = Number(value);\n break;\n case 'solved':\n case 'closed':\n case 'reportActions':\n this[name] = getBoolean(value, false);\n break;\n }\n });\n $xml.children('action').each((_n, child) => {\n const action = new ActionReg();\n action.setProperties($(child));\n this.actions.push(action);\n });\n }\n\n /**\n * Reports a new action done by the user while playing the current activity\n * @param {string} type - Type of action (`click`, `write`, `move`, `select`...)\n * @param {string}+ source - Description of the object on which the action is done.\n * @param {string}+ dest - Description of the object that acts as a target of the action (used in pairings)\n * @param {boolean} ok - `true` if the action was OK, `false`, `null` or `undefined` otherwise\n */\n newAction(type, source, dest, ok) {\n if (!this.closed) {\n this.lastAction = new ActionReg(type, source, dest, ok);\n this.actions.push(this.lastAction);\n }\n }\n\n /**\n * Retrieves a specific {@link module:report/ActionReg.ActionReg ActionReg} element from `actions`\n * @param {number} index - The nth action to be retrieved\n * @returns {module:report/ActionReg.ActionReg}\n */\n getActionReg(index) {\n return index >= this.actions.length ? null : this.actions[index];\n }\n\n /**\n * Closes the current activity, adjusting total time if needed\n */\n closeActivity() {\n if (!this.closed) {\n if (this.lastAction)\n this.totalTime = this.lastAction.time - this.startTime;\n else\n this.totalTime = (new Date()).valueOf() - this.startTime;\n this.closed = true;\n }\n }\n\n /**\n * calculates the final score obtained by the user in this activity.\n * The algorithm used takes in account the minimal number of actions needed, the actions\n * really done by the user, and if the activity was finally solved or not.\n * @returns {number}\n */\n getPrecision() {\n let result = 0;\n if (this.closed && this.minActions > 0 && this.numActions > 0) {\n if (this.solved) {\n if (this.numActions < this.minActions)\n result = 100;\n else\n result = Math.round(this.minActions * 100 / this.numActions);\n } else\n result = Math.round(100 * (this.score * this.score) / (this.minActions * this.numActions));\n }\n return result;\n }\n\n /**\n * This method should be called when the current activity finishes. Data about user's final results\n * on the activity will then be saved.\n * @param {number} score - The final score, usually in a 0-100 scale.\n * @param {number} numActions - The total number of actions done by the user to solve the activity\n * @param {boolean} solved - `true` if the activity was finally solved, `false` otherwise.\n */\n endActivity(score, numActions, solved) {\n if (!this.closed) {\n this.solved = solved;\n this.numActions = numActions;\n this.score = score;\n this.closeActivity();\n }\n }\n}\n\nObject.assign(ActivityReg.prototype, {\n /**\n * Name of the associated activity\n * @name module:report/ActivityReg.ActivityReg#name\n * @type {string} */\n name: '',\n /**\n * Optional code assigned to this activity, used for later filtering\n * @name module:report/ActivityReg.ActivityReg#code\n * @type {string} */\n code: '',\n /**\n * Timestamp when the user starts playing the activity\n * @name module:report/ActivityReg.ActivityReg#startTime\n * @type {number} */\n startTime: 0,\n /**\n * Total time spent by the user in the activity, measured in milliseconds\n * @name module:report/ActivityReg.ActivityReg#totalTime\n * @type {number} */\n totalTime: 0,\n /**\n * Collection of actions done by the user while playing the activity\n * @name module:report/ActivityReg.ActivityReg#actions\n * @type {module:report/ActionReg.ActionReg[]} */\n actions: [],\n /**\n * `true` only when the user has finished and solved the activity\n * @name module:report/ActivityReg.ActivityReg#solved\n * @type {boolean} */\n solved: false,\n /**\n * Last {@link module:report/ActionReg.ActionReg ActionReg} performed by the user in this activity\n * @name module:report/ActivityReg.ActivityReg#lastAction\n * @type {module:report/ActionReg.ActionReg} */\n lastAction: null,\n /**\n * Final score obtained by the current user in this activity\n * @name module:report/ActivityReg.ActivityReg#score\n * @type {number} */\n score: 0,\n /**\n * Minimum number of actions needed to solve the activity\n * @name module:report/ActivityReg.ActivityReg#minActions\n * @type {number} */\n minActions: 0,\n /**\n * `true` when the activity has finished, `false` for the activity that is currently playing\n * @name module:report/ActivityReg.ActivityReg#closed\n * @type {boolean} */\n closed: false,\n /**\n * `true` when this type of activity should record specific actions done by the users\n * @name module:report/ActivityReg.ActivityReg#reportActions\n * @type {boolean} */\n reportActions: false,\n /**\n * Number of actions done by the user playing this activity\n * @name module:report/ActivityReg.ActivityReg#numActions\n * @type {number} */\n numActions: 0,\n});\n\nexport default ActivityReg;\n"],"names":[],"sourceRoot":""}
|
package/dist/2379.jclic-node.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.id = 2379;
|
|
3
|
-
exports.ids = [2379];
|
|
4
|
-
exports.modules = {
|
|
5
|
-
|
|
6
|
-
/***/ 2379:
|
|
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 AutoContentProvider */
|
|
13
|
-
/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1253);
|
|
14
|
-
/**
|
|
15
|
-
* File : automation/AutoContentProvider.js
|
|
16
|
-
* Created : 13/04/2015
|
|
17
|
-
* By : Francesc Busquets <francesc@gmail.com>
|
|
18
|
-
*
|
|
19
|
-
* JClic.js
|
|
20
|
-
* An HTML5 player of JClic activities
|
|
21
|
-
* https://projectestac.github.io/jclic.js
|
|
22
|
-
*
|
|
23
|
-
* @source https://github.com/projectestac/jclic.js
|
|
24
|
-
*
|
|
25
|
-
* @license EUPL-1.2
|
|
26
|
-
* @licstart
|
|
27
|
-
* (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
|
|
28
|
-
*
|
|
29
|
-
* Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
|
|
30
|
-
* the European Commission- subsequent versions of the EUPL (the "Licence");
|
|
31
|
-
* You may not use this work except in compliance with the Licence.
|
|
32
|
-
*
|
|
33
|
-
* You may obtain a copy of the Licence at:
|
|
34
|
-
* https://joinup.ec.europa.eu/software/page/eupl
|
|
35
|
-
*
|
|
36
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
37
|
-
* distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
|
|
38
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
39
|
-
* Licence for the specific language governing permissions and limitations
|
|
40
|
-
* under the Licence.
|
|
41
|
-
* @licend
|
|
42
|
-
* @module
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* This abstract class is the base for classes that create on-time automatic content for JClic
|
|
49
|
-
* activities, usually using random parameters to assure different content in each session.
|
|
50
|
-
*
|
|
51
|
-
* Activities with `AutoContentProvider` objects rely on them to build new content on every start.
|
|
52
|
-
*/
|
|
53
|
-
class AutoContentProvider {
|
|
54
|
-
/**
|
|
55
|
-
* AutoContentProvider constructor
|
|
56
|
-
*/
|
|
57
|
-
constructor() {
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Dynamic constructor that returns a specific type of AutoContentProvider based on the `class`
|
|
62
|
-
* attribute declared on an $xml element.
|
|
63
|
-
* It should be called only from {@link module:Activity.Activity#setProperties Activity.setProperties}
|
|
64
|
-
* @param {external.jQuery} $xml - The XML element to parse
|
|
65
|
-
* @returns {module:automation/AutoContentProvider.AutoContentProvider}
|
|
66
|
-
*/
|
|
67
|
-
static getProvider($xml) {
|
|
68
|
-
let automation = null;
|
|
69
|
-
if ($xml) {
|
|
70
|
-
const
|
|
71
|
-
className = ($xml.attr('class') || '').replace(/^edu\.xtec\.jclic\.automation\./, '@'),
|
|
72
|
-
cl = AutoContentProvider.CLASSES[className];
|
|
73
|
-
if (cl) {
|
|
74
|
-
automation = new cl();
|
|
75
|
-
automation.setProperties($xml);
|
|
76
|
-
} else
|
|
77
|
-
(0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__/* .log */ .Rm)('error', `Unknown AutoContentProvider class: ${className}`);
|
|
78
|
-
}
|
|
79
|
-
return automation;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Loads the object settings from a specific jQuery XML element
|
|
84
|
-
* @param {external:jQuery} $xml - The XML element to parse
|
|
85
|
-
*/
|
|
86
|
-
setProperties($xml) {
|
|
87
|
-
this.className = ($xml.attr('class') || '').replace(/^edu\.xtec\.jclic\.automation\./, '@');
|
|
88
|
-
return this;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Gets a object with the basic attributes needed to rebuild this instance excluding functions,
|
|
93
|
-
* parent references, constants and also attributes retaining the default value.
|
|
94
|
-
* The resulting object is commonly usued to serialize elements in JSON format.
|
|
95
|
-
* @returns {object} - The resulting object, with minimal attrributes
|
|
96
|
-
*/
|
|
97
|
-
getAttributes() {
|
|
98
|
-
// To be overrided!
|
|
99
|
-
return (0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__/* .getAttr */ .iu)(this, ['className']);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Builds a new AutoContentProvider, based on the properties specified in a data object
|
|
104
|
-
* @param {object} data - The data object to be parsed
|
|
105
|
-
* @param {object[]} params - Optional parameters to be passed to `setAttributes`
|
|
106
|
-
* @returns {module:shapers/Shaper.Shaper}
|
|
107
|
-
*/
|
|
108
|
-
static factory(data, params = []) {
|
|
109
|
-
const cl = AutoContentProvider.CLASSES[data.className];
|
|
110
|
-
return (new cl()).setAttributes(data, ...params);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Initializes the content provider
|
|
115
|
-
*/
|
|
116
|
-
init() {
|
|
117
|
-
// To be implemented in real content providers
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Builds an {@link module:automation/AutoContentProvider/ActiveBagContentKit ActiveBagContentKit} and generates the automatized content.
|
|
122
|
-
* @param {number} nRows - Number of rows to be processed
|
|
123
|
-
* @param {number} nCols - Number of columns to be processed
|
|
124
|
-
* @param {module:boxes/ActiveBagContent.ActiveBagContent[]} content - Array with one or more containers of {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent}
|
|
125
|
-
* objects to be filled with new content.
|
|
126
|
-
* @param {boolean} useIds - When `true`, the `id` field of {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} objects is significant
|
|
127
|
-
* @returns {boolean} - `true` if the process was OK. `false` otherwise.
|
|
128
|
-
*/
|
|
129
|
-
generateContent(nRows, nCols, content, useIds) {
|
|
130
|
-
return this.process(new AutoContentProvider.ActiveBagContentKit(nRows, nCols, content, useIds));
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Generates the automatized content
|
|
135
|
-
* @param {module:automation/AutoContentProvider.ActiveBagContentKit} _kit - The objects to be filled with content
|
|
136
|
-
* @returns {boolean} - `true` if the process was OK. `false` otherwise.
|
|
137
|
-
*/
|
|
138
|
-
process(_kit) {
|
|
139
|
-
// To be implemented in subclasses
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Registers a new type of AutoContentProvider
|
|
145
|
-
* @param {string} providerName - The name used to identify this AutoContentProvider
|
|
146
|
-
* @param {function} providerClass - The activity class, usually extending AutoContentProvider
|
|
147
|
-
* @returns {module:automation/AutoContentProvider.AutoContentProvider} - The provider class
|
|
148
|
-
*/
|
|
149
|
-
static registerClass(providerName, providerClass) {
|
|
150
|
-
AutoContentProvider.CLASSES[providerName] = providerClass;
|
|
151
|
-
return providerClass;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
Object.assign(AutoContentProvider.prototype, {
|
|
156
|
-
/**
|
|
157
|
-
* This AutoContentProvider manages numeric expressions, so text literals should be
|
|
158
|
-
* converted to numbers for comparisions, taking in account the
|
|
159
|
-
* number format of the current locale (dot or comma as decimal separator)
|
|
160
|
-
* @name module:automation/AutoContentProvider.AutoContentProvider#numericContent
|
|
161
|
-
* @type {boolean} */
|
|
162
|
-
numericContent: false,
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Utility class used to encapsulate multiple sets of box contents
|
|
167
|
-
* @param {number} nRows - Number of rows to be processed
|
|
168
|
-
* @param {number} nCols - Number of columns to be processed
|
|
169
|
-
* @param {module:boxes/ActiveBagContent.ActiveBagContent[]} content - Array with one or more containers of {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent}
|
|
170
|
-
* objects to be filled with new content.
|
|
171
|
-
* @param {boolean} useIds - `true` when the `id` field of {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} objects is significant.
|
|
172
|
-
*/
|
|
173
|
-
AutoContentProvider.ActiveBagContentKit = class {
|
|
174
|
-
constructor(nRows, nCols, content, useIds) {
|
|
175
|
-
this.nRows = nRows;
|
|
176
|
-
this.nCols = nCols;
|
|
177
|
-
this.content = content;
|
|
178
|
-
this.useIds = useIds;
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Contains the current list of classes derived from AutoContentProvider.
|
|
184
|
-
* This object should be updated by real automation classes at declaration time.
|
|
185
|
-
* Currently, only two types of "AutoContentProvider" are defined: {@link module:automation/arith/Arith.Arith Arith} and TagReplace.
|
|
186
|
-
* @type {object} */
|
|
187
|
-
AutoContentProvider.CLASSES = {
|
|
188
|
-
// TODO: Implement TagReplace
|
|
189
|
-
'@tagreplace.TagReplace': AutoContentProvider
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
// TODO: Implement TagReplace
|
|
193
|
-
AutoContentProvider.registerClass('@tagreplace.TagReplace', AutoContentProvider);
|
|
194
|
-
|
|
195
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AutoContentProvider);
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
/***/ })
|
|
199
|
-
|
|
200
|
-
};
|
|
201
|
-
;
|
|
202
|
-
//# sourceMappingURL=2379.jclic-node.js.map
|