mumuki-domain 7.2.1 → 7.2.2
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/models/assignment.rb +6 -5
- data/app/models/chapter.rb +4 -0
- data/app/models/concerns/navigation/siblings_navigation.rb +4 -3
- data/app/models/exercise.rb +4 -0
- data/app/models/lesson.rb +4 -0
- data/app/models/topic.rb +12 -0
- data/lib/mumuki/domain/submission/base.rb +1 -0
- data/lib/mumuki/domain/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e4000eb54a24a50ced9f8b58ce44db2c4bd93a12737f5e678abaa8bd631d82c
|
|
4
|
+
data.tar.gz: e0f5c3d5752a2aaa0764f9f8dbe53a774f474ac7b3baf047680e41d75f5adaf2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4de888c6f4bcd0670b807acb4c3935c0a335a1b101454e2ce17ada86ff8645cc9a48d4724404e2c4f3d1849aaba3f03dcbc75a0e725d3f628ee191ce3555ca89
|
|
7
|
+
data.tar.gz: 3b0795f583e057f1c6bfc2586bf11cde38ce7ae2751b03ec4c0a93790e49cd34446f1985312bab89bc36bad04ad09eef85326ed93236f2323b84e3083cbe2f8b
|
data/app/models/assignment.rb
CHANGED
|
@@ -40,6 +40,12 @@ class Assignment < Progress
|
|
|
40
40
|
alias_method :user, :submitter
|
|
41
41
|
|
|
42
42
|
after_save :dirty_parent_by_submission!, if: :completion_changed?
|
|
43
|
+
before_save :set_current_organization, unless: :organization
|
|
44
|
+
|
|
45
|
+
# TODO: Momentary as some assignments may not have an associated organization
|
|
46
|
+
def set_current_organization
|
|
47
|
+
self.organization = Organization.current
|
|
48
|
+
end
|
|
43
49
|
|
|
44
50
|
def completion_changed?
|
|
45
51
|
completed_before_last_save? != completed?
|
|
@@ -208,11 +214,6 @@ class Assignment < Progress
|
|
|
208
214
|
exercise.files_for(current_content)
|
|
209
215
|
end
|
|
210
216
|
|
|
211
|
-
def save!(*)
|
|
212
|
-
self.organization = Organization.current
|
|
213
|
-
super
|
|
214
|
-
end
|
|
215
|
-
|
|
216
217
|
private
|
|
217
218
|
|
|
218
219
|
def update_submissions_count!
|
data/app/models/chapter.rb
CHANGED
|
@@ -12,9 +12,10 @@ module SiblingsNavigation
|
|
|
12
12
|
structural_parent.structural_children
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
#TODO reestablish this after indicators reliably linked to assignments
|
|
16
|
+
# def pending_siblings_for(user, organization=Organization.current)
|
|
17
|
+
# siblings.reject { |it| it.progress_for(user, organization).completed? }
|
|
18
|
+
# end
|
|
18
19
|
|
|
19
20
|
# Names
|
|
20
21
|
|
data/app/models/exercise.rb
CHANGED
data/app/models/lesson.rb
CHANGED
data/app/models/topic.rb
CHANGED
|
@@ -41,6 +41,18 @@ class Topic < Content
|
|
|
41
41
|
dup.lessons = lessons.map { |lesson| lesson.guide.fork_to!(organization, syncer, quiet: true).as_lesson_of(dup) }
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
+
def pending_lessons(user)
|
|
45
|
+
guides.
|
|
46
|
+
joins('left join public.exercises exercises
|
|
47
|
+
on exercises.guide_id = guides.id').
|
|
48
|
+
joins("left join public.assignments assignments
|
|
49
|
+
on assignments.exercise_id = exercises.id
|
|
50
|
+
and assignments.submitter_id = #{user.id}
|
|
51
|
+
and assignments.submission_status = #{Mumuki::Domain::Status::Submission::Passed.to_i}").
|
|
52
|
+
where('assignments.id is null').
|
|
53
|
+
group('public.guides.id', 'lessons.number').map(&:lesson)
|
|
54
|
+
end
|
|
55
|
+
|
|
44
56
|
private
|
|
45
57
|
|
|
46
58
|
def lesson_for(slug)
|
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: 7.2.
|
|
4
|
+
version: 7.2.2
|
|
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: 2020-03-
|
|
11
|
+
date: 2020-03-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|