mumuki-domain 7.12.0 → 7.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14e176a8030ca77ad3bfe8319f3cbad4eccef1f66b5f18ed293261a2b64bde1b
4
- data.tar.gz: 6cedd7c76389861d2bbf2f850d4a3f1f66b57f2277ecd6ebe3fb1dcd12b1cf84
3
+ metadata.gz: b5cd387b744651b03da4722b106d3c23584a8a610994bf3127fa03cd814e9a64
4
+ data.tar.gz: 73ecd3f88a806ec887ec68e76554db2468f1b3b0dd9d459197b366bdbd3575fd
5
5
  SHA512:
6
- metadata.gz: 3bf0726d9a3b8b0fb2e3a869a6db125e98a67934285780566e903994a16c0693c7fb879fd044a94807cce5ea03102955a9b69096fb78d6599aa39842153c2866
7
- data.tar.gz: aed09dedbfe35d98c18f3d6c290b96650e95973f549990402a2e02af831fb29b7d040c1ad8d79d6dff0343d81006c686694cc4330bd4a7e6992b8894e0d11139
6
+ metadata.gz: d43c7db4b34a5727005cf7f571d7980075fd27fd394942822759bd9e1800626e6880bd1a2bf3085d7332c443d6bdc9602f000e7ee8f3434099c02411a811d8e4
7
+ data.tar.gz: 24fb849fee899e0636448cedc7c03935931a25902edf5144eb952acb2aabe8d051fb6d6ef9b0c684cde9523b633454e6b6c2c0f24b63c5c54e682f14eef55be2
@@ -145,6 +145,10 @@ class Assignment < Progress
145
145
  end
146
146
  end
147
147
 
148
+ def manual_evaluation_pending!
149
+ update! submission_status: :manual_evaluation_pending
150
+ end
151
+
148
152
  def passed!
149
153
  update! submission_status: :passed
150
154
  end
@@ -7,6 +7,14 @@ module WithTermsAcceptance
7
7
  !has_accepted_all?(profile_terms)
8
8
  end
9
9
 
10
+ def has_role_terms_to_accept?
11
+ !has_accepted_all?(role_specific_terms)
12
+ end
13
+
14
+ def role_specific_terms
15
+ @role_specific_terms ||= Term.role_specific_terms_for(self)
16
+ end
17
+
10
18
  def forum_terms
11
19
  @forum_terms ||= Term.forum_related_terms
12
20
  end
@@ -51,7 +51,10 @@ class Guide < Content
51
51
  joins("left join public.assignments assignments
52
52
  on assignments.exercise_id = exercises.id
53
53
  and assignments.submitter_id = #{user.id}
54
- and assignments.submission_status = #{Mumuki::Domain::Status::Submission::Passed.to_i}").
54
+ and assignments.submission_status in (
55
+ #{Mumuki::Domain::Status::Submission::Passed.to_i},
56
+ #{Mumuki::Domain::Status::Submission::ManualEvaluationPending.to_i}
57
+ )").
55
58
  where('assignments.id is null')
56
59
  end
57
60
 
@@ -48,7 +48,10 @@ class Topic < Content
48
48
  joins("left join public.assignments assignments
49
49
  on assignments.exercise_id = exercises.id
50
50
  and assignments.submitter_id = #{user.id}
51
- and assignments.submission_status = #{Mumuki::Domain::Status::Submission::Passed.to_i}").
51
+ and assignments.submission_status in (
52
+ #{Mumuki::Domain::Status::Submission::Passed.to_i},
53
+ #{Mumuki::Domain::Status::Submission::ManualEvaluationPending.to_i}
54
+ )").
52
55
  where('assignments.id is null').
53
56
  group('public.guides.id', 'lessons.number').map(&:lesson)
54
57
  end
@@ -64,14 +64,13 @@ module Mumuki::Domain
64
64
  # Terms
65
65
  # ========
66
66
 
67
- def accepted_profile_terms?
68
- true
69
- end
70
-
71
- def accepted_forum_terms?
72
- true
67
+ # It avoids role terms acceptance redirections
68
+ def has_role_terms_to_accept?
69
+ false
73
70
  end
74
71
 
72
+ # It makes terms UI to be shown as if no terms were accepted
73
+ # It does not force any term to be accepted though
75
74
  def has_accepted?(term)
76
75
  false
77
76
  end
@@ -53,7 +53,11 @@ class Mumuki::Domain::Submission::Base
53
53
 
54
54
  def save_submission!(assignment)
55
55
  assignment.content = content
56
- assignment.organization = Organization.current
56
+ if assignment.organization != Organization.current
57
+ assignment.dirty_parent_by_submission! if assignment.organization
58
+ assignment.organization = Organization.current
59
+ assignment.parent_id = nil
60
+ end
57
61
  assignment.save!
58
62
  end
59
63
 
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Domain
3
- VERSION = '7.12.0'
3
+ VERSION = '7.12.1'
4
4
  end
5
5
  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: 7.12.0
4
+ version: 7.12.1
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-11-05 00:00:00.000000000 Z
11
+ date: 2020-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails