mumuki-laboratory 8.4.0 → 8.5.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: a5768156d24f254cf945c99755c091bc65af815819018e30c862ca29c3c5f853
4
- data.tar.gz: d6e5afe45c48ff78d0fb091f50474c2c2b26ea1862eedf1c10989d6b931f73ea
3
+ metadata.gz: a7c7290ee8af41b2af9f9d34977a9df9095fd3fb38a74e167bb1678b754cc001
4
+ data.tar.gz: 364699a1f019910da6ccc23d6970d20053a2ea36de3351fd32368c31395df89a
5
5
  SHA512:
6
- metadata.gz: 8d8948197c3172881c4e633432bf60f87228085c7154c458c3169fe4762a789ec6a1c5ecac5def061059d545ed52d3f3a2f9d72415c9b2fce15e24b3c5cb3683
7
- data.tar.gz: 4da96aac20c1f2b16f87dbf87d117d3845c30b58f17c3e8a6b16bd6a7bd18a644ccce006a591b47a9e3c5fbb07f9013472bd3dab6171ab4d17f347bdff934eba
6
+ metadata.gz: b1f8f15e334cfc4599eab6b8872c829553fe2c92559bc5a22f796a23df711caf233317982ca0c057eaf8e8c0c9ddbc4209e1f3454ac9cfa379f79ce07a154265
7
+ data.tar.gz: f38ef6d9aef9f9d29ff14d9a091c60906438789b124334031bd102e605296fb8d844b5d2a2f97dd094e4586c4dd06a662c149d3f9d1ad6ad70cf5b5f4edf21d5
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '8.4.0'
3
+ VERSION = '8.5.0'
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  describe('bridge', () => {
2
2
  it('can create bridge', () => {
3
3
  expect(new mumuki.bridge.Laboratory()).not.toBe(null);
4
- })
5
- })
4
+ });
5
+ });
@@ -1,7 +1,7 @@
1
1
  describe('csrf token', () => {
2
2
  it('can create token', () => {
3
3
  expect(new mumuki.CsrfToken()).not.toBe(null);
4
- })
5
- })
4
+ });
5
+ });
6
6
 
7
7
 
@@ -1,11 +1,10 @@
1
1
  describe('editors', () => {
2
-
3
2
  beforeEach(() => {
4
- mumuki.CustomEditor.clearSources()
5
- })
3
+ mumuki.CustomEditor.clearSources();
4
+ });
6
5
 
7
6
  it('has initially no sources', () => {
8
- expect(mumuki.CustomEditor.hasSources).toBe(false)
7
+ expect(mumuki.CustomEditor.hasSources).toBe(false);
9
8
  });
10
9
 
11
10
  it('can add a custom source', () => {
@@ -26,7 +25,7 @@ describe('editors', () => {
26
25
  <div class="field form-group editor-code">
27
26
  <textarea class="form-control editor" name="solution[content]" id="solution_content">the standard solution</textarea>
28
27
  </div>
29
- </form>`)
28
+ </form>`);
30
29
 
31
30
  mumuki.editors.addCustomSource({
32
31
  getContent() {
@@ -43,11 +42,10 @@ describe('editors', () => {
43
42
  <div class="field form-group editor-code">
44
43
  <textarea class="form-control editor" name="solution[content]" id="solution_content">the solution</textarea>
45
44
  </div>
46
- </form>`)
45
+ </form>`);
47
46
  expect(mumuki.editors.getSubmission()).toEqual({"solution[content]":"the solution"});
48
47
  });
49
48
 
50
-
51
49
  it('reads the form if no sources and exercise is multifile', () => {
52
50
  $('body').html(`
53
51
  <form role="form" class="new_solution">
@@ -63,7 +61,7 @@ describe('editors', () => {
63
61
  name="solution[content[receta.css]]"
64
62
  id="solution_content[receta.css]">some css</textarea>
65
63
  </div>
66
- </form>`)
64
+ </form>`);
67
65
  expect(mumuki.editors.getSubmission()).toEqual({
68
66
  "solution[content[index.html]]": "some html",
69
67
  "solution[content[receta.css]]": "some css"
@@ -74,4 +72,4 @@ describe('editors', () => {
74
72
  $('body').html(``);
75
73
  expect(mumuki.editors.getSubmission()).toEqual({});
76
74
  });
77
- })
75
+ });
@@ -1,7 +1,7 @@
1
1
  describe('elipsis', () => {
2
2
  it('does nothing when no elipsis', () => {
3
3
  expect(mumuki.elipsis('hello')).toEqual('hello');
4
- })
4
+ });
5
5
 
6
6
  it('replaces student elipsis', () => {
7
7
  expect(mumuki.elipsis(`function longitud(unString) {
@@ -10,7 +10,7 @@ describe('elipsis', () => {
10
10
  /*@elipsis-for-student&gt;*/
11
11
  }`)).toEqual(`function longitud(unString) {
12
12
  /* ... */
13
- }`)
13
+ }`);
14
14
  });
15
15
 
16
16
  it('replaces student hidden', () => {
@@ -20,6 +20,6 @@ describe('elipsis', () => {
20
20
  /*@hidden-for-student&gt;*/
21
21
  }`)).toEqual(`function longitud(unString) {
22
22
  /**/
23
- }`)
23
+ }`);
24
24
  });
25
- })
25
+ });
@@ -6,18 +6,18 @@ describe('events', () => {
6
6
  it('is not called when it is not fired', () => {
7
7
  mumuki.events.on('foo', (e) => {
8
8
  fail(`should not be called, but got ${JSON.stringify(e)}`);
9
- })
10
- })
9
+ });
10
+ });
11
11
 
