gaku_frontend 0.2.4 → 0.3.0.pre.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +17 -0
  3. data/app/assets/javascripts/gaku/frontend/courses.js.coffee +5 -5
  4. data/app/assets/javascripts/gaku/frontend/exams.js.coffee +25 -0
  5. data/app/controllers/gaku/courses/exams_controller.rb +12 -12
  6. data/app/controllers/gaku/devise/sessions_controller.rb +1 -1
  7. data/app/controllers/gaku/enrollments_controller.rb +1 -1
  8. data/app/controllers/gaku/exam_portion_scores_controller.rb +16 -7
  9. data/app/controllers/gaku/exams/exam_sessions/enrollments_controller.rb +5 -0
  10. data/app/controllers/gaku/exams/exam_sessions_controller.rb +20 -1
  11. data/app/helpers/gaku/frontend_helper.rb +4 -0
  12. data/app/views/gaku/courses/exams/_grading_table_student_field.html.slim +1 -2
  13. data/app/views/gaku/courses/exams/grading.html.slim +1 -0
  14. data/app/views/gaku/enrollments/create_from_selection.js.erb +3 -0
  15. data/app/views/gaku/exams/edit.html.slim +1 -1
  16. data/app/views/gaku/exams/exam_sessions/_edit_form.html.slim +9 -0
  17. data/app/views/gaku/exams/exam_sessions/edit.html.slim +16 -14
  18. data/app/views/gaku/shared/grading/_exam_portion_head.html.slim +5 -0
  19. data/app/views/gaku/shared/grading/_grading_table_head.html.slim +12 -0
  20. data/app/views/gaku/shared/grading/_grading_table_student_field.html.slim +14 -0
  21. data/app/views/gaku/shared/grading/grading.html.slim +8 -0
  22. data/app/views/gaku/syllabuses/exams/_form_fields.html.slim +1 -1
  23. data/config/initializers/assets.rb +1 -0
  24. data/config/routes.rb +12 -3
  25. data/gaku_frontend.gemspec +46 -0
  26. data/lib/gaku/frontend.rb +4 -4
  27. data/lib/tasks/core.rake +1 -1
  28. metadata +82 -105
  29. data/app/views/gaku/exams/exam_sessions/_students.html.slim +0 -1
  30. data/app/views/gaku/exams/exam_sessions/_tabs.html.slim +0 -10
  31. data/app/views/gaku/exams/exam_sessions/update.js.erb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0bae0b99880236082e693827cac121c789d8a9e
4
- data.tar.gz: 6f564757bdec788333fe0d61d8c28c5ccc433e51
3
+ metadata.gz: 9d0c76c1618ebf30b430a907955f1acda641afa7
4
+ data.tar.gz: dc74445eb99cd221e91116b59fd7b2d537571d12
5
5
  SHA512:
6
- metadata.gz: a5947e576f0c40fb0b9107d69d8fa6ef50f13d6c796b5376b32cd3124ff82709bbc2600eeb8a84b1b24ec07e0086d5b6dc5f08c5638d7a617bb6542777b5644c
7
- data.tar.gz: 7b4e1a93dcf5cef6acf0d841456986b0559b569bedd63b8a8022427aaf9a31285819e57da7f0885f850ceef0e6a8f4966105f9baa0287fb30ed7ac076d780aaa
6
+ metadata.gz: 585218010d9e0ad71bb416fbdd98d9dffe8043434c3da9651723f10d2581423d35c4acea463fd39bf702aafc97eddf16894494ad9b46c9be08c85fba552f7638
7
+ data.tar.gz: 0e9f12084606338f49952b40542a56b04b4a5350bfa93b7a254a225dcb020fee649465683ae7a365094587313c0ea995f244e11c06b388f1289f4c45cde7f0d3
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'rake'
4
+ require 'rake/testtask'
5
+ require 'rake/packagetask'
6
+ require 'rubygems/package_task'
7
+ require 'gaku/testing/common_rake'
8
+
9
+ Bundler::GemHelper.install_tasks
10
+
11
+ task default: :spec
12
+
13
+ desc 'Generates a dummy app for testing'
14
+ task :test_app do
15
+ ENV['LIB_NAME'] = 'gaku/frontend'
16
+ Rake::Task['common:test_app'].invoke
17
+ end
@@ -12,7 +12,9 @@ ready = ->
12
12
 
13
13
  socket.on "grading-change", (message) ->
14
14
  exam_id = message.exam_id
15
- course_id = message.course_id
15
+ gradable_id = message.gradable_id
16
+ gradable_type = message.gradable_type
17
+
16
18
  if message.exam_portion_score
17
19
  exam_portion_score = message.exam_portion_score.exam_portion_score
18
20
  form = $("#edit_exam_portion_score_#{exam_portion_score.id}")
@@ -20,14 +22,12 @@ ready = ->
20
22
  input.val("#{exam_portion_score.score}")
21
23
  for grading_method_id, calculation of message.calculations
22
24
  if calculation.student_results
23
- console.log('vika me collection')
24
25
  for result in calculation.student_results
25
- el = $("#course-#{course_id}-exam-#{exam_id}-student-#{result.id}-grading-method-#{grading_method_id}-score")
26
+ el = $("##{gradable_type}-#{gradable_id}-exam-#{exam_id}-student-#{result.id}-grading-method-#{grading_method_id}-score")
26
27
  el.html result.score
27
28
 
28
29
  else
