zdubzdab_hola 0.0.4 → 0.0.5
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 +4 -4
- data/lib/zdubzdab_hola/acts_as_calculator.rb +10 -0
- data/lib/zdubzdab_hola.rb +2 -8
- metadata +4 -4
- data/lib/zdubzdab_hola/core.rb +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7eb1092488470203d75e183e09ff7b8b094d0736
|
|
4
|
+
data.tar.gz: aaa9b3b8835490a27025fdb92c86fe345e233eb4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 11bd7d0856adaab1b4f41fc58231f3bcb71b8a1fd90d29fb0270360bbb4ea8365ee7d3d4adaba59eb7ba49d5fbc68d865a9a7d98e9b136e280d4b7911ff9623e
|
|
7
|
+
data.tar.gz: 56e5b84a4ede34087c8f33d2d30beaabebc9639f49bf5064d13f5d64ff53f92e9d465bf4a400f63340106f372faee3c98483b234897824085706f491140b277b
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module zdubzdab_hola
|
|
2
|
+
module acts_as_calculator
|
|
3
|
+
def count_result
|
|
4
|
+
true_answers = Answer.belongs_to_current_test(self.id).with_true.joins(:answer_setting).where( answer_settings: {rigth: 'true'} )
|
|
5
|
+
all_questions = self.test_setting.questions
|
|
6
|
+
result = Float(true_answers.count) / all_questions.count * 100
|
|
7
|
+
self.update_attributes(complete_pers: result)
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
data/lib/zdubzdab_hola.rb
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
require 'zdubzdab_hola/
|
|
1
|
+
require 'zdubzdab_hola/acts_as_calculator'
|
|
2
2
|
|
|
3
|
-
module
|
|
4
|
-
# def count_result
|
|
5
|
-
# true_answers = Answer.belongs_to_current_test(self.id).with_true.joins(:answer_setting).where( answer_settings: {rigth: 'true'} )
|
|
6
|
-
# all_questions = self.test_setting.questions
|
|
7
|
-
# result = Float(true_answers.count) / all_questions.count * 100
|
|
8
|
-
# self.update_attributes(complete_pers: result)
|
|
9
|
-
# end
|
|
3
|
+
module zdubzdab_hola
|
|
10
4
|
end
|
|
11
5
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zdubzdab_hola
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- zdubzdab
|
|
@@ -10,14 +10,14 @@ bindir: bin
|
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2016-01-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description: The simplest
|
|
13
|
+
description: The simplest gem that calculate test result in percent.
|
|
14
14
|
email: zdubzdab@gmail.com
|
|
15
15
|
executables: []
|
|
16
16
|
extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
|
18
18
|
files:
|
|
19
19
|
- lib/zdubzdab_hola.rb
|
|
20
|
-
- lib/zdubzdab_hola/
|
|
20
|
+
- lib/zdubzdab_hola/acts_as_calculator.rb
|
|
21
21
|
homepage: http://rubygems.org/gems/zdubzdab_hola
|
|
22
22
|
licenses:
|
|
23
23
|
- MIT
|
|
@@ -41,5 +41,5 @@ rubyforge_project:
|
|
|
41
41
|
rubygems_version: 2.3.0
|
|
42
42
|
signing_key:
|
|
43
43
|
specification_version: 4
|
|
44
|
-
summary:
|
|
44
|
+
summary: Calculate test result
|
|
45
45
|
test_files: []
|