👨💻 Dynamic-Student-Assessment-Server Codaisseur 👩💻
This server has been developed for the Dynamic-Student-Assessment test applied by Codaisseur to candidates wishing to join the academy.
That focuses on the applicant UI and contains the login page and admissions test.
- Admin Client: https://github.com/Official-Codaisseur-Graduate/Dynamic-Student-Assessment-Admin-Client
Portal for the Codaisseur admissions team to manage applicants, scores and tests.
Which contains the end points and database models. (you are here!)
For more information about the endpoints and routers. Check our API docs
apidocs.js in the ./docs folder.
SET UP PROJECT:
- Clone this repo
git clone https://github.com/Official-Codaisseur-Graduate/Dynamic-Student-Assessment-Server
- In your terminal, run the following command to install all the dependencies
- Create a docker container
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=secret postgres
- To start the terminal with nodemon, use the following command (assumes nodemon is installed globally)
- To start the code without tracking saved changes, you can simply run:
As a standard we are using port 4000 for this server.
To add some dummy data to your database, you can use our database import existent in the index.js.
As the password is bcrypted in the database, You can use email: firstname.lastname@example.org and password: Brainclip for logging in on the Admin-Client.
If you are currently running nodemon with the command, mentioned above,
nodemon index, the dummy data will be automatically added to your database, otherwise, you can simply run
node index in your terminal.
index.js, from line 30 up to line 36. Make sure that you have have set:
In lines 27 in
The main score calculation is based on the correct answers and question level see Test Router explanation in the apidocs.md
When a student answers a question, the following happens in the backend:
A post request to /response/ is made (currently in the req.query we expect an answerId and an TestId which we can use in the backend).
In the case of the first question of the test, obviously there is no answerId yet to update. The logic behind the solution for this problem is that in this case we create answerId which has value of null if there's no answer yet inside of the post endpoint
After this, a POST request is made to a new question. It looks at the previousAnswer, which we just provided. It runs through the algorithm and returns a new question.
Currently the algorithm takes a UserAnswer/answerId, checks if its related Answer is correct. If it is, the newLevel will be raised by 1. If not, it will be decreased by 1. If you are at the max level(2) and the answer is correct, the level stays level(2), if not the level will be decreased by 1. If you are at level 0 and the answer is incorrect, the level stays at level(0). If correct the level will be raised by 1.
The algorithm is currently only being used in the POST response endpoint that responds with a new question (so the new question is based on the previous UserAnswer/answerId).
Zeger de Vos:
Veronica H. Stigen:
Melissa 't Hart:
Special thanks to: