mumuki-laboratory 5.3.0 → 5.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -1
  3. data/app/assets/javascripts/application/kids.js +47 -17
  4. data/app/assets/stylesheets/application/modules/_kids.scss +20 -0
  5. data/app/assets/stylesheets/application.scss +1 -1
  6. data/app/controllers/invitations_controller.rb +2 -2
  7. data/app/helpers/application_helper.rb +12 -2
  8. data/app/mailers/user_mailer.rb +12 -3
  9. data/app/models/assignment.rb +8 -0
  10. data/app/models/concerns/assistable.rb +17 -0
  11. data/app/models/concerns/with_expectations.rb +1 -5
  12. data/app/models/concerns/with_reminders.rb +53 -9
  13. data/app/models/concerns/with_slug.rb +1 -1
  14. data/app/models/concerns/with_status.rb +1 -1
  15. data/app/models/exercise.rb +2 -2
  16. data/app/models/organization.rb +8 -0
  17. data/app/models/submission/submission.rb +3 -1
  18. data/app/models/user.rb +4 -0
  19. data/app/views/book/show.html.erb +1 -1
  20. data/app/views/exercise_solutions/_expectations.html.erb +7 -0
  21. data/app/views/exercise_solutions/_results.html.erb +6 -3
  22. data/app/views/layouts/_kids.html.erb +3 -3
  23. data/app/views/layouts/application.html.erb +4 -5
  24. data/app/views/user_mailer/no_submissions_reminder.html.erb +349 -0
  25. data/app/views/user_mailer/no_submissions_reminder.text.erb +13 -0
  26. data/db/migrate/20180307150148_add_failed_submissions_count_to_assignments.rb +5 -0
  27. data/db/migrate/20180526141344_add_tips_rules_to_exercise.rb +5 -0
  28. data/lib/mumuki/laboratory/controllers/dynamic_errors.rb +1 -1
  29. data/lib/mumuki/laboratory/controllers/results_rendering.rb +7 -1
  30. data/lib/mumuki/laboratory/locales/en.yml +2 -0
  31. data/lib/mumuki/laboratory/locales/es.yml +2 -0
  32. data/lib/mumuki/laboratory/locales/narrator.en.yml +14 -0
  33. data/lib/mumuki/laboratory/locales/narrator.es.yml +14 -0
  34. data/lib/mumuki/laboratory/locales/narrator.pt.yml +14 -0
  35. data/lib/mumuki/laboratory/seed.rb +9 -29
  36. data/lib/mumuki/laboratory/status/base.rb +3 -1
  37. data/lib/mumuki/laboratory/status/failed.rb +0 -4
  38. data/lib/mumuki/laboratory/status/passed_with_warnings.rb +0 -4
  39. data/lib/mumuki/laboratory/status/unknown.rb +0 -4
  40. data/lib/mumuki/laboratory/version.rb +1 -1
  41. data/lib/mumuki/laboratory.rb +1 -0
  42. data/lib/tasks/users.rake +5 -4
  43. data/spec/dummy/db/schema.rb +3 -1
  44. data/spec/features/profile_flow_spec.rb +1 -1
  45. data/spec/features/progressive_tips_spec.rb +48 -0
  46. data/spec/helpers/application_helper_spec.rb +3 -5
  47. data/spec/helpers/email_helper_spec.rb +0 -2
  48. data/spec/helpers/with_navigation_spec.rb +0 -2
  49. data/spec/mailers/user_mailer_spec.rb +104 -10
  50. data/spec/models/event_generation_spec.rb +3 -0
  51. data/spec/models/exercise_spec.rb +0 -2
  52. data/spec/models/guide_import_spec.rb +7 -0
  53. data/spec/models/organization_spec.rb +0 -1
  54. data/spec/models/playground_spec.rb +0 -2
  55. data/spec/models/user_spec.rb +8 -0
  56. data/spec/spec_helper.rb +2 -0
  57. metadata +29 -4
@@ -0,0 +1,349 @@
1
+ <span class="muMailPreviewText" style="display:none; font-size:0px; line-height:0px; max-height:0px; max-width:0px; opacity:0; overflow:hidden; visibility:hidden; mso-hide:all;"><%= t :dont_leave_us %></span><!--<![endif]-->
2
+ <center>
3
+ <table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
4
+ <tbody><tr>
5
+ <td align="center" valign="top" id="bodyCell">
6
+ <!-- BEGIN TEMPLATE // -->
7
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
8
+ <tbody><tr>
9
+ <td align="center" valign="top" id="templateHeader" data-template-container="">
10
+ <!--[if (gte mso 9)|(IE)]>
11
+ <table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
12
+ <tr>
13
+ <td align="center" valign="top" width="600" style="width:600px;">
14
+ <![endif]-->
15
+ <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="templateContainer">
16
+ <tbody><tr>
17
+ <td valign="top" class="headerContainer"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailTextBlock" style="min-width:100%;">
18
+ <tbody class="muMailTextBlockOuter">
19
+ <tr>
20
+ <td valign="top" class="muMailTextBlockInner" style="padding-top:9px;">
21
+ <!--[if mso]>
22
+ <table align="left" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100%;">
23
+ <tr>
24
+ <![endif]-->
25
+
26
+ <!--[if mso]>
27
+ <td valign="top" width="600" style="width:600px;">
28
+ <![endif]-->
29
+ <table align="left" border="0" cellpadding="0" cellspacing="0" style="max-width:100%; min-width:100%;" width="100%" class="muMailTextContentContainer">
30
+ <tbody><tr>
31
+
32
+ <td valign="top" class="muMailTextContent" style="padding-top:0; padding-right:18px; padding-bottom:9px; padding-left:18px;">
33
+
34
+ <h1><span style="color:#FFFFFF"><%= t :we_miss_you %></span></h1>
35
+
36
+ </td>
37
+ </tr>
38
+ </tbody></table>
39
+ <!--[if mso]>
40
+ </td>
41
+ <![endif]-->
42
+
43
+ <!--[if mso]>
44
+ </tr>
45
+ </table>
46
+ <![endif]-->
47
+ </td>
48
+ </tr>
49
+ </tbody>
50
+ </table></td>
51
+ </tr>
52
+ </tbody></table>
53
+ <!--[if (gte mso 9)|(IE)]>
54
+ </td>
55
+ </tr>
56
+ </table>
57
+ <![endif]-->
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <td align="center" valign="top" id="templateBody" data-template-container="">
62
+ <!--[if (gte mso 9)|(IE)]>
63
+ <table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
64
+ <tr>
65
+ <td align="center" valign="top" width="600" style="width:600px;">
66
+ <![endif]-->
67
+ <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="templateContainer">
68
+ <tbody><tr>
69
+ <td valign="top" class="bodyContainer"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailCaptionBlock">
70
+ <tbody class="muMailCaptionBlockOuter">
71
+ <tr>
72
+ <td class="muMailCaptionBlockInner" valign="top" style="padding:9px;">
73
+
74
+
75
+
76
+
77
+ <table border="0" cellpadding="0" cellspacing="0" class="muMailCaptionRightContentOuter" width="100%">
78
+ <tbody><tr>
79
+ <td valign="top" class="muMailCaptionRightContentInner" style="padding:0 9px ;">
80
+ <table align="left" border="0" cellpadding="0" cellspacing="0" class="muMailCaptionRightImageContentContainer" width="264">
81
+ <tbody><tr>
82
+ <td class="muMailCaptionRightImageContent" align="center" valign="top">
83
+
84
+
85
+
86
+ <img alt="" src="https://gallery.mailchimp.com/046b6c670d9f80ebd6c5d075b/images/225fe60f-780a-451e-90aa-afb01f88a1b4.png" width="159" style="max-width:159px;" class="muMailImage">
87
+
88
+
89
+
90
+ </td>
91
+ </tr>
92
+ </tbody></table>
93
+ <table class="muMailCaptionRightTextContentContainer" align="right" border="0" cellpadding="0" cellspacing="0" width="264">
94
+ <tbody><tr>
95
+ <td valign="top" class="muMailTextContent">
96
+ <h3 class="null" style="text-align: center;"><br>
97
+ <span style="font-size:24px"><%= t :you_never_submitted_solutions %></span></h3>
98
+
99
+ <div style="text-align: center;"><br>
100
+ <span style="font-size:16px"><%= t :dont_leave_us %></span></div>
101
+
102
+ </td>
103
+ </tr>
104
+ </tbody></table>
105
+ </td>
106
+ </tr>
107
+ </tbody></table>
108
+
109
+
110
+
111
+
112
+ </td>
113
+ </tr>
114
+ </tbody>
115
+ </table><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailButtonBlock" style="min-width:100%;">
116
+ <tbody class="muMailButtonBlockOuter">
117
+ <tr>
118
+ <td style="padding-top:0; padding-right:18px; padding-bottom:18px; padding-left:18px;" valign="top" align="center" class="muMailButtonBlockInner">
119
+ <table border="0" cellpadding="0" cellspacing="0" class="muMailButtonContentContainer" style="border-collapse: separate !important;border-radius: 3px;background-color: #FF5B81;">
120
+ <tbody>
121
+ <tr>
122
+ <td align="center" valign="middle" class="muMailButtonContent" style="font-family: Helvetica; font-size: 18px; padding: 18px;">
123
+ <a class="muMailButton " title=<%= t :keep_learning %> href=<%= Mumukit::Platform.laboratory.organic_url @user.last_organization %> target="_self" style="font-weight: bold;letter-spacing: -0.5px;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;"><%= t :keep_learning %></a>
124
+ </td>
125
+ </tr>
126
+ </tbody>
127
+ </table>
128
+ </td>
129
+ </tr>
130
+ </tbody>
131
+ </table></td>
132
+ </tr>
133
+ </tbody></table>
134
+ <!--[if (gte mso 9)|(IE)]>
135
+ </td>
136
+ </tr>
137
+ </table>
138
+ <![endif]-->
139
+ </td>
140
+ </tr>
141
+ <tr>
142
+ <td align="center" valign="top" id="templateFooter" data-template-container="">
143
+ <!--[if (gte mso 9)|(IE)]>
144
+ <table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
145
+ <tr>
146
+ <td align="center" valign="top" width="600" style="width:600px;">
147
+ <![endif]-->
148
+ <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="templateContainer">
149
+ <tbody><tr>
150
+ <td valign="top" class="footerContainer"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailFollowBlock" style="min-width:100%;">
151
+ <tbody class="muMailFollowBlockOuter">
152
+ <tr>
153
+ <td align="center" valign="top" style="padding:9px" class="muMailFollowBlockInner">
154
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailFollowContentContainer" style="min-width:100%;">
155
+ <tbody><tr>
156
+ <td align="center" style="padding-left:9px;padding-right:9px;">
157
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width:100%;" class="muMailFollowContent">
158
+ <tbody><tr>
159
+ <td align="center" valign="top" style="padding-top:9px; padding-right:9px; padding-left:9px;">
160
+ <table align="center" border="0" cellpadding="0" cellspacing="0">
161
+ <tbody><tr>
162
+ <td align="center" valign="top">
163
+ <!--[if mso]>
164
+ <table align="center" border="0" cellspacing="0" cellpadding="0">
165
+ <tr>
166
+ <![endif]-->
167
+
168
+ <!--[if mso]>
169
+ <td align="center" valign="top">
170
+ <![endif]-->
171
+
172
+
173
+ <table align="left" border="0" cellpadding="0" cellspacing="0" style="display:inline;">
174
+ <tbody><tr>
175
+ <td valign="top" style="padding-right:10px; padding-bottom:9px;" class="muMailFollowContentItemContainer">
176
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailFollowContentItem">
177
+ <tbody><tr>
178
+ <td align="left" valign="middle" style="padding-top:5px; padding-right:10px; padding-bottom:5px; padding-left:9px;">
179
+ <table align="left" border="0" cellpadding="0" cellspacing="0" width="">
180
+ <tbody><tr>
181
+
182
+ <td align="center" valign="middle" width="24" class="muMailFollowIconContent">
183
+ <a href="http://www.facebook.com/MumukiProject" target="_blank"><img src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-light-facebook-48.png" style="display:block;" height="24" width="24" class=""></a>
184
+ </td>
185
+
186
+
187
+ </tr>
188
+ </tbody></table>
189
+ </td>
190
+ </tr>
191
+ </tbody></table>
192
+ </td>
193
+ </tr>
194
+ </tbody></table>
195
+
196
+ <!--[if mso]>
197
+ </td>
198
+ <![endif]-->
199
+
200
+ <!--[if mso]>
201
+ <td align="center" valign="top">
202
+ <![endif]-->
203
+
204
+
205
+ <table align="left" border="0" cellpadding="0" cellspacing="0" style="display:inline;">
206
+ <tbody><tr>
207
+ <td valign="top" style="padding-right:10px; padding-bottom:9px;" class="muMailFollowContentItemContainer">
208
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailFollowContentItem">
209
+ <tbody><tr>
210
+ <td align="left" valign="middle" style="padding-top:5px; padding-right:10px; padding-bottom:5px; padding-left:9px;">
211
+ <table align="left" border="0" cellpadding="0" cellspacing="0" width="">
212
+ <tbody><tr>
213
+
214
+ <td align="center" valign="middle" width="24" class="muMailFollowIconContent">
215
+ <a href="http://www.twitter.com/MumukiProject" target="_blank"><img src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-light-twitter-48.png" style="display:block;" height="24" width="24" class=""></a>
216
+ </td>
217
+
218
+
219
+ </tr>
220
+ </tbody></table>
221
+ </td>
222
+ </tr>
223
+ </tbody></table>
224
+ </td>
225
+ </tr>
226
+ </tbody></table>
227
+
228
+ <!--[if mso]>
229
+ </td>
230
+ <![endif]-->
231
+
232
+ <!--[if mso]>
233
+ <td align="center" valign="top">
234
+ <![endif]-->
235
+
236
+
237
+ <table align="left" border="0" cellpadding="0" cellspacing="0" style="display:inline;">
238
+ <tbody><tr>
239
+ <td valign="top" style="padding-right:0; padding-bottom:9px;" class="muMailFollowContentItemContainer">
240
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailFollowContentItem">
241
+ <tbody><tr>
242
+ <td align="left" valign="middle" style="padding-top:5px; padding-right:10px; padding-bottom:5px; padding-left:9px;">
243
+ <table align="left" border="0" cellpadding="0" cellspacing="0" width="">
244
+ <tbody><tr>
245
+
246
+ <td align="center" valign="middle" width="24" class="muMailFollowIconContent">
247
+ <a href="https://www.youtube.com/channel/UCQmkknsaTT2TDLT_-MDSGvQ" target="_blank"><img src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-light-youtube-48.png" style="display:block;" height="24" width="24" class=""></a>
248
+ </td>
249
+
250
+
251
+ </tr>
252
+ </tbody></table>
253
+ </td>
254
+ </tr>
255
+ </tbody></table>
256
+ </td>
257
+ </tr>
258
+ </tbody></table>
259
+
260
+ <!--[if mso]>
261
+ </td>
262
+ <![endif]-->
263
+
264
+ <!--[if mso]>
265
+ </tr>
266
+ </table>
267
+ <![endif]-->
268
+ </td>
269
+ </tr>
270
+ </tbody></table>
271
+ </td>
272
+ </tr>
273
+ </tbody></table>
274
+ </td>
275
+ </tr>
276
+ </tbody></table>
277
+
278
+ </td>
279
+ </tr>
280
+ </tbody>
281
+ </table><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailDividerBlock" style="min-width:100%;">
282
+ <tbody class="muMailDividerBlockOuter">
283
+ <tr>
284
+ <td class="muMailDividerBlockInner" style="min-width:100%; padding:18px;">
285
+ <table class="muMailDividerContent" border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width: 100%;border-top: 2px solid #505050;">
286
+ <tbody><tr>
287
+ <td>
288
+ <span></span>
289
+ </td>
290
+ </tr>
291
+ </tbody></table>
292
+ <!--
293
+ <td class="muMailDividerBlockInner" style="padding: 18px;">
294
+ <hr class="muMailDividerContent" style="border-bottom-color:none; border-left-color:none; border-right-color:none; border-bottom-width:0; border-left-width:0; border-right-width:0; margin-top:0; margin-right:0; margin-bottom:0; margin-left:0;" />
295
+ -->
296
+ </td>
297
+ </tr>
298
+ </tbody>
299
+ </table><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailTextBlock" style="min-width:100%;">
300
+ <tbody class="muMailTextBlockOuter">
301
+ <tr>
302
+ <td valign="top" class="muMailTextBlockInner" style="padding-top:9px;">
303
+ <!--[if mso]>
304
+ <table align="left" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100%;">
305
+ <tr>
306
+ <![endif]-->
307
+
308
+ <!--[if mso]>
309
+ <td valign="top" width="600" style="width:600px;">
310
+ <![endif]-->
311
+ <table align="left" border="0" cellpadding="0" cellspacing="0" style="max-width:100%; min-width:100%;" width="100%" class="muMailTextContentContainer">
312
+ <tbody><tr>
313
+
314
+ <td valign="top" class="muMailTextContent" style="padding-top:0; padding-right:18px; padding-bottom:9px; padding-left:18px;">
315
+
316
+ © Copyright 2015-2018&nbsp;<a href="https://mumuki.org/home/">Mumuki Project</a><em>.</em><br>
317
+ <br>
318
+ <%= t :stop_emails? %><br>
319
+ <%= link_to t(:cancel_subscription), @organization.url_for("/user/unsubscribe?id=#{@unsubscribe_code}"), target: :_blank %>
320
+ </td>
321
+ </tr>
322
+ </tbody></table>
323
+ <!--[if mso]>
324
+ </td>
325
+ <![endif]-->
326
+
327
+ <!--[if mso]>
328
+ </tr>
329
+ </table>
330
+ <![endif]-->
331
+ </td>
332
+ </tr>
333
+ </tbody>
334
+ </table></td>
335
+ </tr>
336
+ </tbody></table>
337
+ <!--[if (gte mso 9)|(IE)]>
338
+ </td>
339
+ </tr>
340
+ </table>
341
+ <![endif]-->
342
+ </td>
343
+ </tr>
344
+ </tbody></table>
345
+ <!-- // END TEMPLATE -->
346
+ </td>
347
+ </tr>
348
+ </tbody></table>
349
+ </center>
@@ -0,0 +1,13 @@
1
+ <%= t :we_miss_you %>
2
+
3
+
4
+ <%= t :you_never_submitted_solutions %>
5
+
6
+ <%= t :dont_leave_us %>
7
+ <%= t :keep_learning %>
8
+
9
+
10
+ © Copyright 2015-2018 Mumuki Project.
11
+
12
+ <%= t :stop_emails? %>
13
+ <%= t :cancel_subscription %>
@@ -0,0 +1,5 @@
1
+ class AddFailedSubmissionsCountToAssignments < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :assignments, :attemps_count, :integer, default: 0
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddTipsRulesToExercise < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :exercises, :assistance_rules, :text
4
+ end
5
+ end
@@ -15,7 +15,7 @@ module Mumuki::Laboratory::Controllers::DynamicErrors
15
15
  end
16
16
 
17
17
  def not_found
18
- render 'errors/not_found', status: 404
18
+ render 'errors/not_found', status: 404, formats: [:html]
19
19
  end
20
20
 
21
21
  def internal_server_error(exception)
@@ -13,7 +13,8 @@ module Mumuki::Laboratory::Controllers::ResultsRendering
13
13
  class_for_progress_list_item: class_for_progress_list_item(@exercise, true),
14
14
  html: render_results_html(assignment),
15
15
  title_html: render_results_title_html(assignment),
16
- button_html: render_results_button_html(assignment))
16
+ button_html: render_results_button_html(assignment),
17
+ expectations_html: render_results_expectations_html(assignment))
17
18
  end
18
19
 
19
20
  def render_results_html(assignment)
@@ -35,6 +36,11 @@ module Mumuki::Laboratory::Controllers::ResultsRendering
35
36
  locals: {assignment: assignment}
36
37
  end
37
38
 
39
+ def render_results_expectations_html(assignment)
40
+ render_to_string partial: 'exercise_solutions/expectations',
41
+ locals: {assignment: assignment}
42
+ end
43
+
38
44
  def guide_finished_by_solution?
39
45
  !@guide_previously_done && @exercise.guide_done_for?(current_user)
40
46
  end
@@ -154,6 +154,7 @@ en:
154
154
  something_went_wrong_explanation: Something is broken in Mumuki.
155
155
  start_lesson: Start this lesson!
156
156
  start_practicing: Start Practicing!
157
+ start_using_mumuki: Start using Mumuki!
157
158
  stats: Some stats
158
159
  status: Status
159
160
  stay_here: I want to stay here
@@ -185,6 +186,7 @@ en:
185
186
  working: "Working"
186
187
  wrong_answer: The answer is wrong
187
188
  you_must_sign_in_before_submitting: You must sign in before submitting your solutions
189
+ you_never_submitted_solutions: It seems that you've never submitted solutions since you created your account.
188
190
  fullscreen: "Fullscreen"
189
191
  get_messages: "View messages"
190
192
  task: Task
@@ -170,6 +170,7 @@ es:
170
170
  something_went_wrong_explanation: Algo no anduvo como se esperaba.
171
171
  start_lesson: ¡Comenzá esta lección!
172
172
  start_practicing: ¡Empezá ahora!
173
+ start_using_mumuki: ¡Empezá a usar Mumuki!
173
174
  stats: Tu Progreso
174
175
  status: Estado
175
176
  stay_here: No, quiero quedarme acá
@@ -203,6 +204,7 @@ es:
203
204
  working: "Procesando"
204
205
  wrong_answer: La respuesta no es correcta
205
206
  you_must_sign_in_before_submitting: Tenés que iniciar sesión antes de empezar a enviar tus soluciones
207
+ you_never_submitted_solutions: Parece que nunca enviaste soluciones desde que creaste tu cuenta.
206
208
  fullscreen: "Pantalla completa"
207
209
  get_messages: "Ver mensajes"
208
210
  task: Consigna
@@ -0,0 +1,14 @@
1
+ en:
2
+ narrator:
3
+ retry_0: Let's try again!
4
+ retry_1: Keep on!
5
+ retry_2: Let's fix it!
6
+ introduction_0: "Oops, it didn't work :frowning:."
7
+ introduction_1: "Oops, it didn't work :frowning:."
8
+ introduction_2: "Oops, it didn't work :frowning:."
9
+ middle_0: Also, %{tip}.
10
+ middle_1: Also, %{tip}.
11
+ middle_2: Also, %{tip}.
12
+ ending_0: Finally, %{tip}.
13
+ ending_1: Finally, %{tip}.
14
+ ending_2: Finally, %{tip}.
@@ -0,0 +1,14 @@
1
+ es:
2
+ narrator:
3
+ retry_0: ¡Intentemos de nuevo!
4
+ retry_1: 'Pero a no desesperar, intentemos otra vez :muscle:'
5
+ retry_2: ¡Corrijamos el problema!
6
+ introduction_0: 'Parece que algo no funcionó :see_no_evil:.'
7
+ introduction_1: 'Eh, ¿qué pasó acá :frowning:?'
8
+ introduction_2: 'Parece que algo no anduvo bien :sweat_smile:'
9
+ middle_0: "Además, %{tip}."
10
+ middle_1: "También %{tip}."
11
+ middle_2: "Por otro lado, %{tip}."
12
+ ending_0: "Por último, %{tip}."
13
+ ending_1: "Ah, algo más: %{tip}."
14
+ ending_2: "Y para cerrar, %{tip}."
@@ -0,0 +1,14 @@
1
+ pt:
2
+ narrator:
3
+ retry_0: Vamos tentar de novo!
4
+ retry_1: 'Mas não se desespere, vamos tentar novamente :muscle:'
5
+ retry_2: Corrigimos o problema!
6
+ introduction_0: 'Parece que algo não funcionou :see_no_evil:.'
7
+ introduction_1: 'Ei, o que aconteceu aqui :frowning:?'
8
+ introduction_2: 'Parece que algo não correu bem :sweat_smile:'
9
+ middle_0: "Além disso, %{tip}."
10
+ middle_1: "Também %{tip}."
11
+ middle_2: "Por outro lado, %{tip}."
12
+ ending_0: "Finalmente, %{tip}."
13
+ ending_1: "Oh, algo mais: %{tip}."
14
+ ending_2: "E para fechar, %{tip}."
@@ -1,35 +1,15 @@
1
1
  require 'mumukit/bridge'
2
2
 
3
3
  module Mumuki::Laboratory::Seed
4
- class << self
5
- def import_content!(resource)
6
- Mumukit::Bridge::Bibliotheca.new(Mumukit::Platform.bibliotheca_api.url).send(resource.to_s.pluralize).each do |r|
7
- slug = r['slug']
8
- clazz = resource.to_s.classify.constantize
9
- puts "Importing #{resource} #{slug}"
10
- begin
11
- item = clazz.import!(slug)
12
- rescue => e
13
- puts "Ignoring #{slug} because of import error #{e}"
14
- end
15
- end
16
- end
17
-
18
- def import_contents!
19
- %w(guide topic book).each { |it| Mumuki::Laboratory::Seed.import_content!(it) }
20
- end
21
-
22
- def import_languages!
23
- Mumukit::Bridge::Thesaurus.new(Mumukit::Platform.config.thesaurus_url).runners.each do |url|
24
- puts "Importing Language #{url}"
25
-
26
- begin
27
- Language.find_or_initialize_by(runner_url: url).import!
28
- rescue => e
29
- puts "Ignoring Language #{url} because of import error #{e}"
30
- end
31
- end
32
- end
4
+ def self.import_contents!
5
+ Mumukit::Platform.bibliotheca_bridge.import_contents! do |resource_type, slug|
6
+ resource_type.classify.constantize.import!(slug)
7
+ end
8
+ end
33
9
 
10
+ def self.import_languages!
11
+ Mumukit::Platform.thesaurus_bridge.import_languages! do |runner_url|
12
+ Language.find_or_initialize_by(runner_url: runner_url).import!
34
13
  end
14
+ end
35
15
  end
@@ -27,8 +27,10 @@ module Mumuki::Laboratory::Status::Base
27
27
  false
28
28
  end
29
29
 
30
+ # False if and only if this status
31
+ # is `Mumuki::Laboratory::Status::Passed`
30
32
  def should_retry?
31
- group.should_retry?
33
+ true
32
34
  end
33
35
 
34
36
  def iconize
@@ -5,10 +5,6 @@ module Mumuki::Laboratory::Status::Failed
5
5
  true
6
6
  end
7
7
 
8
- def self.should_retry?
9
- true
10
- end
11
-
12
8
  def self.iconize
13
9
  {class: :danger, type: 'times-circle'}
14
10
  end
@@ -5,10 +5,6 @@ module Mumuki::Laboratory::Status::PassedWithWarnings
5
5
  true
6
6
  end
7
7
 
8
- def self.should_retry?
9
- true
10
- end
11
-
12
8
  def self.iconize
13
9
  {class: :warning, type: 'exclamation-circle'}
14
10
  end
@@ -8,8 +8,4 @@ module Mumuki::Laboratory::Status::Unknown
8
8
  def self.iconize
9
9
  {class: :muted, type: :circle}
10
10
  end
11
-
12
- def self.should_retry?
13
- false
14
- end
15
11
  end
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '5.3.0'
3
+ VERSION = '5.4.0'
4
4
  end
5
5
  end
@@ -9,6 +9,7 @@ module Mumuki
9
9
  end
10
10
  end
11
11
 
12
+ require 'mumukit/assistant'
12
13
  require 'mumukit/inspection'
13
14
  require 'mumukit/bridge'
14
15
  require 'mumukit/content_type'
data/lib/tasks/users.rake CHANGED
@@ -1,9 +1,10 @@
1
1
  namespace :users do
2
2
 
3
3
  task notify_reminder: :environment do
4
- if ApplicationMailer.environment_variables_set?
5
- User.where.not(last_submission_date: nil, accepts_reminders: false).each { |user| user.remind! }
6
- end
7
- end
4
+ BATCH_SIZE = ENV['MUMUKI_JOB_BATCH_SIZE']&.to_i || 1000
8
5
 
6
+ User.remindable.find_each(batch_size: BATCH_SIZE) do |user|
7
+ user.try_remind_with_lock!
8
+ end if ApplicationMailer.environment_variables_set?
9
+ end
9
10
  end
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20180402015405) do
13
+ ActiveRecord::Schema.define(version: 20180526141344) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "plpgsql"
@@ -40,6 +40,7 @@ ActiveRecord::Schema.define(version: 20180402015405) do
40
40
  t.string "queries", default: [], array: true
41
41
  t.text "query_results"
42
42
  t.text "manual_evaluation_comment"
43
+ t.integer "attemps_count", default: 0
43
44
  t.index ["exercise_id"], name: "index_assignments_on_exercise_id"
44
45
  t.index ["submission_id"], name: "index_assignments_on_submission_id"
45
46
  t.index ["submitter_id"], name: "index_assignments_on_submitter_id"
@@ -136,6 +137,7 @@ ActiveRecord::Schema.define(version: 20180402015405) do
136
137
  t.text "goal"
137
138
  t.string "initial_state"
138
139
  t.string "final_state"
140
+ t.text "assistance_rules"
139
141
  t.index ["guide_id"], name: "index_exercises_on_guide_id"
140
142
  t.index ["language_id"], name: "index_exercises_on_language_id"
141
143
  end