JoliQuiz

by LaurentBouquet

GitHub Readme.md

JoliQuiz

Build Status Build Status Codacy Badge CodeFactor

Deploy on Heroku

Description

Joliquiz is an online quiz software, a PHP web application developed using the Symfony framework (version 4).

Thanks to Symfony

Screenshot of a quiz in progress

Workout page

Installation

1) Get all source files

git clone https://github.com/LaurentBouquet/joliquiz.git
cd joliquiz
composer install

2) Create database

In the commands below, replace aSecurePassword with a secure password.

Here are the steps to create the database, either with MySQL or with PostreSQL.

Either with MySQL

Enter this commands in a terminal prompt :

sudo mysql
CREATE USER 'joliquiz'@'localhost' IDENTIFIED BY 'aSecurePassword';
CREATE DATABASE joliquiz CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON joliquiz.* TO 'joliquiz'@'localhost';

Update config/packages/doctrine.yaml :

doctrine:
    dbal:
        # configure these for your MySQL database server
        driver: 'pdo_mysql'
        server_version: '5.7'
        charset: utf8mb4
        default_table_options:
            charset: utf8mb4
            collate: utf8mb4_unicode_ci

        # configure these for your PostgreSQL database server
        # driver: 'pdo_pgsql'
        # charset: utf8

Uncomment and update the password in this line of .env file : DATABASE_URL=mysql://joliquiz:aSecurePassword@127.0.0.1:3306/joliquiz

Enter this commands in a terminal prompt :

# cd joliquiz
bin/console doctrine:migrations:latest

If an error occured "could not find driver", enter this command in a terminal prompt (and re-enter the command above) :

sudo apt install php-mysql

Or with PostgreSQL

Enter this commands in a terminal prompt :

sudo -i -u postgres
createuser --interactive
joliquiz
# -> yes
psql
ALTER USER joliquiz WITH password 'aSecurePassword';
ALTER USER joliquiz SET search_path = public;
\q
exit

Update config/packages/doctrine.yaml :

doctrine:
    dbal:
        # configure these for your MySQL database server
        # driver: 'pdo_mysql'
        # server_version: '5.7'
        # charset: utf8mb4
        # default_table_options:
        #     charset: utf8mb4
        #     collate: utf8mb4_unicode_ci

        # configure these for your PostgreSQL database server
        driver: 'pdo_pgsql'
        charset: utf8

Uncomment and update the password in this line of .env file : DATABASE_URL=pgsql://joliquiz:aSecurePassword@127.0.0.1:5432/joliquiz

Enter this commands in a terminal prompt :

# cd joliquiz
php bin/console doctrine:database:create

If an error occured "could not find driver", enter this command in a terminal prompt (and re-enter the command above) :

sudo apt install php-pgsql

3) Fill database and start built-in server

Enter this commands in a terminal prompt :

# cd joliquiz
php bin/console doctrine:migrations:migrate
php bin/console doctrine:fixtures:load
php bin/console server:start

4) With your web browser open url where server is listening on

For example, with your browser open this page : http://127.0.0.1:8000 and GO !

Workout page

Here is initial credentials of the student user.

  • Username : user
  • Password : user

Here is initial credentials of the teacher user.

  • Username : teacher
  • Password : teacher

Here is initial credentials of the admin user.

  • Username : admin
  • Password : admin

Here is initial credentials of the super-admin user.

  • Username : superadmin
  • Password : superadmin

Live Demo

https://joliquiz.herokuapp.com/

Thanks to Heroku

French version of JoliQuiz : http://joliquiz.joliciel.fr/