jclic 2.1.21 → 2.1.22
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 +4 -0
- package/dist/jclic-node.js +1 -1
- 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 +1 -1
- package/src/GlobalData.js +1 -1
- 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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"9103.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;;AAEiC;AACY;;AAE7C;AACA;AACA,SAAS,2CAA2C;AACpD;AACA;AACO,qBAAqB,kDAAM;AAClC;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;;AAEA,sBAAsB,kBAAkB;AACxC,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,gBAAgB;AACpC,sBAAsB,gBAAgB;AACtC;AACA;AACA,uBAAuB,mDAAI,MAAM,yDAAU;AAC3C;AACA;AACA;AACA;AACA,yBAAyB,yDAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA;AACA;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA,uBAAuB,yDAAU;AACjC,uBAAuB,yDAAU;AACjC,uBAAuB,yDAAU;AACjC;AACA,uBAAuB,yDAAU;AACjC;AACA;;AAEA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,yDAAU;AACjC,MAAM;AACN;AACA;AACA;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA,uBAAuB,yDAAU;AACjC,uBAAuB,yDAAU;AACjC,uBAAuB,yDAAU;AACjC;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA;;AAEA;AACA,iEAAe,kDAAM,iCAAiC,EAAC;;;;;;;;;;;;;;;;AChKvD;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;AACsD;AACL;;AAExE;AACA;AACA,UAAU,kDAAkD;AAC5D;AACA;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,MAAM,wDAAG,6BAA6B,UAAU;AAChD;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC,8BAA8B,oDAAK;AACnC;;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;AACA;AACA;AACA,uBAAuB,+DAAU;AACjC;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,MAAM,6CAAC;AACP;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,IAAI,kDAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,wDAAS;AAChC;AACA;AACA,uBAAuB,sDAAO;AAC9B;AACA;AACA;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA,KAAK;;AAEL,2CAA2C,mDAAI;AAC/C;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,WAAW,4DAAO;AAClB;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,IAAI,4DAAO;AACX;AACA;AACA;AACA;AACA;AACA,QAAQ,sBAAsB,oDAAK,EAAE;AACrC,QAAQ,sBAAsB,oDAAK,kBAAkB;AACrD;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,sBAAsB;AACnC,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe,wDAAS;AACxB;;AAEA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA2C,wDAAS;AACpD,oBAAoB,iBAAiB;AACrC;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,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,SAAS,0CAA0C;AACnD;AACA,YAAY,QAAQ;AACpB;AACA;AACA,SAAS,0CAA0C;AACnD;AACA,YAAY,QAAQ;AACpB;AACA;AACA,SAAS,0CAA0C;AACnD;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,SAAS,uCAAuC;AAChD;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA,SAAS,uCAAuC;AAChD;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA,SAAS,uCAAuC;AAChD;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA,SAAS,uCAAuC;AAChD;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA,CAAC;;AAED;AACA;AACA;AACA,UAAU,QAAQ;AAClB;;AAEA,iEAAe,MAAM,EAAC;;;;;;;;;;;;;;;ACjYtB;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;;AAEiC;AACA;AACM;;AAEvC;AACA,SAAS,2CAA2C;AACpD;AACA;AACA;AACO,+BAA+B,kDAAM;AAC5C;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA,gBAAgB;AAChB;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA;AACA;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA,uBAAuB,yDAAU;AACjC,uBAAuB,yDAAU;AACjC;AACA,uBAAuB,yDAAU;AACjC;AACA;;AAEA;AACA,gBAAgB;AAChB;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA,uBAAuB,yDAAU;AACjC,uBAAuB,yDAAU;AACjC;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA;;AAEA;AACA,iEAAe,kDAAM,qDAAqD,EAAC","sources":["webpack://jclic/./src/shapers/JigSaw.js","webpack://jclic/./src/shapers/Shaper.js","webpack://jclic/./src/shapers/TriangularJigSaw.js"],"sourcesContent":["/**\n * File : shapers/JigSaw.js\n * Created : 01/04/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport Shaper from './Shaper.js';\nimport { Path, PathStroke } from '../AWT.js';\n\n/**\n *\n * This {@link module:shapers/Shaper.Shaper Shaper} returns a set of rectangular shapes with teeth and slots that fit between them.\n * @extends module:shapers/Shaper.Shaper\n */\nexport class JigSaw extends Shaper {\n /**\n * JigSaw constructor\n * @param {number} nx - Number of columns\n * @param {number} ny - Number of rows\n */\n constructor(nx, ny) {\n super(nx, ny);\n }\n\n /**\n * Builds the jigsaw shapes based on the number of rows and columns\n * @override\n */\n buildShapes() {\n // Create two two-dimension arrays for storing the type of horizontal and vertical lines\n let hLineType = [], vLineType = [];\n for (let i = 0; i <= this.nRows; i++) {\n hLineType[i] = [];\n vLineType[i] = [];\n }\n\n for (let row = 0; row < this.nRows; row++) {\n for (let col = 0; col < this.nCols; col++) {\n hLineType[row][col] = row === 0 ? 0 : 1 + (this.randomLines ? Math.round(Math.random() * 9) : row + col) % 2;\n vLineType[row][col] = col === 0 ? 0 : 1 + (this.randomLines ? Math.round(Math.random() * 9) : col + row + 1) % 2;\n if (col === this.nCols - 1)\n vLineType[row][col + 1] = 0;\n if (row === this.nRows - 1)\n hLineType[row + 1][col] = 0;\n }\n }\n\n const w = 1 / this.nCols, h = 1 / this.nRows;\n for (let r = 0; r < this.nRows; r++) {\n for (let c = 0; c < this.nCols; c++) {\n const x = w * c;\n const y = h * r;\n const sd = new Path([new PathStroke('M', [x, y])]);\n this.hLine(sd, hLineType[r][c], x + 0, y + 0, w, h, false);\n this.vLine(sd, vLineType[r][c + 1], x + w, y + 0, w, h, false);\n this.hLine(sd, hLineType[r + 1][c], x + w, y + h, w, h, true);\n this.vLine(sd, vLineType[r][c], x + 0, y + h, w, h, true);\n sd.addStroke(new PathStroke('X'));\n sd.calcEnclosingRect();\n // Save the Path in `shapeData`\n this.shapeData[r * this.nCols + c] = sd;\n }\n }\n this.initiated = true;\n }\n\n /**\n * Adds an horizontal line to the provided path\n * @param {module:AWT.Path} sd - The Path to which the line will be added\n * @param {number} type - Type of tooth: 0 is flat (no tooth), 1 means tooth up, and 2 means tooth down\n * @param {number} x - X coordinate of the starting point\n * @param {number} y - Y coordinate of the starting point\n * @param {number} w - Width of the piece\n * @param {number} h - Height of the piece\n * @param {boolean} inv - The line must be drawn right to left\n */\n hLine(sd, type, x, y, w, h, inv) {\n const\n kx = inv ? -1 : 1,\n ky = type === 1 ? 1 : -1;\n\n if (type === 0)\n // Flat line\n sd.addStroke(new PathStroke('L', [x + w * kx, y]));\n else {\n const x0 = x + (w - w * this.baseWidthFactor) / 2 * kx;\n const wb = w * this.baseWidthFactor * kx;\n // Approximation to the tooth:\n sd.addStroke(new PathStroke('L', [x0, y]));\n // The tooth:\n const hb = h * this.toothHeightFactor * ky;\n sd.addStroke(new PathStroke('L', [x0, y + hb]));\n sd.addStroke(new PathStroke('L', [x0 + wb, y + hb]));\n sd.addStroke(new PathStroke('L', [x0 + wb, y]));\n // Draw the remaining of the line\n sd.addStroke(new PathStroke('L', [x + w * kx, y]));\n }\n }\n\n /**\n *\n * Adds a vertical line to the provided path\n * @param {module:AWT.Path} sd - The Path to which the line will be added\n * @param {number} type - Type of tooth: 0 is flat (no tooth), 1 means tooth right, and 2 means tooth left\n * @param {number} x - X coordinate of the starting point\n * @param {number} y - Y coordinate of the starting point\n * @param {number} w - Width of the piece\n * @param {number} h - Height of the piece\n * @param {boolean} inv - The line must be drawn bottom to top\n */\n vLine(sd, type, x, y, w, h, inv) {\n const\n ky = inv ? -1 : 1,\n kx = type === 1 ? 1 : -1;\n\n if (type === 0) {\n // Flat line\n sd.addStroke(new PathStroke('L', [x, y + h * ky]));\n } else {\n const y0 = y + (h - h * this.baseWidthFactor) / 2 * ky;\n const hb = h * this.baseWidthFactor * ky;\n // Approximation to the tooth:\n sd.addStroke(new PathStroke('L', [x, y0]));\n // The tooth:\n const wb = w * this.toothHeightFactor * kx;\n sd.addStroke(new PathStroke('L', [x + wb, y0]));\n sd.addStroke(new PathStroke('L', [x + wb, y0 + hb]));\n sd.addStroke(new PathStroke('L', [x, y0 + hb]));\n // Draw the remaining line\n sd.addStroke(new PathStroke('L', [x, y + h * ky]));\n }\n }\n}\n\n// Register this class in the list of known shapers\nexport default Shaper.registerClass('@JigSaw', JigSaw);\n","/**\n * File : shapers/Shaper.js\n * Created : 13/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 { log, attrForEach, getBoolean, getAttr, setAttr } from '../Utils.js';\nimport { Shape, Rectangle, Ellipse, PathStroke, Path } from '../AWT.js';\n\n/**\n * The function of this class and its subclasses is to draw a set of \"shapes\" that will be used to\n * place {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects at a specific position, and to determine its dimension and\n * appearance.\n */\nexport class Shaper {\n /**\n * Shaper constructor\n * @param {number} nx - Number of columns (in grid-based shapers)\n * @param {number} ny - Number of rows (in grid-based shapers)\n */\n constructor(nx, ny) {\n this.reset(nx, ny);\n }\n\n /**\n * Registers a new type of shaper\n * @param {string} shaperName - The name used to identify this shaper\n * @param {function} shaperClass - The shaper class, usually extending Shaper\n * @returns {module:shapers/Shaper.Shaper} - The provided shaper class\n */\n static registerClass(shaperName, shaperClass) {\n Shaper.CLASSES[shaperName] = shaperClass;\n return shaperClass;\n }\n\n /**\n * Factory constructor that returns a Shaper of the requested class.\n * @param {string} className - The class name of the requested Shaper.\n * @param {number} nx - Number of columns (in grid-based shapers)\n * @param {number} ny - Number of rows (in grid-based shapers)\n * @returns {module:shapers/Shaper.Shaper}\n */\n static getShaper(className, nx, ny) {\n const cl = Shaper.CLASSES[(className || '').replace(/^edu\\.xtec\\.jclic\\.shapers\\./, '@')];\n if (!cl)\n log('error', `Unknown shaper: ${className}`);\n return cl ? new cl(nx, ny) : null;\n }\n\n /**\n * Initializes this Shaper to default values\n * @param {number} nCols - Number of columns\n * @param {number} nRows - Number of rows\n */\n reset(nCols, nRows) {\n this.nCols = nCols;\n this.nRows = nRows;\n this.nCells = nRows * nCols;\n this.initiated = false;\n this.shapeData = [];\n for (let i = 0; i < this.nCells; i++)\n this.shapeData[i] = new Shape();\n }\n\n /**\n * Loads this shaper settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element with the shaper data\n */\n setProperties($xml) {\n attrForEach($xml.get(0).attributes, (name, value) => {\n switch (name) {\n case 'class':\n this.className = value;\n break;\n case 'cols':\n this.nCols = Number(value);\n break;\n case 'rows':\n this.nRows = Number(value);\n break;\n case 'baseWidthFactor':\n case 'toothHeightFactor':\n case 'scaleX':\n case 'scaleY':\n this[name] = Number(value);\n break;\n case 'randomLines':\n case 'showEnclosure':\n this[name] = getBoolean(value, true);\n break;\n }\n });\n\n // Reads the 'enclosing'\n // (main shape area where the other shape elements are placed)\n $xml.children('enclosing:first').each((_n, child) => {\n $(child).children('shape:first').each((_n, child2) => {\n let sh = Shaper.readShapeData(child2, this.scaleX, this.scaleY);\n this.enclosing = sh;\n this.showEnclosure = true;\n this.hasRemainder = true;\n });\n });\n\n // Read the shape elements\n $xml.children('shape').each((n, child) => {\n this.shapeData[n] = Shaper.readShapeData(child, this.scaleX, this.scaleY);\n });\n\n // Correction needed for '@Holes' shaper\n if (this.shapeData.length > 0 /* && this.shapeData.length !== this.nRows * this.nCols */) {\n //this.nRows = this.shapeData.length\n //this.nCols = 1\n //this.nCells = this.nCols * this.nRows\n this.nCells = this.shapeData.length;\n }\n return this;\n }\n\n /**\n * Reads an individual shape from an XML element.\n * Shapes are arrays of `stroke` objects.\n * Each `stroke` has an `action` (_move to_, _line to_, _quad to_...) and associated `data`.\n * @param {external:jQuery} $xml - The XML element with the shape data\n * @param {number} scaleX\n * @param {number} scaleY\n * @returns {module:AWT.Shape}\n */\n static readShapeData(xml, scaleX, scaleY) {\n const shd = [];\n let result = null;\n $.each(xml.textContent.split('|'), (_n, txt) => {\n const sd = txt.split(':');\n // Possible strokes are: `rectangle`, `ellipse`, `M`, `L`, `Q`, `B`, `X`\n // Also possible, but not currently used in JClic: `roundRectangle` and `pie`\n let data = sd.length > 1 ? sd[1].split(',') : null;\n //\n // Data should be always divided by the scale (X or Y)\n if (data)\n data = data.map((d, n) => d / (n % 2 ? scaleY : scaleX));\n\n switch (sd[0]) {\n case 'rectangle':\n result = new Rectangle(data[0], data[1], data[2], data[3]);\n break;\n case 'ellipse':\n result = new Ellipse(data[0], data[1], data[2], data[3]);\n break;\n default:\n // It's an `AWT.PathStroke`\n shd.push(new PathStroke(sd[0], data));\n break;\n }\n });\n\n return !result && shd.length > 0 ? new Path(shd) : result;\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 const fields = [\n 'className', 'nCols', 'nRows',\n 'baseWidthFactor', 'toothHeightFactor',\n 'scaleX', 'scaleY',\n 'randomLines',\n ];\n\n if (this.customShapes) {\n ['showEnclosure', 'hasRemainder',\n 'enclosing', 'shapeData', // Array of AWT.Rectangle, AWT.Ellipse or (AWT.Path -> AWT.PathStroke)\n ].forEach(f => fields.push(f));\n }\n\n return getAttr(this, fields);\n }\n\n /**\n * Builds a new shaper, based on the properties specified in a data object\n * @param {object} data - The data object to be parsed\n * @returns {module:shapers/Shaper.Shaper}\n */\n static factory(data) {\n const result = Shaper.getShaper(data.className, data.nCols, data.nRows);\n setAttr(result, data, [\n 'className', 'nCols', 'nRows',\n 'baseWidthFactor', 'toothHeightFactor',\n 'scaleX', 'scaleY',\n 'randomLines',\n 'showEnclosure', 'hasRemainder',\n { key: 'enclosing', fn: Shape },\n { key: 'shapeData', fn: Shape, group: 'array' },\n ]);\n\n result.nCells = result.shapeData.length || result.nCols * result.nRows;\n\n return result;\n }\n\n /**\n * Builds the individual shapes that will form this Shaper\n */\n buildShapes() {\n }\n\n /**\n * Gets a clone of the nth Shape object, scaled and located inside a Rectangle\n * @param {number} n\n * @param {module:AWT.Rectangle} rect\n * @returns {module:AWT.Shape}\n */\n getShape(n, rect) {\n if (!this.initiated)\n this.buildShapes();\n if (n >= this.nCells || this.shapeData[n] === null)\n return null;\n return this.shapeData[n].getShape(rect);\n }\n\n /**\n * Gets the nth Shape data object\n * @param {number} n\n * @returns {object}\n */\n getShapeData(n) {\n return n >= 0 && n < this.shapeData.length ? this.shapeData[n] : null;\n }\n\n /**\n * Gets the AWT.Rectangle that contains all shapes of this Shaper.\n * @returns {module:AWT.Rectangle}\n */\n getEnclosingShapeData() {\n return new Rectangle(0, 0, 1, 1);\n }\n\n /**\n * When `hasRemainder` is true, this method gets the rectangle containing the full surface where\n * the Shaper develops.\n * @param {module:AWT.Rectangle} rect - The frame where to move and scale all the shapes\n * @returns {module:AWT.Rectangle}\n */\n getRemainderShape(rect) {\n if (!this.hasRemainder)\n return null;\n\n if (!this.initiated)\n this.buildShapes();\n\n const sh = this.getEnclosingShapeData();\n const r = sh ? sh.getShape(rect) : new Rectangle();\n for (let i = 0; i < this.nCells; i++) {\n if (this.shapeData[i])\n r.add(this.shapeData[i].getShape(rect), false);\n }\n return r;\n }\n}\n\nObject.assign(Shaper.prototype, {\n /**\n * This shaper class name\n * @name module:shapers/Shaper.Shaper#className\n * @type {string} */\n className: 'Shaper',\n /**\n * Number of columns (useful in grid-based shapers)\n * @name module:shapers/Shaper.Shaper#nCols\n * @type {number} */\n nCols: 0,\n /**\n * Number of rows (useful in grid-based shapers)\n * @name module:shapers/Shaper.Shaper#nRows\n * @type {number} */\n nRows: 0,\n /**\n * Number of cells managed by this shaper\n * @name module:shapers/Shaper.Shaper#nCells\n * @type {number} */\n nCells: 0,\n /**\n * Contains the specific definition of each shape\n * @name module:shapers/Shaper.Shaper#shapeData\n * @type {object} */\n shapeData: null,\n /**\n * Flag used to check if the `Shaper` has been initialized against a real surface\n * @name module:shapers/Shaper.Shaper#initiated\n * @type {boolean} */\n initiated: false,\n //\n // Fields used only in JigSaw shapers\n /**\n * In {@link module:shapers/JigSaw.JigSaw JigSaw}, ratio between the base width of the tooth and the total length of the side.\n * @name module:shapers/Shaper.Shaper#baseWidthFactor\n * @type {number} */\n baseWidthFactor: 1.0 / 3,\n /**\n * In {@link module:shapers/JigSaw.JigSaw JigSaw}, ratio between the tooth height and the total length of the side.\n * @name module:shapers/Shaper.Shaper#toothHeightFactor\n * @type {number} */\n toothHeightFactor: 1.0 / 6,\n /**\n * In {@link module:shapers/JigSaw.JigSaw JigSaw}, whether the tooths take random directions or not\n * @name module:shapers/Shaper.Shaper#randomLines\n * @type {boolean} */\n randomLines: false,\n //\n // Fields used only in the `Holes` shaper\n /**\n * In {@link module:shapers/Holes.Holes Holes}, scale to be applied to horizontal positions and lengths to achieve the real\n * value of the shape placed on a real surface.\n * @name module:shapers/Shaper.Shaper#scaleX\n * @type {number} */\n scaleX: 1.0,\n /**\n * In {@link module:shapers/Holes.Holes Holes}, scale to be applied to vertical positions and lengths to achieve the real\n * value of the shape placed on a real surface.\n * @name module:shapers/Shaper.Shaper#scaleY\n * @type {number} */\n scaleY: 1.0,\n /**\n * In {@link module:shapers/Holes.Holes Holes}, the enclosing area where all shapes are placed.\n * @name module:shapers/Shaper.Shaper#enclosing\n * @type {module:AWT.Shape} */\n enclosing: null,\n /**\n * In {@link module:shapers/Holes.Holes Holes}, when `true`, the enclosing area will be drawn\n * @name module:shapers/Shaper.Shaper#showEnclosure\n * @type {boolean} */\n showEnclosure: false,\n /**\n * Flag indicating if this shaper organizes its cells in rows and columns\n * @name module:shapers/Shaper.Shaper#rectangularShapes\n * @type {boolean} */\n rectangularShapes: false,\n /**\n * Flag indicating if this Shaper deploys over a surface biggest than the rectangle enclosing\n * all its shapes\n * @name module:shapers/Shaper.Shaper#hasRemainder\n * @type {boolean} */\n hasRemainder: false,\n /**\n * Only the `Holes` shaper has this flag activated\n * @name module:shapers/Shaper.Shaper#customShapes\n * @type {boolean} */\n customShapes: false,\n});\n\n/**\n * List of known classes derived from Shaper. It should be filled by real shaper classes at\n * declaration time.\n * @type {object} */\nShaper.CLASSES = {};\n\nexport default Shaper;\n","/**\n * File : shapers/TriangularJigSaw.js\n * Created : 25/05/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport Shaper from './Shaper.js';\nimport JigSaw from './JigSaw.js';\nimport { PathStroke } from '../AWT.js';\n\n/**\n * This {@link module:shapers/Shaper.Shaper Shaper} returns a set of rectangular shapes with triangular teeth and slots that\n * fit between them.\n * @extends module:shapers/JigSaw.JigSaw\n */\nexport class TriangularJigSaw extends JigSaw {\n /**\n * TriangularJigSaw constructor\n * @param {number} nx - Number of columns\n * @param {number} ny - Number of rows\n */\n constructor(nx, ny) {\n super(nx, ny);\n }\n\n /**\n * Overrides {@link module:shapers/JigSaw.JigSaw#hLine}\n * @override\n * @param {module:AWT.Path} sd - The Path to which the line will be added\n * @param {number} type - Type of tooth: 0 is flat (no tooth), 1 means tooth up, and 2 means tooth down\n * @param {number} x - X coordinate of the starting point\n * @param {number} y - Y coordinate of the starting point\n * @param {number} w - Width of the piece\n * @param {number} h - Height of the piece\n * @param {boolean} inv - The line must be drawn right to left\n */\n hLine(sd, type, x, y, w, h, inv) {\n const\n kx = inv ? -1 : 1,\n ky = type === 1 ? 1 : -1;\n\n if (type === 0)\n // Flat line\n sd.addStroke(new PathStroke('L', [x + w * kx, y]));\n else {\n const x0 = x + (w - w * this.baseWidthFactor) / 2 * kx;\n const wb = w * this.baseWidthFactor * kx;\n // Approximation to the tooth:\n sd.addStroke(new PathStroke('L', [x0, y]));\n // This is the tooth:\n const hb = h * this.toothHeightFactor * ky;\n sd.addStroke(new PathStroke('L', [x0 + wb / 2, y + hb]));\n sd.addStroke(new PathStroke('L', [x0 + wb, y]));\n // Draw the remaining line\n sd.addStroke(new PathStroke('L', [x + w * kx, y]));\n }\n }\n\n /**\n * Overrides {@link module:shapers/JigSaw.JigSaw#vLine}\n * @override\n * @param {module:AWT.Path} sd - The Path to which the line will be added\n * @param {number} type - Type of tooth: 0 is flat (no tooth), 1 means tooth right, and 2 means tooth left\n * @param {number} x - X coordinate of the starting point\n * @param {number} y - Y coordinate of the starting point\n * @param {number} w - Width of the piece\n * @param {number} h - Height of the piece\n * @param {boolean} inv - The line must be drawn bottom to top\n */\n vLine(sd, type, x, y, w, h, inv) {\n const\n ky = inv ? -1 : 1,\n kx = type === 1 ? 1 : -1;\n\n if (type === 0)\n // Flat line\n sd.addStroke(new PathStroke('L', [x, y + h * ky]));\n else {\n const\n y0 = y + (h - h * this.baseWidthFactor) / 2 * ky,\n hb = h * this.baseWidthFactor * ky;\n\n // Approximation to the tooth:\n sd.addStroke(new PathStroke('L', [x, y0]));\n // This is the tooth:\n const wb = w * this.toothHeightFactor * kx;\n sd.addStroke(new PathStroke('L', [x + wb, y0 + hb / 2]));\n sd.addStroke(new PathStroke('L', [x, y0 + hb]));\n // Draw the remaining line\n sd.addStroke(new PathStroke('L', [x, y + h * ky]));\n }\n }\n}\n\n// Register this class in the list of known shapers\nexport default Shaper.registerClass('@TriangularJigSaw', TriangularJigSaw);\n"],"names":[],"sourceRoot":""}
|
package/dist/9359.jclic-node.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.id = 9359;
|
|
3
|
-
exports.ids = [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
|
-
};
|
|
144
|
-
;
|
|
145
|
-
//# sourceMappingURL=9359.jclic-node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"9359.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","sources":["webpack://jclic/./src/report/ActionReg.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"],"names":[],"sourceRoot":""}
|