mumuki-laboratory 7.12.0 → 8.1.1
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/characters.js +3 -1
- data/app/assets/javascripts/mumuki_laboratory/application/gamification.js +89 -11
- data/app/assets/javascripts/mumuki_laboratory/application/kids.js +171 -333
- data/app/assets/javascripts/mumuki_laboratory/application/kindergarten.js +144 -130
- data/app/assets/javascripts/mumuki_laboratory/application/mu-modal-carrousel.js +63 -0
- data/app/assets/javascripts/mumuki_laboratory/application/number-counter.js +18 -0
- data/app/assets/javascripts/mumuki_laboratory/application/primary.js +258 -0
- data/app/assets/javascripts/mumuki_laboratory/application/submission.js +1 -1
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids_results.scss +117 -0
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kindergarten.scss +47 -113
- 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/api/courses_controller.rb +1 -2
- data/app/controllers/api/organizations_controller.rb +2 -3
- data/app/controllers/api/users_controller.rb +2 -4
- 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/discussions_controller.rb +4 -0
- data/app/controllers/exercises_controller.rb +1 -0
- data/app/controllers/guides_controller.rb +2 -0
- data/app/controllers/invitations_controller.rb +2 -2
- 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/assistance_box_helper.rb +7 -5
- data/app/helpers/contextualization_result_helper.rb +9 -1
- data/app/helpers/gamification_helper.rb +5 -0
- data/app/helpers/links_helper.rb +1 -1
- 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/_kids_results.html.erb +1 -1
- 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/show.html.erb +4 -1
- data/app/views/layouts/_kindergarten.html.erb +4 -4
- data/app/views/layouts/_organizations_listing.html.erb +8 -12
- data/app/views/layouts/application.html.erb +8 -2
- data/app/views/layouts/modals/_guide_corollary.html.erb +1 -1
- 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 +10 -7
- data/app/views/layouts/modals/_level_up.html.erb +27 -0
- data/app/views/users/_edit_user_form.html.erb +1 -1
- 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/events/events.rb +0 -33
- data/lib/mumuki/laboratory/locales/en.yml +11 -0
- data/lib/mumuki/laboratory/locales/es-CL.yml +5 -0
- data/lib/mumuki/laboratory/locales/es.yml +12 -1
- data/lib/mumuki/laboratory/locales/pt.yml +11 -0
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/capybara_helper.rb +5 -1
- data/spec/controllers/exercise_solutions_controller_spec.rb +1 -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 +155 -0
- metadata +108 -98
- data/app/helpers/organization_list_helper.rb +0 -5
- data/spec/features/choose_organization_spec.rb +0 -74
@@ -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.
|
29
|
+
mumuki.gamification.currentLevelProgression.setExpMessage(data);
|
30
30
|
}
|
31
31
|
error(submitButton) {
|
32
32
|
this.submissionsResultsArea.html('');
|
@@ -1,3 +1,14 @@
|
|
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
|
+
|
1
12
|
@each $class in success, warning, danger, broken {
|
2
13
|
.mu-kids-callout-#{$class} {
|
3
14
|
h4 {
|
@@ -47,3 +58,109 @@ $capital-animation-width: 135px;
|
|
47
58
|
}
|
48
59
|
}
|
49
60
|
|
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
|
+
}
|
@@ -14,15 +14,6 @@ $modal-footer-height: 95px;
|
|
14
14
|
height: calc(100% - #{$kids-characters-height} - 15px);
|
15
15
|
width: 100%;
|
16
16
|
|
17
|
-
.konvajs-content {
|
18
|
-
width: unset !important;
|
19
|
-
height: unset !important;
|
20
|
-
canvas {
|
21
|
-
width: unset !important;
|
22
|
-
height: unset !important;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
17
|
.mu-kids-single-state,
|
27
18
|
.mu-kids-blocks {
|
28
19
|
width: 50%;
|
@@ -30,7 +21,7 @@ $modal-footer-height: 95px;
|
|
30
21
|
}
|
31
22
|
|
32
23
|
.mu-kids-blocks {
|
33
|
-
|
24
|
+
margin-right: 15px;
|
34
25
|
}
|
35
26
|
|
36
27
|
&.mu-full-workspace {
|
@@ -78,7 +69,7 @@ $modal-footer-height: 95px;
|
|
78
69
|
padding: 30px;
|
79
70
|
img {
|
80
71
|
padding: 0;
|
81
|
-
border:
|
72
|
+
border: 3px solid black;
|
82
73
|
border-radius: 30px;
|
83
74
|
}
|
84
75
|
}
|
@@ -96,126 +87,69 @@ $modal-footer-height: 95px;
|
|
96
87
|
}
|
97
88
|
}
|
98
89
|
|
99
|
-
.
|
90
|
+
.modal-content.kindergarten {
|
91
|
+
$width-lg: 800px;
|
92
|
+
$height-lg: $width-lg * 0.625;
|
100
93
|
|
101
|
-
|
94
|
+
width: $width-lg;
|
95
|
+
height: $height-lg;
|
102
96
|
|
103
|
-
|
104
|
-
width: 100vw;
|
105
|
-
margin: 0;
|
97
|
+
top: calc(50vh - #{$height-lg} / 2);
|
106
98
|
|
107
|
-
|
108
|
-
|
99
|
+
@media (orientation: landscape) and (max-height: $height-lg + 50px) {
|
100
|
+
$height-sm: 85vh;
|
101
|
+
$width-sm: $height-sm / 0.625;
|
109
102
|
|
110
|
-
|
111
|
-
|
103
|
+
width: $width-sm;
|
104
|
+
height: $height-sm;
|
112
105
|
|
113
|
-
|
114
|
-
|
106
|
+
top: calc(50vh - #{$height-sm} / 2);
|
107
|
+
left: calc(50vw - #{$width-sm} / 2);
|
108
|
+
}
|
115
109
|
|
116
|
-
|
117
|
-
|
110
|
+
@media (orientation: portrait) {
|
111
|
+
$height-sm: 85vh;
|
112
|
+
$width-sm: 85vw;
|
118
113
|
|
119
|
-
|
120
|
-
|
121
|
-
border-style: solid;
|
122
|
-
border-color: $mu-color-link;
|
123
|
-
border-radius: $border-width;
|
124
|
-
box-shadow: none;
|
114
|
+
width: $width-sm;
|
115
|
+
height: $height-sm;
|
125
116
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
height: 100%;
|
130
|
-
.mu-kindergarten-context-image-slides {
|
131
|
-
img:not(.active) {
|
132
|
-
display: none;
|
133
|
-
}
|
134
|
-
}
|
135
|
-
img {
|
136
|
-
width: 100%;
|
137
|
-
height: 100%;
|
138
|
-
object-position: center;
|
139
|
-
object-fit: contain;
|
140
|
-
}
|
141
|
-
}
|
142
|
-
}
|
117
|
+
top: calc(50vh - #{$height-sm} / 2);
|
118
|
+
left: calc(50vw - #{$width-sm} / 2);
|
119
|
+
}
|
143
120
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
width: $diameter;
|
150
|
-
color: white;
|
151
|
-
font-weight: bold;
|
152
|
-
border: none;
|
153
|
-
padding: 0;
|
154
|
-
background: $mu-color-link;
|
155
|
-
&.mu-next,
|
156
|
-
&.mu-close {
|
157
|
-
top: - $diameter / 2 - $border-width / 2;
|
158
|
-
right: - $diameter / 2 - $border-width / 2;
|
159
|
-
}
|
160
|
-
&.mu-previous {
|
161
|
-
top: - $diameter / 2 - $border-width / 2;
|
162
|
-
left: - $diameter / 2 - $border-width / 2;
|
163
|
-
}
|
164
|
-
}
|
121
|
+
.modal-header,
|
122
|
+
.modal-footer {
|
123
|
+
text-align: center;
|
124
|
+
text-transform: uppercase;
|
125
|
+
}
|
165
126
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
'failed': $mu-color-danger,
|
174
|
-
'aborted': $mu-color-broken,
|
175
|
-
'pending': $mu-color-info
|
176
|
-
);
|
177
|
-
|
178
|
-
@each $class, $color in $mu-statuses-colors {
|
179
|
-
&.#{$class} {
|
180
|
-
border-color: $color;
|
181
|
-
.mu-kindergarten-modal-button {
|
182
|
-
background: $color;
|
183
|
-
}
|
184
|
-
}
|
185
|
-
.submission-results {
|
186
|
-
width: 100%;
|
187
|
-
height: 100%;
|
188
|
-
.mu-kids-callout-#{$class},
|
189
|
-
p {
|
190
|
-
display: none;
|
191
|
-
}
|
192
|
-
.mu-kids-default-#{$class} {
|
193
|
-
width: 100%;
|
194
|
-
height: 100%;
|
195
|
-
img {
|
196
|
-
width: 100%;
|
197
|
-
height: 100%;
|
198
|
-
object-position: center;
|
199
|
-
object-fit: contain;
|
200
|
-
}
|
201
|
-
}
|
202
|
-
}
|
203
|
-
}
|
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;
|
204
134
|
}
|
205
135
|
}
|
206
136
|
}
|
207
137
|
|
208
|
-
#kids-results.mu-
|
138
|
+
#kids-results.mu-kids-modal-border {
|
209
139
|
.modal-body{
|
210
140
|
height: calc(100% - #{$modal-header-height} - #{$modal-footer-height});
|
211
141
|
}
|
212
142
|
}
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
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
|
+
}
|
219
153
|
}
|
220
154
|
}
|
221
155
|
|
@@ -1,12 +1,3 @@
|
|
1
|
-
summary.terms-summary {
|
2
|
-
font-size: 29px;
|
3
|
-
outline: 0;
|
4
|
-
cursor: pointer;
|
5
|
-
.terms-summary-title {
|
6
|
-
display: inline;
|
7
|
-
}
|
8
|
-
}
|
9
|
-
|
10
1
|
.terms-card {
|
11
2
|
position: relative;
|
12
3
|
display: -ms-flexbox;
|
@@ -38,7 +29,13 @@ summary.terms-summary {
|
|
38
29
|
padding: 1.25rem;
|
39
30
|
}
|
40
31
|
|
41
|
-
.terms-acceptance
|
42
|
-
margin-top:
|
43
|
-
|
32
|
+
.terms-acceptance {
|
33
|
+
margin-top: 30px;
|
34
|
+
|
35
|
+
.terms-acceptance-btn {
|
36
|
+
margin-top: 10px;
|
37
|
+
display: block
|
38
|
+
}
|
44
39
|
}
|
40
|
+
|
41
|
+
|
@@ -31,7 +31,37 @@
|
|
31
31
|
}
|
32
32
|
}
|
33
33
|
|
34
|
-
.mu-profile-info {
|
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 {
|
35
65
|
font-size: 20px;
|
36
66
|
margin-top: 5px;
|
37
67
|
div {
|
@@ -40,6 +70,4 @@
|
|
40
70
|
font-style: italic;
|
41
71
|
}
|
42
72
|
}
|
43
|
-
|
44
|
-
|
45
73
|
}
|
@@ -14,13 +14,12 @@ module Api
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def create
|
17
|
-
@organization.
|
17
|
+
@organization.save!
|
18
18
|
render json: @organization.to_resource_h
|
19
19
|
end
|
20
20
|
|
21
21
|
def update
|
22
|
-
@organization.
|
23
|
-
|
22
|
+
@organization.update! organization_params
|
24
23
|
render json: @organization.to_resource_h
|
25
24
|
end
|
26
25
|
end
|
@@ -4,14 +4,12 @@ module Api
|
|
4
4
|
before_action :authorize_janitor!
|
5
5
|
|
6
6
|
def create
|
7
|
-
@user.
|
8
|
-
@user.notify!
|
7
|
+
@user.save_and_notify!
|
9
8
|
render json: @user.to_resource_h
|
10
9
|
end
|
11
10
|
|
12
11
|
def update
|
13
|
-
@user.
|
14
|
-
@user.notify!
|
12
|
+
@user.update_and_notify! user_params.except([:email, :permissions, :uid])
|
15
13
|
render json: @user.to_resource_h
|
16
14
|
end
|
17
15
|
end
|