README.md 2.19 KB

README

Requirements:

The webserver is a python application and requires python 3.5+ to be installed.

The following additional python packages are required:

  • CherryPy
  • Mako
  • Markdown
  • PyYAML
  • Pygments
  • SQLAlchemy
  • bcrypt

These can be installed globally or in a python virtual environment.

# install in a virtualenv
pyvenv-3.5 venv/perguntations         # or choose another virtualenv directory
source venv/perguntations/bin/activate     # activate virtualenv

pip3.5 install cherrypy
pip3.5 install mako
pip3.5 install markdown
pip3.5 install pyyaml
pip3.5 install pygments
pip3.5 install sqlalchemy
pip3.5 install bcrypt

To install perguntations:

cd WHERE/TO/PUT/THE/SOFTWARE
git clone https://USERNAME@bitbucket.org/USERNAME/perguntations.git

where USERNAME is your account on bitbucket.

System setup:

The following commands will show how to run a demonstration test:

cd WHERE/YOU/INSTALLED/perguntations

# create database.
# a database with 5 fake students is created if no CSV file is provided
./initdb_from_csv.py OPTIONAL_CSV_FILE
mv students.db demo/

# edit test configuration and check if everything looks right
vi demo/test.yaml

# edit server configuration and check if everything looks right
vi config/server.conf

We are now ready to run the server:

# get help
./serve.py --help 

# run demo test
./serve.py demo/test.yaml

Open the browser at http://127.0.0.1:8080/ and login as user number 0 (administrator) and:

  1. Authorize students by clicking the checkboxes.
  2. Open a different browser at http://127.0.0.1:8080/ and login as one of the authorized students. Answer the questions and submit.

The server can be stoped from the terminal with C.

Troubleshooting

  • If you are getting any UnicodeEncodeError type of errors that's because the terminal is not supporting UTF-8. Try running locale on the terminal and see if there is any error messages. Fix it with sudo dpkg-reconfigure locales, select your UTF-8 locales and try again.

Contribute

  • Writing questions in yaml format
  • Testing and reporting bugs
  • Code review
  • New features and ideas

Contacts