mumuki-gobstones-runner 2.12.1 → 2.14.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 471512b781af57084f5a0aeef2422931db62ebba489e2988e696eb1d58f72a14
4
- data.tar.gz: 01bb5e8b9275e2b31c6fe658c8234ed03a1acf7fd476ba423862fbca36580903
3
+ metadata.gz: 1b244e3280bfaca356fd1ef62b451f829961373477c9246531b87bf80c37efbf
4
+ data.tar.gz: 58e31a7aae944b043c4be7a471d8f3622d47205a3be0395c0350f6b7425597b8
5
5
  SHA512:
6
- metadata.gz: 236ee1be573d9baa4b852e085d8248d4e15c18e01d82c4f2c884d8be8b0bc5f52cfe694d1cd8eadf35a393ce24bc70faf4776006d15e26b76606572bace7464b
7
- data.tar.gz: 78b60bee1aa0fb52fd9dbd9e3da72ca609867665b548fa358ffbdbdd09a61a91e9d43175015f9474c14413a94ce42964e4a8334bd1144a29b640b2eadd1160fe
6
+ metadata.gz: '0941624faa0e39fd3e52a9379c026292581085979580fc44f87bc22cc6e6568d00e2588c6a02b19b8c1d123f4325c3d18685c1e495f82258b41e7c1436fcae97'
7
+ data.tar.gz: 9ce27aef7d8681b10b1baa6b8d86fd4a2c08bca8ecf8e71e35e9ffa30dcec9963d37cf8f5fc79fba4c852299886fff4c47e3571caa5f2a8e1ccc9ba492d70abc
@@ -17,10 +17,10 @@ class Mumukit::Server::App < Sinatra::Base
17
17
  get_local_asset "#{asset_type}/#{name}.svg", "lib/public/#{name}.svg", 'image/svg+xml'
18
18
  end
19
19
 
20
- def self.get_media_assets(folder)
20
+ def self.get_media_assets(folder, content_type = nil)
21
21
  Dir.glob(File.join(__dir__,"../lib/public/#{folder}/*")).each do |path|
22
22
  relative_media_asset_path = "#{folder}/#{File.basename path}"
23
- get_local_asset relative_media_asset_path, "lib/public/#{relative_media_asset_path}"
23
+ get_local_asset relative_media_asset_path, "lib/public/#{relative_media_asset_path}", content_type
24
24
  end
25
25
  end
26
26
 
@@ -38,9 +38,13 @@ class Mumukit::Server::App < Sinatra::Base
38
38
  get_local_asset 'editor/editor.css', 'lib/render/editor/editor.css', 'text/css'
39
39
  get_local_asset 'editor/hammer.min.js', 'lib/render/editor/hammer.min.js', 'application/javascript'
40
40
  get_local_asset 'boom.png', 'lib/public/boom.png', 'image/png'
41
+
42
+ # Depracated, prefer toolbox path
41
43
  get_local_asset 'full-kindergarten-toolbox.xml', 'lib/public/full-kindergarten-toolbox.xml', 'text/plain'
42
44
  get_local_asset 'minimal-kindergarten-toolbox.xml', 'lib/public/minimal-kindergarten-toolbox.xml', 'text/plain'
43
45
 
46
+ get_media_assets 'toolbox', 'text/plain'
47
+
44
48
  get_media_assets 'media'
45
49
  get_media_assets 'local-media'
46
50
 
@@ -62,6 +62,26 @@ procedure ShiftDown() {
62
62
  ShiftTo(Sur)
63
63
  }
64
64
 
65
+ function one() {
66
+ return (1);
67
+ }
68
+
69
+ function two() {
70
+ return (2);
71
+ }
72
+
73
+ function three() {
74
+ return (3);
75
+ }
76
+
77
+ function four() {
78
+ return (4);
79
+ }
80
+
81
+ function five() {
82
+ return (5);
83
+ }
84
+
65
85
  procedure ShiftTo(dir) {
66
86
  if (puedeMover(dir)) {
67
87
  Sacar(Rojo)
Binary file
Binary file
Binary file
Binary file
@@ -1,2 +1 @@
1
1
  <category name="Procedimientos primitivos"></category>
2
- <category name="Funciones primitivas"></category>
@@ -0,0 +1,6 @@
1
+ <category name="Bloques de Gobstones">
2
+ <block type="RepeticionSimple"></block>
3
+ <block type="two"></block>
4
+ <block type="three"></block>
5
+ </category>
6
+ <category name="Procedimientos primitivos"></category>
@@ -0,0 +1,7 @@
1
+ <category name="Bloques de Gobstones">
2
+ <block type="RepeticionSimple"></block>
3
+ <block type="two"></block>
4
+ <block type="three"></block>
5
+ <block type="four"></block>
6
+ </category>
7
+ <category name="Procedimientos primitivos"></category>
@@ -0,0 +1,8 @@
1
+ <category name="Bloques de Gobstones">
2
+ <block type="RepeticionSimple"></block>
3
+ <block type="two"></block>
4
+ <block type="three"></block>
5
+ <block type="four"></block>
6
+ <block type="five"></block>
7
+ </category>
8
+ <category name="Procedimientos primitivos"></category>
@@ -0,0 +1,5 @@
1
+ <category name="Bloques de Gobstones">
2
+ <block type="RepeticionSimple"></block>
3
+ </category>
4
+ <category name="Funciones primitivas"></category>
5
+ <category name="Procedimientos primitivos"></category>
@@ -0,0 +1 @@
1
+ <category name="Procedimientos primitivos"></category>
@@ -133,3 +133,7 @@
133
133
  border: 1px solid #6D6E70 !important;
134
134
  border-radius: 4px;
135
135
  }
136
+
137
+ .mu-kids-exercise.mu-kindergarten .blocklyBubbleCanvas {
138
+ display: none;
139
+ }
@@ -428,11 +428,14 @@
428
428
  console.debug("Set game actions");
429
429
  const blockly = this._getBlockly();
430
430
 
431
- this._setPrimitiveProcedures((blockly.primitiveProcedures || []).concat([
432
- this._gamePrimitive('ShiftUp'),
433
- this._gamePrimitive('ShiftDown'),
434
- this._gamePrimitive('ShiftLeft'),
435
- this._gamePrimitive('ShiftRight')
431
+ this._setPrimitiveProcedures(
432
+ this._gamePrimitivesFor(blockly.primitiveProcedures, [
433
+ 'ShiftUp', 'ShiftDown', 'ShiftLeft', 'ShiftRight'
434
+ ]));
435
+
436
+ this._setPrimitiveFunctions(
437
+ this._gamePrimitivesFor(blockly.primitiveFunctions, [
438
+ 'one', 'two', 'three', 'four', 'five'
436
439
  ]));
437
440
  },
438
441
 
@@ -458,6 +461,10 @@
458
461
  return { alias: 'procedureDeclaration', name, attributes: {block_icon: `<%= @assets_url %>/media/${name}.png`} };
459
462
  },
460
463
 
464
+ _gamePrimitivesFor(base, names) {
465
+ return (base || []).concat(names.map(it => this._gamePrimitive(it)));
466
+ },
467
+
461
468
  _getBlockly() {
462
469
  return this.$.blocklyElement;
463
470
  },
@@ -802,7 +809,7 @@
802
809
  this.$editor = $("mu-gobstones-custom-editor")[0];
803
810
  },
804
811
 
805
- _boardToState : function ({size, table, header, boom}) {
812
+ _boardToState: function ({size, table, header, boom}) {
806
813
  return {size, table, header, boom}
807
814
  },
808
815
 
@@ -823,15 +830,11 @@
823
830
  const targetStateIndex = this.multipleScenarios.currentScenarioIndex;
824
831
  this.targetState = this.initialState[targetStateIndex];
825
832
 
826
- const promise = new mumuki.bridge.Laboratory()
827
- .runTests(solution)
833
+ const promise = mumuki.submission.sendSolution({solution})
828
834
  .then((results) => {
829
835
  if (promise !== this.serverPromise) return;
830
836
 
831
837
  this._onRemoteExecutionStop(results);
832
- })
833
- .catch(() => {
834
- mumuki.kids.showResult({status: 'aborted'})
835
838
  });
836
839
  this.serverPromise = promise;
837
840
 
@@ -866,12 +869,22 @@
866
869
  if (reason === "end") {
867
870
  this._onExecutionEnd(editor);
868
871
  }
869
- else if (reason === "cancel" && editor.interactiveMode) {
870
- this._onInteractiveStop(editor);
872
+ else if (reason === "cancel") {
873
+ this._onExecutionCancel(editor);
871
874
  }
872
875
  else this.serverPromise = undefined;
873
876
  },
874
877
 
878
+ _onExecutionCancel: function(editor) {
879
+ if(editor.interactiveMode) {
880
+ this._onInteractiveStop(editor);
881
+ }
882
+ else {
883
+ this._onResetState();
884
+ this.serverPromise = undefined;
885
+ }
886
+ },
887
+
875
888
  _onExecutionEnd: function (editor) {
876
889
  if(editor.interactiveMode) {
877
890
  editor.toggleInteractiveMode();
@@ -21,4 +21,32 @@ $(document).ready(function () {
21
21
  $blockSvg.width($blocks.width());
22
22
  $blockSvg.height($blocks.height());
23
23
  });
24
+
25
+ mumuki.I18n.register({
26
+ 'es': {
27
+ 'kindergarten_passed': '¡Tu programa está muy bien!',
28
+ 'kindergarten_passed_with_warnings': 'Tu programa está bien ¡pero se puede mejorar!',
29
+ 'kindergarten_failed': 'Hay un error en tu programa. ¡Intentá de nuevo!',
30
+ 'kindergarten_errored': 'Hay un error en tu programa. ¡Intentá de nuevo!',
31
+ },
32
+ 'es-CL': {
33
+ 'kindergarten_passed': '¡Tu programa está muy bien!',
34
+ 'kindergarten_passed_with_warnings': 'Tu programa está bien ¡pero se puede mejorar!',
35
+ 'kindergarten_failed': 'Hay un error en tu programa. ¡Intenta de nuevo!',
36
+ 'kindergarten_errored': 'Hay un error en tu programa. ¡Intenta de nuevo!'
37
+ },
38
+ 'en': {
39
+ 'kindergarten_passed': 'Your program is very good!',
40
+ 'kindergarten_passed_with_warnings': 'Your program is good. But it can be improved!',
41
+ 'kindergarten_failed': 'There is an error in your program. Try again!',
42
+ 'kindergarten_errored': 'There is an error in your program. Try again!'
43
+ },
44
+ 'pt': {
45
+ 'kindergarten_passed': 'Seu programa é muito bom!',
46
+ 'kindergarten_passed_with_warnings': 'Seu programa é bom, mas pode ser melhorado!',
47
+ 'kindergarten_failed': 'Há um erro no seu programa. Tenta de novo!',
48
+ 'kindergarten_errored': 'Há um erro no seu programa. Tenta de novo!'
49
+ },
50
+ });
51
+
24
52
  });
@@ -1,3 +1,3 @@
1
1
  module GobstonesVersionHook
2
- VERSION = '2.12.1'
2
+ VERSION = '2.14.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-gobstones-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.1
4
+ version: 2.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Alfonso
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-11-16 00:00:00.000000000 Z
12
+ date: 2021-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gobstones-board
@@ -240,12 +240,22 @@ files:
240
240
  - lib/public/media/disconnect.mp3
241
241
  - lib/public/media/disconnect.ogg
242
242
  - lib/public/media/disconnect.wav
243
+ - lib/public/media/five.png
244
+ - lib/public/media/four.png
245
+ - lib/public/media/one.png
243
246
  - lib/public/media/quote0.png
244
247
  - lib/public/media/quote1.png
245
248
  - lib/public/media/sprites.png
246
249
  - lib/public/media/sprites.svg
250
+ - lib/public/media/three.png
251
+ - lib/public/media/two.png
247
252
  - lib/public/minimal-kindergarten-toolbox.xml
248
253
  - lib/public/red.svg
254
+ - lib/public/toolbox/kindergarten-2-to-3.xml
255
+ - lib/public/toolbox/kindergarten-2-to-4.xml
256
+ - lib/public/toolbox/kindergarten-2-to-5.xml
257
+ - lib/public/toolbox/kindergarten-full.xml
258
+ - lib/public/toolbox/kindergarten-minimal.xml
249
259
  - lib/render/boards.html.erb
250
260
  - lib/render/editor/editor.css
251
261
  - lib/render/editor/editor.html.erb
@@ -276,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
286
  - !ruby/object:Gem::Version
277
287
  version: '0'
278
288
  requirements: []
279
- rubygems_version: 3.0.8
289
+ rubygems_version: 3.0.3
280
290
  signing_key:
281
291
  specification_version: 4
282
292
  summary: Gobstones Runner for Mumuki