userquizattempt 0.0.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 +7 -0
- data/lib/userquizattempt.rb +15 -0
- metadata +43 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 3a3cc0c4e5223d72e57ddc78a7d1b481047b6d1a
|
|
4
|
+
data.tar.gz: 4221db97185718dcc06b312a45e9e0eadcfd884f
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 2590b08acb85d751a1a839c8527661b5d653ff78cee26a566115adeb5aab39e64a4452720cc92746ce2372d952c722e5a1fbed81ea4ba1f305928469ca72be8a
|
|
7
|
+
data.tar.gz: efb95360ab48b5e11fb12869e2ed45e767a6f0940f967c3395961543d260d2bef3a3655456cdcc27b7bb1ce65b252dbe4847f279cbbce6bba978f531a887f6b0
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module User_Quiz_Attempt
|
|
2
|
+
def self.getquiz(topic)
|
|
3
|
+
attempt = QuizAttempt.find_by(user_id: current_user.id, topic_id: topic.id, level: "Easy", passed: true)
|
|
4
|
+
if (attempt).nil?
|
|
5
|
+
return "Easy"
|
|
6
|
+
else
|
|
7
|
+
attempt = QuizAttempt.find_by(user_id: current_user.id, topic_id: topic.id, level: "Medium", passed: true)
|
|
8
|
+
if (attempt).nil?
|
|
9
|
+
return "Medium"
|
|
10
|
+
else
|
|
11
|
+
return "Hard"
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: userquizattempt
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- NoelD
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: A simple gem
|
|
14
|
+
email: noel.devitt@student.ncirl.ie
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/userquizattempt.rb
|
|
20
|
+
homepage: http://rubygems.org/gems/userquizattempt
|
|
21
|
+
licenses: []
|
|
22
|
+
metadata: {}
|
|
23
|
+
post_install_message:
|
|
24
|
+
rdoc_options: []
|
|
25
|
+
require_paths:
|
|
26
|
+
- lib
|
|
27
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
28
|
+
requirements:
|
|
29
|
+
- - ">="
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '0'
|
|
32
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
33
|
+
requirements:
|
|
34
|
+
- - ">="
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: '0'
|
|
37
|
+
requirements: []
|
|
38
|
+
rubyforge_project:
|
|
39
|
+
rubygems_version: 2.2.2
|
|
40
|
+
signing_key:
|
|
41
|
+
specification_version: 4
|
|
42
|
+
summary: Queries db based on topic to return users current quiz level
|
|
43
|
+
test_files: []
|