mumuki-laboratory 5.0.12 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +339 -0
- data/app/assets/javascripts/application/bridge.js +36 -7
- data/app/assets/javascripts/application/kids.js +92 -7
- data/app/assets/javascripts/application/submission.js +2 -1
- data/app/assets/stylesheets/application/modules/_highlight.scss +8 -0
- data/app/assets/stylesheets/application/modules/_kids.scss +92 -27
- data/app/controllers/api/base_controller.rb +23 -0
- data/app/controllers/api/courses_controller.rb +26 -0
- data/app/controllers/api/organizations_controller.rb +28 -0
- data/app/controllers/api/roles_controller.rb +47 -0
- data/app/controllers/api/students_controller.rb +9 -0
- data/app/controllers/api/teachers_controller.rb +9 -0
- data/app/controllers/api/users_controller.rb +18 -0
- data/app/controllers/assets_controller.rb +2 -1
- data/app/controllers/concerns/on_base_organization_only.rb +11 -0
- data/app/controllers/concerns/organizations_controller_template.rb +34 -0
- data/app/controllers/concerns/users_controller_template.rb +28 -0
- data/app/controllers/concerns/with_api_errors.rb +37 -0
- data/app/controllers/concerns/with_authorization.rb +19 -0
- data/app/controllers/concerns/with_errors_filter.rb +32 -0
- data/app/helpers/reset_button_helper.rb +1 -1
- data/app/models/api_client.rb +27 -0
- data/app/models/api_client_spec.rb +6 -0
- data/app/models/concerns/with_assignments.rb +4 -1
- data/app/models/course.rb +4 -6
- data/app/models/exercise/challenge.rb +5 -6
- data/app/models/language.rb +1 -1
- data/app/models/organization.rb +4 -0
- data/app/models/user.rb +22 -1
- data/app/views/exercise_solutions/_kids_results_button.html.erb +11 -0
- data/app/views/exercise_solutions/_results.html.erb +1 -7
- data/app/views/exercise_solutions/_results_button.html.erb +7 -0
- data/app/views/layouts/_kids.html.erb +5 -2
- data/app/views/layouts/exercise_inputs/editors/_custom.html.erb +1 -0
- data/app/views/layouts/exercise_inputs/forms/_kids_form.html.erb +3 -0
- data/app/views/layouts/exercise_inputs/layouts/_input_kids.html.erb +3 -3
- data/app/views/layouts/modals/_kids_context.html.erb +0 -3
- data/app/views/layouts/modals/_kids_results.html.erb +2 -0
- data/config/routes.rb +23 -0
- data/db/migrate/20180129142749_add_api_client.rb +11 -0
- data/lib/mumuki/laboratory/controllers/results_rendering.rb +7 -1
- data/lib/mumuki/laboratory/extensions/string.rb +8 -0
- data/lib/mumuki/laboratory/locales/en.yml +4 -0
- data/lib/mumuki/laboratory/locales/es.yml +4 -0
- data/lib/mumuki/laboratory/locales/pt.yml +4 -0
- data/lib/mumuki/laboratory/mumukit/auth.rb +7 -0
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/public/amarillo_exito.svg +11 -0
- data/public/amarillo_fracaso.svg +5 -0
- data/public/compass_rose.svg +1417 -0
- data/spec/controllers/api_clients_controller.rb +26 -0
- data/spec/controllers/confirmations_controller_spec.rb +1 -1
- data/spec/controllers/courses_api_controller_spec.rb +28 -0
- data/spec/controllers/exercise_solutions_controller_spec.rb +1 -1
- data/spec/controllers/messages_controller_spec.rb +1 -1
- data/spec/controllers/organizations_api_controller_spec.rb +235 -0
- data/spec/controllers/students_api_controller_spec.rb +101 -0
- data/spec/controllers/users_api_controller_spec.rb +56 -0
- data/spec/dummy/db/schema.rb +9 -0
- data/spec/factories/api_client_factory.rb +18 -0
- data/spec/factories/course_factory.rb +9 -0
- data/spec/features/chapter_spec.rb +1 -1
- data/spec/features/complements_flow_spec.rb +1 -1
- data/spec/features/exams_flow_spec.rb +1 -1
- data/spec/features/exercise_flow_spec.rb +1 -1
- data/spec/features/guide_reset_spec.rb +1 -1
- data/spec/features/guides_flow_spec.rb +1 -1
- data/spec/features/home_public_flow_spec.rb +1 -1
- data/spec/features/lessons_flow_spec.rb +1 -1
- data/spec/features/links_flow_spec.rb +1 -1
- data/spec/features/login_flow_spec.rb +1 -1
- data/spec/features/profile_flow_spec.rb +1 -1
- data/spec/features/standard_flow_spec.rb +1 -1
- data/spec/helpers/application_helper_spec.rb +1 -1
- data/spec/helpers/email_helper_spec.rb +1 -1
- data/spec/helpers/exercise_input_helper_spec.rb +1 -1
- data/spec/helpers/with_breadcrumbs_spec.rb +1 -1
- data/spec/helpers/with_navigation_spec.rb +1 -1
- data/spec/models/assignment_spec.rb +1 -1
- data/spec/models/book_import_spec.rb +1 -1
- data/spec/models/book_spec.rb +1 -1
- data/spec/models/course_spec.rb +1 -1
- data/spec/models/event_generation_spec.rb +1 -1
- data/spec/models/exam_spec.rb +1 -1
- data/spec/models/exercise_spec.rb +11 -3
- data/spec/models/guide_spec.rb +1 -1
- data/spec/models/interactive_spec.rb +1 -1
- data/spec/models/lesson_spec.rb +1 -1
- data/spec/models/message_spec.rb +1 -1
- data/spec/models/navigation_spec.rb +1 -1
- data/spec/models/organization_spec.rb +1 -1
- data/spec/models/problem_spec.rb +1 -1
- data/spec/models/question_spec.rb +1 -1
- data/spec/models/reading_spec.rb +1 -1
- data/spec/models/solution_spec.rb +1 -1
- data/spec/models/usage_spec.rb +1 -1
- data/spec/models/user_changed_spec.rb +1 -1
- data/spec/models/user_spec.rb +5 -5
- data/spec/spec_helper.rb +19 -3
- metadata +37 -2
data/spec/spec_helper.rb
CHANGED
@@ -29,19 +29,35 @@ require_relative './evaluation_helper'
|
|
29
29
|
|
30
30
|
RSpec.configure do |config|
|
31
31
|
config.before(:each) do
|
32
|
-
|
33
|
-
|
32
|
+
if RSpec.current_example.metadata[:organization_workspace] == :test
|
33
|
+
set_subdomain_host! 'test'
|
34
34
|
create(:public_organization,
|
35
35
|
name: 'test',
|
36
36
|
book: create(:book, name: 'test', slug: 'mumuki/mumuki-the-book')).switch!
|
37
|
+
elsif RSpec.current_example.metadata[:organization_workspace] == :base
|
38
|
+
set_subdomain_host! 'base'
|
39
|
+
create(:organization, name: 'base',
|
40
|
+
logo_url: 'http://mumuki.io/logo-alt-large.png',
|
41
|
+
terms_of_service: 'Default terms of service',
|
42
|
+
theme_stylesheet: '.defaultCssFromBase { css: red }',
|
43
|
+
extension_javascript: 'function jsFromBase() {}').switch!
|
37
44
|
end
|
38
45
|
end
|
39
46
|
|
40
47
|
config.after(:each) do
|
41
|
-
Mumukit::Platform::Organization.leave!
|
48
|
+
Mumukit::Platform::Organization.leave! if RSpec.current_example.metadata[:organization_workspace]
|
42
49
|
end
|
43
50
|
end
|
44
51
|
|
52
|
+
|
53
|
+
Mumukit::Auth.configure do |c|
|
54
|
+
c.clients.default = {id: 'test-client', secret: 'thisIsATestSecret'}
|
55
|
+
end
|
56
|
+
|
57
|
+
def set_api_client!
|
58
|
+
@request.env["HTTP_AUTHORIZATION"] = api_client.token
|
59
|
+
end
|
60
|
+
|
45
61
|
def reindex_organization!(organization)
|
46
62
|
organization.reload
|
47
63
|
organization.reindex_usages!
|
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.0
|
4
|
+
version: 5.1.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-04-
|
11
|
+
date: 2018-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -257,12 +257,25 @@ files:
|
|
257
257
|
- app/assets/stylesheets/application/modules/_upload.scss
|
258
258
|
- app/assets/stylesheets/application/modules/guide-corollary.scss
|
259
259
|
- app/controllers/ajax_controller.rb
|
260
|
+
- app/controllers/api/base_controller.rb
|
261
|
+
- app/controllers/api/courses_controller.rb
|
262
|
+
- app/controllers/api/organizations_controller.rb
|
263
|
+
- app/controllers/api/roles_controller.rb
|
264
|
+
- app/controllers/api/students_controller.rb
|
265
|
+
- app/controllers/api/teachers_controller.rb
|
266
|
+
- app/controllers/api/users_controller.rb
|
260
267
|
- app/controllers/appendixes_controller.rb
|
261
268
|
- app/controllers/application_controller.rb
|
262
269
|
- app/controllers/assets_controller.rb
|
263
270
|
- app/controllers/book_controller.rb
|
264
271
|
- app/controllers/chapters_controller.rb
|
265
272
|
- app/controllers/complements_controller.rb
|
273
|
+
- app/controllers/concerns/on_base_organization_only.rb
|
274
|
+
- app/controllers/concerns/organizations_controller_template.rb
|
275
|
+
- app/controllers/concerns/users_controller_template.rb
|
276
|
+
- app/controllers/concerns/with_api_errors.rb
|
277
|
+
- app/controllers/concerns/with_authorization.rb
|
278
|
+
- app/controllers/concerns/with_errors_filter.rb
|
266
279
|
- app/controllers/exams_controller.rb
|
267
280
|
- app/controllers/exercise_confirmations_controller.rb
|
268
281
|
- app/controllers/exercise_query_controller.rb
|
@@ -300,6 +313,8 @@ files:
|
|
300
313
|
- app/helpers/status_helper.rb
|
301
314
|
- app/mailers/application_mailer.rb
|
302
315
|
- app/mailers/user_mailer.rb
|
316
|
+
- app/models/api_client.rb
|
317
|
+
- app/models/api_client_spec.rb
|
303
318
|
- app/models/application_record.rb
|
304
319
|
- app/models/assignment.rb
|
305
320
|
- app/models/book.rb
|
@@ -375,7 +390,9 @@ files:
|
|
375
390
|
- app/views/errors/not_found.html.erb
|
376
391
|
- app/views/errors/unauthorized.html.erb
|
377
392
|
- app/views/exams/show.html.erb
|
393
|
+
- app/views/exercise_solutions/_kids_results_button.html.erb
|
378
394
|
- app/views/exercise_solutions/_results.html.erb
|
395
|
+
- app/views/exercise_solutions/_results_button.html.erb
|
379
396
|
- app/views/exercise_solutions/_results_title.html.erb
|
380
397
|
- app/views/exercises/show.html.erb
|
381
398
|
- app/views/invitations/show.html.erb
|
@@ -657,6 +674,7 @@ files:
|
|
657
674
|
- db/migrate/20180117014110_add_custom_editor_assets_to_language.rb
|
658
675
|
- db/migrate/20180123174410_add_initial_and_final_states_to_exercises.rb
|
659
676
|
- db/migrate/20180123180836_add_accepts_reminders_to_users.rb
|
677
|
+
- db/migrate/20180129142749_add_api_client.rb
|
660
678
|
- db/migrate/20180130194923_add_last_reminded_date_to_users.rb
|
661
679
|
- db/migrate/20180130204935_add_course.rb
|
662
680
|
- db/migrate/20180323125804_remove_user_name.rb
|
@@ -718,8 +736,11 @@ files:
|
|
718
736
|
- lib/tasks/users.rake
|
719
737
|
- public/422.html
|
720
738
|
- public/amarillo.svg
|
739
|
+
- public/amarillo_exito.svg
|
740
|
+
- public/amarillo_fracaso.svg
|
721
741
|
- public/anim_amarillo.svg
|
722
742
|
- public/character/kids/yellow_context.svg
|
743
|
+
- public/compass_rose.svg
|
723
744
|
- public/email-banner.png
|
724
745
|
- public/error_403.svg
|
725
746
|
- public/error_404.svg
|
@@ -731,9 +752,14 @@ files:
|
|
731
752
|
- public/logo-alt-large.png
|
732
753
|
- public/logo-alt.png
|
733
754
|
- spec/capybara_helper.rb
|
755
|
+
- spec/controllers/api_clients_controller.rb
|
734
756
|
- spec/controllers/confirmations_controller_spec.rb
|
757
|
+
- spec/controllers/courses_api_controller_spec.rb
|
735
758
|
- spec/controllers/exercise_solutions_controller_spec.rb
|
736
759
|
- spec/controllers/messages_controller_spec.rb
|
760
|
+
- spec/controllers/organizations_api_controller_spec.rb
|
761
|
+
- spec/controllers/students_api_controller_spec.rb
|
762
|
+
- spec/controllers/users_api_controller_spec.rb
|
737
763
|
- spec/dummy/Rakefile
|
738
764
|
- spec/dummy/bin/bundle
|
739
765
|
- spec/dummy/bin/rails
|
@@ -768,10 +794,12 @@ files:
|
|
768
794
|
- spec/dummy/db/seeds.rb
|
769
795
|
- spec/dummy/package.json
|
770
796
|
- spec/evaluation_helper.rb
|
797
|
+
- spec/factories/api_client_factory.rb
|
771
798
|
- spec/factories/assignments_factory.rb
|
772
799
|
- spec/factories/book_factory.rb
|
773
800
|
- spec/factories/chapter_factory.rb
|
774
801
|
- spec/factories/complement_factory.rb
|
802
|
+
- spec/factories/course_factory.rb
|
775
803
|
- spec/factories/exam_factory.rb
|
776
804
|
- spec/factories/exercise_factory.rb
|
777
805
|
- spec/factories/guide_factory.rb
|
@@ -903,9 +931,14 @@ specification_version: 4
|
|
903
931
|
summary: Code assement web application for the Mumuki Platform.
|
904
932
|
test_files:
|
905
933
|
- spec/capybara_helper.rb
|
934
|
+
- spec/controllers/api_clients_controller.rb
|
906
935
|
- spec/controllers/confirmations_controller_spec.rb
|
936
|
+
- spec/controllers/courses_api_controller_spec.rb
|
907
937
|
- spec/controllers/exercise_solutions_controller_spec.rb
|
908
938
|
- spec/controllers/messages_controller_spec.rb
|
939
|
+
- spec/controllers/organizations_api_controller_spec.rb
|
940
|
+
- spec/controllers/students_api_controller_spec.rb
|
941
|
+
- spec/controllers/users_api_controller_spec.rb
|
909
942
|
- spec/dummy/Rakefile
|
910
943
|
- spec/dummy/bin/bundle
|
911
944
|
- spec/dummy/bin/rails
|
@@ -940,10 +973,12 @@ test_files:
|
|
940
973
|
- spec/dummy/db/seeds.rb
|
941
974
|
- spec/dummy/package.json
|
942
975
|
- spec/evaluation_helper.rb
|
976
|
+
- spec/factories/api_client_factory.rb
|
943
977
|
- spec/factories/assignments_factory.rb
|
944
978
|
- spec/factories/book_factory.rb
|
945
979
|
- spec/factories/chapter_factory.rb
|
946
980
|
- spec/factories/complement_factory.rb
|
981
|
+
- spec/factories/course_factory.rb
|
947
982
|
- spec/factories/exam_factory.rb
|
948
983
|
- spec/factories/exercise_factory.rb
|
949
984
|
- spec/factories/guide_factory.rb
|