12
12
  it('is not called when it is fired but not enabled', () => {
13
13
  let fired = false;
14
14
  mumuki.events.on('foo', (e) => {
15
15
  fail(`should not be called, but got ${JSON.stringify(e)}`);
16
16
  fired = true;
17
- })
17
+ });
18
18
  mumuki.events.fire('foo', 42);
19
19
  expect(fired).toBe(false);
20
- })
20
+ });
21
21
 
22
22
  it('is called when it is fired and enabled', () => {
23
23
  let fired = false;
@@ -25,9 +25,9 @@ describe('events', () => {
25
25
  mumuki.events.on('foo', (event) => {
26
26
  expect(event).toEqual(42);
27
27
  fired = true;
28
- })
28
+ });
29
29
 
30
30
  mumuki.events.fire('foo', 42);
31
31
  expect(fired).toBe(true);
32
- })
33
- })
32
+ });
33
+ });
@@ -1,10 +1,9 @@
1
1
  describe('exercise', () => {
2
-
3
2
  it('current exercise information is available when present', () => {
4
3
  $('body').html(`
5
4
  <input type="hidden" name="mu-exercise-id" id="mu-exercise-id" value="3361" />
6
5
  <input type="hidden" name="mu-exercise-layout" id="mu-exercise-layout" value="input_right" />
7
- <input type="hidden" name="mu-exercise-settings" id="mu-exercise-settings" value="{}" />`)
6
+ <input type="hidden" name="mu-exercise-settings" id="mu-exercise-settings" value="{}" />`);
8
7
 
9
8
  mumuki.exercise.load();
10
9
 
@@ -12,13 +11,13 @@ describe('exercise', () => {
12
11
  expect(mumuki.exercise.layout).toBe('input_right');
13
12
  expect(mumuki.exercise.settings).toEqual({});
14
13
  expect(mumuki.exercise.current).not.toBe(null);
15
- })
14
+ });
16
15
 
17
16
  it('current exercise information is available when present and settings are not empty', () => {
18
17
  $('body').html(`
19
18
  <input type="hidden" name="mu-exercise-id" id="mu-exercise-id" value="3361" />
20
19
  <input type="hidden" name="mu-exercise-layout" id="mu-exercise-layout" value="input_right" />
21
- <input type="hidden" name="mu-exercise-settings" id="mu-exercise-settings" value="{&quot;game_framework&quot;:true}" />`)
20
+ <input type="hidden" name="mu-exercise-settings" id="mu-exercise-settings" value="{&quot;game_framework&quot;:true}" />`);
22
21
 
23
22
  mumuki.exercise.load();
24
23
 
@@ -26,10 +25,10 @@ describe('exercise', () => {
26
25
  expect(mumuki.exercise.layout).toBe('input_right');
27
26
  expect(mumuki.exercise.settings.game_framework).toBe(true);
28
27
  expect(mumuki.exercise.current).not.toBe(null);
29
- })
28
+ });
30
29
 
31
30
  it('current exercise information is available when not present', () => {
32
- $('body').html(``)
31
+ $('body').html(``);
33
32
 
34
33
  mumuki.exercise.load();
35
34
 
@@ -37,5 +36,5 @@ describe('exercise', () => {
37
36
  expect(mumuki.exercise.layout).toBe(null);
38
37
  expect(mumuki.exercise.settings).toBe(null);
39
38
  expect(mumuki.exercise.current).toBe(null);
40
- })
41
- })
39
+ });
40
+ });
@@ -1,6 +1,6 @@
1
1
  describe("global loading", () => {
2
2
  it("produces no global loading errors", () => {
3
3
  const error = window['__globalLoadingError__'];
4
- expect(!error).toBe(true, `Expected no global loading errors but got ${error && error.message}`)
5
- })
6
- })
4
+ expect(!error).toBe(true, `Expected no global loading errors but got ${error && error.message}`);
5
+ });
6
+ });
@@ -1,29 +1,30 @@
1
1
  describe('I18n', () => {
2
-
3
2
  describe('t / translate', () => {
4
-
5
3
  it('accept english translations', () => {
6
4
  mumuki.locale = 'en';
7
5
  expect(mumuki.I18n.translate('passed')).toBe('Everything is in order! Your solution passed all our tests!');
8
- })
6
+ });
7
+
9
8
  it('accept spanish translations', () => {
10
9
  mumuki.locale = 'es';
11
10
  expect(mumuki.I18n.translate('passed_with_warnings')).toBe('Tu solución funcionó, pero hay cosas que mejorar');
12
- })
11
+ });
12
+
13
13
  it('accept chilean translations', () => {
14
14
  mumuki.locale = 'es-CL';
15
15
  expect(mumuki.I18n.translate('failed')).toBe('Tu solución no pasó las pruebas');
16
- })
16
+ });
17
+
17
18
  it('accept portuguese translations', () => {
18
19
  mumuki.locale = 'pt';
19
20
  expect(mumuki.I18n.translate('errored')).toBe('Opa! Sua solução não pode ser executada');
20
- })
21
+ });
22
+
21
23
  it('fails when translation missing', () => {
22
24
  mumuki.locale = 'en';
23
25
  expect(mumuki.I18n.translate('foo')).toBe('Translation missing: en, `foo`');
24
- })
25
-
26
- })
26
+ });
27
+ });
27
28
 
