- OnLine: https://quiz-exam-real-time-score.netlify.app/
- OnLine: you can use nextifly
- Localhost: install the Go Live extension in your visual Studio Code, and you will see running on your local machine under url like: https://localhost:5501
Quiz Exam preparation. Allow some text explanation to help. Green green or red color if correct/wrong answer in a realtime js before submit form. Keep the Score in realtime.
- Add your custom Quiz Exam
- Keep the incorrect questions with timeStamp
- Try again only with incorrect quiz
- Try again only with all incorrect quiz
- Show / hide explanation or extra help of each question
- Show / hide explanation images
- No database needed, works with FileStorage
- No server config needed, works on localhost or free online solutions like vercel, netlify,...
This method allow:
- Use a public repository
- keep encripted the exam files
- keep the exam files decrypted working on your localhost
- gitHub ignore to prevent your exam be public
- save a copy of your exam encrypted in github. You must save the password on your keepass
Linux/WSL
sudo apt install gnupg
Windows https://gpg4win.org/
gpg --symmetric --cipher-algo AES256 my_name_file.js
Example: gpg --symmetric --cipher-algo AES256 questions-bases-de-datos-b.js gpg --symmetric --cipher-algo AES256 questions-entornos-de-desarrollo.js gpg --symmetric --cipher-algo AES256 questions-programacion-b.js gpg --symmetric --cipher-algo AES256 questions-formacion-y-orientacion-laboral.js gpg --symmetric --cipher-algo AES256 questions-lenguajes-de-marcas.js
save your password in your keepass. The output file will be like: my_name_file.js.gpg
gpg --decrypt my_name_file.js.gpg > my_name_file.js
recomend try to decrypt the file to checks if works.
Example: gpg --decrypt questions-programacion-b.js.gpg > questions-programacion-b.js gpg --decrypt questions-formacion-y-orientacion-laboral.js.gpg > questions-formacion-y-orientacion-laboral.js gpg --decrypt questions-entornos-de-desarrollo.js.gpg > questions-entornos-de-desarrollo.js gpg --decrypt questions-bases-de-datos-b.js.gpg > questions-bases-de-datos-b.js gpg --decrypt questions-bases-de-datos-b.js.gpg > questions-lenguajes-de-marcas.js
Now you can save the exams of sensitive files encrypted in a public GitHub repository but keep running these files running in your localhost Decrypted.
.gitignore
js/questions-bases-de-datos-b.js js/questions-entornos-de-desarrollo.js js/questions-formacion-y-orientacion-laboral.js js/questions-programacion-b.js js/questions-lenguajes-de-marcas.js
In the explanation you can add images in order to help the estudents or show image code.
The images are located on /images
folder.
Add the new key/value on your js/question.js
file like:
image:["images/java/0001.png", "images/java/0002.png"]
This project uses a basic XOR cipher for encrypting quiz question files to prevent casual inspection of their content in the public repository. This section describes how to encrypt and decrypt the question files using Node.js.
Before you begin, ensure that you have the following installed on your system:
- Node.js: You can download and install Node.js from https://nodejs.org/.
The encrypt-questions.js
script encrypts the question files, overwriting their original content and saving a copy of the original files with a -original
suffix.
-
Set Up your Secret Key:
- In your project's root, you will find a file named
config.js
, this file contains thesecretKey
used to encrypt and decrypt your files. - Make sure to add
config.js
in the.gitignore
file to not publish your key on a public repository.
- In your project's root, you will find a file named
-
Install dependencies:
- Open your terminal in the root project folder.
- Execute
npm install
this will install all the project dependencies.
-
Run the Encryption Script:
-
Open your terminal or command prompt.
-
Navigate to the project's root directory where your
encrypt-questions.js
file is located. -
Execute the following command:
node encrypt-questions.js
-
This command will:
- Read all the
js/questions-*.js
files. - Create a copy of your original files with a
-original
suffix in the same folder. - Encrypt the original question files and saves them with a new encrypted content.
- Output confirmation messages to the console.
- Read all the
-
-
Important: After this step, your question files (
js/questions-*.js
) will contain encrypted text, and a copy of the original files will be created with a-original
suffix.
The decryption process happens automatically inside the application:
- When a user selects a quiz, if the selected quiz is marked as encrypted, the application will show a password input.
- If the user enters the correct password (the same password used to encrypt the files) the questions file will be decrypted using the
decrypt
method onscript.js
and rendered in the user interface.
Important Notes:
- The encryption process will overwrite the original content of your question files.
- The encryption method used in this project is very basic and is intended only for obfuscation, and not for real security.
- The
config.js
file must be added to the.gitignore
to not commit this file on a public repository.