examenJoaquinAngelica 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.travis.yml +16 -0
- data/Gemfile +5 -0
- data/Guardfile +30 -0
- data/LICENSE.txt +22 -0
- data/README.md +20 -0
- data/Rakefile +5 -0
- data/doc/Examen.html +129 -0
- data/doc/Examen/EleccionSimple.html +163 -0
- data/doc/Examen/Exam.html +363 -0
- data/doc/Examen/Examen.html +163 -0
- data/doc/Examen/Interfaz.html +359 -0
- data/doc/Examen/Pregunta.html +385 -0
- data/doc/Examen/Verdaderofalso.html +161 -0
- data/doc/Gemfile.html +100 -0
- data/doc/Gemfile_lock.html +190 -0
- data/doc/Guardfile.html +121 -0
- data/doc/LICENSE_txt.html +116 -0
- data/doc/Lista.html +527 -0
- data/doc/Object.html +130 -0
- data/doc/README_md.html +112 -0
- data/doc/Rakefile.html +99 -0
- data/doc/created.rid +19 -0
- data/doc/examen_gemspec.html +134 -0
- data/doc/fonts.css +167 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +118 -0
- data/doc/js/darkfish.js +140 -0
- data/doc/js/jquery.js +4 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +580 -0
- data/doc/table_of_contents.html +238 -0
- data/examen.gemspec +40 -0
- data/lib/examen.rb +13 -0
- data/lib/examen/eleccionsimple.rb +16 -0
- data/lib/examen/exam.rb +109 -0
- data/lib/examen/examen.rb +17 -0
- data/lib/examen/interfaz.rb +45 -0
- data/lib/examen/lista.rb +92 -0
- data/lib/examen/pregunta.rb +53 -0
- data/lib/examen/verdaderofalso.rb +13 -0
- data/lib/examen/version.rb +3 -0
- data/spec/examen_spec.rb +624 -0
- data/spec/spec_helper.rb +32 -0
- metadata +280 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0190375ae69a514e4f015660dc64bf0f5e4e5f08
|
4
|
+
data.tar.gz: 745931902dd0c3dfb25e363aca60a27dc2d98bcb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: df450cbb292116c2705542a55a577a4a15dbf2f7e932c06d703f4799e4277b5f7ce0df9aa9453ec15535a4361a0d44bda729c74f759156fa95d33c601bf973e0
|
7
|
+
data.tar.gz: 15f4067b03b7ddaad9703d2d3b2676ce8d274c43ae6fe68403da99e9fe4b13d0b631aebde3d54937e03081874e649bf3ce2e7982978612fde77b358c31325b4c
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard :bundler do
|
5
|
+
watch('Gemfile')
|
6
|
+
# Uncomment next line if your Gemfile contains the `gemspec' command.
|
7
|
+
# watch(/^.+\.gemspec/)
|
8
|
+
end
|
9
|
+
|
10
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
11
|
+
# rspec may be run, below are examples of the most common uses.
|
12
|
+
# * bundler: 'bundle exec rspec'
|
13
|
+
# * bundler binstubs: 'bin/rspec'
|
14
|
+
# * spring: 'bin/rsspec' (This will use spring if running and you have
|
15
|
+
# installed the spring binstubs per the docs)
|
16
|
+
# * zeus: 'zeus rspec' (requires the server to be started separetly)
|
17
|
+
# * 'just' rspec: 'rspec'
|
18
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
19
|
+
watch(%r{^spec/.+_spec\.rb$})
|
20
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
21
|
+
watch('spec/spec_helper.rb') { "spec" }
|
22
|
+
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 alu0100837094
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/alu0100505092/prct08.svg?branch=des)](https://travis-ci.org/alu0100505092/prct08)
|
2
|
+
[![Coverage Status](https://img.shields.io/coveralls/alu0100505092/prct08.svg)](https://coveralls.io/r/alu0100505092/prct08)
|
3
|
+
[![Coverage Status](https://coveralls.io/repos/alu0100505092/prct08/badge.png)](https://coveralls.io/r/alu0100505092/prct08)
|
4
|
+
|
5
|
+
|
6
|
+
Practica 10 LPP
|
7
|
+
|
8
|
+
Integrantes LPP_T_13
|
9
|
+
Joaquin Escobar
|
10
|
+
|
11
|
+
Angelica Ravelo
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
Contiene la practica 9 y 10 (y anteriores)
|
16
|
+
|
17
|
+
Usando lambda para invertir las preguntas, se arreglaron las clases Examen e Interfaz.
|
18
|
+
|
19
|
+
|
20
|
+
|
data/Rakefile
ADDED
data/doc/Examen.html
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module 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="module">
|
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
|
+
<div class="nav-section">
|
58
|
+
<h3>Table of Contents</h3>
|
59
|
+
|
60
|
+
<ul class="link-list" role="directory">
|
61
|
+
<li><a href="#module-Examen-label-Class+EleccionSimple">Class EleccionSimple</a>
|
62
|
+
<li><a href="#module-Examen-label-Class+Verdaderofalso">Class Verdaderofalso</a>
|
63
|
+
</ul>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
|
67
|
+
<div id="class-metadata">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
</nav>
|
75
|
+
|
76
|
+
<main role="main" aria-labelledby="module-Examen">
|
77
|
+
<h1 id="module-Examen" class="module">
|
78
|
+
module Examen
|
79
|
+
</h1>
|
80
|
+
|
81
|
+
<section class="description">
|
82
|
+
|
83
|
+
<h3 id="module-Examen-label-Class+EleccionSimple">Class <a href="Examen/EleccionSimple.html">EleccionSimple</a><span><a href="#module-Examen-label-Class+EleccionSimple">¶</a> <a href="#documentation">↑</a></span></h3>
|
84
|
+
|
85
|
+
<p>*Metodo initialize</p>
|
86
|
+
|
87
|
+
<h3 id="module-Examen-label-Class+Verdaderofalso">Class <a href="Examen/Verdaderofalso.html">Verdaderofalso</a><span><a href="#module-Examen-label-Class+Verdaderofalso">¶</a> <a href="#documentation">↑</a></span></h3>
|
88
|
+
|
89
|
+
<p>*Metodo initialize</p>
|
90
|
+
|
91
|
+
</section>
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<section class="constants-list">
|
103
|
+
<header>
|
104
|
+
<h3>Constants</h3>
|
105
|
+
</header>
|
106
|
+
<dl>
|
107
|
+
|
108
|
+
<dt id="VERSION">VERSION
|
109
|
+
|
110
|
+
<dd>
|
111
|
+
|
112
|
+
|
113
|
+
</dl>
|
114
|
+
</section>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
</section>
|
121
|
+
</main>
|
122
|
+
|
123
|
+
|
124
|
+
<footer id="validator-badges" role="contentinfo">
|
125
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
126
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
|
127
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
128
|
+
</footer>
|
129
|
+
|
@@ -0,0 +1,163 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Examen::EleccionSimple - 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">Pregunta
|
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 class="calls-super" ><a href="#method-c-new">::new</a>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
</nav>
|
83
|
+
|
84
|
+
<main role="main" aria-labelledby="class-Examen::EleccionSimple">
|
85
|
+
<h1 id="class-Examen::EleccionSimple" class="class">
|
86
|
+
class Examen::EleccionSimple
|
87
|
+
</h1>
|
88
|
+
|
89
|
+
<section class="description">
|
90
|
+
|
91
|
+
</section>
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
107
|
+
<header>
|
108
|
+
<h3>Public Class Methods</h3>
|
109
|
+
</header>
|
110
|
+
|
111
|
+
|
112
|
+
<div id="method-c-new" class="method-detail ">
|
113
|
+
|
114
|
+
<div class="method-heading">
|
115
|
+
<span class="method-name">new</span><span
|
116
|
+
class="method-args">(arg)</span>
|
117
|
+
|
118
|
+
<span class="method-click-advice">click to toggle source</span>
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
<div class="method-description">
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<div class="method-calls-super">
|
129
|
+
Calls superclass method
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<div class="method-source-code" id="new-source">
|
136
|
+
<pre><span class="ruby-comment"># File lib/examen/eleccionsimple.rb, line 7</span>
|
137
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">arg</span>
|
138
|
+
<span class="ruby-comment">#attr_reader :enuncia2, :verdadero, :falso</span>
|
139
|
+
<span class="ruby-comment">#super(enunciado,verdadero,falso)</span>
|
140
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">arg</span>)
|
141
|
+
<span class="ruby-keyword">end</span></pre>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
|
152
|
+
</section>
|
153
|
+
|
154
|
+
</section>
|
155
|
+
</main>
|
156
|
+
|
157
|
+
|
158
|
+
<footer id="validator-badges" role="contentinfo">
|
159
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
160
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
|
161
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
162
|
+
</footer>
|
163
|
+
|
@@ -0,0 +1,363 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Examen::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-compresp">#compresp</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-insertQuestion">#insertQuestion</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-insertQuestion2">#insertQuestion2</a>
|
83
|
+
|
84
|
+
<li ><a href="#method-i-respu">#respu</a>
|
85
|
+
|
86
|
+
</ul>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
</nav>
|
91
|
+
|
92
|
+
<main role="main" aria-labelledby="class-Examen::Exam">
|
93
|
+
<h1 id="class-Examen::Exam" class="class">
|
94
|
+
class Examen::Exam
|
95
|
+
</h1>
|
96
|
+
|
97
|
+
<section class="description">
|
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-preguntas" class="method-detail">
|
119
|
+
<div class="method-heading attribute-method-heading">
|
120
|
+
<span class="method-name">preguntas</span><span
|
121
|
+
class="attribute-access-type">[R]</span>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div class="method-description">
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div id="attribute-i-respuescorrectas" class="method-detail">
|
132
|
+
<div class="method-heading attribute-method-heading">
|
133
|
+
<span class="method-name">respuescorrectas</span><span
|
134
|
+
class="attribute-access-type">[R]</span>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="method-description">
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
</section>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
149
|
+
<header>
|
150
|
+
<h3>Public Class Methods</h3>
|
151
|
+
</header>
|
152
|
+
|
153
|
+
|
154
|
+
<div id="method-c-new" class="method-detail ">
|
155
|
+
|
156
|
+
<div class="method-heading">
|
157
|
+
<span class="method-name">new</span><span
|
158
|
+
class="method-args">(args)</span>
|
159
|
+
|
160
|
+
<span class="method-click-advice">click to toggle source</span>
|
161
|
+
|
162
|
+
</div>
|
163
|
+
|
164
|
+
|
165
|
+
<div class="method-description">
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<div class="method-source-code" id="new-source">
|
173
|
+
<pre><span class="ruby-comment"># File lib/examen/exam.rb, line 13</span>
|
174
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> (<span class="ruby-identifier">args</span>)
|
175
|
+
<span class="ruby-ivar">@preguntas</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:preguntas</span>]
|
176
|
+
<span class="ruby-ivar">@respuescorrectas</span>=<span class="ruby-identifier">args</span>[<span class="ruby-value">:respuescorrectas</span>]
|
177
|
+
<span class="ruby-keyword">end</span></pre>
|
178
|
+
</div>
|
179
|
+
|
180
|
+
</div>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
</div>
|
186
|
+
|
187
|
+
|
188
|
+
</section>
|
189
|
+
|
190
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
191
|
+
<header>
|
192
|
+
<h3>Public Instance Methods</h3>
|
193
|
+
</header>
|
194
|
+
|
195
|
+
|
196
|
+
<div id="method-i-compresp" class="method-detail ">
|
197
|
+
|
198
|
+
<div class="method-heading">
|
199
|
+
<span class="method-name">compresp</span><span
|
200
|
+
class="method-args">(resp)</span>
|
201
|
+
|
202
|
+
<span class="method-click-advice">click to toggle source</span>
|
203
|
+
|
204
|
+
</div>
|
205
|
+
|
206
|
+
|
207
|
+
<div class="method-description">
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
<div class="method-source-code" id="compresp-source">
|
215
|
+
<pre><span class="ruby-comment"># File lib/examen/exam.rb, line 31</span>
|
216
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">compresp</span>(<span class="ruby-identifier">resp</span>)
|
217
|
+
<span class="ruby-identifier">correctas</span>=<span class="ruby-value">0</span>
|
218
|
+
<span class="ruby-identifier">i</span>=<span class="ruby-value">0</span>
|
219
|
+
<span class="ruby-identifier">n</span>=<span class="ruby-value">0</span>
|
220
|
+
|
221
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">n</span> <span class="ruby-operator"><</span> <span class="ruby-value">5</span> <span class="ruby-keyword">do</span>
|
222
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@respuescorrectas</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">i</span>]
|
223
|
+
<span class="ruby-identifier">correctas</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>
|
224
|
+
<span class="ruby-keyword">end</span>
|
225
|
+
<span class="ruby-identifier">i</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>
|
226
|
+
<span class="ruby-identifier">n</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>
|
227
|
+
<span class="ruby-keyword">end</span>
|
228
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">correctas</span> <span class="ruby-operator"><</span> (<span class="ruby-identifier">i</span><span class="ruby-operator">/</span><span class="ruby-value">2</span>)<span class="ruby-operator">+</span><span class="ruby-value">1</span>
|
229
|
+
<span class="ruby-identifier">mensaje</span> = <span class="ruby-node">"Ha suspendido el examen: #{correctas}/#{i}"</span>
|
230
|
+
<span class="ruby-keyword">else</span>
|
231
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">correctas</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">i</span>
|
232
|
+
<span class="ruby-identifier">mensaje</span> = <span class="ruby-string">"Su nota es: Sobresaliente 10"</span>
|
233
|
+
<span class="ruby-keyword">else</span>
|
234
|
+
<span class="ruby-identifier">mensaje</span> = <span class="ruby-node">"Ha aprobado el examen: #{correctas}/#{i}"</span>
|
235
|
+
<span class="ruby-keyword">end</span>
|
236
|
+
<span class="ruby-keyword">end</span>
|
237
|
+
<span class="ruby-identifier">mensaje</span>
|
238
|
+
<span class="ruby-keyword">end</span></pre>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
</div>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
</div>
|
247
|
+
|
248
|
+
|
249
|
+
<div id="method-i-insertQuestion" class="method-detail ">
|
250
|
+
|
251
|
+
<div class="method-heading">
|
252
|
+
<span class="method-name">insertQuestion</span><span
|
253
|
+
class="method-args">(question)</span>
|
254
|
+
|
255
|
+
<span class="method-click-advice">click to toggle source</span>
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
<div class="method-description">
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
<div class="method-source-code" id="insertQuestion-source">
|
268
|
+
<pre><span class="ruby-comment"># File lib/examen/exam.rb, line 18</span>
|
269
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insertQuestion</span>(<span class="ruby-identifier">question</span>)
|
270
|
+
<span class="ruby-identifier">nodo</span>=<span class="ruby-constant">Nodo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">question</span>)
|
271
|
+
<span class="ruby-identifier">nodoInsertado</span> = <span class="ruby-ivar">@preguntas</span>.<span class="ruby-identifier">pushf</span>(<span class="ruby-identifier">nodo</span>)
|
272
|
+
<span class="ruby-identifier">nodoInsertado</span>.<span class="ruby-identifier">value</span>
|
273
|
+
<span class="ruby-keyword">end</span></pre>
|
274
|
+
</div>
|
275
|
+
|
276
|
+
</div>
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
</div>
|
282
|
+
|
283
|
+
|
284
|
+
<div id="method-i-insertQuestion2" class="method-detail ">
|
285
|
+
|
286
|
+
<div class="method-heading">
|
287
|
+
<span class="method-name">insertQuestion2</span><span
|
288
|
+
class="method-args">(question)</span>
|
289
|
+
|
290
|
+
<span class="method-click-advice">click to toggle source</span>
|
291
|
+
|
292
|
+
</div>
|
293
|
+
|
294
|
+
|
295
|
+
<div class="method-description">
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
<div class="method-source-code" id="insertQuestion2-source">
|
303
|
+
<pre><span class="ruby-comment"># File lib/examen/exam.rb, line 24</span>
|
304
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insertQuestion2</span>(<span class="ruby-identifier">question</span>)
|
305
|
+
<span class="ruby-identifier">nodo</span>=<span class="ruby-constant">Nodo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">question</span>)
|
306
|
+
<span class="ruby-identifier">nodoInsertado</span> = <span class="ruby-ivar">@preguntas</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">nodo</span>)
|
307
|
+
<span class="ruby-identifier">nodoInsertado</span>.<span class="ruby-identifier">value</span>
|
308
|
+
<span class="ruby-keyword">end</span></pre>
|
309
|
+
</div>
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
</div>
|
317
|
+
|
318
|
+
|
319
|
+
<div id="method-i-respu" class="method-detail ">
|
320
|
+
|
321
|
+
<div class="method-heading">
|
322
|
+
<span class="method-name">respu</span><span
|
323
|
+
class="method-args">()</span>
|
324
|
+
|
325
|
+
<span class="method-click-advice">click to toggle source</span>
|
326
|
+
|
327
|
+
</div>
|
328
|
+
|
329
|
+
|
330
|
+
<div class="method-description">
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
<div class="method-source-code" id="respu-source">
|
338
|
+
<pre><span class="ruby-comment"># File lib/examen/exam.rb, line 61</span>
|
339
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">respu</span>
|
340
|
+
<span class="ruby-ivar">@respuescorrectas</span>
|
341
|
+
<span class="ruby-keyword">end</span></pre>
|
342
|
+
</div>
|
343
|
+
|
344
|
+
</div>
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
</div>
|
350
|
+
|
351
|
+
|
352
|
+
</section>
|
353
|
+
|
354
|
+
</section>
|
355
|
+
</main>
|
356
|
+
|
357
|
+
|
358
|
+
<footer id="validator-badges" role="contentinfo">
|
359
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
360
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
|
361
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
362
|
+
</footer>
|
363
|
+
|