mumuki-domain 6.2.0 → 6.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/exercise.rb +7 -7
- data/app/models/language.rb +1 -0
- data/lib/mumuki/domain/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76ce31380b9bb9748fa7bb45e294758326fe416a7e23f653ccd7685687b52d9e
|
4
|
+
data.tar.gz: fb574a1ed0d64dfc987e32cdab66878d590b1245eaf8b5ff043ffa859de371bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 909546a44435e5fdd0d93961e96cff5b96d8c5306e1b4d4bff4ef3b91dcb0425e8a411ce101c3bf3345e968c08e697ab0c8bcae5f5cf6e5d711850bcebe8bcb8
|
7
|
+
data.tar.gz: 926e48d33c8ec6c2433fa6ceb9a9c7fa68297f0e7d3d8a2cb57346e5461b7c104125b689afda72bb818b5b998e876581a92f557283cc8c69a10be3c015901ee9
|
data/app/models/exercise.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
class Exercise < ApplicationRecord
|
2
|
+
RANDOMIZED_FIELDS = [:default_content, :description, :extra, :hint, :test]
|
3
|
+
|
2
4
|
include WithDescription
|
3
5
|
include WithLocale
|
4
6
|
include WithNumber,
|
@@ -23,7 +25,7 @@ class Exercise < ApplicationRecord
|
|
23
25
|
validates_presence_of :submissions_count,
|
24
26
|
:guide, :bibliotheca_id
|
25
27
|
|
26
|
-
randomize
|
28
|
+
randomize(*RANDOMIZED_FIELDS)
|
27
29
|
delegate :timed?, to: :navigable_parent
|
28
30
|
|
29
31
|
def console?
|
@@ -106,10 +108,12 @@ class Exercise < ApplicationRecord
|
|
106
108
|
|
107
109
|
def to_resource_h
|
108
110
|
language_resource_h = language.to_embedded_resource_h if language != guide.language
|
109
|
-
as_json(only: %i(name layout editor
|
110
|
-
choices
|
111
|
+
as_json(only: %i(name layout editor corollary teacher_info manual_evaluation locale
|
112
|
+
choices assistance_rules randomizations tag_list extra_visible goal
|
111
113
|
free_form_editor_source initial_state final_state))
|
112
114
|
.merge(id: bibliotheca_id, language: language_resource_h, type: type.underscore)
|
115
|
+
.merge(expectations: own_expectations)
|
116
|
+
.merge(RANDOMIZED_FIELDS.map { |it| [it, self[it]] }.to_h)
|
113
117
|
.symbolize_keys
|
114
118
|
.compact
|
115
119
|
end
|
@@ -164,10 +168,6 @@ class Exercise < ApplicationRecord
|
|
164
168
|
{}
|
165
169
|
end
|
166
170
|
|
167
|
-
def default_content
|
168
|
-
self[:default_content] || ''
|
169
|
-
end
|
170
|
-
|
171
171
|
# Submits the user solution
|
172
172
|
# only if the corresponding assignment has attemps left
|
173
173
|
def try_submit_solution!(user, solution={})
|
data/app/models/language.rb
CHANGED
@@ -75,6 +75,7 @@ class Language < ApplicationRecord
|
|
75
75
|
|
76
76
|
# TODO we should use Mumukit::Directives::Pipeline
|
77
77
|
def interpolate(interpolee, *interpolations)
|
78
|
+
interpolee = interpolee || ''
|
78
79
|
interpolations.inject(interpolee) { |content, interpolation| directives_interpolations.interpolate(content, interpolation).first }
|
79
80
|
end
|
80
81
|
|
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: 6.2.
|
4
|
+
version: 6.2.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: 2018-12-
|
11
|
+
date: 2018-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -618,7 +618,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
618
618
|
- !ruby/object:Gem::Version
|
619
619
|
version: '0'
|
620
620
|
requirements: []
|
621
|
-
rubygems_version: 3.0.
|
621
|
+
rubygems_version: 3.0.1
|
622
622
|
signing_key:
|
623
623
|
specification_version: 4
|
624
624
|
summary: Mumuki Platform's Domain Model
|