gaku_core 0.3.0.pre.0 → 0.3.0.pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/gaku/courses.js.coffee +20 -0
- data/app/assets/javascripts/gaku/exams.js.coffee +23 -0
- data/app/assets/stylesheets/gaku/bootstrap_and_theme.css.scss +574 -0
- data/app/controllers/gaku/courses/exams/exam_portion_scores_controller.rb +23 -0
- data/app/controllers/gaku/courses/exams_controller.rb +291 -0
- data/app/controllers/gaku/exams_controller.rb +170 -0
- data/app/helpers/gaku/gaku_helper.rb +155 -0
- data/app/models/gaku/enrollment.rb +1 -1
- data/app/models/gaku/exam_portion.rb +9 -0
- data/app/models/gaku/semester_connector.rb +1 -1
- data/app/models/gaku/student.rb +4 -0
- data/app/views/gaku/admin/grading_methods/_form_fields.html.slim +7 -0
- data/app/views/gaku/courses/_form_fields.html.slim +5 -0
- data/app/views/gaku/courses/exams/exam_portion_scores/update.js.erb +5 -0
- data/app/views/gaku/courses/exams/grading/_calculations.html.slim +16 -0
- data/app/views/gaku/courses/exams/grading/_exam_portion_score_form.htmls.lim +0 -0
- data/app/views/gaku/courses/exams/grading/_exam_scores.html.slim +78 -0
- data/app/views/gaku/courses/exams/grading/_students.html.slim +12 -0
- data/app/views/gaku/courses/exams/grading.html.slim +38 -0
- data/app/views/gaku/layouts/gaku.html.slim +25 -0
- data/app/views/gaku/shared/menu/_global.html.erb +1 -1
- data/config/locales/bg.yml +421 -413
- data/config/locales/en.yml +53 -110
- data/config/locales/ja.yml +891 -883
- data/config/locales/pt-BR.yml +11 -3
- data/config/locales/zh-CN.yml +9 -1
- data/config/routes.rb +120 -5
- data/db/migrate/20160209100945_add_score_types_to_exam_portions.rb +6 -0
- data/db/migrate/20160209104713_add_fields_to_exam_portion_score.rb +6 -0
- data/lib/gaku/grading/single/percentage.rb +3 -3
- data/lib/gaku/grading/single/score.rb +3 -3
- data/lib/gaku/testing/factories/exam_portion_factory.rb +1 -1
- metadata +20 -2
data/config/locales/pt-BR.yml
CHANGED
@@ -49,8 +49,8 @@ pt-BR:
|
|
49
49
|
zipcode: CEP
|
50
50
|
admitted: Admitido Em
|
51
51
|
alert:
|
52
|
-
already_added:
|
53
|
-
empty:
|
52
|
+
already_added: "%{resource} já foram adicionados!"
|
53
|
+
empty: "%{resource} está vazio!"
|
54
54
|
not_selected: Nenhum %{resource} selecionado!
|
55
55
|
and: e
|
56
56
|
are_you_sure: Você tem certeza?
|
@@ -240,7 +240,7 @@ pt-BR:
|
|
240
240
|
already_enrolled:
|
241
241
|
choose: Escolha Curso
|
242
242
|
code: Código de Curso
|
243
|
-
code_sample:
|
243
|
+
code_sample: "[EX: FALL2020]"
|
244
244
|
combined_code: Código Combinado
|
245
245
|
count: Contagem de cursos
|
246
246
|
edit: Editar Curso
|
@@ -452,6 +452,7 @@ pt-BR:
|
|
452
452
|
view:
|
453
453
|
weight:
|
454
454
|
exam_portion:
|
455
|
+
add_option:
|
455
456
|
adjustments:
|
456
457
|
attached_file_count:
|
457
458
|
count:
|
@@ -466,7 +467,14 @@ pt-BR:
|
|
466
467
|
name:
|
467
468
|
plural:
|
468
469
|
problem_count:
|
470
|
+
remove_option:
|
469
471
|
save:
|
472
|
+
score_selection_options:
|
473
|
+
score_type:
|
474
|
+
plural:
|
475
|
+
score:
|
476
|
+
score_selection:
|
477
|
+
score_text:
|
470
478
|
show:
|
471
479
|
singular:
|
472
480
|
use_weighting:
|
data/config/locales/zh-CN.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
zh-CN:
|
2
2
|
academic:
|
3
3
|
achievement:
|
4
|
-
add: 添加成就
|
4
|
+
add: "添加成就"
|
5
5
|
authority:
|
6
6
|
badge:
|
7
7
|
choose:
|
@@ -452,6 +452,7 @@ zh-CN:
|
|
452
452
|
view:
|
453
453
|
weight:
|
454
454
|
exam_portion:
|
455
|
+
add_option:
|
455
456
|
adjustments:
|
456
457
|
attached_file_count:
|
457
458
|
count:
|
@@ -466,7 +467,14 @@ zh-CN:
|
|
466
467
|
name:
|
467
468
|
plural:
|
468
469
|
problem_count:
|
470
|
+
remove_option:
|
469
471
|
save:
|
472
|
+
score_selection_options:
|
473
|
+
score_type:
|
474
|
+
plural:
|
475
|
+
score:
|
476
|
+
score_selection:
|
477
|
+
score_text:
|
470
478
|
show:
|
471
479
|
singular:
|
472
480
|
use_weighting:
|
data/config/routes.rb
CHANGED
@@ -1,10 +1,125 @@
|
|
1
1
|
Gaku::Core::Engine.routes.draw do
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
# concerns
|
4
|
+
|
5
|
+
concern :addresses do
|
6
|
+
resources :addresses, concerns: %i( soft_delete primary ), except: %i( show index soft )
|
7
|
+
end
|
8
|
+
|
9
|
+
concern :contacts do
|
10
|
+
resources :contacts, concerns: %i( soft_delete primary )
|
11
|
+
end
|
12
|
+
|
13
|
+
concern :notes do
|
14
|
+
resources :notes
|
15
|
+
end
|
16
|
+
|
17
|
+
concern :soft_delete do
|
18
|
+
patch :recovery, on: :member
|
19
|
+
patch :soft_delete, on: :member
|
20
|
+
end
|
21
|
+
|
22
|
+
concern(:primary) { patch :make_primary, on: :member }
|
23
|
+
concern(:show_deleted) { get :show_deleted, on: :member }
|
24
|
+
concern(:pagination) { get 'page/:page', action: :index, on: :collection }
|
25
|
+
concern(:sort) { post :sort, on: :collection }
|
26
|
+
concern(:download) { get :download, on: :member }
|
27
|
+
|
28
|
+
concern(:enroll_students) { post :enroll_students, on: :collection }
|
29
|
+
concern(:enroll_student) { post :enroll_student, on: :collection }
|
30
|
+
concern(:student_chooser) { get :student_chooser, on: :member }
|
31
|
+
|
32
|
+
# devise
|
33
|
+
devise_for :users, {
|
34
|
+
class_name: 'Gaku::User',
|
35
|
+
module: :devise,
|
36
|
+
controllers: {
|
37
|
+
sessions: 'gaku/devise/sessions',
|
38
|
+
registrations: 'gaku/devise/registrations',
|
39
|
+
passwords: 'gaku/devise/passwords'
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
devise_scope :user do
|
44
|
+
get :set_up_admin_account, to: 'devise/registrations#set_up_admin_account'
|
45
|
+
post :create_admin, to: 'devise/registrations#create_admin'
|
46
|
+
end
|
47
|
+
|
48
|
+
resources :extracurricular_activities, concerns: %i( student_chooser pagination soft_delete show_deleted ) do
|
49
|
+
resources :students,
|
50
|
+
controller: 'extracurricular_activities/students',
|
51
|
+
concerns: %i( enroll_student )
|
52
|
+
end
|
53
|
+
|
54
|
+
resources :class_groups, concerns: %i( notes soft_delete student_chooser ) do
|
55
|
+
resources :semester_class_groups, controller: 'class_groups/semester_class_groups'
|
56
|
+
resources :class_group_course_enrollments, controller: 'class_groups/courses', only: %i( new create destroy )
|
57
|
+
resources :students, controller: 'class_groups/students', only: %i( new destroy ), concerns: %i( enroll_student )
|
58
|
+
end
|
59
|
+
|
60
|
+
resources :courses, concerns: %i( notes student_chooser soft_delete show_deleted ) do
|
61
|
+
resources :semester_courses, controller: 'courses/semester_courses'
|
62
|
+
resources :enrollments, controller: 'courses/enrollments', concerns: %i( enroll_student ) do
|
63
|
+
post :enroll_class_group, on: :collection
|
64
|
+
end
|
65
|
+
|
66
|
+
resources :exams, controller: 'courses/exams' do
|
67
|
+
resources :exam_portion_scores, controller: 'courses/exams/exam_portion_scores' do
|
68
|
+
resources :attendances
|
69
|
+
end
|
70
|
+
|
71
|
+
collection do
|
72
|
+
get :grading
|
73
|
+
get :export
|
74
|
+
end
|
75
|
+
|
76
|
+
member do
|
77
|
+
get :grading
|
78
|
+
put :update_score
|
79
|
+
get :completed
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
resources :class_group_enrollments, concerns: %i( enroll_students )
|
85
|
+
resources :course_enrollments, concerns: %i( enroll_students )
|
86
|
+
resources :extracurricular_activity_enrollments, concerns: %i( enroll_students )
|
87
|
+
|
88
|
+
resources :syllabuses, concerns: %i( notes soft_delete show_deleted ) do
|
89
|
+
resources :assignments, controller: 'syllabuses/assignments'
|
90
|
+
resources :exams, controller: 'syllabuses/exams'
|
91
|
+
resources :exam_syllabuses, controller: 'syllabuses/exam_syllabuses'
|
92
|
+
end
|
93
|
+
|
94
|
+
resources :teachers, concerns: %i( addresses contacts notes soft_delete show_deleted pagination )
|
95
|
+
|
96
|
+
resources :students, concerns: %i( addresses contacts notes soft_delete show_deleted pagination ) do
|
97
|
+
get :load_autocomplete_data, on: :collection
|
98
|
+
|
99
|
+
resources :simple_grades, controller: 'students/simple_grades', except: :show
|
100
|
+
resources :commute_methods, controller: 'students/commute_methods'
|
101
|
+
resources :student_achievements, controller: 'students/student_achievements', except: :show
|
102
|
+
resources :student_specialties, controller: 'students/student_specialties', except: :show
|
103
|
+
|
104
|
+
resources :guardians, except: %i( index show ),
|
105
|
+
controller: 'students/guardians',
|
106
|
+
concerns: %i( addresses contacts soft_delete )
|
107
|
+
|
108
|
+
resources :course_enrollments,
|
109
|
+
controller: 'students/course_enrollments',
|
110
|
+
only: %i( new create destroy )
|
111
|
+
|
112
|
+
resources :class_group_enrollments, controller: 'students/class_group_enrollments'
|
113
|
+
end
|
114
|
+
|
115
|
+
resources :exams, concerns: %i( notes soft_delete ) do
|
116
|
+
put :create_exam_portion, on: :member
|
117
|
+
|
118
|
+
resources :exam_scores
|
119
|
+
resources :exam_portions, controller: 'exams/exam_portions', concerns: %i( sort ) do
|
120
|
+
resources :attachments, controller: 'exams/exam_portions/attachments'
|
121
|
+
end
|
122
|
+
end
|
8
123
|
|
9
124
|
resources :states, only: :index
|
10
125
|
|
@@ -7,9 +7,9 @@ class Gaku::Grading::Single::Percentage < Gaku::Grading::Single::BaseMethod
|
|
7
7
|
|
8
8
|
@scores = []
|
9
9
|
@max_score = exam.max_score
|
10
|
-
exam.exam_portions.each_with_index do |exam_portion, index|
|
11
|
-
ep_score = @student.exam_portion_scores.
|
12
|
-
@scores << ep_score.score if ep_score
|
10
|
+
exam.exam_portions.select(&:score?).each_with_index do |exam_portion, index|
|
11
|
+
ep_score = @student.exam_portion_scores.find_by(gradable: gradable_scope, exam_portion_id: exam_portion.id)
|
12
|
+
@scores << ep_score.score if ep_score.score
|
13
13
|
end
|
14
14
|
|
15
15
|
@result = { id: @student.id, score: formated_score }
|
@@ -3,9 +3,9 @@ class Gaku::Grading::Single::Score < Gaku::Grading::Single::BaseMethod
|
|
3
3
|
def grade_exam
|
4
4
|
@score = nil
|
5
5
|
exam = @gradable
|
6
|
-
exam.exam_portions.each_with_index do |exam_portion, index|
|
7
|
-
ep_score = @student.exam_portion_scores.
|
8
|
-
@score = @score.to_f + ep_score.score if ep_score
|
6
|
+
exam.exam_portions.select(&:score?).each_with_index do |exam_portion, index|
|
7
|
+
ep_score = @student.exam_portion_scores.find_by(gradable: gradable_scope, exam_portion_id: exam_portion.id)
|
8
|
+
@score = @score.to_f + ep_score.score if ep_score.score
|
9
9
|
end
|
10
10
|
|
11
11
|
@result = { id: @student.id, score: @score }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gaku_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.0.pre.
|
4
|
+
version: 0.3.0.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rei Kagetsuki
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-12-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -309,12 +309,19 @@ files:
|
|
309
309
|
- app/assets/images/tick.png
|
310
310
|
- app/assets/images/ui-bg_flat_75_ffffff_40x100.png
|
311
311
|
- app/assets/images/up_arrow.gif
|
312
|
+
- app/assets/javascripts/gaku/courses.js.coffee
|
313
|
+
- app/assets/javascripts/gaku/exams.js.coffee
|
314
|
+
- app/assets/stylesheets/gaku/bootstrap_and_theme.css.scss
|
312
315
|
- app/controllers/gaku/core_controller.rb
|
316
|
+
- app/controllers/gaku/courses/exams/exam_portion_scores_controller.rb
|
317
|
+
- app/controllers/gaku/courses/exams_controller.rb
|
318
|
+
- app/controllers/gaku/exams_controller.rb
|
313
319
|
- app/decorators/gaku/course_decorator.rb
|
314
320
|
- app/decorators/gaku/guardian_decorator.rb
|
315
321
|
- app/decorators/gaku/person_decorator.rb
|
316
322
|
- app/decorators/gaku/student_decorator.rb
|
317
323
|
- app/decorators/gaku/teacher_decorator.rb
|
324
|
+
- app/helpers/gaku/gaku_helper.rb
|
318
325
|
- app/models/application_record.rb
|
319
326
|
- app/models/concerns/addresses.rb
|
320
327
|
- app/models/concerns/contacts.rb
|
@@ -403,6 +410,15 @@ files:
|
|
403
410
|
- app/services/gaku/user_creator.rb
|
404
411
|
- app/views/gaku/admin/grading_methods/_arguments_form_fields.html.slim
|
405
412
|
- app/views/gaku/admin/grading_methods/_arguments_template.html.slim
|
413
|
+
- app/views/gaku/admin/grading_methods/_form_fields.html.slim
|
414
|
+
- app/views/gaku/courses/_form_fields.html.slim
|
415
|
+
- app/views/gaku/courses/exams/exam_portion_scores/update.js.erb
|
416
|
+
- app/views/gaku/courses/exams/grading.html.slim
|
417
|
+
- app/views/gaku/courses/exams/grading/_calculations.html.slim
|
418
|
+
- app/views/gaku/courses/exams/grading/_exam_portion_score_form.htmls.lim
|
419
|
+
- app/views/gaku/courses/exams/grading/_exam_scores.html.slim
|
420
|
+
- app/views/gaku/courses/exams/grading/_students.html.slim
|
421
|
+
- app/views/gaku/layouts/gaku.html.slim
|
406
422
|
- app/views/gaku/shared/menu/_global.html.erb
|
407
423
|
- config/initializers/active_record.rb
|
408
424
|
- config/initializers/devise.rb
|
@@ -453,6 +469,8 @@ files:
|
|
453
469
|
- db/migrate/20140728121353_create_student_review_table.rb
|
454
470
|
- db/migrate/20150213095508_improve_countries_and_states.rb
|
455
471
|
- db/migrate/20160125194100_add_gradable_to_exam_portion_score.rb
|
472
|
+
- db/migrate/20160209100945_add_score_types_to_exam_portions.rb
|
473
|
+
- db/migrate/20160209104713_add_fields_to_exam_portion_score.rb
|
456
474
|
- db/migrate/20170509132020_change_enrollmentable_to_enrollable.rb
|
457
475
|
- db/schema.rb
|
458
476
|
- db/seeds.rb
|