28
29
  describe('register', () => {
29
30
  beforeEach(() => {
@@ -33,21 +34,23 @@ describe('I18n', () => {
33
34
  greet: (data) => `Hi ${data.name}`,
34
35
  errored: "D'Oh!"
35
36
  }
36
- })
37
- })
37
+ });
38
+ });
39
+
38
40
  it('overrides existing translation key', () => {
39
41
  expect(mumuki.I18n.translate('errored')).toBe("D'Oh!");
40
- })
42
+ });
43
+
41
44
  it('add missing translation key', () => {
42
45
  expect(mumuki.I18n.translate('greet', {name: 'Jane'})).toBe('Hi Jane');
43
- })
46
+ });
47
+
44
48
  it('keep non overriding translation key', () => {
45
49
  expect(mumuki.I18n.translate('passed')).toBe('Everything is in order! Your solution passed all our tests!');
46
- })
47
- })
50
+ });
51
+ });
48
52
 
49
53
  describe('with some prefix', () => {
50
-
51
54
  fixture.set(`
52
55
  <div class="mu-kindergarten" data-i18n-prefix="testing">
53
56
  <button class="mu-kids-button">Click me<button>
@@ -61,19 +64,19 @@ describe('I18n', () => {
61
64
  en: {
62
65
  testing_failed: 'Ops! Execution failed',
63
66
  }
64
- })
67
+ });
65
68
  });
66
69
 
67
70
  it('Using prefix with existing translation key', () => {
68
71
  expect(mumuki.I18n.t('passed')).toBe('Everything is in order! Your solution passed all our tests!');
69
72
  });
73
+
70
74
  it('Use prefix with none existing translation key but default key exists', () => {
71
75
  expect(mumuki.I18n.t('failed')).toBe('Ops! Execution failed');
72
76
  });
77
+
73
78
  it('No key found', () => {
74
79
  expect(mumuki.I18n.t('foo')).toBe('Translation missing: en, `foo`');
75
- })
76
-
80
+ });
77
81
  });
78
-
79
82
  });
@@ -1,5 +1,4 @@
1
1
  describe('KidsButton', () => {
2
-
3
2
  let button;
4
3
 
5
4
  fixture.set(`
@@ -12,25 +11,24 @@ describe('KidsButton', () => {
12
11
  beforeEach(() => {
13
12
  mumuki.kids = new mumuki.Kids();
14
13
  button = new mumuki.submission.KidsSubmitButton($('.mu-kids-button'));
15
- })
14
+ });
16
15
 
17
16
  it('can create button', () => {
18
17
  expect(button).not.toBe(null);
19
- })
18
+ });
20
19
 
21
20
  it('overlay is hidden by default', () => {
22
21
  expect(mumuki.kids.$overlay.css('display')).toBe('none');
23
- })
22
+ });
24
23
 
