Giter Club home page Giter Club logo

farismuhovic / online-quiz-platform Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 28.62 MB

An online quiz platform where users can take quizzes across various categories, create their own quizzes, and engage in real-time chat discussions. Administrators can manage quizzes, view analytics, and moderate user interactions.

License: MIT License

CSS 19.38% HTML 20.15% JavaScript 40.78% PHP 19.00% Hack 0.70%
css flightphp html javascript rest-api bootstrap5

online-quiz-platform's Introduction

Online-Quiz-Platform

An online quiz platform where users can take quizzes across various categories, create their own quizzes, and engage in real-time chat discussions. Administrators can manage and create new quizzes, view analytics, and moderate user interactions and users overall.

Website Demo

Website authentication

Dashboard, quiz doing

Quiz and User management

Profile, Quiz history

Swagger Documentation

Swagger API Docs

Local Hosting Guide

If you want to host the website and Swagger documentation locally, follow these steps:

  1. Requirements:
    • XAMPP or similar local server software based on your operating system.
  2. Steps:
    • Download and install XAMPP.
    • Start the Apache server from the XAMPP control panel.
    • Place your website files in the htdocs directory within the XAMPP installation directory.
    • Access your website locally using a web browser at http://localhost/your-website-folder.

Front-end

Front end is built using the techonlogies listed below, the website itself is a single page application (SPA) in which all content is loaded initially and swapped when user clicks on a link. The website is responsive to both tablet and mobile devices using css media queries and break points. The folder structures includes data folder which holds random fun fact displayed to user. Images folder holds various avatars and banners for quizzes and such. Library folder holds the SPA plugin. Scripts folder holds javascript files for ajax calls and logic for quiz grading and displaying various modals. Stylesheets folder is a group of css filles that hold design for specific view. Utils folder contains some constants that are used through various scripts, modal function which returns a modal based on the type of error and message, and invalid session which checks returns the user to login page.

Front end is built using:

  • HTML5
  • CSS3 and Bootstrap5
  • Javascript and Jquery

External libraries used:

  • Jquery validation plugin
  • Highcharts JS
  • Jquery SPA

Front end project structure

└── 📁frontend
    └── 📁data
        └── facts.json
    └── 📁images
        └── 404banner.svg
        └── authbanner.png
        └── 📁avatars
            └── avatar1.svg
            └── avatar2.svg
            └── avatar3.svg
            └── avatar4.svg
            └── avatar5.svg
            └── avatar6.svg
            └── avatar7.svg
            └── avatar8.svg
            └── avatar9.svg
        └── 📁dashboard-banners
            └── leaderboard.png
            └── manageusers.png
            └── profilebanner.png
            └── quizbanner.png
            └── quizhistory.png
            └── settings.png
            └── stats.png
        └── emptybox.svg
        └── favicon.png
        └── 📁quiz-type-banners
            └── geography.svg
            └── history.svg
            └── languages.svg
            └── literature.svg
            └── math.svg
            └── movies.svg
            └── music.svg
            └── science.svg
            └── sport.svg
    └── index.css
    └── index.html
    └── 📁library
        └── 📁spap
            └── app.js
            └── jquery.spapp.min.js
    └── 📁scripts
        └── analyticsFunctions.js
        └── authFunctions.js
        └── dashboardFunctions.js
        └── leaderboardFunctions.js
        └── pageFunctions.js
        └── profileFunctions.js
        └── quizHistoryFunctions.js
        └── quizManagementFunctions.js
        └── quizRender.js
        └── quizReviewFunctions.js
        └── quizSearchFunctions.js
        └── userManagement.js
    └── 📁stylesheets
        └── analytics.css
        └── authentication.css
        └── dashboard.css
        └── leaderboard.css
        └── profile.css
        └── quiz.css
        └── quizHistory.css
        └── quizManagement.css
        └── quizReview.css
        └── quizSearch.css
        └── userManagement.css
    └── 📁utils
        └── constants.js
        └── invalidSession.js
        └── modal.js
    └── 📁views
        └── analytics.html
        └── dashboard.html
        └── error_404.html
        └── leaderboard.html
        └── login.html
        └── profile.html
        └── quiz.html
        └── quizHistory.html
        └── quizManagement.html
        └── quizReview.html
        └── quizSearch.html
        └── register.html
        └── userManagement.html

Backend

The backend is built using PHP with the Flight PHP framework, and a MySQL database. The backend follows a DAO (Data Access Object) pattern to manage database interactions, and it is structured similarly to an MVC (Model-View-Controller) architecture. The DAO pattern separates data access logic from business logic. The dao folder contains data access objects for authentication, quizzes, history, and user management.The routes folder defines the API endpoints for authentication, history, quizzes, and user routes.The services folder implements business logic for authentication, history, quizzes, and user services.The utils folder includes utility functions like authentication middleware.The public folder contains the API documentation generated by Swagger OpenAPI.

Backend is built using:

  • PHP (Flight PHP framework)
  • MySQL

Authentication

The platform uses JWT for authentication. Upon login, a token is generated and sent to the client, which must include this token in the Authorization header for requests. The app also has 2 roles included, user and admin. Admin has access to routes like deletion of users and quizzes, promotion of user and creating new quizzes.

Backend project structure

└── 📁rest
    └── .htaccess
    └── composer.json
    └── composer.lock
    └── config.php
    └── 📁dao
        └── AuthDao.class.php
        └── BaseDao.class.php
        └── HistoryDao.class.php
        └── QuizDao.class.php
        └── UserDao.class.php
    └── index.php
    └── 📁public
        └── 📁v1
            └── 📁docs
                └── doc_setup.php
                └── index.php
                └── oauth2-redirect.html
                └── swagger-ui-bundle.js
                └── swagger-ui-bundle.js.map
                └── swagger-ui-standalone-preset.js
                └── swagger-ui-standalone-preset.js.map
                └── swagger-ui.css
                └── swagger-ui.css.map
                └── swagger-ui.js
                └── swagger-ui.js.map
                └── swagger.php
    └── 📁routes
        └── authRoutes.php
        └── historyRoutes.php
        └── quizRoutes.php
        └── userRoutes.php
    └── 📁services
        └── AuthService.class.php
        └── HistoryService.class.php
        └── QuizService.class.php
        └── UserService.class.php
    └── 📁utils
        └── authMiddleware.php
        └── however.php

Database

The database is built using SQL, the code for creating and some default data insertion can be found in the database folder, along with the ER diagram in pdf folder and mwb format.Below is the ER diagram.

ER diagram

online-quiz-platform's People

Contributors

amelavm avatar farismuhovic avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.