Perguntations user manual
Quick start
After installing python and the required packages as described in the README.md
you can run a demonstration:
$ cd PATH/TO/perguntations
$ ./initdb.py --demo
New database created: students.db
10 users inserted:
0 - Professor (administrator)
1465 - Gil Vicente
... - ...
1924 - Alexandre O'Neill
$ mv students.db demo/
$ ./serve.py demo/test.yaml
2016-07-13 15:19:21,718 | INFO | app | ============= Running perguntations =============
2016-07-13 15:19:21,740 | INFO | questions | Loaded 9 questions from "questions.yaml".
2016-07-13 15:19:21,740 | INFO | test | Test factory ready for "demo".
2016-07-13 15:19:21,756 | INFO | app | Database has 9 students registered.
...
2016-07-13 15:19:21,919 | INFO | cherrypy.error | [13/Jul/2016:15:19:21] ENGINE Serving on http://0.0.0.0:8080
2016-07-13 15:19:21,919 | INFO | cherrypy.error | [13/Jul/2016:15:19:21] ENGINE Bus STARTED
You can now open a browser and point it to the server address, e.g. http://127.0.0.1:8080
.
Enter 0
for the number and choose any password. This will be your password from now on.
After login, you will see an administrator page. This page allows you to:
- Allow students to login to the test. This can be done one at a time using the checkboxes on the left of each student, or allow all students by clicking the button in the bottom of the page.
- Review a test done by a student by clicking the grade colorbar on the right. If a student has multiple tests, then several bars will be shown. A tooltip shows the date/time for each test.
- Reset student passwords. Students that already have a password will have a label
PW
next to the student name. To reset the password, go to the bottom of the page and insert the student number in the box and press the button to reset the password. The labelPW
will disappear. - Online students will be highlighted and the table on the top of the page will show some more information (login time, ip address, etc)
- If a student moves unfocus the browser window on his computer (e.g. for cheating), a red bar appears along with the status
unfocus
. Screen saver is also reported as unfocus, so some care should be taken... - It is also possible to add new students by clicking the button on the bottom of the page.
Answering a test
Students are redirected to a test as soon as they login.
Just answer the questions. If the answer is unknown, the question should be disabled on the top right corner. This avoids penalties in some questions.
After answering all the questions, the test is submited by clicking the button on the bottom of the page. A new page is shown with the grade obtained.
Creating a new test
A test is specified in a single yaml file. Look at demo/test.yaml
for an example and documentation.
Creating questions
Questions are defined in yaml files. Each yaml file contains a list of questions from which some can be chosen to be part of a test.
The types of questions supported are:
radio
questions are multiple choice where only one can be selected.checkbox
questions are also multiple choice but several can be selected.text
andtext_regex
questions provide a line to write the answer.textarea
provide a multiline text box to write the answer (e.g. for computer code). The answer is corrected by calling an external program that is not part of the server and is up to you to right it.
Besides these, there are information
and alert
types which just show text but do not expect answers.
All the types above are predifined questions. It is also possible to generate questions by code. These are defined as type generator
and an external program must be provided to generate a question of the types above.
An example file with these types of questions is provided in demo/questions/questions.yaml
along with accompanying files under the directory demo/questions
.
Testing a new test
Before using a test in product you should test is very carefully. After writing the questions and the test configuration, my recommendation is to:
./serve.py --allow-all shiny_new_test.yaml
where the--allow-all
option avoids having to use a second browser for the admin page to explicitly allow a student.- If bugs are found, try commenting questions in the
shiny_new_test.yaml
to isolate the bug. Use the--debug
option to add more information in the webpage.