mumuki-laboratory 7.12.3 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/mumuki_laboratory/application/gamification.js +11 -89
  3. data/app/assets/javascripts/mumuki_laboratory/application/kids.js +4 -16
  4. data/app/assets/javascripts/mumuki_laboratory/application/kindergarten.js +50 -9
  5. data/app/assets/javascripts/mumuki_laboratory/application/primary.js +1 -2
  6. data/app/assets/javascripts/mumuki_laboratory/application/submission.js +1 -1
  7. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids_results.scss +0 -117
  8. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kindergarten.scss +131 -45
  9. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_profile.scss +3 -31
  10. data/app/controllers/api/courses_controller.rb +1 -2
  11. data/app/controllers/api/organizations_controller.rb +2 -3
  12. data/app/controllers/api/users_controller.rb +2 -4
  13. data/app/controllers/invitations_controller.rb +1 -2
  14. data/app/views/exercise_solutions/_contextualization_results_container.html.erb +0 -9
  15. data/app/views/exercise_solutions/_results_title.html.erb +0 -5
  16. data/app/views/exercises/show.html.erb +1 -4
  17. data/app/views/layouts/_kindergarten.html.erb +1 -1
  18. data/app/views/layouts/application.html.erb +2 -8
  19. data/app/views/layouts/modals/_guide_corollary.html.erb +1 -1
  20. data/app/views/layouts/modals/_kids_context.html.erb +1 -1
  21. data/app/views/layouts/modals/_kids_results.html.erb +6 -16
  22. data/app/views/layouts/modals/_kindergarten_context.html.erb +15 -15
  23. data/app/views/layouts/modals/_kindergarten_results.html.erb +7 -20
  24. data/app/views/layouts/modals/_kindergarten_results_aborted.html.erb +4 -4
  25. data/app/views/users/_user_form.html.erb +2 -12
  26. data/lib/mumuki/laboratory/controllers/results_rendering.rb +0 -1
  27. data/lib/mumuki/laboratory/events/events.rb +0 -24
  28. data/lib/mumuki/laboratory/locales/en.yml +0 -5
  29. data/lib/mumuki/laboratory/locales/es-CL.yml +0 -5
  30. data/lib/mumuki/laboratory/locales/es.yml +0 -5
  31. data/lib/mumuki/laboratory/locales/pt.yml +0 -5
  32. data/lib/mumuki/laboratory/version.rb +1 -1
  33. data/spec/controllers/exercise_solutions_controller_spec.rb +1 -1
  34. metadata +99 -104
  35. data/app/assets/javascripts/mumuki_laboratory/application/mu-modal-carrousel.js +0 -63
  36. data/app/assets/javascripts/mumuki_laboratory/application/number-counter.js +0 -18
  37. data/app/helpers/gamification_helper.rb +0 -5
  38. data/app/views/exercise_solutions/_kids_level_up.html.erb +0 -11
  39. data/app/views/layouts/modals/_level_up.html.erb +0 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26c8eb799e96cc5d8e68fc6d5b9ae0e268fcc77fa99156db5051b373b6aee412
4
- data.tar.gz: 4dde09623edc6d26430bbd6bc86bcd6e85347e73bcd444df00d8f7b47274859c
3
+ metadata.gz: 6c5e8b0b9d50cec890d396b4d9fdc32191fb2083adb4b2519784051c497e7900
4
+ data.tar.gz: 0fa8577f8f65a8b3565980ee8678da46d9514f7d49cd4b4044cc07a6605c4271
5
5
  SHA512:
6
- metadata.gz: efef98352ef78664e8aac7493a70546b824b54e97ed556d18ae1068c532564dcf509f2878e2c8105d9e5a0e318222b3aa0b1894d43fe2d1d48da397137ea6329
7
- data.tar.gz: fb241340ebe7994e84ab86c08275304c74cd5669bbc2ca3b7c8bcf616d1186b088ecd3da59fe8abb80b65a1f9dfd8538eccbf31cba4f55dbd83f7a2838601911
6
+ metadata.gz: 95639b3675a795883b05ca19c746438cbfbfd6bba423561f9b8c17aefde40fad23495a9a242bbcc0274cb5b1116d5335c968aeea60ddbe298865210b1727aadd
7
+ data.tar.gz: 4b0032d3733982144a681d8728cc193182aa989022b7af3b9ae736552079eea001a1e484f680a7a75d3fe62e4f53c6cd48569493cd154c41f036b86e3c7afd7f
@@ -5,22 +5,9 @@ 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
-
18
8
  class LevelProgression {
19
9
  constructor(currentExp) {
20
10
  this.currentExp = currentExp;
21
- this.lastEarnedExp = 0;
22
- this._levelUpAction = this.defaultLevelUpAction;
23
- this._gainedExperienceAction = this.defaultGainedExperienceAction;
24
11
  }
25
12
 
26
13
  expToLevelUp() {
@@ -51,8 +38,8 @@ mumuki.gamification = (() => {
51
38
  return Math.floor((-b + Math.sqrt(Math.pow(b, 2) - 4 * a * (c - exp))) / (2 * a));
52
39
  }
53
40
 
54
- triggersLevelChange(newExp) {
55
- return this.levelFor(this.currentExp + newExp) !== this.currentLevel();
41
+ triggersLevelChange(exp) {
42
+ return this.levelFor(exp) !== this.currentLevel();
56
43
  }
57
44
 
58
45
  currentLevelProgress() {
@@ -63,87 +50,23 @@ mumuki.gamification = (() => {
63
50
  return this.expFor(this.currentLevel());
64
51
  }
65
52
 
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();
53
+ setExpMessage(exp) {
54
+ let expGained = exp - this.currentExp;
77
55
 
56
+ if (expGained > 0) {
78
57
  this.currentExp = exp;
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);
58
+ $('#mu-exp-points').html(expGained);
59
+ $('#mu-level-number').html(this.currentLevel());
103
60
  }
104
61
  }
105
-
106
- animateExperienceCounter(selector) {
107
- mumuki.animateNumberCounter(selector, this.lastEarnedExp);
108
- }
109
-
110
- updateLevel() {
111
- const $muLevelProgress = $('#mu-level-progress');
112
-
113
- $('#mu-solve-more-exercises span').text(this.exercisesToNextLevel());
114
- $('.mu-level-number').html(this.currentLevel());
115
- $('.mu-level-tooltip').attr("title", (_, value) => `${value} ${this.currentLevel()}`);
116
-
117
- if (this.currentLevelProgress() === 0) {
118
- $muLevelProgress.attr("display", "none");
119
- }
120
-
121
- $muLevelProgress.animate(
122
- {'progress': this.currentLevelProgress() * 250},
123
- {
124
- step: function(progress) {
125
- let pattern = progress + ", 999";
126
- $(this).attr("stroke-dasharray", pattern);
127
- },
128
- duration: 1000
129
- });
130
- }
131
62
  }
132
63
 
133
64
  function _setUpCurrentLevelProgression() {
134
- if (_gamificationEnabled()) {
135
- mumuki.gamification.currentLevelProgression = new LevelProgression(currentExp());
136
- } else {
137
- mumuki.gamification.currentLevelProgression = new DummyLevelProgression();
138
- }
139
- }
140
-
141
- function _gamificationEnabled() {
142
- return $('#mu-current-exp').length;
65
+ mumuki.gamification._currentLevelProgression = new LevelProgression(currentExp());
143
66
  }
144
67
 
145
68
  function currentExp() {
146
- return parseInt($('#mu-current-exp').val());
69
+ return $('#mu-current-exp').val();
147
70
  }
148
71
 
149
72
  return {
@@ -152,12 +75,11 @@ mumuki.gamification = (() => {
152
75
 
153
76
  _setUpCurrentLevelProgression,
154
77
 
155
- /** @type {LevelProgression|DummyLevelProgression} */
156
- currentLevelProgression: null
78
+ /** @type {LevelProgression} */
79
+ _currentLevelProgression: null
157
80
  };
158
81
  })();
159
82
 
160
83
  mumuki.load(() => {
161
84
  mumuki.gamification._setUpCurrentLevelProgression();
162
- mumuki.gamification.currentLevelProgression.updateLevel();
163
85
  });
@@ -21,20 +21,9 @@ 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');
25
24
  this.$resultsAbortedModal = $('#kids-results-aborted');
26
25
  this.$bubbleCharacterAnimation = $('.mu-kids-character-animation');
27
26
  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);
38
27
  }
39
28
 
40
29
  showContext() {
@@ -85,7 +74,7 @@ mumuki.Kids = class {
85
74
  }
86
75
 
87
76
  onSubmissionResultModalOpen(_data) {
88
- this.resultsCarrousel.show();
77
+ // SubClasses may override this method
89
78
  }
90
79
 
91
80
  // =================
@@ -93,10 +82,9 @@ mumuki.Kids = class {
93
82
  // =================
94
83
 
95
84
  _openSubmissionResultModal(data) {
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);
85
+ this.$resultsModal.modal({ backdrop: 'static', keyboard: false })
86
+ this.$resultsModal.find('.modal-header').first().html(data.title_html)
87
+ this.$resultsModal.find('.modal-footer').first().html(data.button_html)
100
88
  $('.mu-close-modal').click(() => this.$resultsModal.modal('hide'));
101
89
  this.onSubmissionResultModalOpen(data);
102
90
  }
@@ -10,7 +10,7 @@ mumuki.load(() => {
10
10
 
11
11
  initialize() {
12
12
  super.initialize();
13
- this.$contextModalButton = new mumuki.Button($('#mu-kids-context .mu-kids-modal-button.mu-close'));
13
+ this.$contextModalButton = new mumuki.Button($('#mu-kids-context .mu-kindergarten-modal-button.mu-close'));
14
14
 
15
15
  this.resultActions.passed = this._showSuccessPopup.bind(this);
16
16
  this.resultActions.passed_with_warnings = this._showSuccessPopup.bind(this);
@@ -29,9 +29,10 @@ mumuki.load(() => {
29
29
  // ================
30
30
 
31
31
  showNonAbortedPopup(data, animation_name) {
32
+ data.guide_finished_by_solution = false;
32
33
  this.$submissionResult.html(data.title_html);
33
- this.$resultsModal.find('.modal-content').removeClass().addClass('modal-content kindergarten').addClass(data.status);
34
- super.showNonAbortedPopup(data, animation_name);
34
+ this.$resultsModal.find('.modal-content').removeClass().addClass('modal-content').addClass(data.status);
35
+ super.showNonAbortedPopup(data, animation_name, 1000);
35
36
  }
36
37
 
37
38
  showAbortedPopup(data) {
@@ -71,11 +72,6 @@ mumuki.load(() => {
71
72
  // == Called by the runner ==
72
73
  // ==========================
73
74
 
74
- showResult(data) {
75
- data.guide_finished_by_solution = false;
76
- super.showResult(data);
77
- }
78
-
79
75
  restart() {
80
76
  mumuki.presenterCharacter.playAnimation('talk', this.$bubbleCharacterAnimation);
81
77
  }
@@ -147,7 +143,52 @@ mumuki.load(() => {
147
143
  }
148
144
 
149
145
  get context() {
150
- return new mumuki.ModalCarrousel('.mu-kindergarten-context-image-slides', () => mumuki.kids.showContext());
146
+ return {
147
+ showContext() {
148
+ mumuki.kids.showContext();
149
+ this._showFirstSlideImage();
150
+ },
151
+ nextSlide() {
152
+ this._clickButton('next');
153
+ },
154
+ prevSlide() {
155
+ this._clickButton('prev');
156
+ },
157
+ _imageSlides() {
158
+ return $('.mu-kindergarten-context-image-slides');
159
+ },
160
+ _activeSlideImage() {
161
+ return this._imageSlides().find('.active');
162
+ },
163
+ _clickButton(prevOrNext) {
164
+ this._activeSlideImage().removeClass('active')[prevOrNext]().addClass('active');
165
+ this.showNextOrCloseButton();
166
+ this._hidePreviousButtonIfFirstImage();
167
+ },
168
+ showNextOrCloseButton() {
169
+ const $next = $('.mu-kindergarten-modal-button.mu-next');
170
+ const $close = $('.mu-kindergarten-modal-button.mu-close');
171
+ const isLastChild = this._activeSlideImage().is(':last-child');
172
+ this._addClassIf($next, 'hidden', () => isLastChild);
173
+ this._addClassIf($close, 'hidden', () => !isLastChild);
174
+ },
175
+ _hidePreviousButtonIfFirstImage() {
176
+ const $prev = $('.mu-kindergarten-modal-button.mu-previous');
177
+ this._addClassIf($prev, 'hidden', () => this._activeSlideImage().is(':first-child'))
178
+ },
179
+ _showFirstSlideImage() {
180
+ this._imageSlides().find('img').each((i, el) => this._addClassIf($(el), 'active', () => i === 0))
181
+ this.showNextOrCloseButton();
182
+ this._hidePreviousButtonIfFirstImage();
183
+ },
184
+ _addClassIf(element, clazz, criteria) {
185
+ if (criteria()) {
186
+ element.addClass(clazz)
187
+ } else {
188
+ element.removeClass(clazz);
189
+ }
190
+ }
191
+ }
151
192
  }
152
193
 
153
194
  }
@@ -123,9 +123,8 @@ mumuki.load(() => {
123
123
  this._showMessageOnCharacterBubble(data);
124
124
  }
125
125
 
126
- onSubmissionResultModalOpen(data) {
126
+ onSubmissionResultModalOpen(_data) {
127
127
  this._showCorollaryCharacter();
128
- super.onSubmissionResultModalOpen(data);
129
128
  }
130
129
 
131
130
  // ==========================
@@ -26,7 +26,7 @@ mumuki.submission = (() => {
26
26
  this.submissionsResultsArea.html(data.html);
27
27
  data.status === 'aborted' ? this.error(submitButton) : submitButton.enable();
28
28
  mumuki.updateProgressBarAndShowModal(data);
29
- mumuki.gamification.currentLevelProgression.setExpMessage(data);
29
+ mumuki.gamification._currentLevelProgression.setExpMessage(data.current_exp);
30
30
  }
31
31
  error(submitButton) {
32
32
  this.submissionsResultsArea.html('');
@@ -1,14 +1,3 @@
1
- @mixin full-size-character {
2
- width: 100%;
3
- height: 100%;
4
- img {
5
- width: 100%;
6
- height: 100%;
7
- object-position: center;
8
- object-fit: contain;
9
- }
10
- }
11
-
12
1
  @each $class in success, warning, danger, broken {
13
2
  .mu-kids-callout-#{$class} {
14
3
  h4 {
@@ -58,109 +47,3 @@ $capital-animation-width: 135px;
58
47
  }
59
48
  }
60
49
 
61
- .mu-kids-modal-border {
62
-
63
- .modal-dialog {
64
-
65
- height: 100vh;
66
- width: 100vw;
67
- margin: 0;
68
-
69
- .modal-content {
70
-
71
- position: absolute;
72
-
73
- $width-lg: 800px;
74
-
75
- width: $width-lg;
76
-
77
- top: 60px;
78
- left: calc(50% - #{$width-lg} / 2);
79
-
80
- @media (max-width: $width-lg + 30px) {
81
- width: calc(100vw - 30px);
82
- }
83
-
84
- $border-width: 16px;
85
- border-width: $border-width;
86
- border-style: solid;
87
- border-color: $mu-color-link;
88
- border-radius: $border-width;
89
- box-shadow: none;
90
-
91
- .modal-body {
92
- div, p {
93
- height: 100%;
94
- .mu-kids-results-carrousel,
95
- .mu-kindergarten-context-image-slides {
96
- > :not(.active) {
97
- display: none;
98
- }
99
- }
100
- }
101
- .mu-level p {
102
- height: unset;
103
- }
104
- }
105
-
106
- .mu-kids-modal-button {
107
- $diameter: 64px;
108
- position: absolute;
109
- border-radius: 50%;
110
- height: $diameter;
111
- width: $diameter;
112
- color: white;
113
- font-weight: bold;
114
- border: none;
115
- padding: 0;
116
- background: $mu-color-link;
117
- &.mu-next,
118
- &.mu-close {
119
- top: - $diameter / 2 - $border-width / 2;
120
- right: - $diameter / 2 - $border-width / 2;
121
- }
122
- &.mu-previous {
123
- top: - $diameter / 2 - $border-width / 2;
124
- left: - $diameter / 2 - $border-width / 2;
125
- }
126
- }
127
-
128
- $mu-statuses-colors: (
129
- 'broken': $mu-color-broken,
130
- 'danger': $mu-color-danger,
131
- 'success': $mu-color-success,
132
- 'warning': $mu-color-warning,
133
- 'passed': $mu-color-success,
134
- 'passed-with-warnings': $mu-color-warning,
135
- 'failed': $mu-color-danger,
136
- 'errored': $mu-color-broken,
137
- 'aborted': $mu-color-broken,
138
- 'pending': $mu-color-info
139
- );
140
-
141
- @each $class, $color in $mu-statuses-colors {
142
- &.#{$class} {
143
- border-color: $color;
144
- .mu-kids-modal-button {
145
- background: $color;
146
- }
147
- }
148
- .mu-kids-character.kindergarten {
149
- @include full-size-character;
150
- }
151
-
152
- .submission-results.kindergarten {
153
- width: 100%;
154
- height: 100%;
155
- .mu-kids-callout-#{$class},
156
- p {
157
- display: none;
158
- }
159
- .mu-kids-default-#{$class} {
160
- @include full-size-character;
161
- }
162
- }
163
- }
164
- }
165
- }
166
- }
@@ -87,69 +87,155 @@ $modal-footer-height: 95px;
87
87
  }
88
88
  }
89
89
 
90
- .modal-content.kindergarten {
91
- $width-lg: 800px;
92
- $height-lg: $width-lg * 0.625;
90
+ .mu-kindergarten-context {
93
91
 
94
- width: $width-lg;
95
- height: $height-lg;
92
+ .modal-dialog {
96
93
 
97
- top: calc(50vh - #{$height-lg} / 2);
94
+ height: 100vh;
95
+ width: 100vw;
96
+ margin: 0;
98
97
 
99
- @media (orientation: landscape) and (max-height: $height-lg + 50px) {
100
- $height-sm: 85vh;
101
- $width-sm: $height-sm / 0.625;
98
+ .modal-content {
99
+ position: absolute;
102
100
 
103
- width: $width-sm;
104
- height: $height-sm;
101
+ $width-lg: 800px;
102
+ $height-lg: $width-lg * 0.625;
105
103
 
106
- top: calc(50vh - #{$height-sm} / 2);
107
- left: calc(50vw - #{$width-sm} / 2);
108
- }
104
+ width: $width-lg;
105
+ height: $height-lg;
109
106
 
110
- @media (orientation: portrait) {
111
- $height-sm: 85vh;
112
- $width-sm: 85vw;
107
+ top: calc(50vh - #{$height-lg} / 2);
108
+ left: calc(50vw - #{$width-lg} / 2);
113
109
 
114
- width: $width-sm;
115
- height: $height-sm;
110
+ @media (orientation: landscape) and (max-height: $height-lg + 50px) {
111
+ $height-sm: 85vh;
112
+ $width-sm: $height-sm / 0.625;
116
113
 
117
- top: calc(50vh - #{$height-sm} / 2);
118
- left: calc(50vw - #{$width-sm} / 2);
119
- }
114
+ width: $width-sm;
115
+ height: $height-sm;
120
116
 
121
- .modal-header,
122
- .modal-footer {
123
- text-align: center;
124
- text-transform: uppercase;
125
- }
117
+ top: calc(50vh - #{$height-sm} / 2);
118
+ left: calc(50vw - #{$width-sm} / 2);
119
+ }
126
120
 
127
- .modal-body.mu-kids-context-body {
128
- height: 100%;
129
- div img, p img {
130
- width: 100%;
131
- height: 100%;
132
- object-position: center;
133
- object-fit: contain;
121
+ @media (orientation: portrait) {
122
+ $height-sm: 85vh;
123
+ $width-sm: 85vw;
124
+
125
+ width: $width-sm;
126
+ height: $height-sm;
127
+
128
+ top: calc(50vh - #{$height-sm} / 2);
129
+ left: calc(50vw - #{$width-sm} / 2);
130
+ }
131
+
132
+ $border-width: 16px;
133
+ border-width: $border-width;
134
+ border-style: solid;
135
+ border-color: $mu-color-link;
136
+ border-radius: $border-width;
137
+ box-shadow: none;
138
+
139
+ .modal-header,
140
+ .modal-footer {
141
+ text-align: center;
142
+ text-transform: uppercase;
143
+ }
144
+
145
+ .modal-body {
146
+ height: 100%;
147
+ div, p {
148
+ height: 100%;
149
+ .mu-kindergarten-context-image-slides {
150
+ img:not(.active) {
151
+ display: none;
152
+ }
153
+ }
154
+ img {
155
+ width: 100%;
156
+ height: 100%;
157
+ object-position: center;
158
+ object-fit: contain;
159
+ }
160
+ }
161
+ }
162
+
163
+ .mu-kindergarten-modal-button {
164
+ $diameter: 64px;
165
+ position: absolute;
166
+ border-radius: 50%;
167
+ height: $diameter;
168
+ width: $diameter;
169
+ color: white;
170
+ font-weight: bold;
171
+ border: none;
172
+ padding: 0;
173
+ background: $mu-color-link;
174
+ &.mu-next,
175
+ &.mu-close {
176
+ top: - $diameter / 2 - $border-width / 2;
177
+ right: - $diameter / 2 - $border-width / 2;
178
+ }
179
+ &.mu-previous {
180
+ top: - $diameter / 2 - $border-width / 2;
181
+ left: - $diameter / 2 - $border-width / 2;
182
+ }
183
+ }
184
+
185
+ $mu-statuses-colors: (
186
+ 'broken': $mu-color-broken,
187
+ 'danger': $mu-color-danger,
188
+ 'success': $mu-color-success,
189
+ 'warning': $mu-color-warning,
190
+ 'passed': $mu-color-success,
191
+ 'passed-with-warnings': $mu-color-warning,
192
+ 'failed': $mu-color-danger,
193
+ 'errored': $mu-color-broken,
194
+ 'aborted': $mu-color-broken,
195
+ 'pending': $mu-color-info
196
+ );
197
+
198
+ @each $class, $color in $mu-statuses-colors {
199
+ &.#{$class} {
200
+ border-color: $color;
201
+ .mu-kindergarten-modal-button {
202
+ background: $color;
203
+ }
204
+ }
205
+ .submission-results {
206
+ width: 100%;
207
+ height: 100%;
208
+ .mu-kids-callout-#{$class},
209
+ p {
210
+ display: none;
211
+ }
212
+ .mu-kids-default-#{$class} {
213
+ width: 100%;
214
+ height: 100%;
215
+ img {
216
+ width: 100%;
217
+ height: 100%;
218
+ object-position: center;
219
+ object-fit: contain;
220
+ }
221
+ }
222
+ }
223
+ }
134
224
  }
135
225
  }
136
226
  }
137
227
 
138
- #kids-results.mu-kids-modal-border {
228
+ #kids-results.mu-kindergarten-context {
139
229
  .modal-body{
140
230
  height: calc(100% - #{$modal-header-height} - #{$modal-footer-height});
141
231
  }
142
232
  }
143
-
144
- #kids-results-aborted.mu-kids-modal-border {
145
- .modal-content.kindergarten {
146
- .modal-body {
147
- height: calc(100% - #{$modal-header-height});
148
- }
149
-
150
- h4.modal-header {
151
- margin: 0;
152
- }
233
+ #kids-results-aborted.mu-kindergarten-context {
234
+ .modal-body{
235
+ height: calc(100% - #{$modal-header-height});
236
+ }
237
+ h4.modal-header {
238
+ margin: 0;
153
239
  }
154
240
  }
155
241
 
@@ -31,37 +31,7 @@
31
31
  }
32
32
  }
33
33
 
34
- .mu-profile-info-left {
35
- display: flex;
36
- flex-direction: column;
37
- align-items: center;
38
- text-align: center;
39
-
40
- .mu-level-progress {
41
- position: relative;
42
- top: -275px;
43
- margin-bottom: -275px;
44
- }
45
- }
46
-
47
- .mu-level {
48
- .mu-level-number {
49
- position: absolute;
50
- margin-top: 11px;
51
- margin-left: -86px;
52
- width: 87px;
53
-
54
- text-align: center;
55
- font-size: 1.5em;
56
- font-weight: bold;
57
- color: white;
58
-
59
- user-select: none;
60
- pointer-events: none;
61
- }
62
- }
63
-
64
- .mu-profile-info-right {
34
+ .mu-profile-info {
65
35
  font-size: 20px;
66
36
  margin-top: 5px;
67
37
  div {
@@ -70,4 +40,6 @@
70
40
  font-style: italic;
71
41
  }
72
42
  }
43
+
44
+
73
45
  }
@@ -5,7 +5,6 @@ module Api
5
5
 
6
6
  def create
7
7
  @course.save!
8
- @course.notify!
9
8
  render json: @course
10
9
  end
11
10
 
@@ -23,4 +22,4 @@ module Api
23
22
  @course.slug
24
23
  end
25
24
  end
26
- end
25
+ end