This is a web app to manage and take quizzes and it’s written in ruby code.
Inside the app you can upload a csv files to fill the pool of questions, but this file need to be formatted in the same way as the file named sample_40_questions.csv
that appears at the root of this repository.
Once you have uploaded the questions you can generate a new quiz, submitting a nickname and the number of questions that you want.
-
A01377154 Felipe Osornio
-
A01378838 Eric Gómez
-
A01378916 Rafael Moreno Cañas
To run the web application, download this repository and then inside the src
folder type the following instruction at the command line:
$ ruby app_router.rb
-
Model-View-Controller : The application follows the classical web implementation of the MVC architectural pattern. The models (
.rb
files) and views (.erb
files) are stored in the corresponding models and views directory. The controllers are the (.rb
files) inside of controllers directory and theapp_router.rb
-
Adapter : The model
game.rb
is an adapter to use theplayer.rb
andquiz.rb
inside the controllerquiz_app.rb
. -
Domain-Specific Language : The
app_router.rb
file consists of a series of Sinatra routes. Sinatra is a DSL for creating web applications in Ruby. -
Command : The controllers
quiz_app.rb
andmanger_app.rb
contain the concrete commands to each route declared in theapp_router.rb
, so in this way all the web routes invoke the corresponding command to do a concrete action.
-
R. Olsen. Design Patterns in Ruby. Addison-Wesley, 2007.