examen 1.2.4
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/.coveralls.yml +1 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.travis.yml +6 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +91 -0
- data/Guardfile +40 -0
- data/LICENSE.txt +22 -0
- data/README.md +65 -0
- data/README.rdoc +65 -0
- data/Rakefile +25 -0
- data/doc/prct10.pdf +0 -0
- data/doc/prct5.pdf +0 -0
- data/doc/prct6.pdf +0 -0
- data/doc/prct7.pdf +0 -0
- data/doc/prct8.pdf +0 -0
- data/doc/prct9.pdf +0 -0
- data/doc/pruebas/index.html +430 -0
- data/examen.gemspec +29 -0
- data/html/Exam.html +296 -0
- data/html/Examen.html +119 -0
- data/html/ExamenIu.html +278 -0
- data/html/Lista.html +536 -0
- data/html/Object.html +119 -0
- data/html/Pregunta.html +361 -0
- data/html/PreguntaVerdaderoFalso.html +169 -0
- data/html/Quiz.html +363 -0
- data/html/README_rdoc.html +154 -0
- data/html/created.rid +11 -0
- data/html/fonts.css +167 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +178 -0
- data/html/js/darkfish.js +140 -0
- data/html/js/jquery.js +4 -0
- data/html/js/navigation.js +142 -0
- data/html/js/search.js +109 -0
- data/html/js/search_index.js +1 -0
- data/html/js/searcher.js +228 -0
- data/html/rdoc.css +580 -0
- data/html/table_of_contents.html +204 -0
- data/lib/examen.rb +3 -0
- data/lib/examen/base.rb +3 -0
- data/lib/examen/exam.rb +24 -0
- data/lib/examen/examen_iu.rb +38 -0
- data/lib/examen/lista.rb +108 -0
- data/lib/examen/pregunta.rb +38 -0
- data/lib/examen/pregunta_verdadero_falso.rb +16 -0
- data/lib/examen/quiz.rb +35 -0
- data/lib/examen/version.rb +4 -0
- data/spec/examen_spec.rb +334 -0
- data/spec/spec_helper.rb +99 -0
- metadata +229 -0
data/examen.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'examen/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "examen"
|
8
|
+
spec.version = Examen::VERSION
|
9
|
+
spec.authors = ["César Ravelo Martínez", "Ayose Castillo Barroso"]
|
10
|
+
spec.email = ["alu0100511314@ull.edu.es", "alu0100600810@ull.edu.es"]
|
11
|
+
spec.summary = %q{Gema para la implementación de preguntas de respuesta de selección simple}
|
12
|
+
spec.description = %q{Gema para la implementación de preguntas de respuestas simple frente a un conjunto de respuestas}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib", "lib/examen"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "rspec", "~> 2.11"
|
24
|
+
|
25
|
+
spec.add_development_dependency "guard"
|
26
|
+
spec.add_development_dependency "guard-rspec"
|
27
|
+
spec.add_development_dependency "guard-bundler"
|
28
|
+
spec.add_development_dependency "coveralls"
|
29
|
+
end
|
data/html/Exam.html
ADDED
@@ -0,0 +1,296 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Exam - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link href="./fonts.css" rel="stylesheet">
|
10
|
+
<link href="./rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "./";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="./js/jquery.js"></script>
|
17
|
+
<script src="./js/navigation.js"></script>
|
18
|
+
<script src="./js/search_index.js"></script>
|
19
|
+
<script src="./js/search.js"></script>
|
20
|
+
<script src="./js/searcher.js"></script>
|
21
|
+
<script src="./js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
<div id="parent-class-section" class="nav-section">
|
61
|
+
<h3>Parent</h3>
|
62
|
+
|
63
|
+
|
64
|
+
<p class="link"><a href="Object.html">Object</a>
|
65
|
+
|
66
|
+
</div>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
|
76
|
+
<li ><a href="#method-c-new">::new</a>
|
77
|
+
|
78
|
+
<li ><a href="#method-i-3C-3C">#<<</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-push_back">#push_back</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
83
|
+
|
84
|
+
</ul>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
</nav>
|
89
|
+
|
90
|
+
<main role="main" aria-labelledby="class-Exam">
|
91
|
+
<h1 id="class-Exam" class="class">
|
92
|
+
class Exam
|
93
|
+
</h1>
|
94
|
+
|
95
|
+
<section class="description">
|
96
|
+
|
97
|
+
<p>Clase gestora de examenes con preguntas</p>
|
98
|
+
|
99
|
+
</section>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<section class="attribute-method-details" class="method-section">
|
113
|
+
<header>
|
114
|
+
<h3>Attributes</h3>
|
115
|
+
</header>
|
116
|
+
|
117
|
+
|
118
|
+
<div id="attribute-i-list" class="method-detail">
|
119
|
+
<div class="method-heading attribute-method-heading">
|
120
|
+
<span class="method-name">list</span><span
|
121
|
+
class="attribute-access-type">[RW]</span>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div class="method-description">
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
</section>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
136
|
+
<header>
|
137
|
+
<h3>Public Class Methods</h3>
|
138
|
+
</header>
|
139
|
+
|
140
|
+
|
141
|
+
<div id="method-c-new" class="method-detail ">
|
142
|
+
|
143
|
+
<div class="method-heading">
|
144
|
+
<span class="method-name">new</span><span
|
145
|
+
class="method-args">(p)</span>
|
146
|
+
|
147
|
+
<span class="method-click-advice">click to toggle source</span>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
|
152
|
+
<div class="method-description">
|
153
|
+
|
154
|
+
<p>Crea una instancia de la clase <a href="Exam.html">Exam</a> , a partir de
|
155
|
+
una pregunta.</p>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<div class="method-source-code" id="new-source">
|
161
|
+
<pre><span class="ruby-comment"># File lib/examen/exam.rb, line 6</span>
|
162
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">p</span>)
|
163
|
+
<span class="ruby-ivar">@list</span> = <span class="ruby-constant">Lista</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">p</span>)
|
164
|
+
<span class="ruby-keyword">end</span></pre>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
</div>
|
173
|
+
|
174
|
+
|
175
|
+
</section>
|
176
|
+
|
177
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
178
|
+
<header>
|
179
|
+
<h3>Public Instance Methods</h3>
|
180
|
+
</header>
|
181
|
+
|
182
|
+
|
183
|
+
<div id="method-i-3C-3C" class="method-detail ">
|
184
|
+
|
185
|
+
<div class="method-heading">
|
186
|
+
<span class="method-name"><<</span><span
|
187
|
+
class="method-args">(p)</span>
|
188
|
+
|
189
|
+
<span class="method-click-advice">click to toggle source</span>
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
|
194
|
+
<div class="method-description">
|
195
|
+
|
196
|
+
<p>Sobrecarga del operador << para insertar preguntas al final del <a
|
197
|
+
href="Examen.html">Examen</a>.</p>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<div class="method-source-code" id="3C-3C-source">
|
203
|
+
<pre><span class="ruby-comment"># File lib/examen/exam.rb, line 14</span>
|
204
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator"><<</span>(<span class="ruby-identifier">p</span>)
|
205
|
+
<span class="ruby-ivar">@list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">p</span>
|
206
|
+
<span class="ruby-keyword">end</span></pre>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
</div>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
</div>
|
215
|
+
|
216
|
+
|
217
|
+
<div id="method-i-push_back" class="method-detail ">
|
218
|
+
|
219
|
+
<div class="method-heading">
|
220
|
+
<span class="method-name">push_back</span><span
|
221
|
+
class="method-args">(*preguntas)</span>
|
222
|
+
|
223
|
+
<span class="method-click-advice">click to toggle source</span>
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
|
228
|
+
<div class="method-description">
|
229
|
+
|
230
|
+
<p>Inserta una o varias preguntas sucesivamente.</p>
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
<div class="method-source-code" id="push_back-source">
|
236
|
+
<pre><span class="ruby-comment"># File lib/examen/exam.rb, line 18</span>
|
237
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">push_back</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">preguntas</span>)
|
238
|
+
<span class="ruby-identifier">preguntas</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">p</span>}
|
239
|
+
<span class="ruby-identifier">preguntas</span>
|
240
|
+
<span class="ruby-keyword">end</span></pre>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
</div>
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
<div id="method-i-to_s" class="method-detail ">
|
252
|
+
|
253
|
+
<div class="method-heading">
|
254
|
+
<span class="method-name">to_s</span><span
|
255
|
+
class="method-args">()</span>
|
256
|
+
|
257
|
+
<span class="method-click-advice">click to toggle source</span>
|
258
|
+
|
259
|
+
</div>
|
260
|
+
|
261
|
+
|
262
|
+
<div class="method-description">
|
263
|
+
|
264
|
+
<p>Definición del Metotodo <a href="Exam.html#method-i-to_s">#to_s</a>, para
|
265
|
+
la clase <a href="Exam.html">Exam</a>.</p>
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
<div class="method-source-code" id="to_s-source">
|
271
|
+
<pre><span class="ruby-comment"># File lib/examen/exam.rb, line 10</span>
|
272
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
273
|
+
<span class="ruby-node">"#{@list}"</span>
|
274
|
+
<span class="ruby-keyword">end</span></pre>
|
275
|
+
</div>
|
276
|
+
|
277
|
+
</div>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
</div>
|
283
|
+
|
284
|
+
|
285
|
+
</section>
|
286
|
+
|
287
|
+
</section>
|
288
|
+
</main>
|
289
|
+
|
290
|
+
|
291
|
+
<footer id="validator-badges" role="contentinfo">
|
292
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
293
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
294
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
295
|
+
</footer>
|
296
|
+
|
data/html/Examen.html
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Examen - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link href="./fonts.css" rel="stylesheet">
|
10
|
+
<link href="./rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "./";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="./js/jquery.js"></script>
|
17
|
+
<script src="./js/navigation.js"></script>
|
18
|
+
<script src="./js/search_index.js"></script>
|
19
|
+
<script src="./js/search.js"></script>
|
20
|
+
<script src="./js/searcher.js"></script>
|
21
|
+
<script src="./js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
<div id="parent-class-section" class="nav-section">
|
61
|
+
<h3>Parent</h3>
|
62
|
+
|
63
|
+
|
64
|
+
<p class="link"><a href="Object.html">Object</a>
|
65
|
+
|
66
|
+
</div>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
</div>
|
72
|
+
</nav>
|
73
|
+
|
74
|
+
<main role="main" aria-labelledby="class-Examen">
|
75
|
+
<h1 id="class-Examen" class="class">
|
76
|
+
class Examen
|
77
|
+
</h1>
|
78
|
+
|
79
|
+
<section class="description">
|
80
|
+
|
81
|
+
</section>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
<section class="constants-list">
|
93
|
+
<header>
|
94
|
+
<h3>Constants</h3>
|
95
|
+
</header>
|
96
|
+
<dl>
|
97
|
+
|
98
|
+
<dt id="VERSION">VERSION
|
99
|
+
|
100
|
+
<dd>
|
101
|
+
|
102
|
+
|
103
|
+
</dl>
|
104
|
+
</section>
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
</section>
|
111
|
+
</main>
|
112
|
+
|
113
|
+
|
114
|
+
<footer id="validator-badges" role="contentinfo">
|
115
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
116
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
117
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
118
|
+
</footer>
|
119
|
+
|
data/html/ExamenIu.html
ADDED
@@ -0,0 +1,278 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class ExamenIu - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link href="./fonts.css" rel="stylesheet">
|
10
|
+
<link href="./rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "./";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="./js/jquery.js"></script>
|
17
|
+
<script src="./js/navigation.js"></script>
|
18
|
+
<script src="./js/search_index.js"></script>
|
19
|
+
<script src="./js/search.js"></script>
|
20
|
+
<script src="./js/searcher.js"></script>
|
21
|
+
<script src="./js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
<div id="parent-class-section" class="nav-section">
|
61
|
+
<h3>Parent</h3>
|
62
|
+
|
63
|
+
|
64
|
+
<p class="link"><a href="Object.html">Object</a>
|
65
|
+
|
66
|
+
</div>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
|
76
|
+
<li ><a href="#method-c-new">::new</a>
|
77
|
+
|
78
|
+
<li ><a href="#method-i-test">#test</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-testinteractivo">#testinteractivo</a>
|
81
|
+
|
82
|
+
</ul>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
</nav>
|
87
|
+
|
88
|
+
<main role="main" aria-labelledby="class-ExamenIu">
|
89
|
+
<h1 id="class-ExamenIu" class="class">
|
90
|
+
class ExamenIu
|
91
|
+
</h1>
|
92
|
+
|
93
|
+
<section class="description">
|
94
|
+
|
95
|
+
<p>Clase gestora de la Interfaz de usuario de la gema.</p>
|
96
|
+
|
97
|
+
</section>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<section class="attribute-method-details" class="method-section">
|
111
|
+
<header>
|
112
|
+
<h3>Attributes</h3>
|
113
|
+
</header>
|
114
|
+
|
115
|
+
|
116
|
+
<div id="attribute-i-exam" class="method-detail">
|
117
|
+
<div class="method-heading attribute-method-heading">
|
118
|
+
<span class="method-name">exam</span><span
|
119
|
+
class="attribute-access-type">[RW]</span>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
<div class="method-description">
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
</section>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
134
|
+
<header>
|
135
|
+
<h3>Public Class Methods</h3>
|
136
|
+
</header>
|
137
|
+
|
138
|
+
|
139
|
+
<div id="method-c-new" class="method-detail ">
|
140
|
+
|
141
|
+
<div class="method-heading">
|
142
|
+
<span class="method-name">new</span><span
|
143
|
+
class="method-args">(pregunta)</span>
|
144
|
+
|
145
|
+
<span class="method-click-advice">click to toggle source</span>
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
|
150
|
+
<div class="method-description">
|
151
|
+
|
152
|
+
<p>Crea una nueva instancia a partir de una pregunta.</p>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<div class="method-source-code" id="new-source">
|
158
|
+
<pre><span class="ruby-comment"># File lib/examen/examen_iu.rb, line 6</span>
|
159
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">pregunta</span>)
|
160
|
+
<span class="ruby-ivar">@exam</span> = <span class="ruby-constant">Exam</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">pregunta</span>)
|
161
|
+
<span class="ruby-keyword">end</span></pre>
|
162
|
+
</div>
|
163
|
+
|
164
|
+
</div>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
</div>
|
170
|
+
|
171
|
+
|
172
|
+
</section>
|
173
|
+
|
174
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
175
|
+
<header>
|
176
|
+
<h3>Public Instance Methods</h3>
|
177
|
+
</header>
|
178
|
+
|
179
|
+
|
180
|
+
<div id="method-i-test" class="method-detail ">
|
181
|
+
|
182
|
+
<div class="method-heading">
|
183
|
+
<span class="method-name">test</span><span
|
184
|
+
class="method-args">(resp)</span>
|
185
|
+
|
186
|
+
<span class="method-click-advice">click to toggle source</span>
|
187
|
+
|
188
|
+
</div>
|
189
|
+
|
190
|
+
|
191
|
+
<div class="method-description">
|
192
|
+
|
193
|
+
<p>Dado un conjunto de respuestas las evalua e indica cuales son correctas y
|
194
|
+
cuales no.</p>
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
<div class="method-source-code" id="test-source">
|
200
|
+
<pre><span class="ruby-comment"># File lib/examen/examen_iu.rb, line 10</span>
|
201
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test</span>(<span class="ruby-identifier">resp</span>)
|
202
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@exam</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">count</span>, <span class="ruby-value">0</span>)
|
203
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
|
204
|
+
<span class="ruby-ivar">@exam</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
|
205
|
+
<span class="ruby-identifier">result</span>[<span class="ruby-identifier">i</span>] = (<span class="ruby-identifier">p</span>.<span class="ruby-identifier">right</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">eql?</span><span class="ruby-identifier">resp</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">to_s</span>)<span class="ruby-operator">?</span><span class="ruby-value">1</span><span class="ruby-operator">:</span><span class="ruby-value">0</span>
|
206
|
+
<span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
207
|
+
<span class="ruby-keyword">end</span>
|
208
|
+
<span class="ruby-identifier">result</span>
|
209
|
+
<span class="ruby-keyword">end</span></pre>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
</div>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
</div>
|
218
|
+
|
219
|
+
|
220
|
+
<div id="method-i-testinteractivo" class="method-detail ">
|
221
|
+
|
222
|
+
<div class="method-heading">
|
223
|
+
<span class="method-name">testinteractivo</span><span
|
224
|
+
class="method-args">()</span>
|
225
|
+
|
226
|
+
<span class="method-click-advice">click to toggle source</span>
|
227
|
+
|
228
|
+
</div>
|
229
|
+
|
230
|
+
|
231
|
+
<div class="method-description">
|
232
|
+
|
233
|
+
<p>Muestra la Interfaz de Usuario solicitando por pantalla las respuestas e
|
234
|
+
indicando si son correctas o no.</p>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
<div class="method-source-code" id="testinteractivo-source">
|
240
|
+
<pre><span class="ruby-comment"># File lib/examen/examen_iu.rb, line 20</span>
|
241
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">testinteractivo</span>
|
242
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@exam</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">count</span>, <span class="ruby-value">0</span>)
|
243
|
+
<span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
|
244
|
+
<span class="ruby-identifier">acertadas</span> = <span class="ruby-value">0</span>
|
245
|
+
<span class="ruby-ivar">@exam</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
|
246
|
+
<span class="ruby-identifier">pActual</span> = <span class="ruby-identifier">p</span>.<span class="ruby-identifier">to_s</span>
|
247
|
+
<span class="ruby-identifier">puts</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">") "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">pActual</span>
|
248
|
+
<span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">flush</span>
|
249
|
+
<span class="ruby-identifier">opc</span> = <span class="ruby-identifier">pActual</span>.<span class="ruby-identifier">match</span>(<span class="ruby-node">%r{#{gets.chomp}\)\s+(.*)}</span>)[<span class="ruby-value">1</span>]
|
250
|
+
<span class="ruby-identifier">result</span>[<span class="ruby-identifier">i</span>] = (<span class="ruby-identifier">p</span>.<span class="ruby-identifier">right</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">eql?</span><span class="ruby-identifier">opc</span>)<span class="ruby-operator">?</span><span class="ruby-value">1</span><span class="ruby-operator">:</span><span class="ruby-value">0</span>
|
251
|
+
<span class="ruby-identifier">acertadas</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> (<span class="ruby-identifier">result</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>)
|
252
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-node">"> Respuesta #{((result[i] == 1)?"correcta":"incorrecta") + " (" + acertadas.to_s + "/" + result.size.to_s + ")"}\n\n"</span>
|
253
|
+
<span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
254
|
+
<span class="ruby-keyword">end</span>
|
255
|
+
<span class="ruby-identifier">result</span>
|
256
|
+
<span class="ruby-keyword">end</span></pre>
|
257
|
+
</div>
|
258
|
+
|
259
|
+
</div>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
</div>
|
265
|
+
|
266
|
+
|
267
|
+
</section>
|
268
|
+
|
269
|
+
</section>
|
270
|
+
</main>
|
271
|
+
|
272
|
+
|
273
|
+
<footer id="validator-badges" role="contentinfo">
|
274
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
275
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
276
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
277
|
+
</footer>
|
278
|
+
|