29
- console.log('vika me single')
30
- el = $("#course-#{course_id}-exam-#{exam_id}-student-#{calculation.id}-grading-method-#{grading_method_id}-score")
30
+ el = $("##{gradable_type}-#{gradable_id}-exam-#{exam_id}-student-#{calculation.id}-grading-method-#{grading_method_id}-score")
31
31
  el.html calculation.score
32
32
 
33
33
  @app.courses = new CoursesController
@@ -18,6 +18,31 @@ ready = ->
18
18
  # $('.exam_weightformError').remove()
19
19
  edit: ->
20
20
  $('.datetimepicker').datetimepicker()
21
+ grading: ->
22
+ socket = io.connect("http://localhost:5001")
23
+
24
+ socket.on "grading-change", (message) ->
25
+ exam_id = message.exam_id
26
+ gradable_id = message.gradable_id
27
+ gradable_type = message.gradable_type
28
+ console.log message
29
+
30
+ if message.exam_portion_score
31
+ exam_portion_score = message.exam_portion_score.exam_portion_score
32
+ form = $("#edit_exam_portion_score_#{exam_portion_score.id}")
33
+ input = form.children('input#exam_portion_score_score')
34
+ input.val("#{exam_portion_score.score}")
35
+ for grading_method_id, calculation of message.calculations
36
+ if calculation.student_results
37
+ for result in calculation.student_results
38
+ el = $("##{gradable_type}-#{gradable_id}-exam-#{exam_id}-student-#{result.id}-grading-method-#{grading_method_id}-score")
39
+ el.html result.score
40
+
41
+ else
42
+ el = $("##{gradable_type}-#{gradable_id}-exam-#{exam_id}-student-#{calculation.id}-grading-method-#{grading_method_id}-score")
43
+ console.log el
44
+ el.html calculation.score
45
+
21
46
 
22
47
  @app.exams = new ExamsController
23
48
 
@@ -11,26 +11,26 @@ module Gaku
11
11
 
12
12
  def grading
13
13
  @course = Course.find(params[:course_id])
14
- @exam = Exam.find(params[:id])
14
+ @exam = Exam.includes(exam_portions: :exam_portion_scores).find(params[:id])
15
15
  @students = @course.students
16
16
  @grading_methods = @course.grading_methods
17
+ @gradable_scope = @course
18
+ init_portion_scores
17
19
 
18
- @grading_calculations = Grading::Collection::Calculations.new(@grading_methods, @students, @exam).calculate
20
+ @grading_calculations = Grading::Collection::Calculations.new(@grading_methods, @students, @exam, @gradable_scope).calculate
19
21
 
20
- respond_with @exam
22
+ render 'gaku/shared/grading/grading'
21
23
  end
22
24
 
23
25
  private
24
26
 
25
- # def init_portion_scores
26
- # @students.each do |student|
27
- # @exam.exam_portions.each do |portion|
28
- # unless portion.exam_portion_scores.pluck(:student_id).include?(student.id)
29
- # ExamPortionScore.create!(exam_portion: portion, student: student)
30
- # end
31
- # end
32
- # end
33
- # end
27
+ def init_portion_scores
28
+ @students.each do |student|
29
+ @exam.exam_portions.each do |portion|
30
+ portion.exam_portion_scores.where(student: student, gradable: @gradable_scope).first_or_create
31
+ end
32
+ end
33
+ end
34
34
 
35
35
  end
36
36
  end
@@ -2,7 +2,7 @@ class Gaku::Devise::SessionsController < Devise::SessionsController
2
2
  # helper Gaku::GakuHelper
3
3
  layout 'gaku/layouts/gaku'
4
4
 
5
- skip_before_filter :require_login, except: %i( new create )
5
+ # skip_before_filter :require_login, except: %i( new create )
6
6
 
7
7
  def create
8
8
  self.resource = warden.authenticate!(auth_options)
@@ -12,7 +12,7 @@ module Gaku
12
12
 
13
13
  def student_selection
14
14
  @enrollment = @enrollmentable.enrollments.new
15
- @student_selection = Gaku::StudentSelection.new(current_user).all
15
+ @student_selection = Gaku::StudentSelection.new(current_user).students
16
16
  end
17
17
 
18
18
  def new
@@ -3,7 +3,7 @@ module Gaku
3
3
 
4
4
  respond_to :js
5
5
 
6
- before_action :set_course, only: :update
6
+ before_action :set_resource, only: :update
7
7
  before_action :set_exam, only: :update
8
8
 
9
9
  def update
@@ -11,13 +11,13 @@ module Gaku
11
11
  exam_portion_score.update_attributes(exam_portion_score_params)
12
12
 
13
13
  student = exam_portion_score.student
14
- grading_methods = @course.grading_methods
15
-
16
- calculations = Grading::Single::Calculations.new(grading_methods, student, @exam, @course.students).calculate
14
+ grading_methods = @gradable_scope.grading_methods
17
15
 
16
+ calculations = Grading::Single::Calculations.new(grading_methods, student, @exam, @gradable_scope, @gradable_scope.students).calculate
18
17
  message = {
19
18
  exam_id: @exam.id,
20
- course_id: @course.id,
19
+ gradable_type: gradable_type,
20
+ gradable_id: @gradable_scope.id,
21
21
  calculations: calculations,
22
22
  exam_portion_score: exam_portion_score
23
23
  }
@@ -37,13 +37,22 @@ module Gaku
37
37
  %i( score )
38
38
  end
39
39
 
