mumuki-gobstones-runner 2.11.0 → 2.12.0

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: 1636b8a5a322c4a74f84a725e8df8fa0118e38362b3732a70e76deba7b87e620
4
- data.tar.gz: 41d818b4cb24ce921ed45f0c539437ac0395ddc4152e2f5a4ebf3e2a19168b07
3
+ metadata.gz: d85da0b0c9fecd26e9b7d19346e44235e47a3e6efe5ee76c2504d40eb47a2dcd
4
+ data.tar.gz: 3cff2267ef410ea1cce2d63d4524d0453bc7b976e292050edc7c1441d78b65f4
5
5
  SHA512:
6
- metadata.gz: bb2ac8c37f98b4239de66fdc9f4b73982a013769add4d71172561e7d399774038647690468193a2dee19d2c8cf886582538f4bfc13479057a3837918affec4d0
7
- data.tar.gz: aba3b7d54384b3c44587219236ccfb4d3720560d63f5d7ac8193bc95604e4ec1ddd3de32544c8fcbaf0d3f396d19c62b3c9b6576b036e27f17d7d207d155b827
6
+ metadata.gz: ecda66dd1d44e538330f68ea19087eda4eb5c9e5b44bf7d04f60d49f477e75669f78781da58bc3c27bd8375e4a2f80b803190d750f8da970b4dd6ab34612f7e1
7
+ data.tar.gz: 6cdd4d96eaa8f55ad1f977adbf7b3cfe8ceab835240672a469c78bca907abb4f23735f1eab64e6fa5c776ac609dae00c4d4f9785e51a7ae481df795a5af869a9
@@ -65,7 +65,7 @@ class GobstonesFeedbackHook < Mumukit::Hook
65
65
  end
66
66
  end
67
67
 
68
- def explain_missing_closing_brace_after_procedure(submission, result)
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] }
@@ -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 %{color}. Maybe you meant %{rectified_color}?'
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
- missing_closing_brace_after_procedure: "Looks like you're missing a <code>}</code> to close a <code>procedure</code>. Maybe it's on line <strong>%{line}</strong> or near it?"
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>."
@@ -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 %{color}. ¿Quisiste referirte al color %{rectified_color}?'
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
- missing_closing_brace_after_procedure: 'Parece que te falta una <code>}</code> que cierre un <code>procedure</code>. ¿Puede que sea en la línea <strong>%{line}</strong> o cerca de ella?'
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>.'
@@ -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 %{color}. Você quis se referir à cor %{rectified_color}?'
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
- missing_closing_brace_after_procedure: 'Parece que está faltando um <code>}</code> que fecha um <code>procedure</code>. Pode ser na linha <strong>%{line}</strong> ou perto dela?'
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>.'
@@ -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,6 +230,11 @@
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
  });
@@ -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,16 @@
280
295
  },
281
296
 
282
297
  _relocateTrash() {
298
+ if (this.readOnly) {
299
+ console.debug("No trash relocate required");
300
+ return;
301
+ }
302
+
303
+ const $blocklyTrash = $('.blocklyTrash');
283
304
  const width = $('#blocklyDiv').width() - 68;
284
305
  const height = $('#blocklyDiv').height() - 210;
285
- $('.blocklyTrash').css("transform", `translate(${width}px, ${height}px)`);
286
- $('.blocklyTrash').css("display", "unset");
306
+ $blocklyTrash.css("transform", `translate(${width}px, ${height}px)`);
307
+ $blocklyTrash.css("display", "unset");
287
308
  },
288
309
 
289
310
  _updateSolution() {
@@ -16,6 +16,7 @@
16
16
  _setAttire: function () {
17
17
  $.getJSON(this.attireUrl, function (attire) {
18
18
  GobstonesBoard && GobstonesBoard.setDefaultAttire(attire);
19
+ attire.rules.forEach((rule) => $.get(rule.image));
19
20
  });
20
21
  }
21
22
  });
@@ -1,3 +1,3 @@
1
1
  module GobstonesVersionHook
2
- VERSION = '2.11.0'
2
+ VERSION = '2.12.0'
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.11.0
4
+ version: 2.12.0
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-10 00:00:00.000000000 Z
12
+ date: 2020-11-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gobstones-board