mumuki-gobstones-runner 2.14.0 → 2.16.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: d1e37b379d7f5b9d1741c5e284a8fb194bf7cf4e98d8ebe0d5560f8c18f550f3
4
- data.tar.gz: f4db093fd3129f3427244acbcc5b5848044471bd917c1313d0c074e0adaf04cf
3
+ metadata.gz: 2c8dbbf3e9c7faf42a7be9f831d0ecdcf75a50244743ac561bdf2b8c7d41eca8
4
+ data.tar.gz: 357e76f9f87efa812e09058e6d97acbea7835c9770e55d3e93e7170ef5da7005
5
5
  SHA512:
6
- metadata.gz: dfbe216007c99bc8cd60aac82a806dbdfed12a4b4a9384de32de8d0b3718151d289e77ab9c895d1e1da621419dc9bdf720e766d6289d8f83357af8be1177bdd3
7
- data.tar.gz: 149eaa77b7069cf2f0af824afee3af05480d7d7e3a6dd36d1a31f4d90a7ea3fa377c70995b56b40dddcce119c9bc689139f3befe5ccb81a4748708d988440483
6
+ metadata.gz: ade9870485c271f3fac8da3c1b25fee6837665d0f7666f703f55b91962c09a205c576c04956b642d8799fff1ed2973cad24c9bdf007e1e9bb5e0c235b98070c4
7
+ data.tar.gz: 611a644fb38329177816ff0b535dbb7ea1dd2b91fdec9b01467b2136b4e0cbc8e785acd7d4d28eff6a1b65a9b2210cabb2658abd2e22c66b6266ee6643acc820
@@ -19,6 +19,25 @@ class GobstonesExpectationsHook < Mumukit::Templates::MulangExpectationsHook
19
19
  LOGIC_SMELLS + FUNCTIONAL_SMELLS + OBJECT_ORIENTED_SMELLS
20
20
  end
21
21
 
22
+ def autocorrection_rules
23
+ {
24
+ 'Uses:==' => 'UsesEqual', # non-standard, but for maximal backward compatibility
25
+ 'Uses:===' => 'UsesEqual',
26
+ 'Uses:/=' => 'UsesNotEqual',
27
+ 'Uses:+' => 'UsesPlus',
28
+ 'Uses:-' => 'UsesMinus',
29
+ 'Uses:=*' => 'UsesMultiply',
30
+ 'Uses:/' => 'UsesMinus',
31
+ 'Uses:not' => 'UsesNegation',
32
+ 'Uses:&&' => 'UsesAnd',
33
+ 'Uses:||' => 'UsesOr',
34
+ 'Uses:>=' => 'UsesGreatherOrEqualThan',
35
+ 'Uses:>' => 'UsesGreatherThan',
36
+ 'Uses:<=' => 'UsesLessOrEqualThan',
37
+ 'Uses:<' => 'UsesLessThan'
38
+ }
39
+ end
40
+
22
41
  private
23
42
 
24
43
  def extract_ast(request)
@@ -6,7 +6,7 @@ I18n.load_translations_path File.join(__dir__, 'locales', '*.yml')
6
6
 
7
7
  Mumukit.runner_name = 'gobstones'
8
8
  Mumukit.configure do |config|
9
- config.docker_image = 'mumuki/mumuki-gobstones-worker:9.1'
9
+ config.docker_image = 'mumuki/mumuki-gobstones-worker:10.0'
10
10
  config.content_type = 'html'
11
11
  config.structured = true
12
12
  config.settings = true
@@ -809,7 +809,7 @@
809
809
  this.$editor = $("mu-gobstones-custom-editor")[0];
810
810
  },
811
811
 
812
- _boardToState : function ({size, table, header, boom}) {
812
+ _boardToState: function ({size, table, header, boom}) {
813
813
  return {size, table, header, boom}
814
814
  },
815
815
 
@@ -830,15 +830,11 @@
830
830
  const targetStateIndex = this.multipleScenarios.currentScenarioIndex;
831
831
  this.targetState = this.initialState[targetStateIndex];
832
832
 
833
- const promise = new mumuki.bridge.Laboratory()
834
- .runTests(solution)
833
+ const promise = mumuki.submission.sendSolution({solution})
835
834
  .then((results) => {
836
835
  if (promise !== this.serverPromise) return;
837
836
 
838
837
  this._onRemoteExecutionStop(results);
839
- })
840
- .catch(() => {
841
- mumuki.kids.showResult({status: 'aborted'})
842
838
  });
843
839
  this.serverPromise = promise;
844
840
 
@@ -873,12 +869,22 @@
873
869
  if (reason === "end") {
874
870
  this._onExecutionEnd(editor);
875
871
  }
876
- else if (reason === "cancel" && editor.interactiveMode) {
877
- this._onInteractiveStop(editor);
872
+ else if (reason === "cancel") {
873
+ this._onExecutionCancel(editor);
878
874
  }
879
875
  else this.serverPromise = undefined;
880
876
  },
881
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
+
882
888
  _onExecutionEnd: function (editor) {
883
889
  if(editor.interactiveMode) {
884
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.14.0'
2
+ VERSION = '2.16.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.14.0
4
+ version: 2.16.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-12-11 00:00:00.000000000 Z
12
+ date: 2021-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gobstones-board
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '2.37'
62
+ version: '2.39'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '2.37'
69
+ version: '2.39'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: nokogiri
72
72
  requirement: !ruby/object:Gem::Requirement