40
- def set_course
41
- @course = Course.find(params[:course_id])
40
+ def set_resource
41
+ @gradable_scope = "gaku/#{request_path_array[1]}".classify.constantize.find(request_path_array[2])
42
42
  end
43
43
 
44
44
  def set_exam
45
45
  @exam = Exam.find(params[:exam_id])
46
46
  end
47
47
 
48
+ def request_path_array
49
+ request.path.split('/')
50
+ end
51
+
52
+ def gradable_type
53
+ @gradable_scope.class.to_s.demodulize.underscore.dasherize
54
+ end
55
+
56
+
48
57
  end
49
58
  end
@@ -0,0 +1,5 @@
1
+ module Gaku
2
+ class Exams::ExamSessions::EnrollmentsSessionsController < EnrollmentsController
3
+
4
+ end
5
+ end
@@ -3,7 +3,7 @@ module Gaku
3
3
 
4
4
  respond_to :js, except: :index
5
5
 
6
- before_filter :set_exam_session, only: %i( edit update destroy )
6
+ before_filter :set_exam_session, only: %i( edit update destroy grading )
7
7
  before_filter :load_data, only: %i( new edit )
8
8
  before_filter :set_count, only: :create
9
9
 
@@ -32,6 +32,17 @@ module Gaku
32
32
  respond_with @exam_session, location: [:exams]
33
33
  end
34
34
 
35
+ def grading
36
+ @gradable_scope = @exam_session
37
+ @exam = @exam_session.exam
38
+ @students = @gradable_scope.students
39
+ @grading_methods = @gradable_scope.grading_methods
40
+ init_portion_scores
41
+
42
+ @grading_calculations = Grading::Collection::Calculations.new(@grading_methods, @students, @exam, @gradable_scope).calculate
43
+ render 'gaku/shared/grading/grading'
44
+ end
45
+
35
46
  private
36
47
 
37
48
  def exam_session_params
@@ -54,5 +65,13 @@ module Gaku
54
65
  @count = ExamSession.count
55
66
  end
56
67
 
68
+ def init_portion_scores
69
+ @students.each do |student|
70
+ @exam.exam_portions.each do |portion|
71
+ portion.exam_portion_scores.where(student: student, gradable: @gradable_scope).first_or_create
72
+ end
73
+ end
74
+ end
75
+
57
76
  end
58
77
  end
@@ -8,6 +8,10 @@ module Gaku
8
8
  include Gaku::StudentChooserHelper
9
9
  include Gaku::StudentsHelper
10
10
 
11
+ def gradable_resource(gradable)
12
+ gradable.class.to_s.demodulize.underscore.dasherize
13
+ end
14
+
11
15
  def badge_count(count, text, css_class)
12
16
  if count != 0
13
17
  "#{text}<span class='badge pull-right #{css_class}'>#{count}</span>".html_safe
@@ -2,10 +2,9 @@
2
2
  td.vm-tc
3
3
  td.vm-tc
4
4
  td.vm = "#{student.name} #{student.surname}"
5
-
6
5
  - @exam.exam_portions.each do |portion|
7
6
  - portion.exam_portion_scores.each do |score|
8
- - if score.student_id == student.id
7
+ - if score.student_id == student.id && score.gradable == @gradable_scope
9
8
  td
10
9
  = form_for [@course, @exam, score], remote: true do |f|
11
10
  = f.number_field :score, min: 0, max: portion.max_score, class: 'span12'
@@ -1,5 +1,6 @@
1
1
  row
2
2
  .span12
3
+ #generate-report
3
4
  table.main-grading.table.table-bordered.table-condensed
4
5
  thead
5
6
  = render 'grading_table_head'
@@ -1,5 +1,8 @@
1
1
  $('#student-selection').modal('hide');
2
2
 
3
+ $(".<%= @enrollmentable_resource %>-enrollments-count").html("<%= print_count(@count, t(:'student.list')) %>");
4
+ $('.students-count').html("<%= @count %>");
5
+
3
6
  <% @enrollments.each do |enrollment| %>
4
7
  $("#<%= @enrollmentable_resource %>-enrollments-index tbody").append('<%= j render("enrollment", {enrollment: enrollment}) %>');
5
8
  <% end %>
@@ -7,7 +7,7 @@
7
7
  h4#exam-edit-menu.panel-title
8
8
  = link_to t(:'edit'), [:edit, @exam], remote: true
9
9
  .panel-body
10
- ul.list-unstyled
10
+ ul#edit-panel.list-unstyled
11
11
  li#exams-notes-menu
12
12
  = link_to badge_count(@exam.notes_count, t(:'note.plural'),'notes-count'), [@exam, :notes], remote: true
13
13
  li#exams-grading-methods-menu
@@ -0,0 +1,9 @@
1
+ = normal_form_for @exam_session, label: t(:'exam_session.singular') do |f|
2
+ = render 'form_fields', f: f
3
+ = buttons_for @exan_session
4
+
5
+ = footer do
6
+ .col-md-3.pull-right
7
+ = link_to_modal_delete
8
+ .delete_modal
9
+ = render 'gaku/shared/delete_modal', target: @exam
@@ -1,16 +1,18 @@
1
1
  .row
2
- .col-md-12
3
- = normal_form_for @exam_session, label: 'nil' do |f|
4
- = render 'form_fields', f: f, exam_session: @exam_session
5
- = buttons_for @exam_session
2
+ .col-md-2
3
+ .panel-group#accordion
6
4
 
7
- hr
8
-
9
- = render 'tabs'
10
-
11
- = footer do
12
- .col-md-9
13
- = link_to_index exams_path
14
- .col-md-3
15
- = link_to_modal_delete
16
- = render 'gaku/shared/delete_modal_without_soft', target: @exam_session
5
+ .panel.panel-default
6
+ .panel-heading
7
+ h4#exam-session-edit-menu.panel-title
8
+ = link_to t(:'edit'), [:edit, @exam_session], remote: true
9
+ .panel-body
10
+ ul#edit-panel.list-unstyled
11
+ li#exam-sessions-enrollments-menu
12
+ = link_to badge_count(@exam_session.students.count, t(:'student.plural'), 'students-count'), [@exam_session, :enrollments], remote: true
13
+ li#exam-sessions-grading-methods-menu
14
+ = link_to badge_count(@exam_session.grading_method_connectors.count, t(:'grading_method.plural'), 'grading-methods-count'), [@exam_session, :grading_method_connectors], remote: true
15
+ li#exam-sessions-grading
16
+ = link_to t('grade.grading'), grading_exam_session_path(@exam_session)
17
+ .col-md-10#ajax-load
18
+ = render 'edit_form', exam: @exam
@@ -0,0 +1,5 @@
1
+ th.btn-warning style="width: 160px"
2
+ = exam_portion.name
3
+ - if @exam.use_weighting
4
+ span style='margin-left: 5px'
5
+ = exam_portion.max_score
@@ -0,0 +1,12 @@
1
+ tr
2
+ th.btn-primary colspan='3' =t(:'student.singular')
3
+ th.btn-success colspan="#{@exam.exam_portions_count + @grading_methods.count}"= @exam.name
4
+ tr
5
+ th.btn-info style="width:60px" Class
6
+ th.btn-info style="width:60px" Seat_Number
7
+ th.btn-info style="width:150px" Name
8
+ = render partial: 'gaku/shared/grading/exam_portion_head', collection: @exam.exam_portions, as: :exam_portion
9
+ / th.btn-danger style="width:60px" Score
10
+ - @gradable_scope.grading_methods.each do |grading_method|
11
+ th.btn-danger style="width:60px"
12
+ = grading_method
@@ -0,0 +1,14 @@
1
+ = tr_for student do
2
+ td.vm-tc
3
+ td.vm-tc
4
+ td.vm = "#{student.name} #{student.surname}"
5
+ - @exam.exam_portions.each do |portion|
6
+ - portion.exam_portion_scores.each do |score|
7
+ - if score.student_id == student.id && score.gradable == @gradable_scope
8
+ td
9
+ = form_for [@gradable_scope, @exam, score], remote: true do |f|
10
+ = f.number_field :score, min: 0, max: portion.max_score, class: 'span12'
11
+ - @grading_methods.each do |grading_method|
12
+ td.vm id="#{gradable_resource(@gradable_scope)}-#{@gradable_scope.id}-exam-#{@exam.id}-student-#{student.id}-grading-method-#{grading_method.id}-score"
13
+ = @grading_calculations[grading_method.id]['student_results'].find { |h| h['id'] == student.id }['score']
14
+ / td.vm
@@ -0,0 +1,8 @@
1
+ row
2
+ .span12
3
+ #generate-report
4
+ table.main-grading.table.table-bordered.table-condensed
5
+ thead
6
+ = render partial: 'gaku/shared/grading/grading_table_head'
7
+ tbody
8
+ = render partial: 'gaku/shared/grading/grading_table_student_field', collection: @students, as: :student
@@ -2,7 +2,7 @@
2
2
  .col-md-6
3
3
  = f.text_field :name, label: t(:'exam.name')
4
4
  .col-md-6
5
- = f.collection_select :grading_method_id, @grading_methods, :id, :name, { include_blank: true }, label: t(:'exam.grading_method')
5
+ = f.select :grading_method_id, options_for_select(@grading_methods), { include_blank: true }, label: t(:'exam.grading_method')
6
6
  .row
7
7
  .col-md-6
8
8
  = f.text_area :description, size: "0x2", label: t(:'exam.description')
@@ -0,0 +1 @@
1
+ Rails.application.config.assets.precompile += %w( gakuengine20.png gaku-logo.png missing_thumb.png )
data/config/routes.rb CHANGED
@@ -98,6 +98,7 @@ Gaku::Core::Engine.routes.draw do
98
98
  get :grading
99
99
  put :update_score
100
100
  get :completed
101
+ post :generate, to: 'courses/exams/reports#generate'
101
102
  end
102
103
  end
103
104
  end
@@ -123,6 +124,7 @@ Gaku::Core::Engine.routes.draw do
123
124
  resources :guardians, only: [], concerns: %i( addresses contacts set_picture )
124
125
 
125
126
  resources :students, concerns: %i( addresses contacts notes pagination set_picture ) do
127
+
126
128
  get :search, on: :collection
127
129
  get :clear_search, on: :collection
128
130
  get :advanced_search, on: :collection
@@ -132,6 +134,8 @@ Gaku::Core::Engine.routes.draw do
132
134
  resources :badges, controller: 'students/badges', except: :show
133
135
  resources :student_specialties, controller: 'students/student_specialties', except: :show
134
136
  resources :external_school_records, controller: 'students/external_school_records', except: :show
137
+ resources :reports, only: :index, controller: 'students/reports'
138
+
135
139
 
136
140
  resources :guardians, except: %i( show )
137
141
 
@@ -140,16 +144,21 @@ Gaku::Core::Engine.routes.draw do
140
144
  enrollment.resources :course_enrollments, controller: 'students/course_enrollments'
141
145
  enrollment.resources :extracurricular_activity_enrollments, controller: 'students/extracurricular_activity_enrollments'
142
146
  end
147
+ end
143
148
 
144
- resources :reports, only: :index, controller: 'students/reports'
149
+ resources :exam_sessions, concerns: %i( enrollmentable gradable ), controller: 'exams/exam_sessions', except: :index do
150
+ post :generate, to: 'exams/exam_sessions/reports#generate', on: :member
145
151
 
152
+ get :grading, on: :member
153
+ resources :exam, only: %i() do
154
+ resources :exam_portion_scores, only: :update
155
+ end
146
156
  end
147
157
 
148
- resources :exam_sessions, controller: 'exams/exam_sessions', except: :index
149
-
150
158
  resources :exams, concerns: %i( notes pagination gradable ) do
151
159
  put :create_exam_portion, on: :member
152
160
 
161
+ resources :reports, controller: 'exams/reports'
153
162
  resources :exam_scores
154
163
  resources :exam_portions, controller: 'exams/exam_portions', concerns: %i( sort ) do
155
164
  resources :attachments, concerns: %i( download soft_delete )
@@ -0,0 +1,46 @@
1
+ # encoding: UTF-8
2
+
3
+ require_relative '../common_gaku_gemspec_mixin'
4
+
5
+ Gem::Specification.new do |s|
6
+ set_gaku_gemspec_shared s
7
+
8
+ s.name = 'gaku_frontend'
9
+ s.summary = 'Default front end web views for GAKU Engine. See https://github.com/GAKUEngine/gaku'
10
+ s.description = 'The default Rails front end for GAKU Engine, with web views etc.'
11
+
12
+ s.files = Dir.glob("{app,config,lib}/**/*") +
13
+ [
14
+ 'Rakefile',
15
+ 'gaku_frontend.gemspec'
16
+ ]
17
+ s.require_path = 'lib'
18
+
19
+ s.requirements << 'postgresql'
20
+ s.requirements << 'postgresql-contrib'
21
+
22
+ s.add_dependency 'deface', '~> 1.2.0'
23
+ s.add_dependency 'coffee-rails', '~> 4.2.1'
24
+ s.add_dependency 'sass-rails', '~> 5.0.6'
25
+ s.add_dependency 'sprockets', '3.7.1'
26
+ s.add_dependency 'sass', '~> 3.4.23'
27
+ s.add_dependency 'slim', '~> 3.0.7'
28
+ s.add_dependency 'responders', '~> 2.3.0'
29
+ s.add_dependency 'nested_form'
30
+ s.add_dependency 'jquery-rails', '~> 4.2.2'
31
+ s.add_dependency 'jquery-ui-rails', '~> 6.0.1'
32
+ s.add_dependency 'jquery-minicolors-rails', '2.2.3.1 '
33
+ s.add_dependency 'bootstrap-sass', '3.1.1.0'
34
+ s.add_dependency 'bootstrap-datepicker-rails', '~> 1.3.0.1'
35
+ s.add_dependency 'nprogress-rails'
36
+ s.add_dependency 'underscore-rails', '~> 1.5.2'
37
+ s.add_dependency 'momentjs-rails', '~> 2.5.1'
38
+ s.add_dependency 'select2-rails', '3.5.7'
39
+ s.add_dependency 'remotipart', '~> 1.3.1'
40
+ s.add_dependency 'bootstrap-datetime-picker-for-rails', '~> 0.0.4'
41
+ s.add_dependency 'socket.io-rails'
42
+ s.add_dependency 'activemodel-serializers-xml'
43
+
44
+ s.add_dependency 'gaku_core', s.version
45
+ s.add_dependency 'gaku_testing', s.version
46
+ end
data/lib/gaku/frontend.rb CHANGED
@@ -12,15 +12,15 @@ require 'momentjs-rails'
12
12
  require 'underscore-rails'
13
13
  require 'nprogress-rails'
14
14
  require 'kaminari'
15
- require 'client_side_validations'
15
+ # require 'rails4_client_side_validations'
16
16
  require 'sass'
17
17
  require 'bootstrap-sass'
18
18
  require 'bootstrap-datepicker-rails'
19
19
  require 'bootstrap-datetime-picker-for-rails'
20
20
  require 'nested_form'
21
- require 'phantom_helpers'
22
- require 'phantom_forms'
23
- require 'phantom_nested_forms'
21
+ # require 'phantom_helpers'
22
+ # require 'phantom_forms'
23
+ # require 'phantom_nested_forms'
24
24
  require 'select2-rails'
25
25
  require 'remotipart'
26
26
 
data/lib/tasks/core.rake CHANGED
@@ -10,7 +10,7 @@ For .rb use rake db:load_file[/absolute/path/to/sample/filename.rb]}
10
10
 
11
11
  if %w{.yml}.include? file.extname
12
12
  puts "#{File.basename(args.file)}".green
13
- ActiveRecord::Fixtures.create_fixtures(args.dir, file.to_s.sub(file.extname, ""))
13
+ ActiveRecord::FixtureSet.create_fixtures(args.dir, file.to_s.sub(file.extname, ""))
14
14
  elsif file.exist?
15
15
  puts "#{File.basename(file)}".green
16
16
  require file
metadata CHANGED
@@ -1,186 +1,115 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gaku_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0.pre.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei Kagetsuki
8
8
  - Georgi Tapalilov
9
9
  - Nakaya Yukiharu
10
- - Vassil Kalkov
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2015-06-26 00:00:00.000000000 Z
13
+ date: 2017-11-25 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
- name: gaku_core
18
- requirement: !ruby/object:Gem::Requirement
19
- requirements:
20
- - - '='
21
- - !ruby/object:Gem::Version
22
- version: 0.2.4
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - '='
28
- - !ruby/object:Gem::Version
29
- version: 0.2.4
30
- - !ruby/object:Gem::Dependency
31
- name: gaku_testing
16
+ name: deface
32
17
  requirement: !ruby/object:Gem::Requirement
33
18
  requirements:
34
- - - '='
19
+ - - "~>"
35
20
  - !ruby/object:Gem::Version
36
- version: 0.2.4
21
+ version: 1.2.0
37
22
  type: :runtime
38
23
  prerelease: false
39
24
  version_requirements: !ruby/object:Gem::Requirement
40
25
  requirements:
41
- - - '='
26
+ - - "~>"
42
27
  - !ruby/object:Gem::Version
43
- version: 0.2.4
28
+ version: 1.2.0
44
29
  - !ruby/object:Gem::Dependency
45
30
  name: coffee-rails
46
31
  requirement: !ruby/object:Gem::Requirement
47
32
  requirements:
48
33
  - - "~>"
49
34
  - !ruby/object:Gem::Version
50
- version: 4.1.0
35
+ version: 4.2.1
51
36
  type: :runtime
52
37
  prerelease: false
53
38
  version_requirements: !ruby/object:Gem::Requirement
54
39
  requirements:
55
40
  - - "~>"
56
41
  - !ruby/object:Gem::Version
57
- version: 4.1.0
42
+ version: 4.2.1
58
43
  - !ruby/object:Gem::Dependency
59
44
  name: sass-rails
60
45
  requirement: !ruby/object:Gem::Requirement
61
46
  requirements:
62
47
  - - "~>"
63
48
  - !ruby/object:Gem::Version
64
- version: 5.0.0
49
+ version: 5.0.6
65
50
  type: :runtime
66
51
  prerelease: false
67
52
  version_requirements: !ruby/object:Gem::Requirement
68
53
  requirements:
69
54
  - - "~>"
70
55
  - !ruby/object:Gem::Version
71
- version: 5.0.0
56
+ version: 5.0.6
72
57
  - !ruby/object:Gem::Dependency
73
58
  name: sprockets
74
59
  requirement: !ruby/object:Gem::Requirement
75
60
  requirements:
76
61
  - - '='
77
62
  - !ruby/object:Gem::Version
78
- version: 2.11.0
63
+ version: 3.7.1
79
64
  type: :runtime
80
65
  prerelease: false
81
66
  version_requirements: !ruby/object:Gem::Requirement
82
67
  requirements:
83
68
  - - '='
84
69
  - !ruby/object:Gem::Version
85
- version: 2.11.0
70
+ version: 3.7.1
86
71
  - !ruby/object:Gem::Dependency
87
72
  name: sass
88
73
  requirement: !ruby/object:Gem::Requirement
89
74
  requirements:
90
75
  - - "~>"
91
76
  - !ruby/object:Gem::Version
92
- version: '3.2'
77
+ version: 3.4.23
93
78
  type: :runtime
94
79
  prerelease: false
95
80
  version_requirements: !ruby/object:Gem::Requirement
96
81
  requirements:
97
82
  - - "~>"
98
83
  - !ruby/object:Gem::Version
99
- version: '3.2'
84
+ version: 3.4.23
100
85
  - !ruby/object:Gem::Dependency
101
86
  name: slim
102
87
  requirement: !ruby/object:Gem::Requirement
103
88
  requirements:
104
89
  - - "~>"
105
90
  - !ruby/object:Gem::Version
106
- version: '3.0'
91
+ version: 3.0.7
107
92
  type: :runtime
108
93
  prerelease: false
109
94
  version_requirements: !ruby/object:Gem::Requirement
110
95
  requirements:
111
96
  - - "~>"
112
97
  - !ruby/object:Gem::Version
113
- version: '3.0'
98
+ version: 3.0.7
114
99
  - !ruby/object:Gem::Dependency
115
100
  name: responders
116
101
  requirement: !ruby/object:Gem::Requirement
117
102
  requirements:
118
103
  - - "~>"
119
104
  - !ruby/object:Gem::Version
120
- version: '2.0'
105
+ version: 2.3.0
121
106
  type: :runtime
122
107
  prerelease: false
123
108
  version_requirements: !ruby/object:Gem::Requirement
124
109
  requirements:
125
110
  - - "~>"
126
111
  - !ruby/object:Gem::Version
127
- version: '2.0'
128
- - !ruby/object:Gem::Dependency
129
- name: rails4_client_side_validations
130
- requirement: !ruby/object:Gem::Requirement
131
- requirements:
132
- - - "~>"
133
- - !ruby/object:Gem::Version
134
- version: '4.2'
135
- type: :runtime
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - "~>"
140
- - !ruby/object:Gem::Version
141
- version: '4.2'
142
- - !ruby/object:Gem::Dependency
143
- name: phantom_helpers
144
- requirement: !ruby/object:Gem::Requirement
145
- requirements:
146
- - - "~>"
147
- - !ruby/object:Gem::Version
148
- version: '0.11'
149
- type: :runtime
150
- prerelease: false
151
- version_requirements: !ruby/object:Gem::Requirement
152
- requirements:
153
- - - "~>"
154
- - !ruby/object:Gem::Version
155
- version: '0.11'
156
- - !ruby/object:Gem::Dependency
157
- name: phantom_forms
158
- requirement: !ruby/object:Gem::Requirement
159
- requirements:
160
- - - "~>"
161
- - !ruby/object:Gem::Version
162
- version: '0.3'
163
- type: :runtime
164
- prerelease: false
165
- version_requirements: !ruby/object:Gem::Requirement
166
- requirements:
167
- - - "~>"
168
- - !ruby/object:Gem::Version
169
- version: '0.3'
170
- - !ruby/object:Gem::Dependency
171
- name: phantom_nested_forms
172
- requirement: !ruby/object:Gem::Requirement
173
- requirements:
174
- - - "~>"
175
- - !ruby/object:Gem::Version
176
- version: '0.3'
177
- type: :runtime
178
- prerelease: false
179
- version_requirements: !ruby/object:Gem::Requirement
180
- requirements:
181
- - - "~>"
182
- - !ruby/object:Gem::Version
183
- version: '0.3'
112
+ version: 2.3.0
184
113
  - !ruby/object:Gem::Dependency
185
114
  name: nested_form
186
115
  requirement: !ruby/object:Gem::Requirement
@@ -201,42 +130,42 @@ dependencies:
201
130
  requirements:
202
131
  - - "~>"
203
132
  - !ruby/object:Gem::Version
204
- version: '3.1'
133
+ version: 4.2.2
205
134
  type: :runtime
206
135
  prerelease: false
207
136
  version_requirements: !ruby/object:Gem::Requirement
208
137
  requirements:
209
138
  - - "~>"
210
139
  - !ruby/object:Gem::Version
211
- version: '3.1'
140
+ version: 4.2.2
212
141
  - !ruby/object:Gem::Dependency
213
142
  name: jquery-ui-rails
214
143
  requirement: !ruby/object:Gem::Requirement
215
144
  requirements:
216
145
  - - "~>"
217
146
  - !ruby/object:Gem::Version
218
- version: '4.2'
147
+ version: 6.0.1
219
148
  type: :runtime
220
149
  prerelease: false
221
150
  version_requirements: !ruby/object:Gem::Requirement
222
151
  requirements:
223
152
  - - "~>"
224
153
  - !ruby/object:Gem::Version
225
- version: '4.2'
154
+ version: 6.0.1
226
155
  - !ruby/object:Gem::Dependency
227
156
  name: jquery-minicolors-rails
228
157
  requirement: !ruby/object:Gem::Requirement
229
158
  requirements:
230
159
  - - '='
231
160
  - !ruby/object:Gem::Version
232
- version: 2.1.4
161
+ version: 2.2.3.1
233
162
  type: :runtime
234
163
  prerelease: false
235
164
  version_requirements: !ruby/object:Gem::Requirement
236
165
  requirements:
237
166
  - - '='
238
167
  - !ruby/object:Gem::Version
239
- version: 2.1.4
168
+ version: 2.2.3.1
240
169
  - !ruby/object:Gem::Dependency
241
170
  name: bootstrap-sass
242
171
  requirement: !ruby/object:Gem::Requirement
@@ -327,14 +256,14 @@ dependencies:
327
256
  requirements:
328
257
  - - "~>"
329
258
  - !ruby/object:Gem::Version
330
- version: 1.2.1
259
+ version: 1.3.1
331
260
  type: :runtime
332
261
  prerelease: false
333
262
  version_requirements: !ruby/object:Gem::Requirement
334
263
  requirements:
335
264
  - - "~>"
336
265
  - !ruby/object:Gem::Version
337
- version: 1.2.1
266
+ version: 1.3.1
338
267
  - !ruby/object:Gem::Dependency
339
268
  name: bootstrap-datetime-picker-for-rails
340
269
  requirement: !ruby/object:Gem::Requirement
@@ -363,12 +292,55 @@ dependencies:
363
292
  - - ">="
364
293
  - !ruby/object:Gem::Version
365
294
  version: '0'
295
+ - !ruby/object:Gem::Dependency
296
+ name: activemodel-serializers-xml
297
+ requirement: !ruby/object:Gem::Requirement
298
+ requirements:
299
+ - - ">="
300
+ - !ruby/object:Gem::Version
301
+ version: '0'
302
+ type: :runtime
303
+ prerelease: false
304
+ version_requirements: !ruby/object:Gem::Requirement
305
+ requirements:
306
+ - - ">="
307
+ - !ruby/object:Gem::Version
308
+ version: '0'
309
+ - !ruby/object:Gem::Dependency
310
+ name: gaku_core
311
+ requirement: !ruby/object:Gem::Requirement
312
+ requirements:
313
+ - - '='
314
+ - !ruby/object:Gem::Version
315
+ version: 0.3.0.pre.0
316
+ type: :runtime
317
+ prerelease: false
318
+ version_requirements: !ruby/object:Gem::Requirement
319
+ requirements:
320
+ - - '='
321
+ - !ruby/object:Gem::Version
322
+ version: 0.3.0.pre.0
323
+ - !ruby/object:Gem::Dependency
324
+ name: gaku_testing
325
+ requirement: !ruby/object:Gem::Requirement
326
+ requirements:
327
+ - - '='
328
+ - !ruby/object:Gem::Version
329
+ version: 0.3.0.pre.0
330
+ type: :runtime
331
+ prerelease: false
332
+ version_requirements: !ruby/object:Gem::Requirement
333
+ requirements:
334
+ - - '='
335
+ - !ruby/object:Gem::Version
336
+ version: 0.3.0.pre.0
366
337
  description: The default Rails front end for GAKU Engine, with web views etc.
367
338
  email: info@gakuengine.com
368
339
  executables: []
369
340
  extensions: []
370
341
  extra_rdoc_files: []
371
342
  files:
343
+ - Rakefile
372
344
  - app/assets/fonts/gaku/frontend/glyphicons-halflings-regular.eot
373
345
  - app/assets/fonts/gaku/frontend/glyphicons-halflings-regular.svg
374
346
  - app/assets/fonts/gaku/frontend/glyphicons-halflings-regular.ttf
@@ -415,6 +387,7 @@ files:
415
387
  - app/controllers/gaku/enrollments_controller.rb
416
388
  - app/controllers/gaku/exam_portion_scores_controller.rb
417
389
  - app/controllers/gaku/exams/exam_portions_controller.rb
390
+ - app/controllers/gaku/exams/exam_sessions/enrollments_controller.rb
418
391
  - app/controllers/gaku/exams/exam_sessions_controller.rb
419
392
  - app/controllers/gaku/exams_controller.rb
420
393
  - app/controllers/gaku/extracurricular_activities_controller.rb
@@ -641,18 +614,16 @@ files:
641
614
  - app/views/gaku/exams/exam_portions/new.js.erb
642
615
  - app/views/gaku/exams/exam_portions/show.html.slim
643
616
  - app/views/gaku/exams/exam_portions/update.js.erb
617
+ - app/views/gaku/exams/exam_sessions/_edit_form.html.slim
644
618
  - app/views/gaku/exams/exam_sessions/_exam_session.html.slim
645
619
  - app/views/gaku/exams/exam_sessions/_exam_sessions.html.slim
646
620
  - app/views/gaku/exams/exam_sessions/_form.html.slim
647
621
  - app/views/gaku/exams/exam_sessions/_form_fields.html.slim
648
- - app/views/gaku/exams/exam_sessions/_students.html.slim
649
622
  - app/views/gaku/exams/exam_sessions/_table_fields.html.slim
650
- - app/views/gaku/exams/exam_sessions/_tabs.html.slim
651
623
  - app/views/gaku/exams/exam_sessions/create.js.erb
652
624
  - app/views/gaku/exams/exam_sessions/destroy.js.erb
653
625
  - app/views/gaku/exams/exam_sessions/edit.html.slim
654
626
  - app/views/gaku/exams/exam_sessions/new.js.erb
655
- - app/views/gaku/exams/exam_sessions/update.js.erb
656
627
  - app/views/gaku/exams/export.xls.rb
657
628
  - app/views/gaku/exams/index.html.slim
658
629
  - app/views/gaku/exams/new.js.erb
@@ -755,6 +726,10 @@ files:
755
726
  - app/views/gaku/shared/fields/_semester_fields.html.slim
756
727
  - app/views/gaku/shared/form_fields/_exam_portion_form_fields.html.slim
757
728
  - app/views/gaku/shared/form_fields/_person_form_fields.html.slim
729
+ - app/views/gaku/shared/grading/_exam_portion_head.html.slim
730
+ - app/views/gaku/shared/grading/_grading_table_head.html.slim
731
+ - app/views/gaku/shared/grading/_grading_table_student_field.html.slim
732
+ - app/views/gaku/shared/grading/grading.html.slim
758
733
  - app/views/gaku/shared/js/remove_picture.js.erb
759
734
  - app/views/gaku/shared/js/set_picture.js.erb
760
735
  - app/views/gaku/shared/menu/_frontend.html.erb
@@ -920,8 +895,10 @@ files:
920
895
  - app/views/kaminari/_page.html.erb
921
896
  - app/views/kaminari/_paginator.html.erb
922
897
  - app/views/kaminari/_prev_page.html.erb
898
+ - config/initializers/assets.rb
923
899
  - config/initializers/wrap_parameters.rb
924
900
  - config/routes.rb
901
+ - gaku_frontend.gemspec
925
902
  - lib/gaku/app_responder.rb
926
903
  - lib/gaku/class_name_detector.rb
927
904
  - lib/gaku/frontend.rb
@@ -943,17 +920,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
943
920
  requirements:
944
921
  - - ">="
945
922
  - !ruby/object:Gem::Version
946
- version: 2.1.3
923
+ version: '0'
947
924
  required_rubygems_version: !ruby/object:Gem::Requirement
948
925
  requirements:
949
- - - ">="
926
+ - - ">"
950
927
  - !ruby/object:Gem::Version
951
- version: '0'
928
+ version: 1.3.1
952
929
  requirements:
953
930
  - postgresql
954
931
  - postgresql-contrib
955
932
  rubyforge_project:
956
- rubygems_version: 2.4.6
933
+ rubygems_version: 2.6.14
957
934
  signing_key:
958
935
  specification_version: 4
959
936
  summary: Default front end web views for GAKU Engine. See https://github.com/GAKUEngine/gaku
@@ -1 +0,0 @@
1
- / student chooser integration
@@ -1,10 +0,0 @@
1
- .row
2
- .col-md-12
3
- ul.nav.nav-tabs.nav-justified
4
- li.active
5
- a#exam-session-students-tab-link data-toggle="tab" href="#exam-session-students"
6
- = print_count @exam_session.students.count, t(:'student.plural')
7
-
8
- .tab-content
9
- #exam-session-students.tab-pane.active
10
- = render "gaku/exams/exam_sessions/students"
File without changes