25
24
  it('call showOverlay on wait', () => {
26
25
  button.wait();
27
26
  expect(mumuki.kids.$overlay.css('display')).toBe('block');
28
- })
27
+ });
29
28
 
30
29
  it('call hideOverlay on continue', () => {
31
30
  button.wait();
32
31
  button.continue();
33
32
  expect(mumuki.kids.$overlay.css('display')).toBe('none');
34
- })
35
-
36
- })
33
+ });
34
+ });
@@ -1,17 +1,17 @@
1
1
  describe('results renderers', () => {
2
2
  it('can compute class for status', () => {
3
3
  expect(mumuki.renderers.classForStatus('passed')).toEqual('success');
4
- })
4
+ });
5
5
 
6
6
  it('can compute icon for status', () => {
7
7
  expect(mumuki.renderers.iconForStatus('pending')).toEqual('fa-circle');
8
- })
8
+ });
9
9
 
10
10
  it('can compute progress list item for status', () => {
11
11
  expect(mumuki.renderers.progressListItemClassForStatus('passed_with_warnings')).toEqual('progress-list-item text-center warning ');
12
- })
12
+ });
13
13
 
14
14
  it('can compute progress list item for status when active', () => {
15
15
  expect(mumuki.renderers.progressListItemClassForStatus('failed', true)).toEqual('progress-list-item text-center danger active');
16
- })
17
- })
16
+ });
17
+ });
@@ -6,6 +6,5 @@ describe('results renderers', () => {
6
6
  <li>fix that</li>
7
7
  </ul>
8
8
  </div>`);
9
- })
10
-
11
- })
9
+ });
10
+ });
@@ -6,39 +6,39 @@ describe("SubmissionsStore", () => {
6
6
  const passedEmptyProgramSubmissionAndResult = { submission: emptyProgramSubmission, result: passedSubmissionResult };
7
7
 
8
8
  beforeEach(() => {
9
- window.localStorage.clear()
9
+ window.localStorage.clear();
10
10
  });
11
11
 
12
12
  describe('getLastSubmission', () => {
13
13
  it("answers null if submission not present", () => {
14
- expect(mumuki.SubmissionsStore.getLastSubmissionAndResult(1)).toBe(null)
14
+ expect(mumuki.SubmissionsStore.getLastSubmissionAndResult(1)).toBe(null);
15
15
  });
16
16
 
17
17
  it("answers the last submission result if already sent", () => {
18
- mumuki.SubmissionsStore.setSubmissionResultFor(1, passedEmptyProgramSubmissionAndResult)
19
- expect(mumuki.SubmissionsStore.getLastSubmissionAndResult(1)).toEqual(passedEmptyProgramSubmissionAndResult)
18
+ mumuki.SubmissionsStore.setSubmissionResultFor(1, passedEmptyProgramSubmissionAndResult);
19
+ expect(mumuki.SubmissionsStore.getLastSubmissionAndResult(1)).toEqual(passedEmptyProgramSubmissionAndResult);
20
20
  });
21
21
  });
22
22
 
23
23
  describe('getLastSubmissionStatus', () => {
24
24
  it("answers pending if submission not present", () => {
25
- expect(mumuki.SubmissionsStore.getLastSubmissionStatus(1)).toBe('pending')
25
+ expect(mumuki.SubmissionsStore.getLastSubmissionStatus(1)).toBe('pending');
26
26
  });
27
27
 
28
28
  it("answers the last submission status if previously sent", () => {
29
- mumuki.SubmissionsStore.setSubmissionResultFor(1, passedEmptyProgramSubmissionAndResult)
30
- expect(mumuki.SubmissionsStore.getLastSubmissionStatus(1)).toBe('passed')
29
+ mumuki.SubmissionsStore.setSubmissionResultFor(1, passedEmptyProgramSubmissionAndResult);
30
+ expect(mumuki.SubmissionsStore.getLastSubmissionStatus(1)).toBe('passed');
31
31
  });
32
32
  });
33
33
 
34
34
  describe('getCachedResultFor', () => {
35
35
  it("answers null if submission not present", () => {
36
- expect(mumuki.SubmissionsStore.getSubmissionResultFor(1, emptyProgramSubmission)).toBe(null)
36
+ expect(mumuki.SubmissionsStore.getSubmissionResultFor(1, emptyProgramSubmission)).toBe(null);
37
37
  });
38
38
 
39
39
  it("answers the last submission if previously sent", () => {
40
- mumuki.SubmissionsStore.setSubmissionResultFor(1, passedEmptyProgramSubmissionAndResult)
41
- expect(mumuki.SubmissionsStore.getSubmissionResultFor(1, emptyProgramSubmission)).toEqual(passedSubmissionResult)
40
+ mumuki.SubmissionsStore.setSubmissionResultFor(1, passedEmptyProgramSubmissionAndResult);
41
+ expect(mumuki.SubmissionsStore.getSubmissionResultFor(1, emptyProgramSubmission)).toEqual(passedSubmissionResult);
42
42
  });
43
43
  });
44
44
 
@@ -90,7 +90,7 @@ describe("SubmissionsStore", () => {
90
90
  {solution: {content: ''}},
91
91
  {solution: {content: 'bar'}})).toBe(false);
92
92
  });
93
- })
93
+ });
94
94
 
95
95
  describe('classic submissons', () => {
96
96
  it("answers true when they are equal", () => {
@@ -122,7 +122,7 @@ describe("SubmissionsStore", () => {
122
122
  {'solution[content]': ''},
123
123
  {'solution[content]': 'bar'})).toBe(false);
124
124
  });
125
- })
125
+ });
126
126
 
127
127
  describe('multifile submissions', () => {
128
128
  it("answers true when they are equal", () => {
@@ -172,6 +172,6 @@ describe("SubmissionsStore", () => {
172
172
  'solution[content[index.html]]': 'html foo'
173
173
  })).toBe(false);
174
174
  });
175
- })
175
+ });
176
176
  });
177
- })
177
+ });
@@ -4,12 +4,12 @@ describe('sync mode', () => {
4
4
  mumuki.syncMode._selectSyncMode();
5
5
 
6
6
  expect(mumuki.syncMode._current instanceof mumuki.syncMode.ServerSyncMode).toBe(true);
7
- })
7
+ });
8
8
 
9
9
  it('can choose local mode', () => {
10
10
  mumuki.incognitoUser = true;
11
11
  mumuki.syncMode._selectSyncMode();
12
12
 
13
13
  expect(mumuki.syncMode._current instanceof mumuki.syncMode.ClientSyncMode).toBe(true);
14
- })
15
- })
14
+ });
15
+ });
@@ -1,5 +1,5 @@
1
1
  describe('setTimeout', () => {
2
2
  it('can create setTimeout', () => {
3
3
  expect(mumuki.setTimeout).not.toBe(null);
4
- })
5
- })
4
+ });
5
+ });
@@ -1,5 +1,5 @@
1
1
  describe('timer', () => {
2
2
  it('can create timer', () => {
3
3
  expect(mumuki.startTimer).not.toBe(null);
4
- })
5
- })
4
+ });
5
+ });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-laboratory
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.4.0
4
+ version: 8.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-29 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 8.4.0
33
+ version: 8.5.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 8.4.0
40
+ version: 8.5.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mumukit-bridge
43
43
  requirement: !ruby/object:Gem::Requirement