mumuki-laboratory 8.0.0 → 8.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/mumuki_laboratory/application/bridge.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/button.js +4 -4
- data/app/assets/javascripts/mumuki_laboratory/application/codemirror-builder.js +3 -3
- data/app/assets/javascripts/mumuki_laboratory/application/codemirror.js +6 -6
- data/app/assets/javascripts/mumuki_laboratory/application/console.js +2 -2
- data/app/assets/javascripts/mumuki_laboratory/application/discussions.js +7 -7
- data/app/assets/javascripts/mumuki_laboratory/application/editors.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/elipsis.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/events.js +2 -2
- data/app/assets/javascripts/mumuki_laboratory/application/exercise.js +2 -2
- data/app/assets/javascripts/mumuki_laboratory/application/gamification.js +99 -11
- data/app/assets/javascripts/mumuki_laboratory/application/inputs.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/kids.js +20 -8
- data/app/assets/javascripts/mumuki_laboratory/application/kindergarten.js +16 -57
- data/app/assets/javascripts/mumuki_laboratory/application/messages.js +6 -6
- data/app/assets/javascripts/mumuki_laboratory/application/mu-modal-carrousel.js +63 -0
- data/app/assets/javascripts/mumuki_laboratory/application/multiple-choice.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/multiple-files.js +3 -3
- data/app/assets/javascripts/mumuki_laboratory/application/multiple-scenarios.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/number-counter.js +18 -0
- data/app/assets/javascripts/mumuki_laboratory/application/pin.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/primary.js +3 -2
- data/app/assets/javascripts/mumuki_laboratory/application/progress.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/results-renderer.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/speech-bubble-renderer.js +4 -4
- data/app/assets/javascripts/mumuki_laboratory/application/submission.js +3 -3
- data/app/assets/javascripts/mumuki_laboratory/application/submissions-store.js +3 -3
- data/app/assets/javascripts/mumuki_laboratory/application/sync-mode.js +2 -2
- data/app/assets/javascripts/mumuki_laboratory/application/timer.js +1 -1
- data/app/assets/stylesheets/mumuki_laboratory/application/_layout.scss +7 -7
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids.scss +5 -0
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids_results.scss +117 -0
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kindergarten.scss +45 -131
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_overlap.scss +0 -4
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_terms.scss +9 -12
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_profile.scss +31 -3
- data/app/controllers/application_controller.rb +41 -8
- data/app/controllers/assets_controller.rb +1 -0
- data/app/controllers/book_discussions_controller.rb +1 -1
- data/app/controllers/chapters_controller.rb +1 -0
- data/app/controllers/concerns/with_user_discussion_validation.rb +6 -0
- data/app/controllers/discussions_controller.rb +4 -6
- data/app/controllers/exercises_controller.rb +1 -0
- data/app/controllers/guides_controller.rb +2 -0
- data/app/controllers/invitations_controller.rb +1 -0
- data/app/controllers/lessons_controller.rb +1 -0
- data/app/controllers/login_controller.rb +1 -0
- data/app/controllers/users_controller.rb +9 -1
- data/app/helpers/assignment_result_helper.rb +1 -1
- data/app/helpers/assistance_box_helper.rb +7 -5
- data/app/helpers/discussions_helper.rb +4 -4
- data/app/helpers/editor_tabs_helper.rb +1 -1
- data/app/helpers/gamification_helper.rb +5 -0
- data/app/helpers/icons_helper.rb +1 -1
- data/app/helpers/links_helper.rb +3 -3
- data/app/helpers/menu_bar_helper.rb +5 -1
- data/app/helpers/overlapped_buttons_helper.rb +6 -2
- data/app/views/book/show.html.erb +2 -2
- data/app/views/discussions/_message.html.erb +2 -2
- data/app/views/exercise_solutions/_assistant_rules_box.html.erb +13 -0
- data/app/views/exercise_solutions/_contextualization_results_container.html.erb +9 -0
- data/app/views/exercise_solutions/_kids_level_up.html.erb +11 -0
- data/app/views/exercise_solutions/_results.html.erb +19 -19
- data/app/views/exercise_solutions/_results_title.html.erb +5 -0
- data/app/views/exercises/_exercise_assignment.html.erb +1 -1
- data/app/views/exercises/_read_only.html.erb +1 -1
- data/app/views/exercises/show.html.erb +5 -2
- data/app/views/layouts/_copyright.html.erb +1 -1
- data/app/views/layouts/_guide.html.erb +8 -6
- data/app/views/layouts/_kids.html.erb +4 -4
- data/app/views/layouts/_kindergarten.html.erb +6 -6
- data/app/views/layouts/_organizations_listing.html.erb +8 -12
- data/app/views/layouts/_social_media.html.erb +4 -4
- data/app/views/layouts/_timer.html.erb +1 -1
- data/app/views/layouts/application.html.erb +31 -23
- data/app/views/layouts/embedded.html.erb +14 -11
- data/app/views/layouts/exercise_inputs/editors/_code.html.erb +1 -6
- data/app/views/layouts/exercise_inputs/editors/_multiple_files.html.erb +4 -9
- data/app/views/layouts/exercise_inputs/forms/_problem_form.html.erb +1 -1
- data/app/views/layouts/modals/_guide_corollary.html.erb +13 -3
- data/app/views/layouts/modals/_kids_context.html.erb +1 -1
- data/app/views/layouts/modals/_kids_results.html.erb +16 -6
- data/app/views/layouts/modals/_kindergarten_context.html.erb +15 -15
- data/app/views/layouts/modals/_kindergarten_results.html.erb +20 -7
- data/app/views/layouts/modals/_kindergarten_results_aborted.html.erb +5 -5
- data/app/views/layouts/modals/_level_up.html.erb +27 -0
- data/app/views/users/_edit_user_form.html.erb +2 -2
- data/app/views/users/_user_form.html.erb +12 -2
- data/app/views/users/terms.html.erb +12 -0
- data/config/routes.rb +8 -8
- data/lib/mumuki/laboratory.rb +18 -5
- data/lib/mumuki/laboratory/controllers.rb +2 -0
- data/lib/mumuki/laboratory/controllers/action_redirector.rb +21 -0
- data/lib/mumuki/laboratory/controllers/immersive_navigation.rb +7 -0
- data/lib/mumuki/laboratory/controllers/results_rendering.rb +1 -0
- data/lib/mumuki/laboratory/engine.rb +1 -1
- data/lib/mumuki/laboratory/events/events.rb +0 -9
- data/lib/mumuki/laboratory/locales/en.yml +8 -1
- data/lib/mumuki/laboratory/locales/es-CL.yml +9 -2
- data/lib/mumuki/laboratory/locales/es.yml +11 -3
- data/lib/mumuki/laboratory/locales/pt.yml +9 -2
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/capybara_helper.rb +5 -1
- data/spec/controllers/discussions_controller_spec.rb +19 -0
- data/spec/controllers/exercise_solutions_controller_spec.rb +1 -1
- data/spec/dummy/db/schema.rb +2 -1
- data/spec/features/immersive_redirection_spec.rb +181 -0
- data/spec/features/profile_flow_spec.rb +35 -3
- data/spec/features/terms_flow_spec.rb +157 -0
- data/spec/helpers/icons_helper_spec.rb +3 -3
- data/spec/helpers/test_results_rendering_spec.rb +8 -8
- data/spec/helpers/with_navigation_spec.rb +14 -14
- data/spec/javascripts/gamification-spec.js +2 -2
- metadata +112 -98
- data/app/helpers/organization_list_helper.rb +0 -5
- data/spec/dummy/config/database.travis.yml +0 -4
- data/spec/features/choose_organization_spec.rb +0 -74
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef8bf0f9bb9d5a3bc7daced2376fdb01ce52872178726bffc6d86def1081a2a4
|
4
|
+
data.tar.gz: e2e907a4cf38b75a7ccb18160b84bd1beab765d3ac5cc5b986341701a7b4845e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57196182676bed18199d12a5b44901baebe03f0763088f217117fbc85c2c5e3ab2cc009de7fa32aa7f6b1c039b939cd072e58cff755179228b6f328aa3eee2ab
|
7
|
+
data.tar.gz: 268749a38da64dc28363ff6862c3ef566fe65aad62dc208f9629664d5f939414510e8005059fff43ebc6aa0817178362485996481206a442e9331a9295b22be7
|
@@ -113,7 +113,7 @@ mumuki.bridge = (() => {
|
|
113
113
|
* @returns {SubmissionResult}
|
114
114
|
*/
|
115
115
|
_preRenderResult(result) {
|
116
|
-
result.class_for_progress_list_item = mumuki.renderers.progressListItemClassForStatus(result.status, true)
|
116
|
+
result.class_for_progress_list_item = mumuki.renderers.progressListItemClassForStatus(result.status, true);
|
117
117
|
return result;
|
118
118
|
}
|
119
119
|
}
|
@@ -36,7 +36,7 @@ mumuki.Button = class {
|
|
36
36
|
e.preventDefault();
|
37
37
|
main();
|
38
38
|
};
|
39
|
-
this.$button.on('click', this.main)
|
39
|
+
this.$button.on('click', this.main);
|
40
40
|
}
|
41
41
|
|
42
42
|
// ==============
|
@@ -80,7 +80,7 @@ mumuki.Button = class {
|
|
80
80
|
|
81
81
|
this.enable();
|
82
82
|
|
83
|
-
this.$button.on('click', this.main)
|
83
|
+
this.$button.on('click', this.main);
|
84
84
|
}
|
85
85
|
|
86
86
|
// =============
|
@@ -106,11 +106,11 @@ mumuki.Button = class {
|
|
106
106
|
}
|
107
107
|
|
108
108
|
setWaitingText () {
|
109
|
-
this.$button.html('<i class="
|
109
|
+
this.$button.html('<i class="fas fa-sync-alt fa-spin"></i> ' + this.$button.attr('data-waiting'));
|
110
110
|
}
|
111
111
|
|
112
112
|
setRetryText() {
|
113
|
-
this.$button.html('<i class="
|
113
|
+
this.$button.html('<i class="fas fa-undo"></i>');
|
114
114
|
}
|
115
115
|
|
116
116
|
setOriginalContent () {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
(() => {
|
2
2
|
function submit() {
|
3
3
|
$('body').removeClass('fullscreen');
|
4
|
-
$('.editor-resize .
|
4
|
+
$('.editor-resize .fas').toggleClass('fa-expand fa-compress');
|
5
5
|
$('.btn-submit').click();
|
6
6
|
}
|
7
7
|
|
@@ -38,7 +38,7 @@
|
|
38
38
|
mumuki.editor.toggleFullscreen();
|
39
39
|
},
|
40
40
|
'Tab': function (cm) {
|
41
|
-
mumuki.editor.indentWithSpaces(cm)
|
41
|
+
mumuki.editor.indentWithSpaces(cm);
|
42
42
|
}
|
43
43
|
}
|
44
44
|
});
|
@@ -53,7 +53,7 @@
|
|
53
53
|
'Cmd-Enter': submitMessage,
|
54
54
|
'Ctrl-Enter': submitMessage,
|
55
55
|
'Tab': function (cm) {
|
56
|
-
mumuki.editor.indentWithSpaces(cm)
|
56
|
+
mumuki.editor.indentWithSpaces(cm);
|
57
57
|
}
|
58
58
|
}
|
59
59
|
});
|
@@ -23,20 +23,20 @@ mumuki.page.editors = [];
|
|
23
23
|
function resetEditor() {
|
24
24
|
mumuki.page.dynamicEditors.forEach(function (e) {
|
25
25
|
setDefaultContent(e, $('#default_content').val());
|
26
|
-
})
|
26
|
+
});
|
27
27
|
}
|
28
28
|
|
29
29
|
function formatContent() {
|
30
30
|
mumuki.page.editors.each(function (_, editor) {
|
31
|
-
editor.setSelection({line: 0, ch: 0}, {line: editor.lineCount()})
|
32
|
-
editor.indentSelection("smart")
|
33
|
-
editor.setSelection({line: 0})
|
31
|
+
editor.setSelection({line: 0, ch: 0}, {line: editor.lineCount()});
|
32
|
+
editor.indentSelection("smart");
|
33
|
+
editor.setSelection({line: 0});
|
34
34
|
});
|
35
35
|
}
|
36
36
|
|
37
37
|
function toggleFullscreen() {
|
38
38
|
$('body').toggleClass('fullscreen');
|
39
|
-
$('.editor-resize .
|
39
|
+
$('.editor-resize .fas').toggleClass('fa-expand fa-compress');
|
40
40
|
}
|
41
41
|
|
42
42
|
function indentWithSpaces(cm) {
|
@@ -56,7 +56,7 @@ mumuki.page.editors = [];
|
|
56
56
|
if (language !== undefined) {
|
57
57
|
mumuki.page.dynamicEditors.forEach(function (e) {
|
58
58
|
setEditorLanguage(e, language);
|
59
|
-
})
|
59
|
+
});
|
60
60
|
}
|
61
61
|
}
|
62
62
|
|
@@ -32,7 +32,7 @@
|
|
32
32
|
function clearConsole() {
|
33
33
|
$('.jquery-console-message-error').remove();
|
34
34
|
$('.jquery-console-message-value').remove();
|
35
|
-
$('.jquery-console-prompt-box:not(:last)').remove()
|
35
|
+
$('.jquery-console-prompt-box:not(:last)').remove();
|
36
36
|
}
|
37
37
|
|
38
38
|
class QueryConsole {
|
@@ -134,7 +134,7 @@
|
|
134
134
|
url: self._requestUrl,
|
135
135
|
type: 'POST',
|
136
136
|
data: self._requestData
|
137
|
-
})
|
137
|
+
});
|
138
138
|
}
|
139
139
|
get _requestUrl() {
|
140
140
|
return this.console.endpoint;
|
@@ -34,33 +34,33 @@ mumuki.load(() => {
|
|
34
34
|
},
|
35
35
|
token: new mumuki.CsrfToken(),
|
36
36
|
tokenRequest: function (data) {
|
37
|
-
return $.ajax(Forum.token.newRequest(data))
|
37
|
+
return $.ajax(Forum.token.newRequest(data));
|
38
38
|
},
|
39
39
|
discussionPost: function (url) {
|
40
40
|
return Forum.tokenRequest({
|
41
41
|
url: url,
|
42
42
|
method: 'POST',
|
43
43
|
xhrFields: {withCredentials: true}
|
44
|
-
})
|
44
|
+
});
|
45
45
|
},
|
46
46
|
discussionSubscription: function (url) {
|
47
|
-
Forum.discussionPostAndToggle(url, $subscriptionSpans)
|
47
|
+
Forum.discussionPostAndToggle(url, $subscriptionSpans);
|
48
48
|
},
|
49
49
|
discussionUpvote: function (url) {
|
50
|
-
Forum.discussionPostAndToggle(url, $upvoteSpans)
|
50
|
+
Forum.discussionPostAndToggle(url, $upvoteSpans);
|
51
51
|
},
|
52
52
|
discussionPostAndToggle: function (url, elem) {
|
53
|
-
Forum.discussionPost(url).done(Forum.toggleButton(elem))
|
53
|
+
Forum.discussionPost(url).done(Forum.toggleButton(elem));
|
54
54
|
},
|
55
55
|
discussionMessageToggleApprove: function (url, elem) {
|
56
56
|
Forum.discussionPost(url).done(function () {
|
57
57
|
elem.toggleClass("selected");
|
58
|
-
})
|
58
|
+
});
|
59
59
|
},
|
60
60
|
discussionMessageToggleNotActuallyAQuestion: function (url, elem) {
|
61
61
|
Forum.discussionPost(url).done(function () {
|
62
62
|
elem.toggleClass("selected");
|
63
|
-
})
|
63
|
+
});
|
64
64
|
},
|
65
65
|
discussionsToggleCheckbox: function (elem) {
|
66
66
|
const key = elem.attr('name');
|
@@ -34,7 +34,7 @@ mumuki.events = {
|
|
34
34
|
*/
|
35
35
|
fire(eventName, value = null) {
|
36
36
|
if (this._handlers[eventName]) {
|
37
|
-
this._handlers[eventName].forEach(it => it(value))
|
37
|
+
this._handlers[eventName].forEach(it => it(value));
|
38
38
|
}
|
39
39
|
},
|
40
40
|
|
@@ -48,4 +48,4 @@ mumuki.events = {
|
|
48
48
|
this._handlers[eventName] = [];
|
49
49
|
}
|
50
50
|
}
|
51
|
-
}
|
51
|
+
};
|
@@ -5,9 +5,22 @@ mumuki.gamification = (() => {
|
|
5
5
|
static get CONSTANT_TERM() { return -125; }
|
6
6
|
}
|
7
7
|
|
8
|
+
class DummyLevelProgression {
|
9
|
+
setExpMessage() {}
|
10
|
+
|
11
|
+
registerLevelUpAction() {}
|
12
|
+
|
13
|
+
registerGainedExperienceAction() {}
|
14
|
+
|
15
|
+
updateLevel() {}
|
16
|
+
}
|
17
|
+
|
8
18
|
class LevelProgression {
|
9
19
|
constructor(currentExp) {
|
10
20
|
this.currentExp = currentExp;
|
21
|
+
this.lastEarnedExp = 0;
|
22
|
+
this._levelUpAction = this.defaultLevelUpAction;
|
23
|
+
this._gainedExperienceAction = this.defaultGainedExperienceAction;
|
11
24
|
}
|
12
25
|
|
13
26
|
expToLevelUp() {
|
@@ -38,8 +51,8 @@ mumuki.gamification = (() => {
|
|
38
51
|
return Math.floor((-b + Math.sqrt(Math.pow(b, 2) - 4 * a * (c - exp))) / (2 * a));
|
39
52
|
}
|
40
53
|
|
41
|
-
triggersLevelChange(
|
42
|
-
return this.levelFor(
|
54
|
+
triggersLevelChange(newExp) {
|
55
|
+
return this.levelFor(this.currentExp + newExp) !== this.currentLevel();
|
43
56
|
}
|
44
57
|
|
45
58
|
currentLevelProgress() {
|
@@ -50,23 +63,97 @@ mumuki.gamification = (() => {
|
|
50
63
|
return this.expFor(this.currentLevel());
|
51
64
|
}
|
52
65
|
|
53
|
-
|
54
|
-
|
66
|
+
exercisesToNextLevel() {
|
67
|
+
return Math.ceil(this.expToLevelUp() / 100);
|
68
|
+
}
|
69
|
+
|
70
|
+
setExpMessage(data) {
|
71
|
+
const exp = data.current_exp;
|
72
|
+
this.lastEarnedExp = exp - this.currentExp;
|
73
|
+
|
74
|
+
if (this.lastEarnedExp > 0) {
|
75
|
+
this.levelUpActionIfLevelUp(data.level_up_html);
|
76
|
+
this._gainedExperienceAction();
|
55
77
|
|
56
|
-
if (expGained > 0) {
|
57
78
|
this.currentExp = exp;
|
58
|
-
|
59
|
-
|
79
|
+
this.updateLevel();
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
defaultGainedExperienceAction() {
|
84
|
+
$('#mu-exp-points').html(this.lastEarnedExp);
|
85
|
+
$('#mu-exp-earned-message').removeClass('hidden');
|
86
|
+
}
|
87
|
+
|
88
|
+
defaultLevelUpAction(_levelUpHtml) {
|
89
|
+
$('#mu-level-up').modal();
|
90
|
+
}
|
91
|
+
|
92
|
+
registerLevelUpAction(action) {
|
93
|
+
this._levelUpAction = action;
|
94
|
+
}
|
95
|
+
|
96
|
+
registerGainedExperienceAction(action) {
|
97
|
+
this._gainedExperienceAction = action;
|
98
|
+
}
|
99
|
+
|
100
|
+
levelUpActionIfLevelUp(levelUpHtml) {
|
101
|
+
if (this.triggersLevelChange(this.lastEarnedExp)) {
|
102
|
+
this._levelUpAction(levelUpHtml);
|
60
103
|
}
|
61
104
|
}
|
105
|
+
|
106
|
+
animateExperienceCounter(selector) {
|
107
|
+
mumuki.animateNumberCounter(selector, this.lastEarnedExp);
|
108
|
+
}
|
109
|
+
|
110
|
+
updateLevel() {
|
111
|
+
$('#mu-solve-more-exercises span').text(this.exercisesToNextLevel());
|
112
|
+
$('.mu-level-number').html(this.currentLevel());
|
113
|
+
|
114
|
+
this.updateTooltip();
|
115
|
+
this.animateProgressIfAny();
|
116
|
+
}
|
117
|
+
|
118
|
+
updateTooltip() {
|
119
|
+
const $muLevelTooltip = $('.mu-level-tooltip');
|
120
|
+
|
121
|
+
$muLevelTooltip.attr("data-original-title", `${$muLevelTooltip.attr("level")} ${this.currentLevel()}`);
|
122
|
+
$muLevelTooltip.attr("title", "");
|
123
|
+
}
|
124
|
+
|
125
|
+
animateProgressIfAny() {
|
126
|
+
const $muLevelProgress = $('#mu-level-progress');
|
127
|
+
if (this.currentLevelProgress() === 0) {
|
128
|
+
$muLevelProgress.attr("display", "none");
|
129
|
+
}
|
130
|
+
|
131
|
+
$muLevelProgress.animate(
|
132
|
+
{'progress': this.currentLevelProgress() * 250},
|
133
|
+
{
|
134
|
+
step: function(progress) {
|
135
|
+
let pattern = progress + ", 999";
|
136
|
+
$(this).attr("stroke-dasharray", pattern);
|
137
|
+
},
|
138
|
+
duration: 1000
|
139
|
+
});
|
140
|
+
}
|
62
141
|
}
|
63
142
|
|
64
143
|
function _setUpCurrentLevelProgression() {
|
65
|
-
|
144
|
+
if (_gamificationEnabled()) {
|
145
|
+
mumuki.gamification.currentLevelProgression = new LevelProgression(currentExp());
|
146
|
+
} else {
|
147
|
+
mumuki.gamification.currentLevelProgression = new DummyLevelProgression();
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
function _gamificationEnabled() {
|
152
|
+
return $('#mu-current-exp').length;
|
66
153
|
}
|
67
154
|
|
68
155
|
function currentExp() {
|
69
|
-
return $('#mu-current-exp').val();
|
156
|
+
return parseInt($('#mu-current-exp').val());
|
70
157
|
}
|
71
158
|
|
72
159
|
return {
|
@@ -75,11 +162,12 @@ mumuki.gamification = (() => {
|
|
75
162
|
|
76
163
|
_setUpCurrentLevelProgression,
|
77
164
|
|
78
|
-
/** @type {LevelProgression} */
|
79
|
-
|
165
|
+
/** @type {LevelProgression|DummyLevelProgression} */
|
166
|
+
currentLevelProgression: null
|
80
167
|
};
|
81
168
|
})();
|
82
169
|
|
83
170
|
mumuki.load(() => {
|
84
171
|
mumuki.gamification._setUpCurrentLevelProgression();
|
172
|
+
mumuki.gamification.currentLevelProgression.updateLevel();
|
85
173
|
});
|
@@ -21,9 +21,20 @@ mumuki.Kids = class {
|
|
21
21
|
this.$stateImage = $('.mu-kids-state-image');
|
22
22
|
this.$contextModal = $('#mu-kids-context');
|
23
23
|
this.$resultsModal = $('#kids-results');
|
24
|
+
this.resultsCarrousel = new mumuki.ModalCarrousel('.mu-kids-results-carrousel');
|
24
25
|
this.$resultsAbortedModal = $('#kids-results-aborted');
|
25
26
|
this.$bubbleCharacterAnimation = $('.mu-kids-character-animation');
|
26
27
|
this.$submissionResult = $('.submission-results');
|
28
|
+
mumuki.gamification.currentLevelProgression.registerLevelUpAction(this.levelUpAction);
|
29
|
+
mumuki.gamification.currentLevelProgression.registerGainedExperienceAction(this.gainedExperienceAction);
|
30
|
+
}
|
31
|
+
|
32
|
+
gainedExperienceAction() {
|
33
|
+
mumuki.gamification.currentLevelProgression.animateExperienceCounter('.mu-kids-results .mu-experience');
|
34
|
+
}
|
35
|
+
|
36
|
+
levelUpAction(levelUpHtml) {
|
37
|
+
$('.mu-kids-results-carrousel').append(levelUpHtml);
|
27
38
|
}
|
28
39
|
|
29
40
|
showContext() {
|
@@ -50,11 +61,11 @@ mumuki.Kids = class {
|
|
50
61
|
// ==================
|
51
62
|
|
52
63
|
_showSuccessPopup() {
|
53
|
-
this._mustImplementThisMethod()
|
64
|
+
this._mustImplementThisMethod();
|
54
65
|
}
|
55
66
|
|
56
67
|
_showFailurePopup() {
|
57
|
-
this._mustImplementThisMethod()
|
68
|
+
this._mustImplementThisMethod();
|
58
69
|
}
|
59
70
|
|
60
71
|
// ====================
|
@@ -74,7 +85,7 @@ mumuki.Kids = class {
|
|
74
85
|
}
|
75
86
|
|
76
87
|
onSubmissionResultModalOpen(_data) {
|
77
|
-
|
88
|
+
this.resultsCarrousel.show();
|
78
89
|
}
|
79
90
|
|
80
91
|
// =================
|
@@ -82,9 +93,10 @@ mumuki.Kids = class {
|
|
82
93
|
// =================
|
83
94
|
|
84
95
|
_openSubmissionResultModal(data) {
|
85
|
-
this.$resultsModal.modal({ backdrop: 'static', keyboard: false })
|
86
|
-
this.$resultsModal.find('.modal-header').first().html(data.title_html)
|
87
|
-
|
96
|
+
this.$resultsModal.modal({ backdrop: 'static', keyboard: false });
|
97
|
+
this.$resultsModal.find('.modal-header').first().html(data.title_html);
|
98
|
+
mumuki.gamification.currentLevelProgression.setExpMessage(data);
|
99
|
+
this.$resultsModal.find('.modal-footer').first().html(data.button_html);
|
88
100
|
$('.mu-close-modal').click(() => this.$resultsModal.modal('hide'));
|
89
101
|
this.onSubmissionResultModalOpen(data);
|
90
102
|
}
|
@@ -129,7 +141,7 @@ mumuki.Kids = class {
|
|
129
141
|
// ============
|
130
142
|
|
131
143
|
_mustImplementThisMethod() {
|
132
|
-
throw new Error('TODO: implement method')
|
144
|
+
throw new Error('TODO: implement method');
|
133
145
|
}
|
134
146
|
|
135
147
|
// ============
|
@@ -202,4 +214,4 @@ mumuki.Kids = class {
|
|
202
214
|
$blockSvg.height($blocks.height());
|
203
215
|
}
|
204
216
|
|
205
|
-
}
|
217
|
+
};
|