mumuki-domain 7.4.0 → 7.4.1

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: 565a262560be1187382a14821310b252774ddd2cfbff5b1ec27f4740009274a8
4
- data.tar.gz: f81fcb7e631f8f4e1a88526a95a7152bb854c9cc8beea26cf0342574f68413e3
3
+ metadata.gz: 68dc581849f150d3c0a958f3a1df2b25b4959b3ee71a595364cf2ac7533fbd25
4
+ data.tar.gz: dc6a6e467c80e08d035ccc70c7ace81ffdabb41088564350220f76706738332a
5
5
  SHA512:
6
- metadata.gz: 1f47711214119a25152f602e342ad9934d5e5e72253580639704353bdd9337aeba0899ad975c75d139363f5dfb13ed4574673df381d99896c766e14a9b79abc4
7
- data.tar.gz: aab1d74be634268a51719ee81d9a3977ea0412b5b645a8e5b29909b75b690ad2deac25bed2e2872312dfa8b63c48fcf0b5516bd9731fcb50b7dd644d8c2c7fbd
6
+ metadata.gz: d852df438a75e07817d1b01769559faf0a68b7c892a4423b7ee0a97a04153439388904b544a19562597015c2f613596a8236d87205aedaf86304d9141f7992ea
7
+ data.tar.gz: aeb1db5771206c8de35da5e9d03395f5029ce7dcec4d5b643d65365f4d1ef01e5159ffc66038bc056300bc9f9f103549ff029bcbb7b22c08fc2b47270b7aecb8
@@ -25,7 +25,7 @@ module Contextualization
25
25
 
26
26
  delegate :visible_success_output?, to: :exercise
27
27
  delegate :output_content_type, to: :language
28
- delegate :should_retry?, :to_submission_status, :completed?, *Mumuki::Domain::Status::Submission.test_selectors, to: :submission_status
28
+ delegate :should_retry?, :to_submission_status, :completed?, :solved?, *Mumuki::Domain::Status::Submission.test_selectors, to: :submission_status
29
29
  delegate :inspection_keywords, to: :exercise
30
30
  end
31
31
 
@@ -44,11 +44,7 @@ module Contextualization
44
44
  end
45
45
 
46
46
  def results_body_hidden?
47
- (passed? && !visible_success_output?) || exercise.choice? || manual_evaluation_pending?
48
- end
49
-
50
- def result_preview
51
- result.truncate(100) unless passed?
47
+ (passed? && !visible_success_output?) || exercise.choice? || manual_evaluation_pending? || skipped?
52
48
  end
53
49
 
54
50
  def visible_status
@@ -68,7 +64,7 @@ module Contextualization
68
64
  end
69
65
 
70
66
  def failed_expectation_results
71
- expectation_results.to_a.select { |it| it[:result].failed? }
67
+ expectation_results.to_a.select { |it| it[:result].failed? }.uniq
72
68
  end
73
69
 
74
70
  def expectation_results_visible?
@@ -1,7 +1,7 @@
1
1
  module Solvable
2
2
  def submit_solution!(user, attributes={})
3
3
  assignment, _ = find_assignment_and_submit! user, attributes[:content].to_mumuki_solution(language)
4
- try_solve_discussions(user) if assignment.passed?
4
+ try_solve_discussions(user) if assignment.solved?
5
5
  assignment
6
6
  end
7
7
 
data/app/models/stats.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  class Stats
2
2
  include ActiveModel::Model
3
3
 
4
- attr_accessor :passed, :passed_with_warnings, :failed, :pending
4
+ attr_accessor :passed, :passed_with_warnings, :failed, :pending, :skipped
5
5
 
6
6
  def submitted
7
7
  passed + passed_with_warnings + failed
@@ -16,7 +16,7 @@ class Stats
16
16
  end
17
17
 
18
18
  def self.from_statuses(statuses)
19
- Stats.new(statuses.inject({passed: 0, passed_with_warnings: 0, failed: 0, pending: 0}) do |accum, status|
19
+ Stats.new(statuses.inject({passed: 0, passed_with_warnings: 0, failed: 0, pending: 0, skipped: 0}) do |accum, status|
20
20
  accum[status.group.to_sym] += 1
21
21
  accum
22
22
  end)
@@ -5,10 +5,6 @@ module Mumuki::Domain::Status::Submission::Skipped
5
5
  true
6
6
  end
7
7
 
8
- def self.passed?
9
- true
10
- end
11
-
12
8
  def self.iconize
13
9
  {class: :success, type: 'check-circle'}
14
10
  end
@@ -23,8 +23,6 @@ module Mumuki::Domain::Status::Submission
23
23
  self
24
24
  end
25
25
 
26
- # Tells if a new, different submission should be tried.
27
- # True for `failed`, `errored` and `passed_with_warnings`
28
26
  def should_retry?
29
27
  false
30
28
  end
@@ -38,6 +36,10 @@ module Mumuki::Domain::Status::Submission
38
36
  end
39
37
 
40
38
  def completed?
41
- passed?
39
+ solved?
40
+ end
41
+
42
+ def solved?
43
+ passed? || skipped?
42
44
  end
43
45
  end
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Domain
3
- VERSION = '7.4.0'
3
+ VERSION = '7.4.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.4.0
4
+ version: 7.4.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-04-02 00:00:00.000000000 Z
11
+ date: 2020-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails