mumuki-laboratory 5.12.1 → 5.13.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/application/confirmation.js +4 -1
- data/app/controllers/exercise_confirmations_controller.rb +3 -2
- data/app/helpers/application_helper.rb +4 -0
- data/app/helpers/breadcrumbs_helper.rb +1 -1
- data/app/helpers/concerns/with_student_path_navigation.rb +2 -1
- data/app/helpers/concerns/with_student_path_navigation/finish_navigation.rb +12 -0
- data/app/helpers/contextualization_result_helper.rb +1 -1
- data/app/models/application_record.rb +7 -0
- data/app/models/concerns/contextualization.rb +1 -4
- data/app/models/concerns/with_reminders.rb +3 -1
- data/app/views/discussions/_message.html.erb +1 -1
- data/app/views/layouts/_test_results.html.erb +1 -1
- data/db/migrate/20181101180652_add_unique_index_to_organizations_name.rb +5 -0
- data/lib/mumuki/laboratory/controllers/results_rendering.rb +8 -3
- data/lib/mumuki/laboratory/locales/en.yml +2 -0
- data/lib/mumuki/laboratory/locales/es.yml +2 -0
- data/lib/mumuki/laboratory/locales/pt.yml +2 -0
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/controllers/confirmations_controller_spec.rb +1 -1
- data/spec/dummy/db/schema.rb +2 -1
- data/spec/helpers/breadcrumbs_helper_spec.rb +1 -1
- data/spec/mailers/user_mailer_spec.rb +18 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd4028c28b28b7924786fa0459d5406df47c9931e8d52772407960e68af4d3fe
|
4
|
+
data.tar.gz: d18dfab8db95844ce5dc18ac2c563d9e2f7de725ec946cc98081b72710395906
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 150db78584cac26a99017f2bb417149d278a45bb86ed7151410047c6dd83fb5d4df93d3cec966ac332d8b52812f77a4a1c52b047eb3eeb3e915985d2798cd599
|
7
|
+
data.tar.gz: 5cba88c3a2ca3117c9885398a5d1f35617509f02d8e82b43532f1cb2450ae696cd9995d9c4609eb073c86178e4a3580ff55c901d3911d53606fb75c004fb35fd
|
@@ -5,7 +5,10 @@ mumuki.load(function () {
|
|
5
5
|
$.ajax(token.newRequest({
|
6
6
|
method: 'POST',
|
7
7
|
url: $(this).data('confirmation-url'),
|
8
|
-
xhrFields: {withCredentials: true}
|
8
|
+
xhrFields: {withCredentials: true},
|
9
|
+
success: function(data){
|
10
|
+
mumuki.updateProgressBarAndShowModal(data);
|
11
|
+
}
|
9
12
|
}));
|
10
13
|
|
11
14
|
return true;
|
@@ -1,8 +1,9 @@
|
|
1
1
|
class ExerciseConfirmationsController < AjaxController
|
2
2
|
include Mumuki::Laboratory::Controllers::NestedInExercise
|
3
|
+
include Mumuki::Laboratory::Controllers::ResultsRendering
|
3
4
|
|
4
5
|
def create
|
5
|
-
|
6
|
-
render json:
|
6
|
+
@exercise.submit_confirmation! current_user
|
7
|
+
render json: progress_json
|
7
8
|
end
|
8
9
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module WithStudentPathNavigation
|
2
2
|
def next_button(navigable)
|
3
3
|
return unless navigable
|
4
|
-
ContinueNavigation.new(self).button(navigable) || RevisitNavigation.new(self).button(navigable)
|
4
|
+
ContinueNavigation.new(self).button(navigable) || RevisitNavigation.new(self).button(navigable) || FinishNavigation.new(self).button(navigable)
|
5
|
+
#TODO Refactor this
|
5
6
|
end
|
6
7
|
|
7
8
|
def next_lesson_button(guide)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module WithStudentPathNavigation
|
2
|
+
class FinishNavigation < Navigation
|
3
|
+
def button(navigable)
|
4
|
+
return unless navigable.is_a?(Reading) && !navigable.status_for(current_user).like?(:passed)
|
5
|
+
content_tag 'a', t(:finish), merge_confirmation_classes(navigable, class: clazz)
|
6
|
+
end
|
7
|
+
|
8
|
+
def clazz
|
9
|
+
'btn btn-success btn-block'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module ContextualizationResultHelper
|
2
2
|
def humanized_expectation_result_item(expectation_result)
|
3
|
-
%Q{<li>#{status_icon(expectation_result[:result])} #{expectation_result[:explanation]}</li>}.html_safe
|
3
|
+
%Q{<li>#{status_icon(expectation_result[:result])} #{sanitized expectation_result[:explanation]}</li>}.html_safe
|
4
4
|
end
|
5
5
|
|
6
6
|
def render_feedback?(contextualization)
|
@@ -22,6 +22,13 @@ class ApplicationRecord < ActiveRecord::Base
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
def self.serialize_symbolized_hash_array(*keys)
|
26
|
+
keys.each do |field|
|
27
|
+
serialize field
|
28
|
+
define_method(field) { self[field]&.map { |it| it.symbolize_keys } }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
25
32
|
def save(*)
|
26
33
|
super
|
27
34
|
rescue => e
|
@@ -19,10 +19,7 @@ module Contextualization
|
|
19
19
|
serialize :submission_status, Mumuki::Laboratory::Status::Submission
|
20
20
|
validates_presence_of :submission_status
|
21
21
|
|
22
|
-
|
23
|
-
serialize field
|
24
|
-
define_method(field) { self[field]&.map { |it| it.symbolize_keys } }
|
25
|
-
end
|
22
|
+
serialize_symbolized_hash_array :expectation_results, :test_results, :query_results
|
26
23
|
|
27
24
|
composed_of :submission, mapping: submission_mapping, constructor: :from_attributes
|
28
25
|
|
@@ -61,7 +61,9 @@ module WithReminders
|
|
61
61
|
|
62
62
|
module ClassMethods
|
63
63
|
def remindable
|
64
|
-
where('accepts_reminders
|
64
|
+
where('accepts_reminders and email is not null
|
65
|
+
and last_organization_id is not null
|
66
|
+
and (last_submission_date < ? or last_submission_date is null)', reminder_frequency.days.ago)
|
65
67
|
end
|
66
68
|
|
67
69
|
# The frequency of reminders, expressed in days
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<%= status_icon(test_result[:status]) %>
|
11
11
|
<strong class="example-title"><%= test_result[:title] %></strong>
|
12
12
|
<% unless contextualization.visible_success_output? %>
|
13
|
-
<a data-toggle="collapse" href="#example-result-<%= index %>" class="example-see-more"
|
13
|
+
<a data-toggle="collapse" href="#example-result-<%= index %>" class="example-see-more"><%= t :view_details %></a>
|
14
14
|
<% end %>
|
15
15
|
</span>
|
16
16
|
<% else %>
|
@@ -8,9 +8,7 @@ module Mumuki::Laboratory::Controllers::ResultsRendering
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def render_results_json(assignment, results = {})
|
11
|
-
render json: results.merge(
|
12
|
-
guide_finished_by_solution: guide_finished_by_solution?,
|
13
|
-
class_for_progress_list_item: class_for_progress_list_item(@exercise, true),
|
11
|
+
render json: results.merge(progress_json).merge(
|
14
12
|
html: render_results_html(assignment),
|
15
13
|
title_html: render_results_title_html(assignment),
|
16
14
|
button_html: render_results_button_html(assignment),
|
@@ -18,6 +16,13 @@ module Mumuki::Laboratory::Controllers::ResultsRendering
|
|
18
16
|
remaining_attempts_html: remaining_attempts_text(assignment))
|
19
17
|
end
|
20
18
|
|
19
|
+
def progress_json
|
20
|
+
{
|
21
|
+
guide_finished_by_solution: guide_finished_by_solution?,
|
22
|
+
class_for_progress_list_item: class_for_progress_list_item(@exercise, true)
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
21
26
|
def render_results_html(assignment)
|
22
27
|
render_to_string partial: results_partial(assignment),
|
23
28
|
locals: {assignment: assignment}
|
@@ -79,6 +79,7 @@ en:
|
|
79
79
|
explain_redirect: You have registered in another organization
|
80
80
|
failed: Oops, something went wrong
|
81
81
|
feedback: Feedback
|
82
|
+
finish: Finish
|
82
83
|
first_name: First Name
|
83
84
|
forbidden_explanation: You are not allowed to see this content.
|
84
85
|
go_to: 'Go to %{organization}'
|
@@ -228,6 +229,7 @@ en:
|
|
228
229
|
user: User
|
229
230
|
user_data_updated: Your data was updated successfuly
|
230
231
|
username: Username
|
232
|
+
view_details: View details
|
231
233
|
want_permissions: The next user requires permissions
|
232
234
|
we_miss_you: We miss you!
|
233
235
|
working: "Working"
|
@@ -87,6 +87,7 @@ es:
|
|
87
87
|
explain_redirect: Notamos que te registraste en otra organización.
|
88
88
|
failed: Tu solución no pasó las pruebas
|
89
89
|
feedback: Problemas que encontramos
|
90
|
+
finish: Terminar
|
90
91
|
first_name: Nombre
|
91
92
|
forbidden_explanation: Es decir que no tenés autorización para ver este contenido. <br> ¿Puede que hayas ingresado con una cuenta incorrecta?
|
92
93
|
go_to: 'Ir a %{organization}'
|
@@ -253,6 +254,7 @@ es:
|
|
253
254
|
user_data_updated: Tus datos se actualizaron correctamente
|
254
255
|
user: Usuario
|
255
256
|
username: Nombre de usuario
|
257
|
+
view_details: Ver detalles
|
256
258
|
want_permissions: El siguiente usuario requiere permisos
|
257
259
|
we_miss_you: ¡Te extrañamos!
|
258
260
|
will_paginate:
|
@@ -82,6 +82,7 @@ pt:
|
|
82
82
|
explain_redirect: Percebemos que você se registrou em outra organização.
|
83
83
|
failed: Sua solução não passou as provas
|
84
84
|
feedback: Problemas que encontramos
|
85
|
+
finish: Terminar
|
85
86
|
first_name: Nome
|
86
87
|
forbidden_explanation: Isso significa que você não tem autorização para ver esse conteúdo. <br> Você poderia ter entrado com uma conta incorreta?
|
87
88
|
fullscreen: Tela completa
|
@@ -236,6 +237,7 @@ pt:
|
|
236
237
|
user: Usuário
|
237
238
|
user_data_updated: Os seus dados foram atualizados corretamente
|
238
239
|
username: Nome de usuário
|
240
|
+
view_details: Ver detalhes
|
239
241
|
want_permissions: O próximo usuário requer permissões
|
240
242
|
working: Processamento
|
241
243
|
wrong_answer: A resposta não é correta
|
@@ -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.parse_json).to json_like(
|
18
|
+
it { expect(response.body.parse_json).to json_like(guide_finished_by_solution: true, class_for_progress_list_item: 'progress-list-item text-center success active') }
|
19
19
|
end
|
20
20
|
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 20181101180652) do
|
14
14
|
|
15
15
|
# These are extensions that must be enabled in order to support this database
|
16
16
|
enable_extension "plpgsql"
|
@@ -250,6 +250,7 @@ ActiveRecord::Schema.define(version: 20181014233438) do
|
|
250
250
|
t.text "theme", default: "{}", null: false
|
251
251
|
t.text "profile", default: "{}", null: false
|
252
252
|
t.index ["book_id"], name: "index_organizations_on_book_id"
|
253
|
+
t.index ["name"], name: "index_organizations_on_name", unique: true
|
253
254
|
end
|
254
255
|
|
255
256
|
create_table "paths", id: :serial, force: :cascade do |t|
|
@@ -35,6 +35,24 @@ RSpec.describe UserMailer, type: :mailer do
|
|
35
35
|
last_submission_date: 15.minutes.ago }
|
36
36
|
it { expect(User.remindable).to_not include user }
|
37
37
|
end
|
38
|
+
|
39
|
+
context 'when user does not have an email' do
|
40
|
+
let(:user) { create :user,
|
41
|
+
uid: 'user',
|
42
|
+
accepts_reminders: true,
|
43
|
+
last_organization: central,
|
44
|
+
email: nil,
|
45
|
+
last_submission_date: nil }
|
46
|
+
it { expect(User.remindable).to_not include user }
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'when user does not have a last organization' do
|
50
|
+
let(:user) { create :user,
|
51
|
+
uid: 'user',
|
52
|
+
accepts_reminders: true,
|
53
|
+
last_submission_date: nil }
|
54
|
+
it { expect(User.remindable).to_not include user }
|
55
|
+
end
|
38
56
|
end
|
39
57
|
|
40
58
|
describe "we_miss_you_reminder" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-laboratory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mumukit-auth
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -359,6 +359,7 @@ files:
|
|
359
359
|
- app/helpers/choices_helper.rb
|
360
360
|
- app/helpers/concerns/with_student_path_navigation.rb
|
361
361
|
- app/helpers/concerns/with_student_path_navigation/continue_navigation.rb
|
362
|
+
- app/helpers/concerns/with_student_path_navigation/finish_navigation.rb
|
362
363
|
- app/helpers/concerns/with_student_path_navigation/navigation.rb
|
363
364
|
- app/helpers/concerns/with_student_path_navigation/revisit_navigation.rb
|
364
365
|
- app/helpers/contextualization_result_helper.rb
|
@@ -803,6 +804,7 @@ files:
|
|
803
804
|
- db/migrate/20180802190437_add_approved_to_messages.rb
|
804
805
|
- db/migrate/20181004173216_add_free_form_editor_to_exercises.rb
|
805
806
|
- db/migrate/20181014233438_remove_non_null_constraint_from_permissions.rb
|
807
|
+
- db/migrate/20181101180652_add_unique_index_to_organizations_name.rb
|
806
808
|
- db/seeds/users.rb
|
807
809
|
- lib/events.rb
|
808
810
|
- lib/mumuki/laboratory.rb
|