mumuki-laboratory 7.7.6 → 7.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -3
- data/Rakefile +7 -1
- data/app/assets/javascripts/mumuki_laboratory/application/alias-modes.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/bridge.js +66 -57
- data/app/assets/javascripts/mumuki_laboratory/application/codemirror-builder.js +28 -25
- data/app/assets/javascripts/mumuki_laboratory/application/codemirror.js +8 -10
- data/app/assets/javascripts/mumuki_laboratory/application/confirmation.js +2 -2
- data/app/assets/javascripts/mumuki_laboratory/application/console.js +41 -43
- data/app/assets/javascripts/mumuki_laboratory/application/csrf-token.js +9 -12
- data/app/assets/javascripts/mumuki_laboratory/application/custom-editor.js +11 -15
- data/app/assets/javascripts/mumuki_laboratory/application/discussions.js +1 -3
- data/app/assets/javascripts/mumuki_laboratory/application/editors.js +104 -0
- data/app/assets/javascripts/mumuki_laboratory/application/elipsis.js +5 -4
- data/app/assets/javascripts/mumuki_laboratory/application/exercise.js +32 -0
- data/app/assets/javascripts/mumuki_laboratory/application/inputs.js +4 -2
- data/app/assets/javascripts/mumuki_laboratory/application/interval.js +2 -4
- data/app/assets/javascripts/mumuki_laboratory/application/kids.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/load-analytics.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/load-error-svg.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/messages.js +2 -2
- data/app/assets/javascripts/mumuki_laboratory/application/multiple-choice.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/multiple-scenarios.js +3 -6
- data/app/assets/javascripts/mumuki_laboratory/application/pin.js +3 -5
- data/app/assets/javascripts/mumuki_laboratory/application/progress.js +24 -6
- data/app/assets/javascripts/mumuki_laboratory/application/results-renderer.js +20 -11
- data/app/assets/javascripts/mumuki_laboratory/application/speech-bubble-renderer.js +12 -5
- data/app/assets/javascripts/mumuki_laboratory/application/submission.js +19 -101
- data/app/assets/javascripts/mumuki_laboratory/application/submissions-store.js +93 -0
- data/app/assets/javascripts/mumuki_laboratory/application/sync-mode.js +75 -0
- data/app/assets/javascripts/mumuki_laboratory/application/timer.js +5 -6
- data/app/assets/javascripts/mumuki_laboratory/application/tooltip.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/upload.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/user.js +1 -1
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_gs-board.scss +3 -0
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids.scss +0 -1
- data/app/controllers/application_controller.rb +1 -0
- data/app/helpers/{locale_helper.rb → globals_helper.rb} +6 -2
- data/app/mailers/user_mailer.rb +24 -11
- data/app/views/book/show.html.erb +1 -1
- data/app/views/exercises/show.html.erb +2 -0
- data/app/views/layouts/_main.html.erb +1 -2
- data/app/views/layouts/_progress.html.erb +1 -1
- data/app/views/layouts/_progress_bar.html.erb +7 -1
- data/app/views/layouts/application.html.erb +1 -1
- data/lib/mumuki/laboratory/controllers.rb +1 -0
- data/lib/mumuki/laboratory/controllers/incognito_mode.rb +28 -0
- data/lib/mumuki/laboratory/locales/en.yml +6 -4
- data/lib/mumuki/laboratory/locales/es.yml +6 -4
- data/lib/mumuki/laboratory/locales/pt.yml +4 -2
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/dummy/db/schema.rb +2 -1
- data/spec/features/chapter_spec.rb +17 -0
- data/spec/features/exercise_flow_spec.rb +47 -2
- data/spec/features/home_public_flow_spec.rb +16 -0
- data/spec/javascripts/editors-spec.js +54 -0
- data/spec/javascripts/exercise-spec.js +22 -0
- data/spec/javascripts/global-spec.js +6 -0
- data/spec/javascripts/spec-helper.js +4 -0
- data/spec/javascripts/submissions-store-spec.js +44 -0
- data/spec/javascripts/sync-mode-spec.js +15 -0
- data/spec/mailers/user_mailer_spec.rb +18 -3
- data/spec/teaspoon_env.rb +8 -2
- data/vendor/assets/javascripts/codemirror-modes/gobstones.js +2 -3
- metadata +19 -5
- data/app/helpers/version_helper.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf3186d3e4ad3367ccf34396dfde31138bb255456b8cf5e5593a76e908545434
|
4
|
+
data.tar.gz: 7e3aa354499be05940fe21355f7e4a45ae933dab0a989cd8db99b48e564c8f12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e91791ad61d5843960950276383f74330b0eec046f475400c21fdb89af80f044fa3902a7a86e82d1dc3e130f30716c62e23d79f5ea87c8416c9140e550414819
|
7
|
+
data.tar.gz: 528f209da31776d4c01be41b92c2218bcbb6dc98175809a05062c3b077e1dc0ca8951b034e44a9a0f3cca93bbba371fd0f14da18bb56e15fac9ddb3b2e211455
|
data/README.md
CHANGED
@@ -141,7 +141,13 @@ bundle exec rspec
|
|
141
141
|
> it and add it to your path
|
142
142
|
|
143
143
|
```bash
|
144
|
-
bundle exec rake teaspoon
|
144
|
+
MOZ_HEADLESS=1 bundle exec rake teaspoon
|
145
|
+
```
|
146
|
+
|
147
|
+
## Running `eslint`
|
148
|
+
|
149
|
+
```bash
|
150
|
+
yarn run lint
|
145
151
|
```
|
146
152
|
|
147
153
|
## JavaScript API Docs
|
@@ -208,6 +214,10 @@ which are granted to be safe and stable.
|
|
208
214
|
* `SpeechBubbleRenderer`
|
209
215
|
* `renderSpeechBubbleResultItem`
|
210
216
|
* `mumuki.locale`
|
217
|
+
* `mumuki.exercise`
|
218
|
+
* `id`: the `id` of the currently loaded exercise, if any
|
219
|
+
* `layout`: the `layout` of the currently loaded exercise, if any
|
220
|
+
* `mumuki.incognitoUser`: whether the current user is an incognito user
|
211
221
|
* `mumuki.MultipleScenarios`
|
212
222
|
* `scenarios`
|
213
223
|
* `currentScenarioIndex`
|
@@ -369,14 +379,14 @@ contents. There are two different approaches:
|
|
369
379
|
|
370
380
|
```javascript
|
371
381
|
// simplest method - you can register just one
|
372
|
-
mumuki.
|
382
|
+
mumuki.editors.registerContentSyncer(() => {
|
373
383
|
// ... write here your custom component content...
|
374
384
|
$('#mu-custom-editor-value').val(/* ... */);
|
375
385
|
});
|
376
386
|
|
377
387
|
// alternate method
|
378
388
|
// you can register many sources
|
379
|
-
mumuki.
|
389
|
+
mumuki.editors.addCustomSource({
|
380
390
|
getContent() {
|
381
391
|
return { name: "solution[content]", value: /* ... */ } ;
|
382
392
|
}
|
data/Rakefile
CHANGED
@@ -27,8 +27,14 @@ require 'rspec/core/rake_task'
|
|
27
27
|
desc "Run all specs in spec directory (excluding plugin specs)"
|
28
28
|
RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
|
29
29
|
|
30
|
+
desc "Force development environment, required by javascript specs"
|
31
|
+
task :development do
|
32
|
+
ENV['RACK_ENV'] = 'development'
|
33
|
+
ENV['RAILS_ENV'] = 'development'
|
34
|
+
end
|
35
|
+
|
30
36
|
desc "Run the javascript specs"
|
31
|
-
task :
|
37
|
+
task teaspoon: [:development, "app:teaspoon"]
|
32
38
|
|
33
39
|
task default: :spec
|
34
40
|
|
@@ -1,60 +1,41 @@
|
|
1
1
|
/**
|
2
|
-
* @typedef {
|
2
|
+
* @typedef {"errored"|"failed"|"passed_with_warnings"|"passed"|"pending"|"aborted"} SubmissionStatus
|
3
3
|
*/
|
4
4
|
|
5
5
|
/**
|
6
|
-
* @typedef {{
|
6
|
+
* @typedef {{
|
7
|
+
* status: SubmissionStatus,
|
8
|
+
* test_results: [{status: SubmissionStatus, title: string}]
|
9
|
+
* }} SubmissionClientResult
|
7
10
|
*/
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
}
|
17
|
-
|
18
|
-
function asString(json){
|
19
|
-
return JSON.stringify(json);
|
20
|
-
}
|
21
|
-
|
22
|
-
function sameAsLastSolution(newSolution){
|
23
|
-
return asString(lastSubmission.content) === asString(newSolution);
|
24
|
-
}
|
25
|
-
|
26
|
-
function lastSubmissionFinishedSuccessfully(){
|
27
|
-
return lastSubmission.result && lastSubmission.result.status !== 'aborted';
|
28
|
-
}
|
29
|
-
|
30
|
-
function sendNewSolution(submission){
|
31
|
-
var token = new mumuki.CsrfToken();
|
32
|
-
var request = token.newRequest({
|
33
|
-
type: 'POST',
|
34
|
-
url: window.location.origin + window.location.pathname + '/solutions' + window.location.search,
|
35
|
-
data: submission
|
36
|
-
});
|
37
|
-
|
38
|
-
return $.ajax(request).then(preRenderResult).done(function (result) {
|
39
|
-
lastSubmission = { content: {solution: submission.solution}, result: result };
|
40
|
-
});
|
41
|
-
}
|
12
|
+
/**
|
13
|
+
* @typedef {{
|
14
|
+
* status: SubmissionStatus,
|
15
|
+
* class_for_progress_list_item?: string,
|
16
|
+
* guide_finished_by_solution?: boolean
|
17
|
+
* }} SubmissionResult
|
18
|
+
*/
|
42
19
|
|
20
|
+
/**
|
21
|
+
* @typedef {object} Solution
|
22
|
+
*/
|
43
23
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
24
|
+
/**
|
25
|
+
* @typedef {{
|
26
|
+
* "solution[content]"?:string,
|
27
|
+
* solution?: Solution,
|
28
|
+
* client_result?: SubmissionClientResult
|
29
|
+
* }} Submission
|
30
|
+
*/
|
51
31
|
|
52
|
-
|
53
|
-
|
54
|
-
|
32
|
+
/**
|
33
|
+
* @typedef {{submission?: Submission, result?: SubmissionResult}} SubmissionAndResult
|
34
|
+
*/
|
55
35
|
|
56
|
-
|
36
|
+
mumuki.bridge = (() => {
|
57
37
|
|
38
|
+
class Laboratory {
|
58
39
|
// ==========
|
59
40
|
// Public API
|
60
41
|
// ==========
|
@@ -65,9 +46,9 @@ var mumuki = mumuki || {};
|
|
65
46
|
*
|
66
47
|
* @param {object} content the content object
|
67
48
|
* */
|
68
|
-
runTests
|
49
|
+
runTests(content) {
|
69
50
|
return this._submitSolution({ solution: content });
|
70
|
-
}
|
51
|
+
}
|
71
52
|
|
72
53
|
// ===========
|
73
54
|
// Private API
|
@@ -77,18 +58,46 @@ var mumuki = mumuki || {};
|
|
77
58
|
* Sends a solution object
|
78
59
|
*
|
79
60
|
* @param {Submission} submission the submission object
|
61
|
+
* @returns {JQuery.Promise<SubmissionResult>}
|
80
62
|
*/
|
81
|
-
_submitSolution
|
82
|
-
|
83
|
-
|
63
|
+
_submitSolution(submission) {
|
64
|
+
const lastSubmission = mumuki.SubmissionsStore.getSubmissionResultFor(mumuki.exercise.id, submission);
|
65
|
+
if (lastSubmission) {
|
66
|
+
return $.Deferred().resolve(lastSubmission);
|
84
67
|
} else {
|
85
|
-
return
|
68
|
+
return this._sendNewSolution(submission).done((result) => {
|
69
|
+
mumuki.SubmissionsStore.setSubmissionResultFor(mumuki.exercise.id, {submission, result});
|
70
|
+
});
|
86
71
|
}
|
87
72
|
}
|
88
|
-
};
|
89
73
|
|
90
|
-
|
91
|
-
|
92
|
-
|
74
|
+
/**
|
75
|
+
* @param {Submission} submission the submission object
|
76
|
+
* @returns {JQuery.Promise<SubmissionResult>}
|
77
|
+
*/
|
78
|
+
_sendNewSolution(submission){
|
79
|
+
var token = new mumuki.CsrfToken();
|
80
|
+
var request = token.newRequest({
|
81
|
+
type: 'POST',
|
82
|
+
url: window.location.origin + window.location.pathname + '/solutions' + window.location.search,
|
83
|
+
data: submission
|
84
|
+
});
|
85
|
+
return $.ajax(request).then((result) => this._preRenderResult(result));
|
86
|
+
}
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Pre-renders some html parts of submission UI, adding them to the given result
|
90
|
+
*
|
91
|
+
* @param {SubmissionResult} result
|
92
|
+
* @returns {SubmissionResult}
|
93
|
+
*/
|
94
|
+
_preRenderResult(result) {
|
95
|
+
result.class_for_progress_list_item = mumuki.renderers.progressListItemClassForStatus(result.status, true)
|
96
|
+
return result;
|
97
|
+
}
|
98
|
+
}
|
93
99
|
|
94
|
-
|
100
|
+
return {
|
101
|
+
Laboratory
|
102
|
+
};
|
103
|
+
})();
|
@@ -1,12 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
(function (mumuki) {
|
4
|
-
|
5
|
-
function CodeMirrorBuilder(textarea) {
|
6
|
-
this.textarea = textarea;
|
7
|
-
this.$textarea = $(textarea);
|
8
|
-
}
|
9
|
-
|
1
|
+
(() => {
|
10
2
|
function submit() {
|
11
3
|
$('body').removeClass('fullscreen');
|
12
4
|
$('.editor-resize .fa-stack-1x').removeClass('fa-compress').addClass('fa-expand');
|
@@ -29,8 +21,13 @@ var mumuki = mumuki || {};
|
|
29
21
|
autoRefresh: true
|
30
22
|
};
|
31
23
|
|
32
|
-
CodeMirrorBuilder
|
33
|
-
|
24
|
+
class CodeMirrorBuilder {
|
25
|
+
constructor(textarea) {
|
26
|
+
this.textarea = textarea;
|
27
|
+
this.$textarea = $(textarea);
|
28
|
+
}
|
29
|
+
|
30
|
+
setupEditor() {
|
34
31
|
this.editor = this.createEditor({
|
35
32
|
lineNumbers: true,
|
36
33
|
extraKeys: {
|
@@ -47,8 +44,9 @@ var mumuki = mumuki || {};
|
|
47
44
|
});
|
48
45
|
|
49
46
|
return this;
|
50
|
-
}
|
51
|
-
|
47
|
+
}
|
48
|
+
|
49
|
+
setupSimpleEditor() {
|
52
50
|
this.editor = this.createEditor({
|
53
51
|
mode: 'text',
|
54
52
|
extraKeys: {
|
@@ -61,8 +59,9 @@ var mumuki = mumuki || {};
|
|
61
59
|
});
|
62
60
|
|
63
61
|
return this;
|
64
|
-
}
|
65
|
-
|
62
|
+
}
|
63
|
+
|
64
|
+
setupReadOnlyEditor() {
|
66
65
|
this.editor = this.createEditor({
|
67
66
|
readOnly: true,
|
68
67
|
cursorBlinkRate: -1, //Hides the cursor
|
@@ -70,8 +69,9 @@ var mumuki = mumuki || {};
|
|
70
69
|
});
|
71
70
|
|
72
71
|
return this;
|
73
|
-
}
|
74
|
-
|
72
|
+
}
|
73
|
+
|
74
|
+
setupLanguage(language) {
|
75
75
|
var highlightMode = language || this.$textarea.data('editor-language');
|
76
76
|
if (highlightMode === 'dynamic') {
|
77
77
|
mumuki.page.dynamicEditors.push(this.editor);
|
@@ -81,20 +81,23 @@ var mumuki = mumuki || {};
|
|
81
81
|
}
|
82
82
|
|
83
83
|
return this;
|
84
|
-
}
|
85
|
-
|
84
|
+
}
|
85
|
+
|
86
|
+
setupMinLines(minLines) {
|
86
87
|
this.editor.setOption('minLines', minLines);
|
87
88
|
|
88
89
|
return this;
|
89
|
-
}
|
90
|
-
|
90
|
+
}
|
91
|
+
|
92
|
+
build() {
|
91
93
|
return this.editor;
|
92
|
-
}
|
93
|
-
|
94
|
+
}
|
95
|
+
|
96
|
+
createEditor(customOptions) {
|
94
97
|
return CodeMirror.fromTextArea(this.textarea, Object.assign({}, codeMirrorDefaults, customOptions));
|
95
98
|
}
|
96
|
-
}
|
99
|
+
}
|
97
100
|
|
98
101
|
mumuki.editor = mumuki.editor || {};
|
99
102
|
mumuki.editor.CodeMirrorBuilder = CodeMirrorBuilder;
|
100
|
-
}(
|
103
|
+
})();
|
@@ -1,6 +1,9 @@
|
|
1
|
-
|
1
|
+
mumuki.editor = mumuki.editor || {};
|
2
|
+
mumuki.page = mumuki.page || {};
|
3
|
+
mumuki.page.dynamicEditors = [];
|
4
|
+
mumuki.page.editors = [];
|
2
5
|
|
3
|
-
(
|
6
|
+
(() => {
|
4
7
|
function createCodeMirrors() {
|
5
8
|
return $(".editor").map(function (index, textarea) {
|
6
9
|
var $textarea = $("#solution_content");
|
@@ -68,21 +71,16 @@ var mumuki = mumuki || {};
|
|
68
71
|
});
|
69
72
|
}
|
70
73
|
|
71
|
-
mumuki.editor = mumuki.editor || {};
|
72
74
|
mumuki.editor.reset = resetEditor;
|
73
75
|
mumuki.editor.toggleFullscreen = toggleFullscreen;
|
74
76
|
mumuki.editor.formatContent = formatContent;
|
75
77
|
mumuki.editor.indentWithSpaces = indentWithSpaces;
|
76
78
|
mumuki.editor.syncContent = syncContent;
|
77
79
|
|
78
|
-
mumuki.page = mumuki.page || {};
|
79
|
-
mumuki.page.dynamicEditors = [];
|
80
|
-
mumuki.page.editors = [];
|
81
80
|
|
82
|
-
|
83
|
-
mumuki.load(function () {
|
81
|
+
mumuki.load(() => {
|
84
82
|
mumuki.page.editors = createCodeMirrors();
|
85
|
-
mumuki.
|
83
|
+
mumuki.editors.registerContentSyncer(mumuki.editor.syncContent);
|
86
84
|
updateCodeMirrorLanguage();
|
87
85
|
onSelectUpdateCodeMirror();
|
88
86
|
|
@@ -101,4 +99,4 @@ var mumuki = mumuki || {};
|
|
101
99
|
});
|
102
100
|
});
|
103
101
|
|
104
|
-
}(
|
102
|
+
})();
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
(function (mumuki) {
|
1
|
+
(() => {
|
3
2
|
function historicalQueries() {
|
4
3
|
var queries = $('#historical_queries').val();
|
5
4
|
if (queries) {
|
@@ -36,65 +35,64 @@ var mumuki = mumuki || {};
|
|
36
35
|
$('.jquery-console-prompt-box:not(:last)').remove()
|
37
36
|
}
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
newQuery
|
38
|
+
class QueryConsole {
|
39
|
+
constructor() {
|
40
|
+
this.endpoint = $('#console_endpoint').val();
|
41
|
+
this.token = new mumuki.CsrfToken();
|
42
|
+
this.statefulConsole = $('#stateful_console').val() === "true";
|
43
|
+
this.lines = [];
|
44
|
+
this.controller = null;
|
45
|
+
}
|
46
|
+
newQuery(line) {
|
48
47
|
var cookies = this.statefulConsole ? this.lines : [];
|
49
48
|
return new Query(line, cookies, this);
|
50
|
-
}
|
51
|
-
clearState
|
49
|
+
}
|
50
|
+
clearState() {
|
52
51
|
this.lines = [];
|
53
52
|
clearConsole();
|
54
|
-
}
|
55
|
-
sendQuery
|
53
|
+
}
|
54
|
+
sendQuery(queryContent) {
|
56
55
|
this.controller.promptText(queryContent);
|
57
56
|
this.controller.typer.commandTrigger();
|
58
|
-
}
|
59
|
-
preloadQuery
|
57
|
+
}
|
58
|
+
preloadQuery(queryWithResults) {
|
60
59
|
this.lines.push(queryWithResults.query);
|
61
60
|
this.enqueuePreloadedQuery(queryWithResults);
|
62
61
|
this.sendQuery(queryWithResults.query);
|
63
|
-
}
|
64
|
-
enqueuePreloadedQuery
|
62
|
+
}
|
63
|
+
enqueuePreloadedQuery(queryWithResults) {
|
65
64
|
this.preloadedQuery = queryWithResults;
|
66
|
-
}
|
67
|
-
dequeuePreloadedQuery
|
65
|
+
}
|
66
|
+
dequeuePreloadedQuery() {
|
68
67
|
var result = this.preloadedQuery;
|
69
68
|
this.preloadedQuery = undefined;
|
70
69
|
return result;
|
71
|
-
}
|
72
|
-
preloadHistoricalQueries
|
70
|
+
}
|
71
|
+
preloadHistoricalQueries() {
|
73
72
|
var self = this;
|
74
73
|
historicalQueries().forEach(function (queryWithResults) {
|
75
74
|
self.preloadQuery(queryWithResults);
|
76
75
|
});
|
77
76
|
}
|
78
|
-
};
|
79
|
-
|
80
|
-
function Query(line, cookie, console) {
|
81
|
-
this.console = console;
|
82
|
-
this.line = line;
|
83
|
-
this.cookie = cookie;
|
84
77
|
}
|
85
78
|
|
86
|
-
Query
|
79
|
+
class Query {
|
80
|
+
constructor(line, cookie, console) {
|
81
|
+
this.console = console;
|
82
|
+
this.line = line;
|
83
|
+
this.cookie = cookie;
|
84
|
+
}
|
87
85
|
get token() {
|
88
86
|
return this.console.token;
|
89
|
-
}
|
87
|
+
}
|
90
88
|
get content() {
|
91
89
|
var firstEditor = mumuki.page.editors[0];
|
92
90
|
if (firstEditor && $("#include_solution").prop("checked"))
|
93
91
|
return firstEditor.getValue();
|
94
92
|
else
|
95
93
|
return '';
|
96
|
-
}
|
97
|
-
submit
|
94
|
+
}
|
95
|
+
submit(report, queryConsole, line) {
|
98
96
|
var self = this;
|
99
97
|
var preloadedQuery = queryConsole.dequeuePreloadedQuery();
|
100
98
|
if (preloadedQuery) {
|
@@ -110,8 +108,8 @@ var mumuki = mumuki || {};
|
|
110
108
|
}).fail(function (response) {
|
111
109
|
reportStatus(response.responseText, 'failed', report);
|
112
110
|
});
|
113
|
-
}
|
114
|
-
displayGoalResult
|
111
|
+
}
|
112
|
+
displayGoalResult(response) {
|
115
113
|
if (response.status == 'passed') {
|
116
114
|
$('.submission-results').show();
|
117
115
|
$('.submission-results').html(response.html);
|
@@ -121,15 +119,15 @@ var mumuki = mumuki || {};
|
|
121
119
|
$('.submission-results').hide();
|
122
120
|
$('.progress-list-item.active').attr('class', "progress-list-item text-center danger active");
|
123
121
|
}
|
124
|
-
}
|
125
|
-
displayQueryResult
|
122
|
+
}
|
123
|
+
displayQueryResult(report, queryConsole, line, response) {
|
126
124
|
if (response.status !== 'errored') {
|
127
125
|
queryConsole.lines.push(line);
|
128
126
|
reportStatus(response.result, response.status, report);
|
129
127
|
} else {
|
130
128
|
reportStatus(response.result, 'failed', report);
|
131
129
|
}
|
132
|
-
}
|
130
|
+
}
|
133
131
|
get _request() {
|
134
132
|
var self = this;
|
135
133
|
return self.token.newRequest({
|
@@ -137,17 +135,17 @@ var mumuki = mumuki || {};
|
|
137
135
|
type: 'POST',
|
138
136
|
data: self._requestData
|
139
137
|
})
|
140
|
-
}
|
138
|
+
}
|
141
139
|
get _requestUrl() {
|
142
140
|
return this.console.endpoint;
|
143
|
-
}
|
141
|
+
}
|
144
142
|
get _requestData() {
|
145
143
|
return {content: this.content, query: this.line, cookie: this.cookie};
|
146
144
|
}
|
147
|
-
}
|
145
|
+
}
|
148
146
|
|
149
147
|
|
150
|
-
mumuki.load(
|
148
|
+
mumuki.load(() => {
|
151
149
|
var prompt = $('#prompt').attr('value');
|
152
150
|
var queryConsole = new QueryConsole();
|
153
151
|
|
@@ -172,4 +170,4 @@ var mumuki = mumuki || {};
|
|
172
170
|
queryConsole.preloadHistoricalQueries();
|
173
171
|
});
|
174
172
|
|
175
|
-
}(
|
173
|
+
})();
|