mumuki-domain 9.18.0 → 9.19.0

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: 58b906585eb037f9120720bf77a34555343051e1aa2c87636a86208604247c2d
4
- data.tar.gz: ac72f7c3a8e36c388fe4cbf0c7e1e3a51620c9a2a6a333222a033dfa56ab3176
3
+ metadata.gz: bcb85dd95292fca604bdfd6f77560b37650766ede8bfbf1b7afe9caf4a105efd
4
+ data.tar.gz: ed1292935f907bde74fe777fd48de3d61ef87c5f62e6db4c3c7c0ae50c5ce3de
5
5
  SHA512:
6
- metadata.gz: 254fa485adb9816805590f4fc60877b8e1626f152d7e335e419ac5402079ec9bd4f30a5fd85cab712e694c10f8aeb0a9829d762bd1ec01323ccec9525981d930
7
- data.tar.gz: 5ef6dd8ed07d02d17c9c6049371bcd50a1235e7958d9a68ea41940121ff72c2f81c17beb9b9a69b2b5d70fc4c811df0bd1181cd18ebc28efbd9676d922d8d1a1
6
+ metadata.gz: fcc442e31b9f5b510c8a5a99d78bcbd98b8a0f36b828badeb64e25e8eaeecb3d910c7348da4b263047f52e5c6bd9ad6ee8412cfcfdf932cee5418a2ee48cfb7c
7
+ data.tar.gz: 6f888100f4dc2b1f9c332c3f8b9ebc257c1eb3aa2534c7db85bd0b4f4328f9fc2cd24f8da23ecbd04bb1dab8edd56ad236dac2dd6505ea8451ee5c5b6212c570
@@ -68,6 +68,10 @@ class Assignment < Progress
68
68
  end
69
69
  end
70
70
 
71
+ def randomized_values
72
+ exercise.randomizer.randomized_values(submitter.id)
73
+ end
74
+
71
75
  def save_submission!(submission)
72
76
  transaction do
73
77
  update! submission_id: submission.id
@@ -9,7 +9,7 @@ class Organization::Status::InPreparation < Organization::Status::Base
9
9
  end
10
10
 
11
11
  def ex_student_access_mode(user)
12
- OrganizationAccessMode::Forbidden.new user, organization
12
+ OrganizationAccessMode::ReadOnly.new user, organization, :faqs, :profile
13
13
  end
14
14
 
15
15
  def outsider_access_mode(user)
data/app/models/exam.rb CHANGED
@@ -96,6 +96,10 @@ class Exam < ApplicationRecord
96
96
  end
97
97
  end
98
98
 
99
+ def time_left(user)
100
+ (real_end_time(user) - Time.current).round
101
+ end
102
+
99
103
  def started_at(user)
100
104
  authorization_for(user).started_at
101
105
  end
@@ -17,7 +17,7 @@ class OrganizationAccessMode::ReadOnly < OrganizationAccessMode::Base
17
17
  end
18
18
 
19
19
  def validate_discuss_here!(discussion)
20
- super(discussion) unless discussion&.initiator == user
20
+ super(discussion) unless discuss_here? && discussion&.initiator == user
21
21
  end
22
22
 
23
23
  def show_content?(content)
data/app/models/user.rb CHANGED
@@ -157,8 +157,8 @@ class User < ApplicationRecord
157
157
  save_and_notify!
158
158
  end
159
159
 
160
- def detach!(role, course)
161
- make_ex_student_of! course.slug if student_of?(course.slug) && solved_any_exercises?(course.organization)
160
+ def detach!(role, course, deep: false)
161
+ make_ex_student_of! course.slug if !deep && student_of?(course.slug) && solved_any_exercises?(course.organization)
162
162
  remove_permission! role, course.slug
163
163
  save_and_notify!
164
164
  end
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Domain
3
- VERSION = '9.18.0'
3
+ VERSION = '9.19.0'
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: 9.18.0
4
+ version: 9.19.0
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-09-30 00:00:00.000000000 Z
11
+ date: 2021-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails