mumuki-gobstones-runner 2.11.0 → 2.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets_server.rb +6 -2
- data/lib/feedback_hook.rb +1 -1
- data/lib/game_framework/extra.gbs.erb +20 -0
- data/lib/locales/en.yml +2 -2
- data/lib/locales/es.yml +2 -2
- data/lib/locales/pt.yml +2 -2
- data/lib/public/local-media/repeticion-simple.png +0 -0
- data/lib/public/media/five.png +0 -0
- data/lib/public/media/four.png +0 -0
- data/lib/public/media/one.png +0 -0
- data/lib/public/media/three.png +0 -0
- data/lib/public/media/two.png +0 -0
- data/lib/public/minimal-kindergarten-toolbox.xml +0 -1
- data/lib/public/toolbox/kindergarten-2-to-3.xml +6 -0
- data/lib/public/toolbox/kindergarten-2-to-4.xml +7 -0
- data/lib/public/toolbox/kindergarten-2-to-5.xml +8 -0
- data/lib/public/toolbox/kindergarten-full.xml +5 -0
- data/lib/public/toolbox/kindergarten-minimal.xml +1 -0
- data/lib/render/editor/editor.css +4 -0
- data/lib/render/editor/editor.html.erb +43 -14
- data/lib/render/layout/layout.html +1 -0
- data/lib/version_hook.rb +1 -1
- metadata +13 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16b0e7c565a14d86f588746885e896e9bd00157e4d54bde3cf66462ed1a91e24
|
4
|
+
data.tar.gz: a9f2db6e60708af307cab7e26360662bc4cfeade97960bc7fd2297b9ca8ea2e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a83db717ca0f2c78f1222cde2a809a8b78c878f6cabb0428ce4ea38cfbda2e1b92fff01cc11596509522792c7c41f56c971ab80c7c7c9de6139432d1d9d5cd82
|
7
|
+
data.tar.gz: 591f2e6414c5aac0c8ff4779b9a1eaaa9e3516447f941bbd6f12e87066e7f84d097139dead5a3c1c5aa86122aa478761a55e873dcbdb2039ab1b0e2c616c69a9
|
data/lib/assets_server.rb
CHANGED
@@ -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
|
|
data/lib/feedback_hook.rb
CHANGED
@@ -65,7 +65,7 @@ class GobstonesFeedbackHook < Mumukit::Hook
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
def
|
68
|
+
def explain_missing_closing_brace_before_procedure(submission, result)
|
69
69
|
if procedure_instead_of_command?(result) && missing_brace_end?(submission)
|
70
70
|
(error_line(result)).try do |it|
|
71
71
|
{ line: it[1] }
|
@@ -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)
|
data/lib/locales/en.yml
CHANGED
@@ -12,12 +12,12 @@ en:
|
|
12
12
|
code_wrong_argument_type: 'wrong arguments type'
|
13
13
|
code_unassigned_variable: 'unassigned variable'
|
14
14
|
code_wrong_arguments_quantity: 'wrong arguments quantity'
|
15
|
-
color_typo: 'It seems you wrote
|
15
|
+
color_typo: 'It seems you wrote <code>%{color}</code>. Did you mean <code>%{rectified_color}</code>?'
|
16
16
|
expected_board: 'Expected final board'
|
17
17
|
final_board: 'Final board'
|
18
18
|
initial_board: 'Initial board'
|
19
19
|
lower_builtin_procedure_typo: 'Looks lie you wrote <code>%{lower}</code> in lowercase. Remember procedures such as <code>%{upper}()</code> should start in uppercase!'
|
20
|
-
|
20
|
+
missing_closing_brace_before_procedure: "Looks like you're missing a <code>}</code> before a <code>procedure</code>. Maybe it's on line <strong>%{line}</strong> or near it?"
|
21
21
|
no_program_found: 'No program definition was found'
|
22
22
|
program_before_closing_structure_when_no_program: "Looks like you're missing a <code>}</code> to close the last <code>%{keyword}</code>."
|
23
23
|
program_before_closing_structure_when_program: "Looks like you're missing a <code>}</code> to close the last <code>%{keyword}</code> before <code>program</code>."
|
data/lib/locales/es.yml
CHANGED
@@ -12,12 +12,12 @@ es:
|
|
12
12
|
code_wrong_argument_type: 'problema de tipos en los argumentos'
|
13
13
|
code_unassigned_variable: 'variable no asignada'
|
14
14
|
code_wrong_arguments_quantity: 'cantidad errónea de argumentos'
|
15
|
-
color_typo: 'Parece que escribiste
|
15
|
+
color_typo: 'Parece que escribiste <code>%{color}</code>. ¿Quisiste referirte al color <code>%{rectified_color}</code>?'
|
16
16
|
expected_board: 'Tablero final esperado'
|
17
17
|
final_board: 'Tablero final'
|
18
18
|
initial_board: 'Tablero inicial'
|
19
19
|
lower_builtin_procedure_typo: 'Parece que escribiste <code>%{lower}</code> en minúsculas. ¡Recordá que los procedimientos como <code>%{upper}()</code> deben comenzar en mayúsculas!'
|
20
|
-
|
20
|
+
missing_closing_brace_before_procedure: 'Parece que te falta una <code>}</code> antes de un <code>procedure</code>. ¿Puede que sea en la línea <strong>%{line}</strong> o cerca de ella?'
|
21
21
|
no_program_found: 'No se encontró ninguna definición de programa'
|
22
22
|
program_before_closing_structure_when_no_program: 'Parece que te falta una <code>}</code> que cierre el último <code>%{keyword}</code>.'
|
23
23
|
program_before_closing_structure_when_program: 'Parece que te falta una <code>}</code> que cierre el <code>%{keyword}</code> antes de <code>program</code>.'
|
data/lib/locales/pt.yml
CHANGED
@@ -12,12 +12,12 @@ pt:
|
|
12
12
|
code_wrong_argument_type: 'problema de tipos nos argumentos'
|
13
13
|
code_unassigned_variable: 'variável não atribuída'
|
14
14
|
code_wrong_arguments_quantity: 'quantidade errada de argumentos'
|
15
|
-
color_typo: 'Parece que você escreveu
|
15
|
+
color_typo: 'Parece que você escreveu <code>%{color}</code>. Você quis se referir à cor <code>%{rectified_color}</code>?'
|
16
16
|
expected_board: 'Tabuleiro final esperado'
|
17
17
|
final_board: 'Tabuleiro final'
|
18
18
|
initial_board: 'Tabuleiro inicial'
|
19
19
|
lower_builtin_procedure_typo: 'Parece que você escreveu <code>%{lower}</code> em letras minúsculas. Lembre-se de que procedimentos como <code>%{upper}()</code> devem começar em maiúsculas!'
|
20
|
-
|
20
|
+
missing_closing_brace_before_procedure: 'Parece que está faltando um <code>}</code> antes de um <code>procedure</code>. Pode ser na linha <strong>%{line}</strong> ou perto dela?'
|
21
21
|
no_program_found: 'Nenhuma definição de programa foi encontrada'
|
22
22
|
program_before_closing_structure_when_no_program: 'Parece que está faltando um <code>}</code> que fecha a última <code>%{keyword}</code>.'
|
23
23
|
program_before_closing_structure_when_program: 'Parece que está faltando um <code>}</code> que fecha o <code>%{keyword}</code> antes do <code>program</code>.'
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -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 @@
|
|
1
|
+
<category name="Procedimientos primitivos"></category>
|
@@ -216,10 +216,7 @@
|
|
216
216
|
this._setBlocklyDisplayMode();
|
217
217
|
this._setBlocklySounds();
|
218
218
|
this._setBlocklyColors();
|
219
|
-
|
220
|
-
if (!this.readOnly) {
|
221
|
-
this._relocateTrashOnResize();
|
222
|
-
}
|
219
|
+
this._relocateTrashOnResize();
|
223
220
|
|
224
221
|
// Removing "/" from the block id character set to avoid syntax errors
|
225
222
|
Blockly.utils.genUid.soup_ = Blockly.utils.genUid.soup_.replace("/", "");
|
@@ -233,11 +230,16 @@
|
|
233
230
|
},
|
234
231
|
|
235
232
|
_relocateTrashOnResize() {
|
233
|
+
if (this.readOnly) {
|
234
|
+
console.debug("No trash relocate on resize required");
|
235
|
+
return;
|
236
|
+
}
|
237
|
+
|
236
238
|
$('.mu-kids-context, .mu-kids-results').on('hidden.bs.modal shown.bs.modal', () => {
|
237
239
|
this._relocateTrash();
|
238
240
|
});
|
239
241
|
|
240
|
-
$(window).resize(() => this._relocateTrash
|
242
|
+
$(window).resize(() => setTimeout(this._relocateTrash));
|
241
243
|
},
|
242
244
|
|
243
245
|
|
@@ -246,6 +248,8 @@
|
|
246
248
|
*
|
247
249
|
* Blockly's workspace is destroyed when toolbox changes, so initialization
|
248
250
|
* is performed here
|
251
|
+
|
252
|
+
* @see _initializeBlocklyWorkspace
|
249
253
|
*/
|
250
254
|
_initializeCustomToolboxBlocklyWorkspace(toolboxXml) {
|
251
255
|
this._getBlockly().toolbox = { defaultToolbox: toolboxXml };
|
@@ -258,6 +262,8 @@
|
|
258
262
|
* Blockly's workspace is destroyed when toolbox changes,
|
259
263
|
* so this method will initialize it only if a there is a custom toolbox
|
260
264
|
* that will be called later.
|
265
|
+
*
|
266
|
+
* @see _initializeBlocklyWorkspace
|
261
267
|
*/
|
262
268
|
_initializeNonCustomToolboxBlocklyWorkspace() {
|
263
269
|
if (!this.hasCustomToolbox()) {
|
@@ -265,11 +271,20 @@
|
|
265
271
|
}
|
266
272
|
},
|
267
273
|
|
274
|
+
/**
|
275
|
+
* Performs actual workspace (re)creation,
|
276
|
+
* which sets initial xml, user solution, trash position
|
277
|
+
* and appropriate callbacks.
|
278
|
+
*
|
279
|
+
* This method is the actual culmination of the blockly initialization
|
280
|
+
* process
|
281
|
+
*/
|
268
282
|
_initializeBlocklyWorkspace() {
|
269
283
|
console.debug('Initializing Blockly Workspace');
|
270
284
|
|
271
285
|
this._setInitialXml();
|
272
286
|
this._initializeWorkspace();
|
287
|
+
this._relocateTrash();
|
273
288
|
this._subscribeToWorkspace(() => this._updateSolution());
|
274
289
|
|
275
290
|
if (this.hasInteractiveProgram()) {
|
@@ -280,10 +295,17 @@
|
|
280
295
|
},
|
281
296
|
|
282
297
|
_relocateTrash() {
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
298
|
+
if (this.readOnly) {
|
299
|
+
console.debug("No trash relocate required");
|
300
|
+
return;
|
301
|
+
}
|
302
|
+
|
303
|
+
const $blocklyTrash = $('.blocklyTrash');
|
304
|
+
const $blocklyDiv = $('#blocklyDiv');
|
305
|
+
const width = $blocklyDiv.width() - 68;
|
306
|
+
const height = $blocklyDiv.height() - 210;
|
307
|
+
$blocklyTrash.css("transform", `translate(${width}px, ${height}px)`);
|
308
|
+
$blocklyTrash.css("display", "unset");
|
287
309
|
},
|
288
310
|
|
289
311
|
_updateSolution() {
|
@@ -406,11 +428,14 @@
|
|
406
428
|
console.debug("Set game actions");
|
407
429
|
const blockly = this._getBlockly();
|
408
430
|
|
409
|
-
this._setPrimitiveProcedures(
|
410
|
-
this.
|
411
|
-
|
412
|
-
|
413
|
-
|
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'
|
414
439
|
]));
|
415
440
|
},
|
416
441
|
|
@@ -436,6 +461,10 @@
|
|
436
461
|
return { alias: 'procedureDeclaration', name, attributes: {block_icon: `<%= @assets_url %>/media/${name}.png`} };
|
437
462
|
},
|
438
463
|
|
464
|
+
_gamePrimitivesFor(base, names) {
|
465
|
+
return (base || []).concat(names.map(it => this._gamePrimitive(it)));
|
466
|
+
},
|
467
|
+
|
439
468
|
_getBlockly() {
|
440
469
|
return this.$.blocklyElement;
|
441
470
|
},
|
data/lib/version_hook.rb
CHANGED
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.
|
4
|
+
version: 2.14.1
|
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:
|
12
|
+
date: 2021-01-05 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.
|
289
|
+
rubygems_version: 3.0.3
|
280
290
|
signing_key:
|
281
291
|
specification_version: 4
|
282
292
|
summary: Gobstones Runner for Mumuki
|