mumuki-laboratory 5.0.9 → 5.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c1c63573c1251589d69b6391f66655738040a51e008198aea6fb0552f9dbdc4
4
- data.tar.gz: 96e2b33e98a135746c2426a5755fd46e3d83e59cb5c298e9d752e93e4a9d2cae
3
+ metadata.gz: 687cb25da2b7b117a69aee4ea6f6e43c273dd02df35f6d950e04bba9a6c29a02
4
+ data.tar.gz: 5fc3c5c9f5a8692e90aa923cd232e34d7450c35623f23a52bb1cf12cac7d7cdb
5
5
  SHA512:
6
- metadata.gz: 671f065b599f8fbfdfe329a5654378e47502e37e913e9c8fef03ee9794d5b145da79f4390c886b69dc1b76a09ce0f551aa8f1803cb7b115d1beac07d668454b4
7
- data.tar.gz: 8a7222860a58a0af7d4ebe3d618dc4d0e270ff70a550090fbd4a52819ce907273787c07d4b27e357fe7b41c483bbb1a98fae7f76427fd1e2895c35f098f5f221
6
+ metadata.gz: 2f2a09624da7c57fed02a5d0e0dcac4deb359d4775976543329e3a570292018504fbe264159d8c0f1a2cb639e7cd4202f61a579a7226a55b14f5e6b771d75151
7
+ data.tar.gz: 4c138d17b4073663497a1f1e558ce2f57dfe95c16f4990c2fa2cc790a78decebf63a849ad5efd7dbca4c5afbf584723d0d70cb03ba73538c0d49e4ca29377b89
@@ -6,16 +6,17 @@ var mumuki = mumuki || {};
6
6
  }
7
7
 
8
8
  Laboratory.prototype = {
9
- runTests: function (solution) {
9
+ runLocalTests: function (solution) {
10
10
  var token = new mumuki.CsrfToken();
11
11
  var request = token.newRequest({
12
12
  type: 'POST',
13
13
  url: window.location + '/solutions',
14
- data: {
15
- solution: solution
16
- }
14
+ data: solution
17
15
  });
18
16
  return $.ajax(request)
17
+ },
18
+ runTests: function(content) {
19
+ return this.runLocalTests({ solution: content });
19
20
  }
20
21
  };
21
22
 
@@ -55,17 +55,17 @@ var mumuki = mumuki || {};
55
55
  editor.setOption('theme', 'default ' + language);
56
56
  }
57
57
 
58
- function getContent(){
59
- return mumuki.page.editors.map(function (_, editor) {
60
- return editor.getValue();
61
- }).get().join("\n");
58
+ function syncContent(){
59
+ mumuki.page.editors.each(function (_, editor) {
60
+ editor.save();
61
+ });
62
62
  }
63
63
 
64
64
  mumuki.editor = mumuki.editor || {};
65
65
  mumuki.editor.setupCodeMirrors = setEditorLanguage;
66
66
  mumuki.editor.toggleFullscreen = toggleFullscreen;
67
67
  mumuki.editor.indentWithSpaces = indentWithSpaces;
68
- mumuki.editor.getContent = getContent;
68
+ mumuki.editor.syncContent = syncContent;
69
69
 
70
70
  mumuki.page = mumuki.page || {};
71
71
  mumuki.page.dynamicEditors = [];
@@ -64,10 +64,10 @@ var mumuki = mumuki || {};
64
64
  submitButton.disable();
65
65
  resultsBox.waiting();
66
66
 
67
- var solutionContent = mumuki.editor.getContent();
68
- var solution = {content: solutionContent};
67
+ mumuki.editor.syncContent();
68
+ var solution = getContent();
69
69
 
70
- bridge.runTests(solution).always(function () {
70
+ bridge.runLocalTests(solution).always(function () {
71
71
  $(document).renderMuComponents();
72
72
  resultsBox.done();
73
73
  }).done(function (data) {
@@ -79,6 +79,15 @@ var mumuki = mumuki || {};
79
79
 
80
80
  });
81
81
 
82
+ function getContent(){
83
+ var content = {};
84
+ $('.new_solution').serializeArray().forEach(function(it) {
85
+ content[it.name] = it.value;
86
+ });
87
+
88
+ return content;
89
+ }
90
+
82
91
  function animateTimeoutError(submitButton) {
83
92
  var image = $('#submission-result-error-animation')[0];
84
93
  image.src = mumuki.errors.error_timeout_1.url;
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '5.0.9'
3
+ VERSION = '5.0.10'
4
4
  end
5
5
  end
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: 5.0.9
4
+ version: 5.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-03 00:00:00.000000000 Z
11
+ date: 2018-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails