Skip to content

Course project of the course Web software development 2021 offered by the Aalto university.

Notifications You must be signed in to change notification settings

olli-suoniemi/wsd-deno-questions

Repository files navigation

Question Quiz

This app was built on an online course called Web Software Development 2021 offered by Aalto University.

Aim of the final project and course was to develop and improve web development skills and learn how to construct and design web applications which are structually sound and secure.

This app can be used for creating quizzes from your own and other people's created questions. This tool is handy for teachers and students who are looking for a easy way to create flashcards out of your own topics.

The app can be tested online in here


Instructions for local testing

Use the db commands below to create the needed tables to run the program. Then create a .env file and insert your database url into a DATABASE_URL variable.

In order to run the program locally you have to install Deno. Installation guidelines for Deno.

CREATE TABLE users ( id SERIAL PRIMARY KEY, email VARCHAR(255) UNIQUE, password CHAR(60) );

CREATE TABLE questions ( id SERIAL PRIMARY KEY, user_id INTEGER REFERENCES users(id), title VARCHAR(256) NOT NULL, question_text TEXT NOT NULL );

CREATE TABLE question_answer_options ( id SERIAL PRIMARY KEY, question_id INTEGER REFERENCES questions(id), option_text TEXT NOT NULL, is_correct BOOLEAN DEFAULT false );

CREATE TABLE question_answers ( id SERIAL PRIMARY KEY, user_id INTEGER REFERENCES users(id), question_id INTEGER REFERENCES questions(id), question_answer_option_id INTEGER REFERENCES question_answer_options(id), correct BOOLEAN DEFAULT false );

CREATE UNIQUE INDEX ON users((lower(email)));


The table users contains information about users who have registered to the application. The table users stores user information; each user will have an unique identifier id, an email and a password. Further, all stored emails will be unique.

The table questions contains questions that are created by users; each question has an unique identifier id, the id of the user who created the question user_id, a title title, and a text containing the question question_text.

The table question_answer_options lists the options available for the specific question (identified by question_id). Each answer option has a text option_text and information on whether the question answer option is correct or not is_correct.

Finally, the table question_answers stores answers posted to the questions; each question answer has an identifier id, the id of the user who answered the question user_id, the id of the question that was being answered question_id, and the question_answer_option_id that contains the option that the user chose. For simplicity, the table also contains information on whether the answer was correct (correct), even though the information could be inferred from the table question_answer_options.

Unit tests and HTTP tests can be found in the test folder. In order them to work correctly, you have to insert in them your own parameters which matches the ids of your own database. There are more specific instructions commented to each test. In order to run tests use this command in the root of the application: deno test --allow-net --unstable --allow-read

In order to run the app locally use this command in the root of the application: deno run --unstable --allow-all --watch run-locally.js


Credits

Credits for the background image:

Background vector created by starline - www.freepik.com

About

Course project of the course Web software development 2021 offered by the Aalto university.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published