mumuki-laboratory 9.0.6 → 9.1.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/discussions.js +10 -10
- data/app/assets/javascripts/mumuki_laboratory/application/gamification.js +3 -3
- data/app/assets/javascripts/mumuki_laboratory/application/kids.js +11 -7
- data/app/assets/javascripts/mumuki_laboratory/application/kindergarten.js +3 -3
- data/app/assets/javascripts/mumuki_laboratory/application/messages.js +3 -3
- data/app/assets/javascripts/mumuki_laboratory/application/mu-modal-carrousel.js +4 -4
- data/app/assets/javascripts/mumuki_laboratory/application/multiple-files.js +12 -6
- data/app/assets/javascripts/mumuki_laboratory/application/multiple-scenarios.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/primary.js +4 -4
- data/app/assets/javascripts/mumuki_laboratory/application/profile.js +0 -6
- data/app/assets/javascripts/mumuki_laboratory/application/progress.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/speech-bubble-renderer.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/submission.js +4 -3
- data/app/assets/javascripts/mumuki_laboratory/application/toast.js +3 -0
- data/app/assets/javascripts/mumuki_laboratory/application/tooltip.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/upload.js +2 -2
- data/app/assets/stylesheets/mumuki_laboratory/application.scss +0 -1
- data/app/assets/stylesheets/mumuki_laboratory/application/_errors.scss +1 -1
- data/app/assets/stylesheets/mumuki_laboratory/application/_layout.scss +1 -27
- data/app/assets/stylesheets/mumuki_laboratory/application/_modules.scss +0 -2
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_activity.scss +7 -5
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_avatar.scss +5 -0
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_breadcrumb.scss +2 -2
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_datepicker.scss +0 -4
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_discussion.scss +38 -60
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_editor.scss +16 -18
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_exercise_assignment.scss +2 -11
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_exercise_results.scss +1 -7
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_faqs.scss +3 -3
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_flash.scss +7 -46
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids.scss +19 -4
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids_results.scss +18 -23
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kindergarten.scss +1 -9
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_overlap.scss +1 -1
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_progress_bar.scss +5 -5
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_timer.scss +1 -3
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_menu.scss +13 -6
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_profile.scss +0 -2
- data/app/controllers/application_controller.rb +4 -2
- data/app/controllers/discussions_messages_controller.rb +3 -1
- data/app/helpers/application_helper.rb +5 -5
- data/app/helpers/assignment_result_helper.rb +3 -2
- data/app/helpers/assistance_box_helper.rb +1 -1
- data/app/helpers/concerns/with_student_path_navigation.rb +8 -3
- data/app/helpers/concerns/with_student_path_navigation/continue_navigation.rb +1 -1
- data/app/helpers/concerns/with_student_path_navigation/finish_navigation.rb +1 -1
- data/app/helpers/concerns/with_student_path_navigation/next_parent_navigation.rb +7 -0
- data/app/helpers/concerns/with_student_path_navigation/revisit_navigation.rb +1 -1
- data/app/helpers/discussions_helper.rb +61 -24
- data/app/helpers/editor_tabs_helper.rb +10 -6
- data/app/helpers/email_helper.rb +2 -2
- data/app/helpers/exercise_input_helper.rb +2 -3
- data/app/helpers/links_helper.rb +12 -9
- data/app/helpers/menu_bar_helper.rb +1 -1
- data/app/helpers/messages_helper.rb +1 -1
- data/app/helpers/overlapped_buttons_helper.rb +22 -12
- data/app/helpers/profile_helper.rb +3 -3
- data/app/helpers/toast_helper.rb +27 -0
- data/app/helpers/user_activity_helper.rb +1 -1
- data/app/views/book/show.html.erb +2 -2
- data/app/views/certificates/verify.html.erb +1 -1
- data/app/views/chapters/show.html.erb +2 -2
- data/app/views/discussions/_message.html.erb +31 -6
- data/app/views/discussions/_new_message.html.erb +4 -4
- data/app/views/discussions/index.html.erb +8 -10
- data/app/views/discussions/new.html.erb +1 -1
- data/app/views/discussions/show.html.erb +20 -12
- data/app/views/exam_registrations/show.html.erb +10 -11
- data/app/views/exercise_solutions/_assistant_rules_box.html.erb +1 -1
- data/app/views/exercise_solutions/_contextualization_results_body.html.erb +1 -1
- data/app/views/exercise_solutions/_contextualization_results_container.html.erb +1 -1
- data/app/views/exercise_solutions/_kids_results_button.html.erb +2 -2
- data/app/views/exercise_solutions/_results.html.erb +1 -1
- data/app/views/exercises/_exercise_assignment.html.erb +2 -2
- data/app/views/exercises/_exercise_skipped.html.erb +1 -1
- data/app/views/exercises/_read_only.html.erb +108 -105
- data/app/views/exercises/show.html.erb +7 -7
- data/app/views/guides/_guide.html.erb +1 -1
- data/app/views/guides/_guide_container.html.erb +4 -4
- data/app/views/invitations/_invitation_form.html.erb +5 -4
- data/app/views/layouts/_authoring.html.erb +1 -1
- data/app/views/layouts/_discussions.html.erb +7 -7
- data/app/views/layouts/_kids.html.erb +5 -5
- data/app/views/layouts/_kindergarten.html.erb +10 -6
- data/app/views/layouts/_main.html.erb +6 -10
- data/app/views/layouts/_organizations_listing.html.erb +2 -2
- data/app/views/layouts/_progress_bar.html.erb +2 -0
- data/app/views/layouts/_submission_result_error.html.erb +1 -1
- data/app/views/layouts/_test_results.html.erb +1 -1
- data/app/views/layouts/_timer.html.erb +1 -1
- data/app/views/layouts/_user_menu.html.erb +3 -3
- data/app/views/layouts/application.html.erb +39 -42
- data/app/views/layouts/exercise_inputs/editors/_code.html.erb +4 -4
- data/app/views/layouts/exercise_inputs/editors/_free_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/editors/_multiple_choice.html.erb +7 -9
- data/app/views/layouts/exercise_inputs/editors/_multiple_files.html.erb +10 -10
- data/app/views/layouts/exercise_inputs/editors/_single_choice.html.erb +6 -8
- data/app/views/layouts/exercise_inputs/editors/_text.html.erb +2 -3
- data/app/views/layouts/exercise_inputs/editors/_upload.html.erb +5 -5
- data/app/views/layouts/exercise_inputs/forms/_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/forms/_interactive_form.html.erb +2 -2
- data/app/views/layouts/exercise_inputs/forms/_kids_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/forms/_playground_form.html.erb +2 -2
- data/app/views/layouts/exercise_inputs/forms/_problem_form.html.erb +13 -9
- data/app/views/layouts/exercise_inputs/layouts/_input_primary.html.erb +2 -2
- data/app/views/layouts/exercise_inputs/layouts/_input_right.html.erb +2 -2
- data/app/views/layouts/exercise_inputs/read_only_editors/_code.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/read_only_editors/_free_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/read_only_editors/_multiple_choice.html.erb +4 -4
- data/app/views/layouts/exercise_inputs/read_only_editors/_multiple_files.html.erb +2 -2
- data/app/views/layouts/exercise_inputs/read_only_editors/_single_choice.html.erb +4 -4
- data/app/views/layouts/exercise_inputs/read_only_editors/_text.erb +1 -1
- data/app/views/layouts/modals/_avatar_picker.html.erb +2 -5
- data/app/views/layouts/modals/_guide_corollary.html.erb +4 -8
- data/app/views/layouts/modals/_kids_context.html.erb +7 -5
- data/app/views/layouts/modals/_kids_results.html.erb +2 -2
- data/app/views/layouts/modals/_kids_results_aborted.html.erb +2 -2
- data/app/views/layouts/modals/_kindergarten_context.html.erb +3 -3
- data/app/views/layouts/modals/_kindergarten_results.html.erb +3 -3
- data/app/views/layouts/modals/_kindergarten_results_aborted.html.erb +2 -2
- data/app/views/layouts/modals/_level_up.html.erb +2 -5
- data/app/views/layouts/modals/_new_message.html.erb +5 -5
- data/app/views/notifications/_dropdown.html.erb +3 -3
- data/app/views/users/_activity_indicator.html.erb +14 -14
- data/app/views/users/_edit_user_form.html.erb +6 -6
- data/app/views/users/_profile_fields.html.erb +6 -6
- data/app/views/users/_user_form.html.erb +2 -2
- data/app/views/users/activity.html.erb +29 -29
- data/app/views/users/certificates.html.erb +26 -24
- data/app/views/users/discussions.html.erb +23 -21
- data/app/views/users/messages.html.erb +22 -20
- data/app/views/users/show.html.erb +5 -3
- data/app/views/users/terms.html.erb +4 -2
- data/lib/mumuki/laboratory.rb +1 -1
- data/lib/mumuki/laboratory/locales/en.yml +15 -1
- data/lib/mumuki/laboratory/locales/es-CL.yml +15 -1
- data/lib/mumuki/laboratory/locales/es.yml +15 -1
- data/lib/mumuki/laboratory/locales/pt.yml +15 -2
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/capybara_helper.rb +1 -0
- data/spec/controllers/discussions_messages_controller_spec.rb +64 -2
- data/spec/dummy/db/schema.rb +4 -0
- data/spec/features/discussion_flow_spec.rb +20 -2
- data/spec/features/exercise_flow_spec.rb +1 -1
- data/spec/features/guide_reset_spec.rb +1 -1
- data/spec/features/terms_flow_spec.rb +1 -2
- data/spec/helpers/breadcrumbs_helper_spec.rb +2 -2
- data/spec/helpers/with_navigation_spec.rb +36 -13
- data/spec/javascripts/editors-spec.js +3 -3
- data/spec/javascripts/kids-button-spec.js +2 -2
- data/spec/javascripts/upload-spec.js +8 -8
- metadata +114 -114
- data/app/assets/stylesheets/mumuki_laboratory/application/hovers.scss +0 -12
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_checkboxes.scss +0 -34
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_guide_corollary.scss +0 -9
@@ -65,6 +65,18 @@ es-CL:
|
|
65
65
|
created_exercises: Ejercicios Creados
|
66
66
|
created_guides: Lecciones Creadas
|
67
67
|
date: Fecha
|
68
|
+
deleted_by: Eliminado por %{deleter}
|
69
|
+
deleted_message_warning: Si infringes reiteradamente estas u otras reglas del Espacio de Consultas, se te puede prohibir el acceso al mismo o podrás sufrir consecuencias más severas, como la expulsión del curso.
|
70
|
+
deletion_motive:
|
71
|
+
inappropriate_content:
|
72
|
+
present: Incluye contenido inapropiado
|
73
|
+
past: Incluía contenido inapropiado
|
74
|
+
shares_solution:
|
75
|
+
present: Comparte la solución correcta
|
76
|
+
past: Compartía la solución correcta
|
77
|
+
discloses_personal_information:
|
78
|
+
present: Divulga información personal
|
79
|
+
past: Divulgaba información personal
|
68
80
|
day: Día
|
69
81
|
days: Días
|
70
82
|
description: Descripción
|
@@ -176,6 +188,7 @@ es-CL:
|
|
176
188
|
one: 1 mensaje
|
177
189
|
other: '%{count} mensajes'
|
178
190
|
message: Mensaje
|
191
|
+
message_deleted: Este mensaje fue eliminado porque %{motive}, lo cual infringe las %{forum_terms}.
|
179
192
|
messages: Mensajes
|
180
193
|
messages_error: Los mensajes anteriores no están disponibles en este momento. ¡Vuelve a intentar más tarde!
|
181
194
|
messages_pluralized:
|
@@ -259,6 +272,7 @@ es-CL:
|
|
259
272
|
send: Enviar
|
260
273
|
sending_solution: Enviando solución
|
261
274
|
show: Mostrar
|
275
|
+
show_message: Mostrar mensaje
|
262
276
|
sign_in: Inicia sesión
|
263
277
|
sign_in_action: iniciar sesión
|
264
278
|
sign_out: Cerrar Sesión
|
@@ -330,7 +344,7 @@ es-CL:
|
|
330
344
|
user: Usuario
|
331
345
|
username: Nombre de usuario
|
332
346
|
view_details: Ver detalles
|
333
|
-
want_permissions: El siguiente usuario requiere permisos
|
347
|
+
want_permissions: El siguiente usuario requiere permisos para la organización
|
334
348
|
we_miss_you: ¡Te extrañamos!
|
335
349
|
week_of: Semana del %{date}
|
336
350
|
will_paginate:
|
@@ -71,6 +71,18 @@ es:
|
|
71
71
|
created_exercises: Ejercicios Creados
|
72
72
|
created_guides: Lecciones Creadas
|
73
73
|
date: Fecha
|
74
|
+
deleted_by: Eliminado por %{deleter}
|
75
|
+
deleted_message_warning: Si infringís reiteradamente estas u otras reglas del Espacio de Consultas, se te puede prohibir el acceso al mismo o podrás sufrir consecuencias más severas, como la expulsión del curso.
|
76
|
+
deletion_motive:
|
77
|
+
inappropriate_content:
|
78
|
+
present: Incluye contenido inapropiado
|
79
|
+
past: Incluía contenido inapropiado
|
80
|
+
shares_solution:
|
81
|
+
present: Comparte la solución correcta
|
82
|
+
past: Compartía la solución correcta
|
83
|
+
discloses_personal_information:
|
84
|
+
present: Divulga información personal
|
85
|
+
past: Divulgaba información personal
|
74
86
|
day: Día
|
75
87
|
days: Días
|
76
88
|
description: Descripción
|
@@ -187,6 +199,7 @@ es:
|
|
187
199
|
one: 1 mensaje
|
188
200
|
other: '%{count} mensajes'
|
189
201
|
message: Mensaje
|
202
|
+
message_deleted: Este mensaje fue eliminado porque %{motive}, lo cual infringe las %{forum_terms}.
|
190
203
|
messages: Mensajes
|
191
204
|
messages_error: Los mensajes anteriores no están disponibles en este momento. ¡Volvé a intentar mas tarde!
|
192
205
|
messages_pluralized:
|
@@ -274,6 +287,7 @@ es:
|
|
274
287
|
send: Enviar
|
275
288
|
sending_solution: Enviando solución
|
276
289
|
show: Mostrar
|
290
|
+
show_message: Mostrar mensaje
|
277
291
|
sign_in: Iniciá sesión
|
278
292
|
sign_in_action: iniciar sesión
|
279
293
|
sign_out: Cerrar Sesión
|
@@ -346,7 +360,7 @@ es:
|
|
346
360
|
user: Usuario
|
347
361
|
username: Nombre de usuario
|
348
362
|
view_details: Ver detalles
|
349
|
-
want_permissions: El siguiente usuario requiere permisos
|
363
|
+
want_permissions: El siguiente usuario requiere permisos para la organización
|
350
364
|
we_miss_you: ¡Te extrañamos!
|
351
365
|
welcome: ¡Te damos la bienvenida a %{name}!
|
352
366
|
week_of: Semana del %{date}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
---
|
2
1
|
pt:
|
3
2
|
aborted: Opa, não pudemos avaliar sua solução
|
4
3
|
abort_explanation_html: <li>Verifique se o seu programa não possui recursão ou um loop infinito</li> <li>Verifique se você tem uma conexão com a internet</li> <li>Espere um pouco e tente novamente</li>
|
@@ -68,6 +67,18 @@ pt:
|
|
68
67
|
created_exercises: Exercícios criados
|
69
68
|
created_guides: Lições criadas
|
70
69
|
date: Data
|
70
|
+
deleted_by: Removido pelo
|
71
|
+
deleted_message_warning: Se você violar repetidamente essas ou outras regras da Área de Consulta, seu acesso a ela pode ser proibido ou você pode sofrer consequências mais graves, como a expulsão do curso.
|
72
|
+
deletion_motive:
|
73
|
+
inappropriate_content:
|
74
|
+
present: Inclui conteúdo impróprio
|
75
|
+
past: Incluiu conteúdo impróprio
|
76
|
+
shares_solution:
|
77
|
+
present: Compartilhe a solução correta
|
78
|
+
past: Compartilhou a solução correta
|
79
|
+
discloses_personal_information:
|
80
|
+
present: Divulga informações pessoais
|
81
|
+
past: Divulgar informações pessoais
|
71
82
|
day: Dia
|
72
83
|
days: Dias
|
73
84
|
description: Descrição
|
@@ -181,6 +192,7 @@ pt:
|
|
181
192
|
one: 1 mensagem
|
182
193
|
other: '%{count} mensagens'
|
183
194
|
message: Mensagem
|
195
|
+
message_deleted: Esta mensagem foi excluída porque %{motive}, o que viola as %{forum_terms}.
|
184
196
|
messages: Mensagens
|
185
197
|
messages_error: As mensagens acima não estão disponíveis no momento. Eu tentei novamente mais tarde!
|
186
198
|
mais tarde!
|
@@ -264,6 +276,7 @@ pt:
|
|
264
276
|
send: Enviar
|
265
277
|
sending_solution: Solução de envio
|
266
278
|
show: Mostrar
|
279
|
+
show_message: Mostrar mensagem
|
267
280
|
sign_in: Iniciar sessão
|
268
281
|
sign_in_action: iniciar sessão
|
269
282
|
sign_out: Fechar Sessão
|
@@ -329,7 +342,7 @@ pt:
|
|
329
342
|
user_data_updated: Os seus dados foram atualizados corretamente
|
330
343
|
username: Nome de usuário
|
331
344
|
view_details: Ver detalhes
|
332
|
-
want_permissions: O próximo usuário requer permissões
|
345
|
+
want_permissions: O próximo usuário requer permissões para a organização
|
333
346
|
week_of: Semana de %{date}
|
334
347
|
welcome: Convidamos você a {name}!
|
335
348
|
working: Processamento
|
data/spec/capybara_helper.rb
CHANGED
@@ -31,6 +31,68 @@ describe DiscussionsMessagesController, type: :controller, organization_workspac
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
describe 'delete' do
|
35
|
+
let(:message) { create(:message, discussion: discussion, sender: student.uid) }
|
36
|
+
|
37
|
+
describe 'for student' do
|
38
|
+
before { set_current_user! student }
|
39
|
+
|
40
|
+
describe 'own message with permitted motive' do
|
41
|
+
before do
|
42
|
+
delete :destroy, params: {id: message.id, discussion_id: discussion.id, motive: :self_deleted}
|
43
|
+
message.reload
|
44
|
+
end
|
45
|
+
|
46
|
+
it { expect(response.status).to eq 302 }
|
47
|
+
it { expect(message.deleted?).to be true }
|
48
|
+
it { expect(message.deleted_by).to eq student }
|
49
|
+
it { expect(message.deleted_at).to_not eq nil }
|
50
|
+
it { expect(message.deletion_motive).to eq 'self_deleted' }
|
51
|
+
end
|
52
|
+
|
53
|
+
describe 'own message with forbidden motive' do
|
54
|
+
before do
|
55
|
+
delete :destroy, params: {id: message.id, discussion_id: discussion.id, motive: :shares_solution}
|
56
|
+
message.reload
|
57
|
+
end
|
58
|
+
|
59
|
+
it { expect(response.status).to eq 403 }
|
60
|
+
it { expect(message.deleted?).to be false }
|
61
|
+
it { expect(message.deleted_by).to eq nil }
|
62
|
+
it { expect(message.deleted_at).to eq nil }
|
63
|
+
it { expect(message.deletion_motive).to eq nil }
|
64
|
+
end
|
65
|
+
|
66
|
+
describe 'someone else\'s message' do
|
67
|
+
let(:message) { create(:message, discussion: discussion, sender: moderator.uid) }
|
68
|
+
before do
|
69
|
+
delete :destroy, params: {id: message.id, discussion_id: discussion.id, motive: :self_deleted}
|
70
|
+
message.reload
|
71
|
+
end
|
72
|
+
|
73
|
+
it { expect(response.status).to eq 403 }
|
74
|
+
it { expect(message.deleted?).to be false }
|
75
|
+
it { expect(message.deleted_by).to eq nil }
|
76
|
+
it { expect(message.deleted_at).to eq nil }
|
77
|
+
it { expect(message.deletion_motive).to eq nil }
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe 'for moderator' do
|
82
|
+
before do
|
83
|
+
set_current_user! moderator
|
84
|
+
delete :destroy, params: {id: message.id, discussion_id: discussion.id, motive: :inappropriate_content}
|
85
|
+
message.reload
|
86
|
+
end
|
87
|
+
|
88
|
+
it { expect(response.status).to eq 302 }
|
89
|
+
it { expect(message.deleted?).to be true }
|
90
|
+
it { expect(message.deleted_by).to eq moderator }
|
91
|
+
it { expect(message.deleted_at).to_not eq nil }
|
92
|
+
it { expect(message.deletion_motive).to eq 'inappropriate_content' }
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
34
96
|
describe 'approve' do
|
35
97
|
let(:message) { create(:message, discussion: discussion, sender: student.uid) }
|
36
98
|
|
@@ -42,7 +104,7 @@ describe DiscussionsMessagesController, type: :controller, organization_workspac
|
|
42
104
|
it { expect(message.reload.approved).to be false }
|
43
105
|
end
|
44
106
|
|
45
|
-
describe 'for
|
107
|
+
describe 'for moderator' do
|
46
108
|
before { set_current_user! moderator }
|
47
109
|
before { post :approve, params: {id: message.id, discussion_id: discussion.id} }
|
48
110
|
|
@@ -62,7 +124,7 @@ describe DiscussionsMessagesController, type: :controller, organization_workspac
|
|
62
124
|
it { expect(message.reload.not_actually_a_question).to be false }
|
63
125
|
end
|
64
126
|
|
65
|
-
describe 'for
|
127
|
+
describe 'for moderator' do
|
66
128
|
before { set_current_user! moderator }
|
67
129
|
before { post :question, params: {id: message.id, discussion_id: discussion.id} }
|
68
130
|
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -381,7 +381,11 @@ ActiveRecord::Schema.define(version: 20210330175706) do
|
|
381
381
|
t.boolean "not_actually_a_question", default: false
|
382
382
|
t.datetime "approved_at"
|
383
383
|
t.bigint "approved_by_id"
|
384
|
+
t.integer "deletion_motive"
|
385
|
+
t.datetime "deleted_at"
|
386
|
+
t.bigint "deleted_by_id"
|
384
387
|
t.index ["approved_by_id"], name: "index_messages_on_approved_by_id"
|
388
|
+
t.index ["deleted_by_id"], name: "index_messages_on_deleted_by_id"
|
385
389
|
end
|
386
390
|
|
387
391
|
create_table "notifications", force: :cascade do |t|
|
@@ -162,7 +162,12 @@ feature 'Discussion Flow', organization_workspace: :test do
|
|
162
162
|
end
|
163
163
|
|
164
164
|
context 'and forum enabled' do
|
165
|
-
|
165
|
+
let!(:problem_2_discussion_message) { create(:message, discussion: problem_2_discussions.first, sender: another_student.uid) }
|
166
|
+
let!(:another_problem_2_discussion_message) { create(:message, discussion: problem_2_discussions.first, sender: another_student.uid) }
|
167
|
+
before do
|
168
|
+
Organization.current.update! forum_enabled: true
|
169
|
+
another_problem_2_discussion_message.soft_delete! :inappropriate_content, moderator
|
170
|
+
end
|
166
171
|
|
167
172
|
scenario 'newly created discussion' do
|
168
173
|
visit current_path
|
@@ -170,7 +175,14 @@ feature 'Discussion Flow', organization_workspace: :test do
|
|
170
175
|
expect(page).to have_text('Open')
|
171
176
|
expect(page).to have_text('Messages')
|
172
177
|
expect(page).not_to have_text('Preview')
|
178
|
+
expect(page).to have_text(problem_2_discussion_message.content)
|
179
|
+
expect(page).not_to have_text(another_problem_2_discussion_message.content)
|
173
180
|
expect(page).not_to have_xpath("//div[@class='discussion-actions']")
|
181
|
+
expect(page).to_not have_text('Includes inappropriate content')
|
182
|
+
expect(page).to_not have_text('Shares the correct solution')
|
183
|
+
expect(page).to_not have_text('Discloses personal information')
|
184
|
+
expect(page).to have_text('included inappropriate content')
|
185
|
+
expect(page).to_not have_text ("Deleted by #{moderator.name}")
|
174
186
|
end
|
175
187
|
|
176
188
|
context 'for moderator' do
|
@@ -182,11 +194,17 @@ feature 'Discussion Flow', organization_workspace: :test do
|
|
182
194
|
expect(page).to have_text('Open')
|
183
195
|
expect(page).to have_text('Messages')
|
184
196
|
expect(page).to have_text('Preview')
|
197
|
+
expect(page).to have_text(problem_2_discussion_message.content)
|
198
|
+
expect(page).to have_text(another_problem_2_discussion_message.content)
|
185
199
|
expect(page).to have_xpath("//div[@class='discussion-actions']")
|
200
|
+
expect(page).to have_text('Includes inappropriate content')
|
201
|
+
expect(page).to have_text('Shares the correct solution')
|
202
|
+
expect(page).to have_text('Discloses personal information')
|
203
|
+
expect(page).to have_text('included inappropriate content')
|
204
|
+
expect(page).to have_text ("Deleted by #{moderator.name}")
|
186
205
|
end
|
187
206
|
end
|
188
207
|
end
|
189
208
|
end
|
190
209
|
end
|
191
|
-
|
192
210
|
end
|
@@ -190,7 +190,7 @@ feature 'Exercise Flow', organization_workspace: :test do
|
|
190
190
|
expect(page).to have_text('need a hint?')
|
191
191
|
expect(page).to have_selector('.upload')
|
192
192
|
expect(problem_5.language.extension).to eq('gbs')
|
193
|
-
expect(page.find("//
|
193
|
+
expect(page.find("//input[@id = 'mu-upload-input']")['accept']).to eq(".gbs")
|
194
194
|
|
195
195
|
expect(page.find("#mu-exercise-id")['value']).to eq(problem_5.id.to_s)
|
196
196
|
expect(page.find("#mu-exercise-layout")['value']).to eq('input_right')
|
@@ -18,7 +18,7 @@ feature 'Guide Reset Flow', organization_workspace: :test do
|
|
18
18
|
|
19
19
|
before { reindex_current_organization! }
|
20
20
|
|
21
|
-
let(:restart_xpath) { "//
|
21
|
+
let(:restart_xpath) { "//a[@title='#{I18n.t(:restart)}']" }
|
22
22
|
|
23
23
|
context 'no logged in user' do
|
24
24
|
scenario 'visit guide' do
|
@@ -92,8 +92,7 @@ feature 'Terms Flow', organization_workspace: :test do
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
-
context 'with unaccepted role terms' do
|
96
|
-
|
95
|
+
context 'with unaccepted role terms', :toast_interferes_with_view do
|
97
96
|
context 'visit forum' do
|
98
97
|
let(:terms_path) { '/discussions/terms' }
|
99
98
|
before { test_organization.update! forum_enabled: true }
|
@@ -46,7 +46,7 @@ describe BreadcrumbsHelper, organization_workspace: :test do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
context 'in chapter' do
|
49
|
-
let!(:chapter) { create(:chapter, name: 'my chapter', lessons: [lesson]) }
|
49
|
+
let!(:chapter) { create(:chapter, name: 'my chapter', lessons: [lesson], number: 1) }
|
50
50
|
let(:lesson) { create(:lesson, name: 'my lesson', exercises: [exercise]) }
|
51
51
|
let(:exercise) { create(:exercise, name: 'my exercise') }
|
52
52
|
|
@@ -64,7 +64,7 @@ describe BreadcrumbsHelper, organization_workspace: :test do
|
|
64
64
|
it 'mumuki, organization, chapter and lesson have links but exercise does not' do
|
65
65
|
expect(breadcrumb).to include home_breadcrumb_with_link
|
66
66
|
expect(breadcrumb).to include organization_breadcrumb_with_link
|
67
|
-
expect(breadcrumb).to include "<a href=\"/chapters/#{chapter.id}-my-chapter\">my chapter</a>"
|
67
|
+
expect(breadcrumb).to include "<a href=\"/chapters/#{chapter.id}-my-chapter\">1. my chapter</a>"
|
68
68
|
expect(breadcrumb).to include "<a href=\"/lessons/#{lesson.id}-my-chapter-my-lesson\">1. my lesson</a>"
|
69
69
|
expect(breadcrumb).to include "<li class='mu-breadcrumb-list-item last'>1. my exercise</li>"
|
70
70
|
end
|
@@ -14,9 +14,9 @@ describe WithStudentPathNavigation, organization_workspace: :test do
|
|
14
14
|
let!(:exercise_3) { create(:exercise, id: 13, name: 'exercise 3', guide: guide) }
|
15
15
|
|
16
16
|
context 'when user did not submit any solution' do
|
17
|
-
it { expect(next_button(exercise_1)).to eq "<a class=\"btn btn-
|
18
|
-
it { expect(next_button(exercise_2)).to eq "<a class=\"btn btn-
|
19
|
-
it { expect(next_button(exercise_3)).to eq "<a class=\"btn btn-warning
|
17
|
+
it { expect(next_button(exercise_1)).to eq "<a class=\"btn btn-complementary w-100\" role=\"button\" href=\"/exercises/#{exercise_2.friendly_name}\"><span class=\"fa5-text-r\">Next: exercise 2</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
18
|
+
it { expect(next_button(exercise_2)).to eq "<a class=\"btn btn-complementary w-100\" role=\"button\" href=\"/exercises/#{exercise_3.friendly_name}\"><span class=\"fa5-text-r\">Next: exercise 3</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
19
|
+
it { expect(next_button(exercise_3)).to eq "<a class=\"btn btn-warning w-100\" role=\"button\" href=\"/exercises/#{exercise_1.friendly_name}\"><span class=\"fa5-text-r\">Next pending: exercise 1</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
20
20
|
end
|
21
21
|
|
22
22
|
context 'when on last unresolved exercise' do
|
@@ -25,9 +25,9 @@ describe WithStudentPathNavigation, organization_workspace: :test do
|
|
25
25
|
exercise_3.submit_solution!(current_user).passed!
|
26
26
|
end
|
27
27
|
|
28
|
-
it { expect(next_button(exercise_1)).to eq "<a class=\"btn btn-
|
28
|
+
it { expect(next_button(exercise_1)).to eq "<a class=\"btn btn-complementary w-100\" role=\"button\" href=\"/exercises/#{exercise_2.friendly_name}\"><span class=\"fa5-text-r\">Next: exercise 2</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
29
29
|
it { expect(next_button(exercise_2)).to be nil }
|
30
|
-
it { expect(next_button(exercise_3)).to eq "<a class=\"btn btn-warning
|
30
|
+
it { expect(next_button(exercise_3)).to eq "<a class=\"btn btn-warning w-100\" role=\"button\" href=\"/exercises/#{exercise_2.friendly_name}\"><span class=\"fa5-text-r\">Next pending: exercise 2</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
31
31
|
end
|
32
32
|
|
33
33
|
context 'when user did submit a solution' do
|
@@ -35,9 +35,9 @@ describe WithStudentPathNavigation, organization_workspace: :test do
|
|
35
35
|
exercise_1.submit_solution!(current_user).passed!
|
36
36
|
end
|
37
37
|
|
38
|
-
it { expect(next_button(exercise_1)).to eq "<a class=\"btn btn-
|
39
|
-
it { expect(next_button(exercise_2)).to eq "<a class=\"btn btn-
|
40
|
-
it { expect(next_button(exercise_3)).to eq "<a class=\"btn btn-warning
|
38
|
+
it { expect(next_button(exercise_1)).to eq "<a class=\"btn btn-complementary w-100\" role=\"button\" href=\"/exercises/#{exercise_2.friendly_name}\"><span class=\"fa5-text-r\">Next: exercise 2</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
39
|
+
it { expect(next_button(exercise_2)).to eq "<a class=\"btn btn-complementary w-100\" role=\"button\" href=\"/exercises/#{exercise_3.friendly_name}\"><span class=\"fa5-text-r\">Next: exercise 3</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
40
|
+
it { expect(next_button(exercise_3)).to eq "<a class=\"btn btn-warning w-100\" role=\"button\" href=\"/exercises/#{exercise_2.friendly_name}\"><span class=\"fa5-text-r\">Next pending: exercise 2</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -46,8 +46,8 @@ describe WithStudentPathNavigation, organization_workspace: :test do
|
|
46
46
|
let!(:exercise) { create(:exercise, id: 12, name: 'exercise 2', guide: guide) }
|
47
47
|
|
48
48
|
context 'when user did not submit any exercise' do
|
49
|
-
it { expect(next_button(reading)).to eq "<a class=\"btn-confirmation btn btn-
|
50
|
-
it { expect(next_button(exercise)).to eq "<a class=\"btn btn-warning
|
49
|
+
it { expect(next_button(reading)).to eq "<a class=\"btn-confirmation btn btn-complementary w-100\" data-confirmation-url=\"/exercises/#{reading.friendly_name}/confirmations\" role=\"button\" href=\"/exercises/#{exercise.friendly_name}\"><span class=\"fa5-text-r\">Next: exercise 2</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
50
|
+
it { expect(next_button(exercise)).to eq "<a class=\"btn btn-warning w-100\" role=\"button\" href=\"/exercises/#{reading.friendly_name}\"><span class=\"fa5-text-r\">Next pending: exercise 1</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
51
51
|
end
|
52
52
|
|
53
53
|
context 'when user finished just reading' do
|
@@ -55,7 +55,7 @@ describe WithStudentPathNavigation, organization_workspace: :test do
|
|
55
55
|
reading.submit_confirmation!(current_user)
|
56
56
|
end
|
57
57
|
|
58
|
-
it { expect(next_button(reading)).to eq "<a class=\"btn-confirmation btn btn-
|
58
|
+
it { expect(next_button(reading)).to eq "<a class=\"btn-confirmation btn btn-complementary w-100\" data-confirmation-url=\"/exercises/#{reading.friendly_name}/confirmations\" role=\"button\" href=\"/exercises/#{exercise.friendly_name}\"><span class=\"fa5-text-r\">Next: exercise 2</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
59
59
|
it { expect(next_button(exercise)).to eq nil }
|
60
60
|
end
|
61
61
|
end
|
@@ -83,15 +83,38 @@ describe WithStudentPathNavigation, organization_workspace: :test do
|
|
83
83
|
let(:lessons) { [lesson_1, lesson_2, lesson_3] }
|
84
84
|
|
85
85
|
context 'one suggestion' do
|
86
|
-
it { expect(next_button(lesson_2)).to include "<a class=\"btn btn-
|
86
|
+
it { expect(next_button(lesson_2)).to include "<a class=\"btn btn-complementary w-100\" role=\"button\" href=\"/lessons/#{lesson_3.friendly_name}\"><span class=\"fa5-text-r\">Next: #{lesson_3.name}</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
87
87
|
it { expect(next_button(lesson_1)).to be_html_safe }
|
88
88
|
end
|
89
89
|
|
90
90
|
context 'many suggestions' do
|
91
|
-
it { expect(next_button(lesson_1)).to include "<a class=\"btn btn-
|
91
|
+
it { expect(next_button(lesson_1)).to include "<a class=\"btn btn-complementary w-100\" role=\"button\" href=\"/lessons/#{lesson_2.friendly_name}\"><span class=\"fa5-text-r\">Next: #{lesson_2.name}</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
92
92
|
it { expect(next_button(lesson_1)).to be_html_safe }
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
96
|
+
|
97
|
+
context "when there's a next chapter" do
|
98
|
+
let(:organization) { create :organization, book: book }
|
99
|
+
|
100
|
+
let(:book) { create(:book, chapters: [
|
101
|
+
chapter_1,
|
102
|
+
chapter_2
|
103
|
+
]) }
|
104
|
+
|
105
|
+
let(:chapter_1) { create(:chapter, lessons: [lesson_1]) }
|
106
|
+
let(:chapter_2) { create(:chapter, lessons: [create(:lesson, exercises: [ create(:exercise) ])]) }
|
107
|
+
|
108
|
+
let(:lesson_1) { create(:lesson, exercises: [ exercise_1 ]) }
|
109
|
+
let(:exercise_1) { create(:exercise) }
|
110
|
+
|
111
|
+
before do
|
112
|
+
organization.switch!
|
113
|
+
reindex_current_organization!
|
114
|
+
exercise_1.submit_solution!(current_user).passed!
|
115
|
+
end
|
116
|
+
|
117
|
+
it { expect(next_button(lesson_1)).to include "<a class=\"btn btn-complementary w-100\" role=\"button\" href=\"/chapters/#{chapter_2.friendly_name}\"><span class=\"fa5-text-r\">Next: #{chapter_2.name}</span><i class=\"fas fa-chevron-right\"></i></a>" }
|
118
|
+
end
|
96
119
|
end
|
97
120
|
end
|
@@ -22,7 +22,7 @@ describe('editors', () => {
|
|
22
22
|
it('reads the custom sources if present, ignoring the form', () => {
|
23
23
|
$('body').html(`
|
24
24
|
<form role="form" class="new_solution">
|
25
|
-
<div class="
|
25
|
+
<div class="editor-code">
|
26
26
|
<textarea class="form-control editor" name="solution[content]" id="solution_content">the standard solution</textarea>
|
27
27
|
</div>
|
28
28
|
</form>`);
|
@@ -39,7 +39,7 @@ describe('editors', () => {
|
|
39
39
|
it('reads the form if no sources', () => {
|
40
40
|
$('body').html(`
|
41
41
|
<form role="form" class="new_solution">
|
42
|
-
<div class="
|
42
|
+
<div class="editor-code">
|
43
43
|
<textarea class="form-control editor" name="solution[content]" id="solution_content">the solution</textarea>
|
44
44
|
</div>
|
45
45
|
</form>`);
|
@@ -49,7 +49,7 @@ describe('editors', () => {
|
|
49
49
|
it('reads the form if no sources and exercise is multifile', () => {
|
50
50
|
$('body').html(`
|
51
51
|
<form role="form" class="new_solution">
|
52
|
-
<div class="
|
52
|
+
<div class="editor-code">
|
53
53
|
<textarea
|
54
54
|
class="form-control editor"
|
55
55
|
data-editor-language="html"
|