DefiMaths is an open-source project that aims to provide a flexible template for a complete quiz website. This template mainly focuses on math typed quizzes. It supports complex math symbols using MathJax.
- Simple time based quizzes : Easily create quizzes. There are three examples available in the
Assets/Quizfolder. - Multiple answer types : Use the two different built-in answer types (
multipleChoiceandfreeAnswer) or create your own. ThemultipleChoicetype allows you to set up to four (recommended maximum) different answers. With thefreeAnswertype, it's up to the user to get the correct answer. - Basic account management : Users can easily register and login with the account system. The passwords stored in the linked database are hashed for better security.
- Progress tracking : Users progress is stored in the database and displayed when they select a quiz.
- Responsive design : Let your users enjoy the same experience on every device with the responsive design.
This project uses the following libraries and resources:
- MathJax for rendering mathematical symbols.
- FontAwesome for icons.
- Download the source code of this repository or clone it to your local machine using this bash command :
git clone https://github.com/SAMSAM-55/DefiMaths.git- Ensure your web server or hosting service supports PHP.
- Upload all the files on your domain (make sure the folders have the exact same names).
- Follow the instruction in the
config.phpfile to setup the database. Some parts of the instructions might be specific to MySQL.
Defimaths includes a few customisable features in its css. You can adjust the colors of the website in style.css :
:root {
/* Main theme color and variables (some of the colors might also be used in other components than the specified ones) */
--border-color: #ffffff00; /* Border color for buttons */
--header-text-before-width: 75%; /* Width of the header texts underline */
--theme-background-color : #E0B1CB; /* Background color of the page */
--theme-header-color : #5E548E; /* Header color */
--theme-button-color-normal : #BE95C4; /* Normal button color */
--theme-button-color-hovered : #9F86C0; /* Hovered button color */
--theme-button-color-selected : #231942; /* Selected button color */
--score-text-size : 48px; /* Font size for the score text */
}You can also choose the main font of the site by modifying the following line in style.css :
*:not(mjx-container):not(mjx-container *) {
font-family: 'Kanit', sans-serif; /* Main site font */
}- Frontend : HTML, CSS and JavaScript
- Backend : PHP
- Database : MySQL
- MathJax
- FontAwesome
Below are some screenshots showcasing the profile page and quiz selection page of the project:
You can see an example of this project being used at defimaths.net.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions to this project are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and push them to your fork.
- Submit a pull request with a detailed description of your changes.
Feel free to open an issue if you encounter any bugs or have suggestions for improvements.

