erik-text-area 0.2.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/erik-text-area.rb +47 -0
- metadata +58 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8b9321fa85dbe8eaea8e3cd6b8e53f7ce511f070
|
4
|
+
data.tar.gz: 7f96c7cc86163b405bd4a3e93555d65ef73cc885
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ce9bbe831116ef4fbbf10a1363cbe7b0cb708d35d4cdece87bad7da4ff917db6df3afcb21470075ecfe0332541c1ab5ea5194fe0321e61b4e2a17fad2907a89a
|
7
|
+
data.tar.gz: 7c249e88657efc953ae7031d4a5f1bdf8e6fe56144b2f787f5956d9da3d1514612c250cde442ea7f736febf1f39dabde062a4c4906c8ed5b61f96ab09f47b14d
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'erik-question-feedback'
|
2
|
+
|
3
|
+
module Questions
|
4
|
+
class TextArea
|
5
|
+
def initialize(index, question_json)
|
6
|
+
@index = index
|
7
|
+
@text = question_json['question']
|
8
|
+
@answer = question_json['answer']
|
9
|
+
end
|
10
|
+
|
11
|
+
def name
|
12
|
+
@text
|
13
|
+
end
|
14
|
+
|
15
|
+
def mark(answer)
|
16
|
+
correct = answer && (answer.strip == @answer.strip)
|
17
|
+
QuestionFeedback.new(correct, correct ? nil : %(The correct answer was "#{@answer}".))
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_html
|
21
|
+
%(<textarea name="q-#{@index}"></textarea>)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.schema
|
25
|
+
{
|
26
|
+
"properties": {
|
27
|
+
"question": {
|
28
|
+
"type": "string"
|
29
|
+
},
|
30
|
+
"type": {
|
31
|
+
"type": "string",
|
32
|
+
"pattern": "^text-area$"
|
33
|
+
},
|
34
|
+
"answer": {
|
35
|
+
"type": "string"
|
36
|
+
}
|
37
|
+
},
|
38
|
+
"required": [
|
39
|
+
"question",
|
40
|
+
"type",
|
41
|
+
"answer"
|
42
|
+
],
|
43
|
+
"additionalProperties": false
|
44
|
+
}
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
metadata
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: erik-text-area
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Team Eriksen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: erik-question-feedback
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.2'
|
27
|
+
description: A text area question type.
|
28
|
+
email: eriksen@example.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- lib/erik-text-area.rb
|
34
|
+
homepage: http://dams.flippd.it/
|
35
|
+
licenses:
|
36
|
+
- BSD
|
37
|
+
metadata: {}
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
require_paths:
|
41
|
+
- lib
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
requirements: []
|
53
|
+
rubyforge_project:
|
54
|
+
rubygems_version: 2.2.5
|
55
|
+
signing_key:
|
56
|
+
specification_version: 4
|
57
|
+
summary: A text area question type.
|
58
|
+
test_files: []
|