mumuki-laboratory 7.6.1 → 7.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +193 -2
- data/Rakefile +3 -0
- data/app/assets/javascripts/mumuki_laboratory/application.js +0 -1
- data/app/assets/javascripts/mumuki_laboratory/application/assets-loader.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/bridge.js +36 -10
- data/app/assets/javascripts/mumuki_laboratory/application/button.js +90 -1
- data/app/assets/javascripts/mumuki_laboratory/application/codemirror.js +1 -0
- data/app/assets/javascripts/mumuki_laboratory/application/custom-editor.js +46 -4
- data/app/assets/javascripts/mumuki_laboratory/application/discussions.js +14 -13
- data/app/assets/javascripts/mumuki_laboratory/application/kids.js +73 -36
- data/app/assets/javascripts/mumuki_laboratory/application/progress.js +3 -0
- data/app/assets/javascripts/mumuki_laboratory/application/results-renderer.js +51 -0
- data/app/assets/javascripts/mumuki_laboratory/application/submission.js +184 -35
- data/app/assets/stylesheets/mumuki_laboratory/application/_modules.scss +1 -0
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_discussion.scss +43 -5
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids.scss +3 -3
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kindergarten.scss +55 -0
- data/app/controllers/assets_controller.rb +2 -0
- data/app/controllers/concerns/with_authorization.rb +4 -0
- data/app/controllers/concerns/with_user_discussion_validation.rb +14 -0
- data/app/controllers/discussions_controller.rb +6 -14
- data/app/controllers/discussions_messages_controller.rb +10 -1
- data/app/controllers/exercise_solutions_controller.rb +4 -2
- data/app/helpers/application_helper.rb +9 -5
- data/app/helpers/discussions_helper.rb +37 -23
- data/app/helpers/exercise_input_helper.rb +1 -1
- data/app/helpers/icons_helper.rb +3 -3
- data/app/views/book_discussions/index.html.erb +3 -3
- data/app/views/discussions/_message.html.erb +20 -8
- data/app/views/discussions/index.html.erb +0 -1
- data/app/views/discussions/new.html.erb +33 -0
- data/app/views/discussions/show.html.erb +18 -46
- data/app/views/exercise_solutions/_contextualization_results_container.html.erb +1 -1
- data/app/views/exercise_solutions/_results_title.html.erb +2 -2
- data/app/views/exercises/_read_only.html.erb +33 -6
- data/app/views/layouts/_copyright.html.erb +1 -1
- data/app/views/layouts/_discussions.html.erb +21 -3
- data/app/views/layouts/_social_media.html.erb +3 -3
- data/app/views/layouts/_test_results.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/editors/_custom.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/forms/_kids_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/forms/_problem_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/layouts/_input_bottom.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/layouts/_input_kindergarten.html.erb +40 -0
- data/app/views/layouts/exercise_inputs/layouts/{_input_kids.html.erb → _input_primary.html.erb} +1 -1
- data/app/views/layouts/exercise_inputs/layouts/_input_right.html.erb +1 -1
- data/app/views/layouts/modals/_kids_context.html.erb +1 -8
- data/app/views/user_mailer/1st_reminder.html.erb +3 -3
- data/app/views/user_mailer/1st_reminder.text.erb +1 -1
- data/app/views/user_mailer/2nd_reminder.html.erb +3 -3
- data/app/views/user_mailer/2nd_reminder.text.erb +1 -1
- data/app/views/user_mailer/3rd_reminder.html.erb +3 -3
- data/app/views/user_mailer/3rd_reminder.text.erb +1 -1
- data/app/views/user_mailer/no_submissions_reminder.html.erb +3 -3
- data/app/views/user_mailer/no_submissions_reminder.text.erb +1 -1
- data/config/routes.rb +2 -1
- data/lib/mumuki/laboratory/controllers/results_rendering.rb +1 -2
- data/lib/mumuki/laboratory/locales/en.yml +8 -2
- data/lib/mumuki/laboratory/locales/es.yml +7 -1
- data/lib/mumuki/laboratory/locales/pt.yml +8 -4
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/controllers/confirmations_controller_spec.rb +1 -1
- data/spec/controllers/discussions_messages_controller_spec.rb +73 -0
- data/spec/controllers/exercise_solutions_controller_spec.rb +41 -6
- data/spec/dummy/db/schema.rb +12 -1
- data/spec/features/discussion_flow_spec.rb +190 -0
- data/spec/features/exercise_flow_spec.rb +1 -1
- data/spec/features/menu_bar_spec.rb +88 -7
- data/spec/helpers/breadcrumbs_helper_spec.rb +1 -1
- data/spec/javascripts/bridge-spec.js +5 -0
- data/spec/javascripts/csrf-token-spec.js +7 -0
- data/spec/javascripts/elipsis-spec.js +25 -0
- data/spec/javascripts/results-renderers-spec.js +17 -0
- data/spec/javascripts/spec-helper.js +30 -0
- data/spec/javascripts/speech-bubble-renderer-spec.js +11 -0
- data/spec/javascripts/timeout-spec.js +5 -0
- data/spec/javascripts/timer-spec.js +5 -0
- data/spec/teaspoon_env.rb +187 -0
- metadata +33 -9
- data/app/views/layouts/modals/_new_discussion.html.erb +0 -27
- data/vendor/assets/javascripts/hotjar.js +0 -8
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="modal fade mu-kids-context" id="kids-context" tabindex="-1" role="dialog" aria-hidden="true">
|
1
|
+
<div class="modal fade mu-kids-context" id="mu-kids-context" tabindex="-1" role="dialog" aria-hidden="true">
|
2
2
|
<div class="modal-dialog">
|
3
3
|
<div class="modal-content">
|
4
4
|
<div class="modal-header">
|
@@ -24,10 +24,3 @@
|
|
24
24
|
</div>
|
25
25
|
</div>
|
26
26
|
</div>
|
27
|
-
|
28
|
-
<script>
|
29
|
-
$('#kids-context').modal({
|
30
|
-
backdrop: 'static',
|
31
|
-
keyboard: false
|
32
|
-
});
|
33
|
-
</script>
|
@@ -180,7 +180,7 @@
|
|
180
180
|
<tbody><tr>
|
181
181
|
|
182
182
|
<td align="center" valign="middle" width="24" class="muMailFollowIconContent">
|
183
|
-
<a href="http://www.facebook.com/
|
183
|
+
<a href="http://www.facebook.com/MumukiOrg" 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
184
|
</td>
|
185
185
|
|
186
186
|
|
@@ -212,7 +212,7 @@
|
|
212
212
|
<tbody><tr>
|
213
213
|
|
214
214
|
<td align="center" valign="middle" width="24" class="muMailFollowIconContent">
|
215
|
-
<a href="http://www.twitter.com/
|
215
|
+
<a href="http://www.twitter.com/MumukiOrg" 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
216
|
</td>
|
217
217
|
|
218
218
|
|
@@ -313,7 +313,7 @@
|
|
313
313
|
|
314
314
|
<td valign="top" class="muMailTextContent" style="padding-top:0; padding-right:18px; padding-bottom:9px; padding-left:18px;">
|
315
315
|
|
316
|
-
© Copyright 2015-<%= DateTime.now.year %> <a href="https://mumuki.org/home/">Mumuki
|
316
|
+
© Copyright 2015-<%= DateTime.now.year %> <a href="https://mumuki.org/home/">Mumuki</a><em>.</em><br>
|
317
317
|
<br>
|
318
318
|
<%= t :stop_emails? %><br>
|
319
319
|
<%= link_to t(:cancel_subscription), @organization.url_for("/user/unsubscribe?id=#{@unsubscribe_code}"), target: :_blank %>
|
@@ -180,7 +180,7 @@
|
|
180
180
|
<tbody><tr>
|
181
181
|
|
182
182
|
<td align="center" valign="middle" width="24" class="muMailFollowIconContent">
|
183
|
-
<a href="http://www.facebook.com/
|
183
|
+
<a href="http://www.facebook.com/MumukiOrg" 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
184
|
</td>
|
185
185
|
|
186
186
|
|
@@ -212,7 +212,7 @@
|
|
212
212
|
<tbody><tr>
|
213
213
|
|
214
214
|
<td align="center" valign="middle" width="24" class="muMailFollowIconContent">
|
215
|
-
<a href="http://www.twitter.com/
|
215
|
+
<a href="http://www.twitter.com/MumukiOrg" 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
216
|
</td>
|
217
217
|
|
218
218
|
|
@@ -313,7 +313,7 @@
|
|
313
313
|
|
314
314
|
<td valign="top" class="muMailTextContent" style="padding-top:0; padding-right:18px; padding-bottom:9px; padding-left:18px;">
|
315
315
|
|
316
|
-
© Copyright 2015-<%= DateTime.now.year %> <a href="https://mumuki.org/home/">Mumuki
|
316
|
+
© Copyright 2015-<%= DateTime.now.year %> <a href="https://mumuki.org/home/">Mumuki</a><em>.</em><br>
|
317
317
|
<br>
|
318
318
|
<%= t :stop_emails? %><br>
|
319
319
|
<%= link_to t(:cancel_subscription), @organization.url_for("/user/unsubscribe?id=#{@unsubscribe_code}"), target: :_blank %>
|
@@ -180,7 +180,7 @@
|
|
180
180
|
<tbody><tr>
|
181
181
|
|
182
182
|
<td align="center" valign="middle" width="24" class="muMailFollowIconContent">
|
183
|
-
<a href="http://www.facebook.com/
|
183
|
+
<a href="http://www.facebook.com/MumukiOrg" 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
184
|
</td>
|
185
185
|
|
186
186
|
|
@@ -212,7 +212,7 @@
|
|
212
212
|
<tbody><tr>
|
213
213
|
|
214
214
|
<td align="center" valign="middle" width="24" class="muMailFollowIconContent">
|
215
|
-
<a href="http://www.twitter.com/
|
215
|
+
<a href="http://www.twitter.com/MumukiOrg" 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
216
|
</td>
|
217
217
|
|
218
218
|
|
@@ -313,7 +313,7 @@
|
|
313
313
|
|
314
314
|
<td valign="top" class="muMailTextContent" style="padding-top:0; padding-right:18px; padding-bottom:9px; padding-left:18px;">
|
315
315
|
|
316
|
-
© Copyright 2015-<%= DateTime.now.year %> <a href="https://mumuki.org/home/">Mumuki
|
316
|
+
© Copyright 2015-<%= DateTime.now.year %> <a href="https://mumuki.org/home/">Mumuki</a><em>.</em><br>
|
317
317
|
<br>
|
318
318
|
<%= t :stop_emails? %><br>
|
319
319
|
<%= link_to t(:cancel_subscription), @organization.url_for("/user/unsubscribe?id=#{@unsubscribe_code}"), target: :_blank %>
|
@@ -180,7 +180,7 @@
|
|
180
180
|
<tbody><tr>
|
181
181
|
|
182
182
|
<td align="center" valign="middle" width="24" class="muMailFollowIconContent">
|
183
|
-
<a href="http://www.facebook.com/
|
183
|
+
<a href="http://www.facebook.com/MumukiOrg" 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
184
|
</td>
|
185
185
|
|
186
186
|
|
@@ -212,7 +212,7 @@
|
|
212
212
|
<tbody><tr>
|
213
213
|
|
214
214
|
<td align="center" valign="middle" width="24" class="muMailFollowIconContent">
|
215
|
-
<a href="http://www.twitter.com/
|
215
|
+
<a href="http://www.twitter.com/MumukiOrg" 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
216
|
</td>
|
217
217
|
|
218
218
|
|
@@ -313,7 +313,7 @@
|
|
313
313
|
|
314
314
|
<td valign="top" class="muMailTextContent" style="padding-top:0; padding-right:18px; padding-bottom:9px; padding-left:18px;">
|
315
315
|
|
316
|
-
© Copyright 2015-<%= DateTime.now.year %> <a href="https://mumuki.org/home/">Mumuki
|
316
|
+
© Copyright 2015-<%= DateTime.now.year %> <a href="https://mumuki.org/home/">Mumuki</a><em>.</em><br>
|
317
317
|
<br>
|
318
318
|
<%= t :stop_emails? %><br>
|
319
319
|
<%= link_to t(:cancel_subscription), @organization.url_for("/user/unsubscribe?id=#{@unsubscribe_code}"), target: :_blank %>
|
data/config/routes.rb
CHANGED
@@ -6,7 +6,7 @@ Rails.application.routes.draw do
|
|
6
6
|
root to: 'book#show'
|
7
7
|
|
8
8
|
concern :debatable do |options|
|
9
|
-
resources :discussions, options.merge(only: [:index, :show, :create, :update, :destroy]) do
|
9
|
+
resources :discussions, options.merge(only: [:index, :new, :show, :create, :update, :destroy]) do
|
10
10
|
post :subscription, on: :member
|
11
11
|
post :upvote, on: :member
|
12
12
|
end
|
@@ -17,6 +17,7 @@ Rails.application.routes.draw do
|
|
17
17
|
resources :discussions, only: [] do
|
18
18
|
resources :messages, only: [:create, :destroy], controller: 'discussions_messages' do
|
19
19
|
post :approve, on: :member
|
20
|
+
post :question, on: :member
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
@@ -33,8 +33,7 @@ module Mumuki::Laboratory::Controllers::ResultsRendering
|
|
33
33
|
|
34
34
|
def progress_json
|
35
35
|
{
|
36
|
-
guide_finished_by_solution: guide_finished_by_solution
|
37
|
-
class_for_progress_list_item: class_for_progress_list_item(@exercise, true)
|
36
|
+
guide_finished_by_solution: guide_finished_by_solution?
|
38
37
|
}
|
39
38
|
end
|
40
39
|
|
@@ -10,6 +10,7 @@ en:
|
|
10
10
|
all: All
|
11
11
|
appendix: "Appendix"
|
12
12
|
appendix_teaser: Do you want to learn more? <a href="%{link}">Check this chapter's appendix</a>"
|
13
|
+
approved_message: Validated by mentor
|
13
14
|
are_you_sure: 'Are you sure you want to %{action}?'
|
14
15
|
ask_a_question: Ask a question!
|
15
16
|
ask_community: Ask community for help
|
@@ -58,6 +59,7 @@ en:
|
|
58
59
|
destroy: Destroy
|
59
60
|
disabled_explanation: You are trying to visit a permamently disabled or deleted resource
|
60
61
|
disabled_organization_explanation: This path has already finished.
|
62
|
+
discussion_description_placeholder: You can add more information regarding your doubt.
|
61
63
|
discussion_updated: Discussion updated
|
62
64
|
discussions: Discussions
|
63
65
|
dont_leave_us: Don't leave us! Learning is fun. You just have to keep at it.
|
@@ -113,6 +115,7 @@ en:
|
|
113
115
|
kids_default_success: You did it great!
|
114
116
|
language: Language
|
115
117
|
last_name: Last Name
|
118
|
+
last_seen: "Seen by %{name}"
|
116
119
|
last_submission_date: Last submission
|
117
120
|
latest_exercises: Latest exercises
|
118
121
|
learning: Learning
|
@@ -132,7 +135,7 @@ en:
|
|
132
135
|
messages: Messages
|
133
136
|
messages_error: Previous messages are unavailable. Please try again later.
|
134
137
|
more_messages: More
|
135
|
-
moderator:
|
138
|
+
moderator: Mentor
|
136
139
|
mumuki_catchphrase: Improve your programming skills
|
137
140
|
mumuki_short_description: Mumuki is a simple, open and collaborative platform for sharing and solving programming exercises. It is aimed to help people with learning and teaching programing languages and paradigms
|
138
141
|
my_doubts: My doubts
|
@@ -154,7 +157,7 @@ en:
|
|
154
157
|
no_messages: It seems you don't have any messages yet!
|
155
158
|
no_questions: It seems there isn't any question yet.
|
156
159
|
no_submissions: It seems like you haven't tried to solve this exercise
|
157
|
-
no_useful_result:
|
160
|
+
no_useful_result: Didn't find what you were looking for?
|
158
161
|
not_found_explanation: 'You may have mistyped the address or the page may have moved.'
|
159
162
|
not_in_any_organizations: It seems you aren't in any organizations yet!
|
160
163
|
notify_problem_with_exercise: Report a bug
|
@@ -184,7 +187,10 @@ en:
|
|
184
187
|
progress: Progresss
|
185
188
|
read: Read
|
186
189
|
refresh_or_wait: Please press F5 if results are not displayed after a few seconds
|
190
|
+
requires_attention: Requires attention
|
187
191
|
reset_query: Clear current search filters
|
192
|
+
responses_count_asc: By less validated replies
|
193
|
+
responses_count_desc: By more validated replies
|
188
194
|
restart: Restart
|
189
195
|
results: Results
|
190
196
|
results_hidden: Your solution was submitted successfully!
|
@@ -11,6 +11,7 @@ es:
|
|
11
11
|
and: y
|
12
12
|
appendix: "Apéndice"
|
13
13
|
appendix_teaser: ¿Querés saber más? <a href="%{link}">Consultá el apéndice de este capítulo</a>
|
14
|
+
approved_message: Validado por mentor
|
14
15
|
are_you_sure: '¿Estás seguro que querés %{action}?'
|
15
16
|
ask_a_question: ¡Hacé una pregunta!
|
16
17
|
ask_community: Preguntá a la comunidad
|
@@ -65,6 +66,7 @@ es:
|
|
65
66
|
details: Detalles
|
66
67
|
disabled_explanation: Estás intentando acceder a un recurso que fue deshabilitado o eliminado de forma permamente
|
67
68
|
disabled_organization_explanation: ¡Este recorrido ha finalizado!
|
69
|
+
discussion_description_placeholder: Podés agregar información para detallar más tu consulta
|
68
70
|
discussion_updated: Consulta actualizada
|
69
71
|
discussions: Consultas
|
70
72
|
dont_leave_us: ¡No nos abandones! Aprender a programar es divertido. Sólo tenés que seguir practicando.
|
@@ -123,6 +125,7 @@ es:
|
|
123
125
|
language: Lenguaje
|
124
126
|
languages: Lenguajes
|
125
127
|
last_name: Apellido
|
128
|
+
last_seen: "Visto por %{name}"
|
126
129
|
last_submission_date: Última solución
|
127
130
|
latest_exercises: Últimos ejercicios
|
128
131
|
learning: Aprendizaje
|
@@ -144,7 +147,7 @@ es:
|
|
144
147
|
minute: minuto
|
145
148
|
minutes: minutos
|
146
149
|
more_messages: Ver mensajes anteriores
|
147
|
-
moderator:
|
150
|
+
moderator: Mentor
|
148
151
|
mumuki_catchphrase: Aprendé a programar
|
149
152
|
mumuki_short_description: Mumuki es la plataforma libre y gratuita para aprender a programar, de la práctica a la teoría y en tu idioma
|
150
153
|
my_doubts: Mis consultas
|
@@ -202,7 +205,10 @@ es:
|
|
202
205
|
read: Leido
|
203
206
|
read_messages: Ver mensajes
|
204
207
|
refresh_or_wait: Si no se muestra automáticamente en unos segundos, presioná F5
|
208
|
+
requires_attention: Requiere atención
|
205
209
|
reset_query: Borrar los filtros de búsqueda actuales
|
210
|
+
responses_count_asc: Con menos respuestas validadas
|
211
|
+
responses_count_desc: Con más respuestas validadas
|
206
212
|
restart: Reiniciar
|
207
213
|
results_hidden: ¡Tu solución fue enviada con éxito!
|
208
214
|
results: Resultados
|
@@ -11,6 +11,7 @@ pt:
|
|
11
11
|
and: e
|
12
12
|
appendix: Apêndice
|
13
13
|
appendix_teaser: Você quer saber mais? <a href="%{link}"> Consulte o apêndice deste capítulo </a>
|
14
|
+
approved_message: Validado pelo mentor
|
14
15
|
are_you_sure: 'Tem certeza de que deseja %{action}?'
|
15
16
|
ask_a_question: Faça uma pergunta!
|
16
17
|
ask_community: Pergunte à comunidade
|
@@ -62,6 +63,7 @@ pt:
|
|
62
63
|
details: Detalhes
|
63
64
|
disabled_explanation: Você está tentando acessar um recurso que foi desativado ou removido permanentemente
|
64
65
|
disabled_organization_explanation: Este curso terminou!
|
66
|
+
discussion_description_placeholder: Você pode adicionar mais informações sobre sua dúvida
|
65
67
|
discussion_updated: Consulta actualizada
|
66
68
|
discussions: Consultas
|
67
69
|
download: Faça o download do que você fez
|
@@ -119,6 +121,7 @@ pt:
|
|
119
121
|
language: Linguagem
|
120
122
|
languages: Linguagens
|
121
123
|
last_name: Sobrenome
|
124
|
+
last_seen: "Visto por %{name}"
|
122
125
|
last_submission_date: Última solução
|
123
126
|
latest_exercises: Últimos exercícios
|
124
127
|
learning: Aprendendo
|
@@ -132,15 +135,15 @@ pt:
|
|
132
135
|
male: Masculino
|
133
136
|
manual_evaluation_pending: Obrigado por enviar sua solução! Seus professores irão corrigi-lo em breve
|
134
137
|
message_count:
|
135
|
-
|
136
|
-
|
138
|
+
one: 1 mensagem
|
139
|
+
other: '%{count} mensagens'
|
137
140
|
message: Mensagem
|
138
141
|
messages: Mensagens
|
139
142
|
messages_error: As mensagens acima não estão disponíveis no momento. Eu tentei novamente mais tarde!
|
140
143
|
minute: minuto
|
141
144
|
minutes: minutos
|
142
145
|
more_messages: Ver as mensagens anteriores
|
143
|
-
moderator:
|
146
|
+
moderator: Mentor
|
144
147
|
mumuki_catchphrase: Aprendi a programar
|
145
148
|
mumuki_short_description: Mumuki é a plataforma gratuita e gratuita para aprender a programar, desde a prática até a teoria e no seu idioma
|
146
149
|
my_doubts: Minhas duvidas
|
@@ -162,7 +165,7 @@ pt:
|
|
162
165
|
no_messages: Parece que você ainda não tem uma mensagem!
|
163
166
|
no_questions: Parece que ainda não há dúvida.
|
164
167
|
no_submissions: Parece que você ainda não tentou resolver este exercício!
|
165
|
-
no_useful_result:
|
168
|
+
no_useful_result: Não encontrou o que estava buscando?
|
166
169
|
not_found: A página que você pesquisou não existe!
|
167
170
|
not_found_explanation: Olhe se você escreveu o endereço corretamente. Mas...
|
168
171
|
not_in_any_organizations: Parece que você ainda não está em nenhuma organização!
|
@@ -195,6 +198,7 @@ pt:
|
|
195
198
|
read: Ler
|
196
199
|
read_messages: Ver mensagens
|
197
200
|
refresh_or_wait: Se não mostrar automaticamente em alguns segundos, pressione F5
|
201
|
+
requires_attention: Requer atenção
|
198
202
|
reset_query: Limpar filtros de pesquisa atuais
|
199
203
|
restart: Reiniciar
|
200
204
|
results: Resultados
|
@@ -15,6 +15,6 @@ describe ExerciseConfirmationsController, organization_workspace: :test do
|
|
15
15
|
before { post :create, params: { exercise_id: reading.id } }
|
16
16
|
|
17
17
|
it { expect(response.status).to eq 200 }
|
18
|
-
it { expect(response.body).to json_like(guide_finished_by_solution: true
|
18
|
+
it { expect(response.body).to json_like(guide_finished_by_solution: true) }
|
19
19
|
end
|
20
20
|
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe DiscussionsMessagesController, organization_workspace: :test do
|
4
|
+
let(:student) { create(:user, permissions: {student: 'test/*'}) }
|
5
|
+
let(:moderator) { create(:user, permissions: {moderator: 'test/*', student: 'test/*'}) }
|
6
|
+
|
7
|
+
let(:exercise) { create(:exercise) }
|
8
|
+
let(:discussion) { create(:discussion, item: exercise, organization: Organization.current) }
|
9
|
+
|
10
|
+
before { Organization.current.update! forum_enabled: true }
|
11
|
+
|
12
|
+
describe 'post' do
|
13
|
+
describe 'for student' do
|
14
|
+
before { set_current_user! student }
|
15
|
+
before { allow_any_instance_of(DiscussionsMessagesController).to receive(:message_params).and_return content: 'Need help' }
|
16
|
+
before { post :create, params: {discussion_id: discussion.id} }
|
17
|
+
|
18
|
+
it { expect(response.status).to eq 302 }
|
19
|
+
it { expect(discussion.messages.size).to eq 1 }
|
20
|
+
it { expect(discussion.messages.last.content).to eq 'Need help' }
|
21
|
+
end
|
22
|
+
|
23
|
+
describe 'for moderator' do
|
24
|
+
before { set_current_user! moderator }
|
25
|
+
before { allow_any_instance_of(DiscussionsMessagesController).to receive(:message_params).and_return content: 'Do this!' }
|
26
|
+
before { post :create, params: {discussion_id: discussion.id} }
|
27
|
+
|
28
|
+
it { expect(response.status).to eq 302 }
|
29
|
+
it { expect(discussion.messages.size).to eq 1 }
|
30
|
+
it { expect(discussion.messages.last.content).to eq 'Do this!' }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe 'approve' do
|
35
|
+
let(:message) { create(:message, discussion: discussion, sender: student.uid) }
|
36
|
+
|
37
|
+
describe 'for student' do
|
38
|
+
before { set_current_user! student }
|
39
|
+
before { post :approve, params: {id: message.id, discussion_id: discussion.id} }
|
40
|
+
|
41
|
+
it { expect(response.status).to eq 403 }
|
42
|
+
it { expect(message.reload.approved).to be false }
|
43
|
+
end
|
44
|
+
|
45
|
+
describe 'for student' do
|
46
|
+
before { set_current_user! moderator }
|
47
|
+
before { post :approve, params: {id: message.id, discussion_id: discussion.id} }
|
48
|
+
|
49
|
+
it { expect(response.status).to eq 200 }
|
50
|
+
it { expect(message.reload.approved).to be true }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe 'question' do
|
55
|
+
let(:message) { create(:message, discussion: discussion, sender: student.uid) }
|
56
|
+
|
57
|
+
describe 'for student' do
|
58
|
+
before { set_current_user! student }
|
59
|
+
before { post :question, params: {id: message.id, discussion_id: discussion.id} }
|
60
|
+
|
61
|
+
it { expect(response.status).to eq 403 }
|
62
|
+
it { expect(message.reload.not_actually_a_question).to be false }
|
63
|
+
end
|
64
|
+
|
65
|
+
describe 'for student' do
|
66
|
+
before { set_current_user! moderator }
|
67
|
+
before { post :question, params: {id: message.id, discussion_id: discussion.id} }
|
68
|
+
|
69
|
+
it { expect(response.status).to eq 200 }
|
70
|
+
it { expect(message.reload.not_actually_a_question).to be true }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe ExerciseSolutionsController, organization_workspace: :test do
|
4
4
|
let(:user) { create(:user) }
|
5
5
|
let(:problem) { create(:problem) }
|
6
|
-
let(:kids_problem) { create(:problem, layout: :
|
6
|
+
let(:kids_problem) { create(:problem, layout: :input_primary) }
|
7
7
|
let!(:chapter) {
|
8
8
|
create(:chapter, name: 'Functional Programming', lessons: [
|
9
9
|
create(:lesson, exercises: [problem, kids_problem])
|
@@ -13,21 +13,56 @@ describe ExerciseSolutionsController, organization_workspace: :test do
|
|
13
13
|
before { set_current_user! user }
|
14
14
|
|
15
15
|
def post_problem(problem)
|
16
|
-
post :create, params: { exercise_id: problem.id, solution: { content: '
|
16
|
+
post :create, params: { exercise_id: problem.id, solution: { content: 'the content' } }
|
17
17
|
end
|
18
18
|
|
19
19
|
|
20
|
-
|
20
|
+
context 'when submission contains client_result' do
|
21
|
+
let(:problem) { create(:problem) }
|
22
|
+
let(:assignment) { Assignment.last }
|
23
|
+
|
24
|
+
before { expect_any_instance_of(Language).to receive(:run_tests!).with(bridge_request) }
|
25
|
+
before do
|
26
|
+
post :create, params: {
|
27
|
+
exercise_id: problem.id,
|
28
|
+
solution: { content: 'the content' },
|
29
|
+
client_result: {
|
30
|
+
status: :passed_with_warnings,
|
31
|
+
test_results: [{title: 'everything works', status: 'passed'}]
|
32
|
+
}
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
let(:bridge_request) do
|
37
|
+
{
|
38
|
+
content: 'the content',
|
39
|
+
custom_expectations: "\n",
|
40
|
+
expectations: [],
|
41
|
+
extra: "",
|
42
|
+
locale: "en",
|
43
|
+
settings: {},
|
44
|
+
test: "dont care",
|
45
|
+
client_result: {
|
46
|
+
status: 'passed_with_warnings',
|
47
|
+
test_results: [{title: 'everything works', status: 'passed'}]
|
48
|
+
}
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
it { expect(assignment.solution).to eq 'the content' }
|
53
|
+
end
|
54
|
+
|
55
|
+
context 'when simple content is sent' do
|
21
56
|
context 'for a non-kids exercise' do
|
22
57
|
before { post_problem(problem) }
|
23
58
|
let(:assignment) { Assignment.last }
|
24
59
|
|
25
60
|
context 'without client-side interpolations' do
|
26
61
|
it { expect(response.status).to eq 200 }
|
27
|
-
it { expect(assignment.solution).to eq('
|
62
|
+
it { expect(assignment.solution).to eq('the content')}
|
28
63
|
|
29
64
|
it { expect(response.body).to json_eq({ status: :failed, guide_finished_by_solution: false },
|
30
|
-
except: [:
|
65
|
+
except: [:html, :remaining_attempts_html]) }
|
31
66
|
|
32
67
|
|
33
68
|
it 'does not include kids specific renders' do
|
@@ -54,7 +89,7 @@ describe ExerciseSolutionsController, organization_workspace: :test do
|
|
54
89
|
before { post_problem(kids_problem) }
|
55
90
|
|
56
91
|
it { expect(response.body).to json_eq({ status: :failed, guide_finished_by_solution: false },
|
57
|
-
except: [:
|
92
|
+
except: [:html, :remaining_attempts_html,
|
58
93
|
:title_html, :button_html, :expectations, :test_results, :tips]) }
|
59
94
|
|
60
95
|
it 'includes kids specific renders' do
|