A database-driven website to manage quizzes, each consisting of a set of multiple-choice questions and their associated answers. The website’s capabilities is only accessible to registered users.
- Users with Edit permission can view and edit questions and answers.
- Users with View permission can view questions and answers.
- Users with Restricted permission can only view questions.
The required versions of build tools is defined in .tool-versions. These can be automatically installed with asdf-vm, see their installation instructions.
Once installed, run:
asdf plugin add ruby
asdf plugin add nodejs
asdf plugin add yarn
asdf install
asdf install ruby
Ensure you are using the Ruby version which is in .tool-versions. Check by running ruby -v
Install postgres, see their installation instructions
- Run
bundle install
to install the gem dependencies - Run
yarn
to install node dependencies - Run
rails db:create
thenrails db:migrate
to set up the database development - Run
bundle exec rails server
to launch the app on http://localhost:3000
bundle exec rspec
-
On the registration page
/users/sign_up
, enter an email and password. -
You will be asked which type of user you wish to register as, choose
Restricted permission
,View permission
,Edit permission
as appropriate. -
To change your user type, you may re-register and select a different permission.
-
Alternatively, you can edit your user in the console by running the following commands
u = User.find_by(email: 'ENTER_EMAIL_ADDRESS_HERE')
u.user_type = # 'restricted_permission', 'view_permission' or 'edit_permission'
u.save!