mumuki-gobstones-runner 1.10.1 → 1.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/precompile_hook.rb +7 -1
- data/lib/render/editor/editor.html +33 -7
- data/lib/version_hook.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a25c116e5577d9a6ec6bd39ea1c385f5f6cbfbd11348aa5d5a3c4370536d6c99
|
4
|
+
data.tar.gz: 2b7b816e3347a90bdcd49d5273d7eb3d53e5e6a0f101b591951cf8d21a038cea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccb9d74307dd8e4e7a0a92ccfd984ddf5c8815f4ff1e6cbf0c05fa952fc48a21216c1d6dabccfd300f592fe4a9f6f6ca3c6d144e9e9382fbd7e6aa7dcfdf00df
|
7
|
+
data.tar.gz: 7d0909dd929f4812c02e45c761d70f3d5a2422bc47da3203335422817557355b5907bfeb3eaea93e4e67e03b31147c05e2cf3d0726a148a0304c48acc95901ee
|
data/lib/precompile_hook.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
class GobstonesPrecompileHook < Mumukit::Templates::FileHook
|
2
2
|
attr_accessor :batch
|
3
3
|
|
4
|
+
DEFAULT_TIMEOUT = 2
|
5
|
+
|
4
6
|
structured true
|
5
7
|
isolated true
|
6
8
|
|
@@ -17,7 +19,11 @@ class GobstonesPrecompileHook < Mumukit::Templates::FileHook
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def timeout_argument
|
20
|
-
"--timeout
|
22
|
+
"--timeout " + timeout.to_s
|
23
|
+
end
|
24
|
+
|
25
|
+
def timeout
|
26
|
+
(ENV['MUMUKI_GOBSTONES_TIMEOUT'] || DEFAULT_TIMEOUT).to_i * 1000
|
21
27
|
end
|
22
28
|
|
23
29
|
def compile(request)
|
@@ -48,7 +48,6 @@
|
|
48
48
|
},
|
49
49
|
|
50
50
|
attached: function () {
|
51
|
-
|
52
51
|
const setBlocklySounds = () => {
|
53
52
|
Blockly.WorkspaceAudio.prototype.preload = () => {
|
54
53
|
for (var soundName in this.SOUNDS_) {
|
@@ -110,13 +109,13 @@
|
|
110
109
|
const updateFields = () => {
|
111
110
|
const blockly = this.getBlockly();
|
112
111
|
|
113
|
-
const editorValue =
|
112
|
+
const editorValue = this.getEditorValue();
|
114
113
|
if (editorValue) {
|
115
114
|
editorValue.value = blockly.workspaceXml;
|
116
115
|
}
|
117
116
|
|
118
117
|
if (this.teacherMode) {
|
119
|
-
const editorExtra =
|
118
|
+
const editorExtra = this.getEditorExtra();
|
120
119
|
if (editorExtra) {
|
121
120
|
editorExtra.value = blockly.workspaceXml;
|
122
121
|
}
|
@@ -207,18 +206,34 @@
|
|
207
206
|
},
|
208
207
|
|
209
208
|
getStudentXml: function () {
|
210
|
-
return
|
209
|
+
return this.getEditorValue().value || "";
|
211
210
|
},
|
212
211
|
|
213
212
|
getTeacherCode: function () {
|
214
|
-
const teacherXml =
|
213
|
+
const teacherXml = this.getEditorExtra();
|
215
214
|
if (!teacherXml || !teacherXml.value) return;
|
216
215
|
this.$.blocklyTmp.workspaceXml = teacherXml.value;
|
217
216
|
return this.$.blocklyTmp.generateCode();
|
218
217
|
},
|
219
218
|
|
219
|
+
getEditorValue: function() {
|
220
|
+
return $("#mu-custom-editor-value")[0];
|
221
|
+
},
|
222
|
+
|
223
|
+
getEditorDefaultValue: function() {
|
224
|
+
return $("#mu-custom-editor-default-value")[0];
|
225
|
+
},
|
226
|
+
|
227
|
+
getEditorExtra: function() {
|
228
|
+
return $("#mu-custom-editor-extra")[0];
|
229
|
+
},
|
230
|
+
|
231
|
+
getEditorTest: function() {
|
232
|
+
return $("#mu-custom-editor-test")[0];
|
233
|
+
},
|
234
|
+
|
220
235
|
_setInitialXml: function (blockly) {
|
221
|
-
const editorDefaultContent =
|
236
|
+
const editorDefaultContent = this.getEditorDefaultValue();
|
222
237
|
if (editorDefaultContent && editorDefaultContent.value) {
|
223
238
|
blockly.initialXml = editorDefaultContent.value;
|
224
239
|
} else {
|
@@ -228,7 +243,7 @@
|
|
228
243
|
|
229
244
|
_initializeWorkspace: function(blockly, callback) {
|
230
245
|
postpone(() => {
|
231
|
-
const value =
|
246
|
+
const value = this.getEditorValue().value;
|
232
247
|
|
233
248
|
blockly.workspaceXml = value || (
|
234
249
|
this.teacherMode
|
@@ -504,6 +519,17 @@
|
|
504
519
|
},
|
505
520
|
|
506
521
|
_showError: function (region, error) {
|
522
|
+
const expectsTimeout = /expect_endless_while *: *true/.test(
|
523
|
+
this._getEditor().getEditorTest().value
|
524
|
+
);
|
525
|
+
|
526
|
+
const isExpectedTimeout = (
|
527
|
+
error.reason && error.reason.code === "timeout" &&
|
528
|
+
expectsTimeout
|
529
|
+
);
|
530
|
+
|
531
|
+
if (isExpectedTimeout) return;
|
532
|
+
|
507
533
|
this._getBlockly().showBlockError(region, error.message);
|
508
534
|
},
|
509
535
|
|
data/lib/version_hook.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-gobstones-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Alfonso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|