estefania_exam 0.0.2
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 +15 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/Guardfile +39 -0
- data/LICENSE.txt +22 -0
- data/README.md +12 -0
- data/Rakefile +14 -0
- data/exam.gemspec +28 -0
- data/lib/doc/Exam.html +114 -0
- data/lib/doc/Exam/Examen.html +350 -0
- data/lib/doc/Interfaz.html +285 -0
- data/lib/doc/List.html +453 -0
- data/lib/doc/Node.html +170 -0
- data/lib/doc/Object.html +121 -0
- data/lib/doc/Question.html +309 -0
- data/lib/doc/SimpleSelection.html +275 -0
- data/lib/doc/VerdaderoFalso.html +228 -0
- data/lib/doc/created.rid +9 -0
- data/lib/doc/fonts.css +167 -0
- data/lib/doc/fonts/Lato-Light.ttf +0 -0
- data/lib/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/lib/doc/fonts/Lato-Regular.ttf +0 -0
- data/lib/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/lib/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/lib/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/lib/doc/images/add.png +0 -0
- data/lib/doc/images/arrow_up.png +0 -0
- data/lib/doc/images/brick.png +0 -0
- data/lib/doc/images/brick_link.png +0 -0
- data/lib/doc/images/bug.png +0 -0
- data/lib/doc/images/bullet_black.png +0 -0
- data/lib/doc/images/bullet_toggle_minus.png +0 -0
- data/lib/doc/images/bullet_toggle_plus.png +0 -0
- data/lib/doc/images/date.png +0 -0
- data/lib/doc/images/delete.png +0 -0
- data/lib/doc/images/find.png +0 -0
- data/lib/doc/images/loadingAnimation.gif +0 -0
- data/lib/doc/images/macFFBgHack.png +0 -0
- data/lib/doc/images/package.png +0 -0
- data/lib/doc/images/page_green.png +0 -0
- data/lib/doc/images/page_white_text.png +0 -0
- data/lib/doc/images/page_white_width.png +0 -0
- data/lib/doc/images/plugin.png +0 -0
- data/lib/doc/images/ruby.png +0 -0
- data/lib/doc/images/tag_blue.png +0 -0
- data/lib/doc/images/tag_green.png +0 -0
- data/lib/doc/images/transparent.png +0 -0
- data/lib/doc/images/wrench.png +0 -0
- data/lib/doc/images/wrench_orange.png +0 -0
- data/lib/doc/images/zoom.png +0 -0
- data/lib/doc/index.html +99 -0
- data/lib/doc/js/darkfish.js +140 -0
- data/lib/doc/js/jquery.js +4 -0
- data/lib/doc/js/navigation.js +142 -0
- data/lib/doc/js/search.js +109 -0
- data/lib/doc/js/search_index.js +1 -0
- data/lib/doc/js/searcher.js +228 -0
- data/lib/doc/rdoc.css +580 -0
- data/lib/doc/table_of_contents.html +186 -0
- data/lib/exam.rb +46 -0
- data/lib/exam/interfaz.rb +49 -0
- data/lib/exam/list.rb +111 -0
- data/lib/exam/node.rb +5 -0
- data/lib/exam/question.rb +34 -0
- data/lib/exam/simpleSelection.rb +29 -0
- data/lib/exam/verdaderoFalso.rb +21 -0
- data/lib/exam/version.rb +3 -0
- data/lib/quiz.rb +61 -0
- data/lib/quiz/answer.rb +25 -0
- data/lib/quiz/question.rb +29 -0
- data/spec/exam_spec.rb +297 -0
- data/spec/quiz_spec.rb +55 -0
- data/spec/spec_helper.rb +19 -0
- metadata +221 -0
data/lib/doc/Node.html
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
|
|
7
|
+
<title>class Node - 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
|
+
<div id="includes-section" class="nav-section">
|
|
69
|
+
<h3>Included Modules</h3>
|
|
70
|
+
|
|
71
|
+
<ul class="link-list">
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
<li><span class="include">Comparable</span>
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
</ul>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<!-- Method Quickref -->
|
|
82
|
+
<div id="method-list-section" class="nav-section">
|
|
83
|
+
<h3>Methods</h3>
|
|
84
|
+
|
|
85
|
+
<ul class="link-list" role="directory">
|
|
86
|
+
|
|
87
|
+
<li ><a href="#method-i-3C-3D-3E">#<=></a>
|
|
88
|
+
|
|
89
|
+
</ul>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
</div>
|
|
93
|
+
</nav>
|
|
94
|
+
|
|
95
|
+
<main role="main" aria-labelledby="class-Node">
|
|
96
|
+
<h1 id="class-Node" class="class">
|
|
97
|
+
class Node
|
|
98
|
+
</h1>
|
|
99
|
+
|
|
100
|
+
<section class="description">
|
|
101
|
+
|
|
102
|
+
<p>Clase que permitirá crear una lista de objetos.</p>
|
|
103
|
+
|
|
104
|
+
</section>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
120
|
+
<header>
|
|
121
|
+
<h3>Public Instance Methods</h3>
|
|
122
|
+
</header>
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
<div id="method-i-3C-3D-3E" class="method-detail ">
|
|
126
|
+
|
|
127
|
+
<div class="method-heading">
|
|
128
|
+
<span class="method-name"><=></span><span
|
|
129
|
+
class="method-args">(other)</span>
|
|
130
|
+
|
|
131
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
132
|
+
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
<div class="method-description">
|
|
137
|
+
|
|
138
|
+
<p>Método que se ha de implementar al incluir el Mixin Comparable y con el que
|
|
139
|
+
se hace la comparativa entre el valor del nodo y otro pasado por parámetro</p>
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
<div class="method-source-code" id="3C-3D-3E-source">
|
|
145
|
+
<pre><span class="ruby-comment"># File exam/list.rb, line 9</span>
|
|
146
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator"><=></span> (<span class="ruby-identifier">other</span>)
|
|
147
|
+
<span class="ruby-identifier">value</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">value</span>
|
|
148
|
+
<span class="ruby-keyword">end</span></pre>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
</section>
|
|
160
|
+
|
|
161
|
+
</section>
|
|
162
|
+
</main>
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
<footer id="validator-badges" role="contentinfo">
|
|
166
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
167
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
|
|
168
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
169
|
+
</footer>
|
|
170
|
+
|
data/lib/doc/Object.html
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
|
|
7
|
+
<title>class Object - 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">BasicObject
|
|
65
|
+
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
</div>
|
|
72
|
+
</nav>
|
|
73
|
+
|
|
74
|
+
<main role="main" aria-labelledby="class-Object">
|
|
75
|
+
<h1 id="class-Object" class="class">
|
|
76
|
+
class Object
|
|
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="Node">Node
|
|
99
|
+
|
|
100
|
+
<dd><p>Representación de un nodo que tendrá su valor, la dirección del siguiente
|
|
101
|
+
nodo y la del anterior. Esta clase será usada posteriormente por la clase
|
|
102
|
+
<a href="List.html">List</a>.</p>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
</dl>
|
|
106
|
+
</section>
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
</section>
|
|
113
|
+
</main>
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
<footer id="validator-badges" role="contentinfo">
|
|
117
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
118
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
|
|
119
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
120
|
+
</footer>
|
|
121
|
+
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
|
|
7
|
+
<title>class Question - 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
|
+
<div id="includes-section" class="nav-section">
|
|
69
|
+
<h3>Included Modules</h3>
|
|
70
|
+
|
|
71
|
+
<ul class="link-list">
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
<li><span class="include">Comparable</span>
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
</ul>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<!-- Method Quickref -->
|
|
82
|
+
<div id="method-list-section" class="nav-section">
|
|
83
|
+
<h3>Methods</h3>
|
|
84
|
+
|
|
85
|
+
<ul class="link-list" role="directory">
|
|
86
|
+
|
|
87
|
+
<li ><a href="#method-c-new">::new</a>
|
|
88
|
+
|
|
89
|
+
<li ><a href="#method-i-3C-3D-3E">#<=></a>
|
|
90
|
+
|
|
91
|
+
<li ><a href="#method-i-3D-3D">#==</a>
|
|
92
|
+
|
|
93
|
+
</ul>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
</div>
|
|
97
|
+
</nav>
|
|
98
|
+
|
|
99
|
+
<main role="main" aria-labelledby="class-Question">
|
|
100
|
+
<h1 id="class-Question" class="class">
|
|
101
|
+
class Question
|
|
102
|
+
</h1>
|
|
103
|
+
|
|
104
|
+
<section class="description">
|
|
105
|
+
|
|
106
|
+
<p>Clase que representa una pregunta y que contiene las posibles respuestas
|
|
107
|
+
así como la opción correcta. Se incluye el Mixin Comparable.</p>
|
|
108
|
+
|
|
109
|
+
</section>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
<section class="attribute-method-details" class="method-section">
|
|
123
|
+
<header>
|
|
124
|
+
<h3>Attributes</h3>
|
|
125
|
+
</header>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
<div id="attribute-i-ask" class="method-detail">
|
|
129
|
+
<div class="method-heading attribute-method-heading">
|
|
130
|
+
<span class="method-name">ask</span><span
|
|
131
|
+
class="attribute-access-type">[R]</span>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div class="method-description">
|
|
135
|
+
|
|
136
|
+
<p>Atributos que almacenarán el enunciado (ask), la dificultad (difficulty) y
|
|
137
|
+
la opción correcta (respuestaCorrecta)</p>
|
|
138
|
+
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<div id="attribute-i-difficulty" class="method-detail">
|
|
143
|
+
<div class="method-heading attribute-method-heading">
|
|
144
|
+
<span class="method-name">difficulty</span><span
|
|
145
|
+
class="attribute-access-type">[R]</span>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div class="method-description">
|
|
149
|
+
|
|
150
|
+
<p>Atributos que almacenarán el enunciado (ask), la dificultad (difficulty) y
|
|
151
|
+
la opción correcta (respuestaCorrecta)</p>
|
|
152
|
+
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<div id="attribute-i-respuestaCorrecta" class="method-detail">
|
|
157
|
+
<div class="method-heading attribute-method-heading">
|
|
158
|
+
<span class="method-name">respuestaCorrecta</span><span
|
|
159
|
+
class="attribute-access-type">[R]</span>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div class="method-description">
|
|
163
|
+
|
|
164
|
+
<p>Atributos que almacenarán el enunciado (ask), la dificultad (difficulty) y
|
|
165
|
+
la opción correcta (respuestaCorrecta)</p>
|
|
166
|
+
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
</section>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
175
|
+
<header>
|
|
176
|
+
<h3>Public Class Methods</h3>
|
|
177
|
+
</header>
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
<div id="method-c-new" class="method-detail ">
|
|
181
|
+
|
|
182
|
+
<div class="method-heading">
|
|
183
|
+
<span class="method-name">new</span><span
|
|
184
|
+
class="method-args">(ask,respuestaCorrecta,difficulty=0)</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>Inicialización de la pregunta, recogiendo los atributos ask,
|
|
194
|
+
respuestaCorrecta y difficulty (por defecto 0).</p>
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
<div class="method-source-code" id="new-source">
|
|
200
|
+
<pre><span class="ruby-comment"># File exam/question.rb, line 10</span>
|
|
201
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">ask</span>,<span class="ruby-identifier">respuestaCorrecta</span>,<span class="ruby-identifier">difficulty</span>=<span class="ruby-value">0</span>)
|
|
202
|
+
<span class="ruby-ivar">@ask</span>,<span class="ruby-ivar">@respuestaCorrecta</span>,<span class="ruby-ivar">@difficulty</span> = <span class="ruby-identifier">ask</span>,<span class="ruby-identifier">respuestaCorrecta</span>,<span class="ruby-identifier">difficulty</span>
|
|
203
|
+
<span class="ruby-keyword">end</span></pre>
|
|
204
|
+
</div>
|
|
205
|
+
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
</div>
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
</section>
|
|
215
|
+
|
|
216
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
217
|
+
<header>
|
|
218
|
+
<h3>Public Instance Methods</h3>
|
|
219
|
+
</header>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
<div id="method-i-3C-3D-3E" class="method-detail ">
|
|
223
|
+
|
|
224
|
+
<div class="method-heading">
|
|
225
|
+
<span class="method-name"><=></span><span
|
|
226
|
+
class="method-args">(other)</span>
|
|
227
|
+
|
|
228
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
229
|
+
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
<div class="method-description">
|
|
234
|
+
|
|
235
|
+
<p>Método que hace la comparativa entre preguntas en función de su dificultad
|
|
236
|
+
y sólo si la pasada por parámetro es también una <a
|
|
237
|
+
href="Question.html">Question</a></p>
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
<div class="method-source-code" id="3C-3D-3E-source">
|
|
243
|
+
<pre><span class="ruby-comment"># File exam/question.rb, line 17</span>
|
|
244
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator"><=></span> (<span class="ruby-identifier">other</span>)
|
|
245
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_a?</span><span class="ruby-constant">Question</span>
|
|
246
|
+
<span class="ruby-ivar">@difficulty</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">difficulty</span>
|
|
247
|
+
<span class="ruby-keyword">end</span></pre>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
</div>
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
</div>
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
<div id="method-i-3D-3D" class="method-detail ">
|
|
259
|
+
|
|
260
|
+
<div class="method-heading">
|
|
261
|
+
<span class="method-name">==</span><span
|
|
262
|
+
class="method-args">(other)</span>
|
|
263
|
+
|
|
264
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
265
|
+
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
<div class="method-description">
|
|
270
|
+
|
|
271
|
+
<p>Método que invalida el == y lo ajusta en el caso de que se den dos
|
|
272
|
+
preguntas con la misma dificultad donde entonces se determinará que
|
|
273
|
+
realmente son iguales si tienen además el mismo enunciado (ask).</p>
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
<div class="method-source-code" id="3D-3D-source">
|
|
279
|
+
<pre><span class="ruby-comment"># File exam/question.rb, line 25</span>
|
|
280
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">other</span>)
|
|
281
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_a?</span><span class="ruby-constant">Question</span>
|
|
282
|
+
<span class="ruby-identifier">iguales</span> = <span class="ruby-keyword">false</span>
|
|
283
|
+
<span class="ruby-keyword">if</span> (<span class="ruby-keyword">self</span>.<span class="ruby-identifier">difficulty</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">difficulty</span>) <span class="ruby-operator">&&</span> (<span class="ruby-keyword">self</span>.<span class="ruby-identifier">ask</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">ask</span>)
|
|
284
|
+
<span class="ruby-identifier">iguales</span> = <span class="ruby-keyword">true</span>
|
|
285
|
+
<span class="ruby-keyword">end</span>
|
|
286
|
+
<span class="ruby-identifier">iguales</span>
|
|
287
|
+
<span class="ruby-keyword">end</span></pre>
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
</div>
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
</section>
|
|
299
|
+
|
|
300
|
+
</section>
|
|
301
|
+
</main>
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
<footer id="validator-badges" role="contentinfo">
|
|
305
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
306
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
|
|
307
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
308
|
+
</footer>
|
|
309
|
+
|