mumuki-laboratory 9.0.6 → 9.2.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 +6 -30
- 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 -5
- 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/controllers/exam_authorization_requests_controller.rb +1 -5
- data/app/controllers/users_controller.rb +4 -0
- 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/helpers/user_menu_helper.rb +4 -0
- 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_authorization_requests/_approved.html.erb +1 -0
- data/app/views/exam_authorization_requests/_pending.html.erb +4 -0
- data/app/views/exam_authorization_requests/_rejected.html.erb +1 -0
- data/app/views/exam_registrations/show.html.erb +11 -12
- 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 +7 -7
- 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 +2 -2
- data/app/views/layouts/_timer.html.erb +1 -1
- data/app/views/layouts/_user_menu.html.erb +4 -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/notifications/_exam_authorization_request.html.erb +1 -1
- 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/exam_authorizations.html.erb +42 -0
- 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/config/routes.rb +2 -1
- data/lib/mumuki/laboratory.rb +1 -1
- data/lib/mumuki/laboratory/locales/en.yml +17 -2
- data/lib/mumuki/laboratory/locales/es-CL.yml +17 -2
- data/lib/mumuki/laboratory/locales/es.yml +17 -2
- data/lib/mumuki/laboratory/locales/pt.yml +17 -3
- 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/controllers/exam_authorization_requests_controller_spec.rb +1 -18
- data/spec/controllers/users_controller_spec.rb +1 -0
- 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/notifications_flow_spec.rb +2 -3
- 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 +51 -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 +125 -122
- 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
- data/app/views/exam_authorization_requests/show.html.erb +0 -17
@@ -20,10 +20,12 @@
|
|
20
20
|
<div class="terms-acceptance">
|
21
21
|
<%= form_for :user, url: terms_user_path, method: :post do |f| %>
|
22
22
|
<span class="terms-acceptance-checkbox">
|
23
|
-
<%= f.check_box :terms_of_service, required: true,
|
23
|
+
<%= f.check_box :terms_of_service, required: true, class: 'form-check-input',
|
24
|
+
onInvalid: "this.setCustomValidity('#{t(:terms_and_conditions_must_be_accepted)}')",
|
25
|
+
onChange: "this.setCustomValidity(validity.valueMissing ? '#{t(:terms_and_conditions_must_be_accepted)}' : '')" %>
|
24
26
|
<%= t(:accept_terms) %>
|
25
27
|
</span>
|
26
|
-
<%= f.submit t(:accept), class: 'btn btn-
|
28
|
+
<%= f.submit t(:accept), class: 'btn btn-complementary terms-acceptance-btn' %>
|
27
29
|
<% end %>
|
28
30
|
</div>
|
29
31
|
<% end %>
|
data/config/routes.rb
CHANGED
@@ -24,7 +24,7 @@ Rails.application.routes.draw do
|
|
24
24
|
get '/discussions/messages/preview', to: 'discussions_messages#preview', as: :preview_discussion_message
|
25
25
|
|
26
26
|
resources :exam_registrations, only: [:show]
|
27
|
-
resources :exam_authorization_requests, only: [:
|
27
|
+
resources :exam_authorization_requests, only: [:create, :update]
|
28
28
|
|
29
29
|
resources :book, only: [:show]
|
30
30
|
resources :chapters, only: [:show] do
|
@@ -68,6 +68,7 @@ Rails.application.routes.draw do
|
|
68
68
|
get :discussions
|
69
69
|
get :activity
|
70
70
|
get :certificates
|
71
|
+
get :exam_authorizations
|
71
72
|
|
72
73
|
end
|
73
74
|
|
data/lib/mumuki/laboratory.rb
CHANGED
@@ -66,6 +66,18 @@ en:
|
|
66
66
|
create_submission: Submit
|
67
67
|
created_at: Created at
|
68
68
|
date: Date
|
69
|
+
deleted_by: Deleted by %{deleter}
|
70
|
+
deleted_message_warning: If you repeateadly violate these or other rules, you may be prohibited from accessing the forum or you may suffer more severe consequences, such as being expulsed from the course.
|
71
|
+
deletion_motive:
|
72
|
+
inappropriate_content:
|
73
|
+
present: Includes inappropriate content
|
74
|
+
past: Included inappropriate content
|
75
|
+
shares_solution:
|
76
|
+
present: Shares the correct solution
|
77
|
+
past: Shared the correct solution
|
78
|
+
discloses_personal_information:
|
79
|
+
present: Discloses personal information
|
80
|
+
past: Disclosed personal information
|
69
81
|
description: Description
|
70
82
|
destroy: Destroy
|
71
83
|
destroy_message: delete the message
|
@@ -96,9 +108,10 @@ en:
|
|
96
108
|
error_500: 500 error
|
97
109
|
error_description: This is known as a <span class="error-link">%{error}</span>.
|
98
110
|
errored: Oops, your solution didn't work
|
111
|
+
exam_authorization_pending_explanation_html: You have until <strong>%{end_time}</strong> to register. After that date, your request will be processed and you will receive a confirmation. <br> Don't forget to check the notifications!
|
99
112
|
exam_authorization_request_approved_html: Your request was approved, don't forget to log in at <strong>%{date}</strong>. Good luck!
|
100
113
|
exam_authorization_request_created: Your registration to the exam has been saved!
|
101
|
-
exam_authorization_request_rejected: Your request was rejected.
|
114
|
+
exam_authorization_request_rejected: Your request was rejected because you didn't meet the requirements.
|
102
115
|
exam_authorization_request_saved: Your registration to the exam has been updated!
|
103
116
|
exam_authorization_request_updated: Your registration to %{description} has been updated
|
104
117
|
exam_registration_choose_exam: Choose date and time to attend to the exam
|
@@ -176,6 +189,7 @@ en:
|
|
176
189
|
one: 1 message
|
177
190
|
other: '%{count} messages'
|
178
191
|
message: Message
|
192
|
+
message_deleted: This message was deleted because it %{motive}, which violates the %{forum_terms}.
|
179
193
|
messages: Messages
|
180
194
|
messages_error: Previous messages are unavailable. Please try again later.
|
181
195
|
moderation: Mentoring
|
@@ -254,6 +268,7 @@ en:
|
|
254
268
|
select_file: Select file
|
255
269
|
sending_solution: Sending solution
|
256
270
|
show: Show
|
271
|
+
show_message: Show message
|
257
272
|
sign_in: Sign in
|
258
273
|
sign_in_action: sign in
|
259
274
|
sign_out: Sign Out
|
@@ -319,7 +334,7 @@ en:
|
|
319
334
|
user_data_updated: Your data was updated successfully
|
320
335
|
username: Username
|
321
336
|
view_details: View details
|
322
|
-
want_permissions: The
|
337
|
+
want_permissions: The following user requires permissions for the organization
|
323
338
|
we_miss_you: We miss you!
|
324
339
|
week_of: Week of %{date}
|
325
340
|
welcome: Welcome to %{name}!
|
@@ -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
|
@@ -96,9 +108,10 @@ es-CL:
|
|
96
108
|
internal_server_error: ¡Ups! Algo no anduvo bien
|
97
109
|
not_found: ¡Ups! La página no existe
|
98
110
|
errored: ¡Ups! Tu solución no se puede ejecutar
|
111
|
+
exam_authorization_pending_explanation_html: Tienes tiempo hasta el <strong>%{end_time}</strong> para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No olvides revisar las notificaciones!
|
99
112
|
exam_authorization_request_approved_html: Tu solicitud fue aprobada, no olvides conectarte el <strong>%{date}</strong>. ¡Buena suerte!
|
100
113
|
exam_authorization_request_created: ¡Tu inscripción al exámen se registró exitosamente!
|
101
|
-
exam_authorization_request_rejected: Tu solicitud fue rechazada.
|
114
|
+
exam_authorization_request_rejected: Tu solicitud fue rechazada porque no cumpliste con los requisitos para rendir el examen.
|
102
115
|
exam_authorization_request_saved: ¡Tu inscripción al exámen se modificó exitosamente!
|
103
116
|
exam_authorization_request_updated: Hay novedades sobre tu inscripción a %{description}
|
104
117
|
exam_registration_choose_exam: Seleccioná día y horario en el que te gustaría rendir el exámen
|
@@ -176,6 +189,7 @@ es-CL:
|
|
176
189
|
one: 1 mensaje
|
177
190
|
other: '%{count} mensajes'
|
178
191
|
message: Mensaje
|
192
|
+
message_deleted: Este mensaje fue eliminado porque %{motive}, lo cual infringe las %{forum_terms}.
|
179
193
|
messages: Mensajes
|
180
194
|
messages_error: Los mensajes anteriores no están disponibles en este momento. ¡Vuelve a intentar más tarde!
|
181
195
|
messages_pluralized:
|
@@ -259,6 +273,7 @@ es-CL:
|
|
259
273
|
send: Enviar
|
260
274
|
sending_solution: Enviando solución
|
261
275
|
show: Mostrar
|
276
|
+
show_message: Mostrar mensaje
|
262
277
|
sign_in: Inicia sesión
|
263
278
|
sign_in_action: iniciar sesión
|
264
279
|
sign_out: Cerrar Sesión
|
@@ -330,7 +345,7 @@ es-CL:
|
|
330
345
|
user: Usuario
|
331
346
|
username: Nombre de usuario
|
332
347
|
view_details: Ver detalles
|
333
|
-
want_permissions: El siguiente usuario requiere permisos
|
348
|
+
want_permissions: El siguiente usuario requiere permisos para la organización
|
334
349
|
we_miss_you: ¡Te extrañamos!
|
335
350
|
week_of: Semana del %{date}
|
336
351
|
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
|
@@ -104,9 +116,10 @@ es:
|
|
104
116
|
internal_server_error: ¡Ups! Algo no anduvo bien
|
105
117
|
not_found: ¡Ups! La página no existe
|
106
118
|
errored: ¡Ups! Tu solución no se puede ejecutar
|
119
|
+
exam_authorization_pending_explanation_html: Tenés tiempo hasta el <strong>%{end_time}</strong> para cambiar el turno haciendo click <strong><a href="%{edit_path}">acá</a></strong>. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No te olvides de revisar las notificaciones!
|
107
120
|
exam_authorization_request_approved_html: Tu solicitud fue aprobada, no olvides conectarte el <strong>%{date}</strong>. ¡Buena suerte!
|
108
121
|
exam_authorization_request_created: ¡Tu inscripción al exámen se registró exitosamente!
|
109
|
-
exam_authorization_request_rejected: Tu solicitud fue rechazada.
|
122
|
+
exam_authorization_request_rejected: Tu solicitud fue rechazada porque no cumpliste con los requisitos para rendir el examen.
|
110
123
|
exam_authorization_request_saved: ¡Tu inscripción al exámen se modificó exitosamente!
|
111
124
|
exam_authorization_request_updated: Hay novedades sobre tu inscripción a %{description}
|
112
125
|
exam_registration_choose_exam: Seleccioná día y horario en el que te gustaría rendir el exámen
|
@@ -187,6 +200,7 @@ es:
|
|
187
200
|
one: 1 mensaje
|
188
201
|
other: '%{count} mensajes'
|
189
202
|
message: Mensaje
|
203
|
+
message_deleted: Este mensaje fue eliminado porque %{motive}, lo cual infringe las %{forum_terms}.
|
190
204
|
messages: Mensajes
|
191
205
|
messages_error: Los mensajes anteriores no están disponibles en este momento. ¡Volvé a intentar mas tarde!
|
192
206
|
messages_pluralized:
|
@@ -274,6 +288,7 @@ es:
|
|
274
288
|
send: Enviar
|
275
289
|
sending_solution: Enviando solución
|
276
290
|
show: Mostrar
|
291
|
+
show_message: Mostrar mensaje
|
277
292
|
sign_in: Iniciá sesión
|
278
293
|
sign_in_action: iniciar sesión
|
279
294
|
sign_out: Cerrar Sesión
|
@@ -346,7 +361,7 @@ es:
|
|
346
361
|
user: Usuario
|
347
362
|
username: Nombre de usuario
|
348
363
|
view_details: Ver detalles
|
349
|
-
want_permissions: El siguiente usuario requiere permisos
|
364
|
+
want_permissions: El siguiente usuario requiere permisos para la organización
|
350
365
|
we_miss_you: ¡Te extrañamos!
|
351
366
|
welcome: ¡Te damos la bienvenida a %{name}!
|
352
367
|
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
|
@@ -100,9 +111,10 @@ pt:
|
|
100
111
|
error_500: erro 500
|
101
112
|
error_description: Isto é o que é conhecido como <span class = "error-link"> %{error} </ span>.
|
102
113
|
errored: Opa! Sua solução não pode ser executada
|
114
|
+
exam_authorization_pending_explanation_html: Você tem tempo até <strong>%{date}</strong> para se inscrever. Após essa data, sua inscrição será avaliada e você receberá uma confirmação. <br> Não se esqueça de verificar as notificações!
|
103
115
|
exam_authorization_request_approved_html: Sua solicitação foi aprovada, não se esqueça de conectar em <strong>%{date}</strong>. Boa sorte!
|
104
116
|
exam_authorization_request_created: Seu registro de exame foi salvo com sucesso!
|
105
|
-
exam_authorization_request_rejected:
|
117
|
+
exam_authorization_request_rejected: Sua solicitação foi rejeitada porque você não atendeu aos requisitos.
|
106
118
|
exam_authorization_request_saved: Seu registro de exame foi modificado com sucesso!
|
107
119
|
exam_authorization_request_updated: Há notícias sobre seu registro para %{description}
|
108
120
|
exam_registration_choose_exam: Selecione o dia e a hora em que gostaria de fazer o exame
|
@@ -181,6 +193,7 @@ pt:
|
|
181
193
|
one: 1 mensagem
|
182
194
|
other: '%{count} mensagens'
|
183
195
|
message: Mensagem
|
196
|
+
message_deleted: Esta mensagem foi excluída porque %{motive}, o que viola as %{forum_terms}.
|
184
197
|
messages: Mensagens
|
185
198
|
messages_error: As mensagens acima não estão disponíveis no momento. Eu tentei novamente mais tarde!
|
186
199
|
mais tarde!
|
@@ -264,6 +277,7 @@ pt:
|
|
264
277
|
send: Enviar
|
265
278
|
sending_solution: Solução de envio
|
266
279
|
show: Mostrar
|
280
|
+
show_message: Mostrar mensagem
|
267
281
|
sign_in: Iniciar sessão
|
268
282
|
sign_in_action: iniciar sessão
|
269
283
|
sign_out: Fechar Sessão
|
@@ -329,7 +343,7 @@ pt:
|
|
329
343
|
user_data_updated: Os seus dados foram atualizados corretamente
|
330
344
|
username: Nome de usuário
|
331
345
|
view_details: Ver detalhes
|
332
|
-
want_permissions: O próximo usuário requer permissões
|
346
|
+
want_permissions: O próximo usuário requer permissões para a organização
|
333
347
|
week_of: Semana de %{date}
|
334
348
|
welcome: Convidamos você a {name}!
|
335
349
|
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
|
|
@@ -7,23 +7,6 @@ describe ExamAuthorizationRequestsController, type: :controller, organization_wo
|
|
7
7
|
|
8
8
|
before { set_current_user! user }
|
9
9
|
|
10
|
-
describe 'show' do
|
11
|
-
context 'when authorization does not exist' do
|
12
|
-
before { get :show, params: {id: 0} }
|
13
|
-
it { expect(response.status).to eq 404 }
|
14
|
-
end
|
15
|
-
|
16
|
-
context 'when authorization exists' do
|
17
|
-
let(:exam_authorization_request) { create(:exam_authorization_request, user: user, exam_registration: exam_registration) }
|
18
|
-
let!(:notification) { create(:notification, target: exam_authorization_request, user: user) }
|
19
|
-
|
20
|
-
before { get :show, params: {id: exam_authorization_request.id} }
|
21
|
-
|
22
|
-
it { expect(response.status).to eq 200 }
|
23
|
-
it { expect(notification.reload.read).to be_truthy }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
10
|
describe 'create' do
|
28
11
|
let!(:notification) { create(:notification, target: exam_registration, user: user) }
|
29
12
|
|
@@ -33,7 +16,7 @@ describe ExamAuthorizationRequestsController, type: :controller, organization_wo
|
|
33
16
|
}
|
34
17
|
end
|
35
18
|
|
36
|
-
it { expect(response.status).to eq
|
19
|
+
it { expect(response.status).to eq 302 }
|
37
20
|
it { expect(exam_registration.authorization_requests.length).to be 1 }
|
38
21
|
it { expect(notification.reload.read).to be_truthy }
|
39
22
|
end
|
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
|