mumuki-domain 9.14.1 → 9.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b312037c43def7204d8591702f2002340539b6f66df217e4bf8b35e5a0392785
4
- data.tar.gz: f417d2c02346fcd6e2460c246d38f0a9c4eb1ac8a5162bf72bbe00f983326bec
3
+ metadata.gz: 304bef838324905dba928e6099d897752778b1781ce9c445448f8e9a6601c76d
4
+ data.tar.gz: 28b4571ce4c641fec10223786b7e9ddd367d85e8b45fda84e315ef990efe35a7
5
5
  SHA512:
6
- metadata.gz: 5786a0b215fee7332099994a47e13b24d2f8a66647ede57aaa67bdcdd2e77433e471d8dc5f7ef48369bea06fb2636f900ed365d24b3b1549f0cef3c48d316f25
7
- data.tar.gz: 282e425ad11463f7c0945b323327f17addc7997e60f191a034b07317907e0156918fcd667786f4905b89682abe9bb2090148fab392aebd9f99c6c0ab1320be2b
6
+ metadata.gz: 1727cf0e4115b793e472529251ed7754a2ec4adee510910f0a4d09ebd5c5aa04c2c59dc7b2459b8ab316391e4b0b26422d9c38c4321988b14ca5a27bfc965bcc
7
+ data.tar.gz: e30036eb0b135ebdd26f8ec9fbb782b445955bc2c24695d6ec298f6b7229f26e54360fe7093a1640540081254f0e0e9f6ad469aa56fdf4af1e000b2c48ffde65
@@ -43,20 +43,6 @@ class Assignment < Progress
43
43
  after_initialize :set_default_top_submission_status
44
44
  before_save :award_experience_points!, :update_top_submission!, if: :submission_status_changed?
45
45
  after_save :dirty_parent_by_submission!, if: :completion_changed?
46
- before_validation :set_current_organization!, unless: :organization
47
-
48
- # TODO: Momentary as some assignments may not have an associated organization
49
- def set_current_organization!
50
- self.organization = Organization.current
51
- end
52
-
53
- def recontextualize!(new_organization = Organization.current)
54
- if organization != new_organization
55
- dirty_parent_by_submission! if organization.present? && exercise.used_in?(organization)
56
- self.organization = new_organization
57
- self.parent_id = nil
58
- end
59
- end
60
46
 
61
47
  def set_default_top_submission_status
62
48
  self.top_submission_status ||= 0
@@ -123,7 +109,7 @@ class Assignment < Progress
123
109
  end
124
110
 
125
111
  def content=(content)
126
- if content.present? && exercise.solvable?
112
+ if exercise.solvable?
127
113
  self.solution = exercise.single_choice? ? exercise.choice_index_for(content) : content
128
114
  end
129
115
  end
@@ -52,8 +52,6 @@ class Mumuki::Domain::Submission::Base
52
52
  private
53
53
 
54
54
  def save_submission!(assignment)
55
- assignment.content = content
56
- assignment.recontextualize!
57
55
  assignment.save!
58
56
  end
59
57
 
@@ -1,5 +1,6 @@
1
1
  class Mumuki::Domain::Submission::PersistentSubmission < Mumuki::Domain::Submission::Base
2
2
  def save_submission!(assignment)
3
+ assignment.content = content
3
4
  assignment.running!
4
5
  super
5
6
  assignment.save_submission! self
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Domain
3
- VERSION = '9.14.1'
3
+ VERSION = '9.15.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.14.1
4
+ version: 9.15.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-07 00:00:00.000000000 Z
11
+ date: 2021-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails