mumuki-domain 8.6.0 → 9.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/assignment.rb +2 -2
- data/app/models/book.rb +1 -1
- data/app/models/certificate.rb +29 -0
- data/app/models/certificate_program.rb +42 -0
- data/app/models/concerns/with_assignments.rb +2 -3
- data/app/models/concerns/with_assignments_batch.rb +2 -2
- data/app/models/concerns/with_generated_code.rb +19 -0
- data/app/models/concerns/with_notifications.rb +1 -1
- data/app/models/course.rb +26 -2
- data/app/models/discussion.rb +1 -1
- data/app/models/exercise.rb +13 -0
- data/app/models/guide.rb +1 -10
- data/app/models/invitation.rb +7 -11
- data/app/models/organization.rb +5 -1
- data/app/models/topic.rb +7 -12
- data/app/models/user.rb +27 -1
- data/app/models/user_stats.rb +32 -0
- data/db/migrate/20210119174504_create_certificate_programs.rb +13 -0
- data/db/migrate/20210119174835_create_certificates.rb +13 -0
- data/db/migrate/20210301210530_add_period_start_and_end_to_course.rb +7 -0
- data/db/migrate/20210302181654_add_faqs_to_organizations.rb +5 -0
- data/lib/mumuki/domain/factories.rb +2 -0
- data/lib/mumuki/domain/factories/book_factory.rb +13 -0
- data/lib/mumuki/domain/factories/certificate_factory.rb +8 -0
- data/lib/mumuki/domain/factories/certificate_program_factory.rb +7 -0
- data/lib/mumuki/domain/factories/organization_factory.rb +2 -1
- data/lib/mumuki/domain/helpers/course.rb +1 -1
- data/lib/mumuki/domain/incognito.rb +3 -0
- data/lib/mumuki/domain/organization/settings.rb +2 -2
- data/lib/mumuki/domain/version.rb +1 -1
- metadata +13 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a503cf97148dbefc08c07e442bb086ac2eb37ad13e00abb39497f980e5b2e5ec
|
4
|
+
data.tar.gz: 41056f07210ae148026a0333518a5948739766ad70333038413f393acd7a3ad1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 643e7098cd029bd2185c99ea476b3d82e04b3e161970047b310f78edef0f68b753bcf142ceab2e0b53711f353092a176c40babfef9259f437178fefcb5f483f6
|
7
|
+
data.tar.gz: 85e12de8b448db4fffcf1227231de46026a7e2142664a31c15310042138ed86cfd5f44aa09afe7c7bae27aaf3aeb4ab6cce9835604c809e1285301d14432beae
|
data/app/models/assignment.rb
CHANGED
@@ -275,11 +275,11 @@ class Assignment < Progress
|
|
275
275
|
|
276
276
|
def update_submissions_count!
|
277
277
|
self.class.connection.execute(
|
278
|
-
"update
|
278
|
+
"update exercises
|
279
279
|
set submissions_count = submissions_count + 1
|
280
280
|
where id = #{exercise.id}")
|
281
281
|
self.class.connection.execute(
|
282
|
-
"update
|
282
|
+
"update assignments
|
283
283
|
set submissions_count = submissions_count + 1
|
284
284
|
where id = #{id}")
|
285
285
|
exercise.reload
|
data/app/models/book.rb
CHANGED
@@ -18,7 +18,7 @@ class Book < Content
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def discussions_in_organization(organization = Organization.current)
|
21
|
-
Discussion.where(organization: organization).includes(exercise: [:language, :guide])
|
21
|
+
Discussion.where(organization: organization, item: organization.exercises).includes(exercise: [:language, :guide])
|
22
22
|
end
|
23
23
|
|
24
24
|
def first_chapter
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Certificate < ApplicationRecord
|
2
|
+
include WithGeneratedCode
|
3
|
+
|
4
|
+
belongs_to :user
|
5
|
+
belongs_to :certificate_program
|
6
|
+
|
7
|
+
has_one :organization, through: :certificate_program
|
8
|
+
|
9
|
+
delegate :title, :description, :template_html_erb, :background_image_url, to: :certificate_program
|
10
|
+
|
11
|
+
def self.code_size
|
12
|
+
12
|
13
|
+
end
|
14
|
+
|
15
|
+
def filename
|
16
|
+
"#{title.parameterize.underscore}.pdf"
|
17
|
+
end
|
18
|
+
|
19
|
+
def template_locals
|
20
|
+
{ user: user,
|
21
|
+
certificate_program: certificate_program,
|
22
|
+
organization: organization,
|
23
|
+
certificate: self }
|
24
|
+
end
|
25
|
+
|
26
|
+
def for_user?(user)
|
27
|
+
self.user == user
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
class CertificateProgram < ApplicationRecord
|
2
|
+
belongs_to :organization
|
3
|
+
has_many :certificates
|
4
|
+
|
5
|
+
def friendly
|
6
|
+
title
|
7
|
+
end
|
8
|
+
|
9
|
+
def template_html_erb
|
10
|
+
self[:template_html_erb] ||= <<HTML
|
11
|
+
<style>
|
12
|
+
.qr-code {
|
13
|
+
bottom: 5px;
|
14
|
+
right: 5px;
|
15
|
+
height: 15mm;
|
16
|
+
width: 15mm;
|
17
|
+
}
|
18
|
+
.name {
|
19
|
+
position: absolute;
|
20
|
+
width: 100%;
|
21
|
+
top: 380px;
|
22
|
+
text-align: center;
|
23
|
+
}
|
24
|
+
</style>
|
25
|
+
<!-- You can use interpolations like --
|
26
|
+
<%#= certificate.start_date %>
|
27
|
+
<%#= certificate.end_date %>
|
28
|
+
<%#= user.formal_first_name %>
|
29
|
+
<%#= user.formal_last_name %>
|
30
|
+
<%#= user.formal_full_name %>
|
31
|
+
<%#= certificate_program.title %>
|
32
|
+
<%#= certificate_program.description %>
|
33
|
+
<%#= organization.name %>
|
34
|
+
<%#= organization.display_name %>
|
35
|
+
-- -->
|
36
|
+
<section class="name">
|
37
|
+
<h1><%= user.formal_full_name %></h1>
|
38
|
+
</section>
|
39
|
+
HTML
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -19,9 +19,8 @@ module WithAssignments
|
|
19
19
|
end
|
20
20
|
|
21
21
|
# TODO: When the organization is used in this one, please change guide.pending_exercises
|
22
|
-
|
23
|
-
|
24
|
-
assignments.find_by(submitter: user)
|
22
|
+
def find_assignment_for(user, organization)
|
23
|
+
assignments.find_by(submitter: user, organization: organization)
|
25
24
|
end
|
26
25
|
|
27
26
|
def status_for(user)
|
@@ -4,13 +4,13 @@
|
|
4
4
|
module WithAssignmentsBatch
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
|
-
def find_assignments_for(user,
|
7
|
+
def find_assignments_for(user, organization = Organization.current, &block)
|
8
8
|
block = block_given? ? block : lambda { |it, _e| it }
|
9
9
|
|
10
10
|
return exercises.map { |it| block.call nil, it } unless user
|
11
11
|
|
12
12
|
pairs = exercises.map { |it| [it.id, [nil, it]] }.to_h
|
13
|
-
Assignment.where(submitter: user, exercise: exercises).each do |it|
|
13
|
+
Assignment.where(submitter: user, organization: organization, exercise: exercises).each do |it|
|
14
14
|
pairs[it.exercise_id][0] = it
|
15
15
|
end
|
16
16
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module WithGeneratedCode
|
2
|
+
extend ActiveSupport::Concern
|
3
|
+
|
4
|
+
included do
|
5
|
+
validates_uniqueness_of :code
|
6
|
+
|
7
|
+
defaults do
|
8
|
+
self.code ||= self.class.generate_code
|
9
|
+
end
|
10
|
+
|
11
|
+
required :code_size
|
12
|
+
end
|
13
|
+
|
14
|
+
class_methods do
|
15
|
+
def generate_code
|
16
|
+
SecureRandom.urlsafe_base64 code_size
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/app/models/course.rb
CHANGED
@@ -3,7 +3,7 @@ class Course < ApplicationRecord
|
|
3
3
|
include Mumuki::Domain::Helpers::Course
|
4
4
|
include Mumuki::Domain::Area
|
5
5
|
|
6
|
-
validates_presence_of :slug, :
|
6
|
+
validates_presence_of :slug, :period, :code, :description, :organization_id
|
7
7
|
validates_uniqueness_of :slug
|
8
8
|
belongs_to :organization
|
9
9
|
|
@@ -11,7 +11,7 @@ class Course < ApplicationRecord
|
|
11
11
|
|
12
12
|
alias_attribute :name, :code
|
13
13
|
|
14
|
-
resource_fields :slug, :shifts, :code, :days, :period, :description
|
14
|
+
resource_fields :slug, :shifts, :code, :days, :period, :description, :period_start, :period_end
|
15
15
|
|
16
16
|
def current_invitation
|
17
17
|
invitations.where('expiration_date > ?', Time.now).first
|
@@ -35,6 +35,30 @@ class Course < ApplicationRecord
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
def ended?
|
39
|
+
period_end.present? && period_end.past?
|
40
|
+
end
|
41
|
+
|
42
|
+
def started?
|
43
|
+
period_start.present? && period_start.past?
|
44
|
+
end
|
45
|
+
|
46
|
+
def infer_period_range!
|
47
|
+
return if period_start || period_end
|
48
|
+
|
49
|
+
period =~ /^(\d{4})?/
|
50
|
+
year = $1.to_i
|
51
|
+
|
52
|
+
return nil unless year.between? 2014, (DateTime.now.year + 1)
|
53
|
+
|
54
|
+
self.period_start = DateTime.new(year).beginning_of_year
|
55
|
+
self.period_end = DateTime.new(year).end_of_year
|
56
|
+
end
|
57
|
+
|
58
|
+
def canonical_code
|
59
|
+
"#{period}-#{code}".downcase
|
60
|
+
end
|
61
|
+
|
38
62
|
def closed?
|
39
63
|
current_invitation.blank? || current_invitation.expired?
|
40
64
|
end
|
data/app/models/discussion.rb
CHANGED
@@ -167,7 +167,7 @@ class Discussion < ApplicationRecord
|
|
167
167
|
end
|
168
168
|
|
169
169
|
def being_accessed_by_moderator?
|
170
|
-
last_moderator_access_at.present? && last_moderator_access_at
|
170
|
+
last_moderator_access_at.present? && (last_moderator_access_at + MODERATOR_REVIEW_AVERAGE_TIME).future?
|
171
171
|
end
|
172
172
|
|
173
173
|
def last_moderator_access_visible_for?(user)
|
data/app/models/exercise.rb
CHANGED
@@ -267,4 +267,17 @@ class Exercise < ApplicationRecord
|
|
267
267
|
def self.default_layout
|
268
268
|
layouts.keys[0]
|
269
269
|
end
|
270
|
+
|
271
|
+
def self.with_pending_assignments_for(user, relation)
|
272
|
+
relation.
|
273
|
+
joins("left join assignments assignments
|
274
|
+
on assignments.exercise_id = exercises.id
|
275
|
+
and assignments.submitter_id = #{user.id}
|
276
|
+
and assignments.organization_id = #{Organization.current.id}
|
277
|
+
and assignments.submission_status in (
|
278
|
+
#{Mumuki::Domain::Status::Submission::Passed.to_i},
|
279
|
+
#{Mumuki::Domain::Status::Submission::ManualEvaluationPending.to_i}
|
280
|
+
)").
|
281
|
+
where('assignments.id is null')
|
282
|
+
end
|
270
283
|
end
|
data/app/models/guide.rb
CHANGED
@@ -50,17 +50,8 @@ class Guide < Content
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
# TODO: Make use of pending_siblings logic
|
54
53
|
def pending_exercises(user)
|
55
|
-
exercises
|
56
|
-
joins("left join public.assignments assignments
|
57
|
-
on assignments.exercise_id = exercises.id
|
58
|
-
and assignments.submitter_id = #{user.id}
|
59
|
-
and assignments.submission_status in (
|
60
|
-
#{Mumuki::Domain::Status::Submission::Passed.to_i},
|
61
|
-
#{Mumuki::Domain::Status::Submission::ManualEvaluationPending.to_i}
|
62
|
-
)").
|
63
|
-
where('assignments.id is null')
|
54
|
+
Exercise.with_pending_assignments_for(user, exercises)
|
64
55
|
end
|
65
56
|
|
66
57
|
def first_exercise
|
data/app/models/invitation.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
class Invitation < ApplicationRecord
|
2
|
-
include Mumuki::Domain::Syncable
|
2
|
+
include Mumuki::Domain::Syncable,
|
3
|
+
WithGeneratedCode
|
3
4
|
|
4
5
|
belongs_to :course
|
5
6
|
|
6
7
|
validate :ensure_not_expired, on: :create
|
7
|
-
validates_uniqueness_of :code
|
8
|
-
|
9
|
-
defaults do
|
10
|
-
self.code ||= self.class.generate_code
|
11
|
-
end
|
12
8
|
|
13
9
|
def ensure_not_expired
|
14
10
|
errors.add(:base, :invitation_expired) if expired?
|
@@ -43,7 +39,7 @@ class Invitation < ApplicationRecord
|
|
43
39
|
end
|
44
40
|
|
45
41
|
def expired?
|
46
|
-
|
42
|
+
expiration_date.past?
|
47
43
|
end
|
48
44
|
|
49
45
|
def unexpired
|
@@ -51,12 +47,12 @@ class Invitation < ApplicationRecord
|
|
51
47
|
self
|
52
48
|
end
|
53
49
|
|
54
|
-
def self.generate_code
|
55
|
-
SecureRandom.urlsafe_base64 4
|
56
|
-
end
|
57
|
-
|
58
50
|
private
|
59
51
|
|
52
|
+
def self.code_size
|
53
|
+
4
|
54
|
+
end
|
55
|
+
|
60
56
|
def course_name
|
61
57
|
course.name
|
62
58
|
end
|
data/app/models/organization.rb
CHANGED
@@ -11,7 +11,7 @@ class Organization < ApplicationRecord
|
|
11
11
|
serialize :settings, Mumuki::Domain::Organization::Settings
|
12
12
|
serialize :theme, Mumuki::Domain::Organization::Theme
|
13
13
|
|
14
|
-
markdown_on :description, :display_description, :page_description
|
14
|
+
markdown_on :description, :display_description, :page_description, :faqs
|
15
15
|
teaser_on :display_description
|
16
16
|
|
17
17
|
validate :ensure_consistent_public_login
|
@@ -138,6 +138,10 @@ class Organization < ApplicationRecord
|
|
138
138
|
self[:progressive_display_lookahead] = lookahead.to_i.positive? ? lookahead : nil
|
139
139
|
end
|
140
140
|
|
141
|
+
def activity_start_date(default_date)
|
142
|
+
[default_date, in_preparation_until&.to_date].compact.max
|
143
|
+
end
|
144
|
+
|
141
145
|
# ==============
|
142
146
|
# Display fields
|
143
147
|
# ==============
|
data/app/models/topic.rb
CHANGED
@@ -50,18 +50,13 @@ class Topic < Content
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def pending_lessons(user)
|
53
|
-
|
54
|
-
.
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
and assignments.submission_status in (
|
61
|
-
#{Mumuki::Domain::Status::Submission::Passed.to_i},
|
62
|
-
#{Mumuki::Domain::Status::Submission::ManualEvaluationPending.to_i}
|
63
|
-
)")
|
64
|
-
.where('assignments.id is null')
|
53
|
+
Exercise
|
54
|
+
.with_pending_assignments_for(
|
55
|
+
user,
|
56
|
+
lessons
|
57
|
+
.includes(:guide)
|
58
|
+
.references(:guide)
|
59
|
+
.joins('left join exercises exercises on exercises.guide_id = guides.id'))
|
65
60
|
.group('guides.id', 'lessons.number', 'lessons.id')
|
66
61
|
end
|
67
62
|
|
data/app/models/user.rb
CHANGED
@@ -35,6 +35,8 @@ class User < ApplicationRecord
|
|
35
35
|
|
36
36
|
has_many :exams, through: :exam_authorizations
|
37
37
|
|
38
|
+
has_many :certificates
|
39
|
+
|
38
40
|
enum gender: %i(female male other unspecified)
|
39
41
|
belongs_to :avatar, polymorphic: true, optional: true
|
40
42
|
|
@@ -52,6 +54,10 @@ class User < ApplicationRecord
|
|
52
54
|
last_guide.try(:lesson)
|
53
55
|
end
|
54
56
|
|
57
|
+
def messages_in_organization(organization = Organization.current)
|
58
|
+
messages.where('assignments.organization': organization)
|
59
|
+
end
|
60
|
+
|
55
61
|
def passed_submissions_count_in(organization)
|
56
62
|
assignments.where(top_submission_status: Mumuki::Domain::Status::Submission::Passed.to_i, organization: organization).count
|
57
63
|
end
|
@@ -217,7 +223,7 @@ class User < ApplicationRecord
|
|
217
223
|
end
|
218
224
|
|
219
225
|
def next_exercise_at(guide)
|
220
|
-
guide.pending_exercises(self).order('
|
226
|
+
guide.pending_exercises(self).order('exercises.number asc').first
|
221
227
|
end
|
222
228
|
|
223
229
|
def run_submission!(submission, assignment, evaluation)
|
@@ -275,6 +281,26 @@ class User < ApplicationRecord
|
|
275
281
|
end
|
276
282
|
end
|
277
283
|
|
284
|
+
def formal_first_name
|
285
|
+
verified_first_name || first_name
|
286
|
+
end
|
287
|
+
|
288
|
+
def formal_last_name
|
289
|
+
verified_last_name || last_name
|
290
|
+
end
|
291
|
+
|
292
|
+
def formal_full_name
|
293
|
+
"#{formal_first_name} #{formal_last_name}"
|
294
|
+
end
|
295
|
+
|
296
|
+
def certificates_in_organization(organization = Organization.current)
|
297
|
+
certificates.where certificate_program: CertificateProgram.where(organization: organization)
|
298
|
+
end
|
299
|
+
|
300
|
+
def certificated_in?(certificate_program)
|
301
|
+
certificates.where(certificate_program: certificate_program).exists?
|
302
|
+
end
|
303
|
+
|
278
304
|
private
|
279
305
|
|
280
306
|
def welcome_to_new_organizations!
|
data/app/models/user_stats.rb
CHANGED
@@ -10,7 +10,39 @@ class UserStats < ApplicationRecord
|
|
10
10
|
self.stats_for(user).exp
|
11
11
|
end
|
12
12
|
|
13
|
+
def activity(date_range = nil)
|
14
|
+
date_filter = { submitted_at: date_range }.compact
|
15
|
+
{
|
16
|
+
exercises: {
|
17
|
+
solved_count: organization_exercises
|
18
|
+
.joins(:assignments)
|
19
|
+
.where(assignments: { top_submission_status: [:passed, :skipped], submitter: user }.merge(date_filter))
|
20
|
+
.count,
|
21
|
+
count: organization_exercises.count},
|
22
|
+
|
23
|
+
messages: messages_in_discussions_count(date_range)
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
13
27
|
def add_exp!(points)
|
14
28
|
self.exp += points
|
15
29
|
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def messages_in_discussions_count(date_range = nil)
|
34
|
+
date_filter = { date: date_range }.compact
|
35
|
+
result = Message.joins(:discussion)
|
36
|
+
.where({sender: user.uid, discussions: { organization: organization }}.merge(date_filter))
|
37
|
+
.group(:approved)
|
38
|
+
.count
|
39
|
+
unapproved = result[false] || 0
|
40
|
+
approved = result[true] || 0
|
41
|
+
|
42
|
+
{ count: unapproved + approved, approved: approved }
|
43
|
+
end
|
44
|
+
|
45
|
+
def organization_exercises
|
46
|
+
@organization_exercises ||= organization.exercises
|
47
|
+
end
|
16
48
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateCertificatePrograms < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
create_table :certificate_programs do |t|
|
4
|
+
t.string :title
|
5
|
+
t.string :template_html_erb
|
6
|
+
t.text :description
|
7
|
+
t.string :background_image_url
|
8
|
+
t.references :organization, index: true
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateCertificates < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
create_table :certificates do |t|
|
4
|
+
t.references :user, index: true
|
5
|
+
t.references :certificate_program, index: true
|
6
|
+
t.datetime :start_date
|
7
|
+
t.datetime :end_date
|
8
|
+
t.string :code
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -2,6 +2,8 @@ require_relative './factories/api_client_factory'
|
|
2
2
|
require_relative './factories/assignments_factory'
|
3
3
|
require_relative './factories/avatar_factory'
|
4
4
|
require_relative './factories/book_factory'
|
5
|
+
require_relative './factories/certificate_factory'
|
6
|
+
require_relative './factories/certificate_program_factory'
|
5
7
|
require_relative './factories/chapter_factory'
|
6
8
|
require_relative './factories/complement_factory'
|
7
9
|
require_relative './factories/course_factory'
|
@@ -4,4 +4,17 @@ FactoryBot.define do
|
|
4
4
|
description { Faker::Lorem.sentence(word_count: 30) }
|
5
5
|
slug { "mumuki/mumuki-test-book-#{SecureRandom.uuid}" }
|
6
6
|
end
|
7
|
+
|
8
|
+
factory :book_with_full_tree, parent: :book do
|
9
|
+
transient do
|
10
|
+
children_factor { 3 }
|
11
|
+
exercises { create_list(:exercise, children_factor) }
|
12
|
+
lessons { create_list(:lesson, children_factor, exercises: exercises) }
|
13
|
+
chapters { create_list(:chapter, children_factor, lessons: lessons) }
|
14
|
+
end
|
15
|
+
|
16
|
+
after(:build) do |book, evaluator|
|
17
|
+
book.chapters = evaluator.chapters
|
18
|
+
end
|
19
|
+
end
|
7
20
|
end
|
@@ -29,7 +29,8 @@ FactoryBot.define do
|
|
29
29
|
book { create(:book, name: 'test', slug: 'mumuki/mumuki-the-book') }
|
30
30
|
end
|
31
31
|
|
32
|
-
factory :another_test_organization, parent: :test_organization
|
32
|
+
factory :another_test_organization, parent: :test_organization do
|
33
|
+
name { 'another-test' }
|
33
34
|
book { create(:book, name: 'another-test', slug: 'mumuki/mumuki-another-book') }
|
34
35
|
end
|
35
36
|
|
@@ -40,10 +40,10 @@ class Mumuki::Domain::Organization::Settings < Mumukit::Platform::Model
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def disabled?
|
43
|
-
disabled_from.present? && disabled_from
|
43
|
+
disabled_from.present? && disabled_from.past?
|
44
44
|
end
|
45
45
|
|
46
46
|
def in_preparation?
|
47
|
-
in_preparation_until.present? && in_preparation_until
|
47
|
+
in_preparation_until.present? && in_preparation_until.future?
|
48
48
|
end
|
49
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-domain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 9.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '7.0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
138
|
+
version: '7.0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: mumukit-sync
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -249,6 +249,8 @@ files:
|
|
249
249
|
- app/models/assignment.rb
|
250
250
|
- app/models/avatar.rb
|
251
251
|
- app/models/book.rb
|
252
|
+
- app/models/certificate.rb
|
253
|
+
- app/models/certificate_program.rb
|
252
254
|
- app/models/chapter.rb
|
253
255
|
- app/models/complement.rb
|
254
256
|
- app/models/concerns/assistable.rb
|
@@ -280,6 +282,7 @@ files:
|
|
280
282
|
- app/models/concerns/with_discussions.rb
|
281
283
|
- app/models/concerns/with_editor.rb
|
282
284
|
- app/models/concerns/with_expectations.rb
|
285
|
+
- app/models/concerns/with_generated_code.rb
|
283
286
|
- app/models/concerns/with_language.rb
|
284
287
|
- app/models/concerns/with_layout.rb
|
285
288
|
- app/models/concerns/with_locale.rb
|
@@ -651,7 +654,11 @@ files:
|
|
651
654
|
- db/migrate/20210118180941_create_exam_authorization_request.rb
|
652
655
|
- db/migrate/20210118194904_create_notification.rb
|
653
656
|
- db/migrate/20210119160440_add_prevent_manual_evaluation_content_to_organizations.rb
|
657
|
+
- db/migrate/20210119174504_create_certificate_programs.rb
|
658
|
+
- db/migrate/20210119174835_create_certificates.rb
|
654
659
|
- db/migrate/20210119190204_create_exam_registration_exam_join_table.rb
|
660
|
+
- db/migrate/20210301210530_add_period_start_and_end_to_course.rb
|
661
|
+
- db/migrate/20210302181654_add_faqs_to_organizations.rb
|
655
662
|
- lib/mumuki/domain.rb
|
656
663
|
- lib/mumuki/domain/area.rb
|
657
664
|
- lib/mumuki/domain/engine.rb
|
@@ -680,6 +687,8 @@ files:
|
|
680
687
|
- lib/mumuki/domain/factories/assignments_factory.rb
|
681
688
|
- lib/mumuki/domain/factories/avatar_factory.rb
|
682
689
|
- lib/mumuki/domain/factories/book_factory.rb
|
690
|
+
- lib/mumuki/domain/factories/certificate_factory.rb
|
691
|
+
- lib/mumuki/domain/factories/certificate_program_factory.rb
|
683
692
|
- lib/mumuki/domain/factories/chapter_factory.rb
|
684
693
|
- lib/mumuki/domain/factories/complement_factory.rb
|
685
694
|
- lib/mumuki/domain/factories/course_factory.rb
|