2017 © Pedro Peláez
 

symfony-bundle quiz-bundle

Quiz bundle.

image

lms42/quiz-bundle

Quiz bundle.

  • Tuesday, October 1, 2013
  • by smirik
  • Repository
  • 5 Watchers
  • 5 Stars
  • 583 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 3 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

QuizBundle

Introduction

This bundle provides quiz functionality as standalone symfony2 bundle. Created by 4xxi.com. All bundles by 4xxi., (*1)

Features

  • Unlimited quiz creation.
  • Every quiz can have different number of questions. The question's database could have much more questions than need. For quizes questions are taken randomly.
  • Every question can have any number of answers (radio-button answers) or text answer (input field).
  • Question & answer can have image.
  • Quiz could be limited by time (e.g. 10 minutes).
  • It is possible to hide quiz from users. The administrator can manually assign users to quiz.
  • Bundle is translated, see Resources/translations. Some translations on english could be missed because of rapidly development.

Requirements

  • Symfony2 with twig.
  • Doctrine2, DoctrineExtension & DoctrineFixtures.
  • FOSUserBundle (please see the installation steps here).
  • Annotations for Controllers.
  • jQuery & twitter bootstrap css / js or similar.
  • It is recommended to use this bundle with SmirikAdminBundle which provides public assets (including twitter bootstrap & jquery) + menu + core classes.

Installation

  • Add bundle to your deps file:, (*2)

    [SmirikQuizBundle]
    git=git://github.com/smirik/SmirikQuizBundle.git
    target=/bundles/Smirik/QuizBundle
    
  • Register the namespace in autoload.php (if you don't use other Smirik* bundles):, (*3)

    $loader->registerNamespaces(array(
      ...
      'Smirik'           => __DIR__.'/../vendor/bundles',
    ));
    
  • Register bundle in your AppKernel.php:, (*4)

    $bundles = array(
      ...
      new Smirik\QuizBundle\SmirikQuizBundle(),
      ...
    );
    
  • Add the following code to config.yml:, (*5)

    fos_user:
        db_driver: orm # other valid values are 'mongodb', 'couchdb'
        firewall_name: main
        user_class: Smirik\QuizBundle\Entity\User
        group:
            group_class: Smirik\QuizBundle\Entity\Group
    
    ...
    twig:
      debug:            %kernel.debug%
      strict_variables: %kernel.debug%
      form:
        resources:
          - 'SmirikQuizBundle:Form:fields.html.twig'
    
  • Add routes to routing.yml:, (*6)

    SmirikQuizBundle:
      resource: "@SmirikQuizBundle/Controller/"
      type:     annotation
      prefix:   /
    
  • Update database and load test fixtures to see admin functionality, (*7)

    php app/console doctrine:schema:update --force
    php app/console doctrine:fixtures:load --append
    
  • See test quiz at http://host/admin/quiz/, (*8)

  • Please check that bootstrap.css file is loaded., (*9)

  • Enjoy!, (*10)

Database schema

Database schema, (*11)

How to use

  • Bundle has its own layout Resources/views/layout.html.twig extending base.html.twig. All templates extending this layout. All admin templates extends Resources/views/Admin/layout.html.twig.
  • There are 4 controllers:
    • AdminQuestionController (/admin/questions/*) for questions management,
    • AdminQuizController (/admin/quiz/*) for quizes management,
    • AdminUserController (/admin/quiz-users/*) for assigning users to quizes,
    • QuizController (/quiz/*) — frontend for users.
  • Access to all parts is granted just for authorized users.
  • Just ROLE_ADMIN users have access to /admin/* parts.
  • To start test quiz you should login (/login) and go to /quiz webpage.

Roadmap

  • Comments, pulls, reviews, forks are welcome!

License

MIT., (*12)

The Versions

01/10 2013

dev-master

9999999-dev https://lms42.com

Quiz bundle.

  Sources   Download

MIT

quiz

01/10 2013

v1.0.1

1.0.1.0 https://lms42.com

Quiz bundle.

  Sources   Download

MIT

quiz

01/10 2013

dev-develop

dev-develop https://4xxi.com

Quiz bundle.

  Sources   Download

MIT

quiz

13/08 2013

v1.0.0

1.0.0.0 https://lms42.com

Quiz bundle.

  Sources   Download

MIT

quiz

01/08 2013

v0.4.0

0.4.0.0 https://4xxi.com

Quiz bundle.

  Sources   Download

MIT

quiz

28/06 2013

v0.3

0.3.0.0 https://lms42.com

Quiz bundle.

  Sources   Download

MIT

quiz