Giter Club home page Giter Club logo

simple-quiz's Introduction

Software License Build Status SensioLabsInsight

Simple-Quiz is a simple framework for creating quizzes for the web, created and maintained by Ben Hall.

PHP version > 5.4 is required

Quick start

Three quick start options are available:

What's included

Within the download you'll find the following directories and files:

/
├── SimpleQuiz/
│   ├── Utils/
│   │   ├── Base/
│   │   │   ├── SampleConfig.php
│   │   │   ├── Installer.php
│   │   │   ├── IQuestion.php    
│   │   │   ├── IQuiz.php
│   │   │   ├── ISession.php
│   │   │   ├── ISimple.php
│   │   │   ├── User.php
│   │   │   └── setup.php
│   │   ├── Exceptions/
│   │   │   ├── LoginException.php        
│   │   │   ├── RegisterException.php 
│   │   ├── User/ 
│   │   │   ├── AdminUser.php
│   │   │   ├── EndUser.php
│   │   │   ├── GuestUser.php                   
│   │   ├── LeaderBoard.php
│   │   ├── Quiz.php
│   │   ├── QuestionStorage.php    
│   │   ├── Session.php
│   │   └── Simple.php
│   │   └── RadioQuestion.php
│   ├── Tests/
│       ├── Base/      
│       │   ├── InstallerTest.php
│       └── QuizTest.php
├── public/ (**this is your document root**)
│   ├── images/
│   │    ├── ajax-loader.gif
│   │    ├── sq.png   
│   ├── res/
│   │    ├── bootstrap/
│   │    │      ├── assets/ 
│   │    │      ├── dist/  
│   │    ├── css/
│   │    │      ├── quiz.css  
│   │    ├── js/
│   │    │      ├── admin.js
│   │    │      ├── form.js 
│   │    │      ├── general.js 
│   │    │      ├── login.js
│   │    │      ├── start.js                  
│   ├── .htaccess
│   └── index.php
├── routes/
│   ├── admin.php
│   ├── public.php        
├── templates/
│   ├── admin/
│   │    ├── editanswers.php
│   │    ├── footer.php
│   │    ├── header.php
│   │    ├── index.php
│   │    ├── login.php    
│   │    └── quiz.php
│   ├── email/
│   │    ├── registerconfirm.html
│   │    └── registerconfirm.txt     
│   ├── quiz/
│   │    ├── error.php    
│   │    ├── footer.php  
│   │    ├── header.php  
│   │    ├── quiz.php  
│   │    ├── results.php  
│   │    ├── test.php                      
│   ├── category.php 
│   ├── emailconfirmed.php
│   ├── emailsent.php    
│   ├── index.php
│   ├── login.php
│   └── requirements.php                     
├── vendor/
├── .gitignore  
├── .travis.yml
├── composer.json
├── composer.lock
├── LICENSE
├── phpunit.xml
├── .gitignore
├── README.md
└── simple-quiz.sql

Installation

Get The Code.

  • If you are downloading from SourceForge, all project dependencies are bundled with the project. If, however, you are cloning from GitHub or downloading the release zip file, you must run 'composer install' to download all of the dependencies.
  • If you don't know what composer is, take a look here: Composer
  • Unpack the downloaded code zip archive.
  • Place the contents of the /public directory inside your document root.
  • All other directories should be placed outside of the document root and not accessible via a web browser (look at the above diagram to see the structure).
  • The mod_rewrite module (if using apache server) or URL Rewrite module (if using IIS) will need to be enabled in your server configuration.
  • Create a MySQL database called 'simple-quiz'
  • Import simple-quiz.sql into MySQL using a tool like phpmyadmin or using the MySQL 'source' command.
  • Change credentials in /SimpleQuiz/Utils/Base/SampleConfig.php.
  • Rename SampleConfig.php to Config.php
  • Default web admin user is [email protected] with password of 123456
  • Navigate to the web accessible folder in your browser.

Twitter Stuff

Authors

Ben Hall

Copyright and license

Copyright 2013 Ben Hall under the Apache 2.0 license.

simple-quiz's People

Contributors

ktos avatar sorck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simple-quiz's Issues

users forgotten password

Hi,

i have an issue where the user has forgotten the password. is there away to have a forgotten password form? or somehow to reset it in MYSLQ? i've logged into PHPmy admin and removed the hash in hope to login but that doesn't work.

any thoughts?

thank you

Admin settings link broken

When logged in as an Admin both the settings and change password links in the drop down redirect to admin/config/ and admin/edit respectively, which are not directories in this package. Perhaps I am doing something wrong?

Uncaught exception 'PDOException'

I get this error: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'quiz'@'localhost' (using password: YES)' in /home/homework/vendor/j4mie/idiorm/idiorm.php:255 Stack trace: #0 /home/homework/vendor/j4mie/idiorm/idiorm.php(255): PDO->__construct('mysql:host=loca...', 'quiz', 'XXXXXXXXXXX...', NULL) #1 /home/homework/vendor/j4mie/idiorm/idiorm.php(237): ORM::_setup_db('default') #2 /home/homework/SimpleQuiz/Utils/Session.php(73): ORM::for_table('sessions') #3 [internal function]: SimpleQuiz\Utils\Session->read('21e19d4772bf669...') #4 /home/homework/SimpleQuiz/Utils/Session.php(22): session_start() #5 /home/homework/public_html/quiz/index.php(14): SimpleQuiz\Utils\Session->__construct() #6 {main} thrown in /home/homework/vendor/j4mie/idiorm/idiorm.php on line 255

I installed this from the SourceForge site. Thanks for any help!

Unable to "start quiz' redirects to homepage.

I'm having a strange issue where any quiz I try to start it redirects me back to http://localhost/simple-quiz/public/

I'm running XAMPP on my MAC machine at the moment. My .htaccess is

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule .* %{REQUEST_URI}.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

I've tried changing values and no luck. Just cannot get it to start a quiz. Any ideas?

Mail error when registering

I get this error when I register a new user. The user gets registered but its disconcerting for them, and email isn't working obviously.


Details
Type: Swift_RfcComplianceException
Message: Address in mailbox given [] does not comply with RFC 2822, 3.6.2.
File: /home/tautline/public_html/simple-quiz/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php
Line: 348
Trace
#0 /home/tautline/public_html/simple-quiz/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(263): Swift_Mime_Headers_MailboxHeader->_assertValidAddress('')
#1 /home/tautline/public_html/simple-quiz/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(106): Swift_Mime_Headers_MailboxHeader->normalizeMailboxes(Array)
#2 /home/tautline/public_html/simple-quiz/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(63): Swift_Mime_Headers_MailboxHeader->setNameAddresses(Array)
#3 /home/tautline/public_html/simple-quiz/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php(602): Swift_Mime_Headers_MailboxHeader->setFieldBodyModel(Array)
#4 /home/tautline/public_html/simple-quiz/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php(213): Swift_Mime_SimpleMimeEntity->_setHeaderFieldModel('From', Array)
#5 /home/tautline/public_html/simple-quiz/SimpleQuiz/Utils/Base/Mailer.php(25): Swift_Mime_SimpleMessage->setFrom(Array)
#6 /home/tautline/public_html/simple-quiz/routes/public.php(138): SimpleQuiz\Utils\Base\Mailer->__construct()
#7 [internal function]: {closure}()
#8 /home/tautline/public_html/simple-quiz/vendor/slim/slim/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
#9 /home/tautline/public_html/simple-quiz/vendor/slim/slim/Slim/Slim.php(1357): Slim\Route->dispatch()
#10 /home/tautline/public_html/simple-quiz/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#11 /home/tautline/public_html/simple-quiz/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#12 /home/tautline/public_html/simple-quiz/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#13 /home/tautline/public_html/simple-quiz/vendor/slim/slim/Slim/Slim.php(1302): Slim\Middleware\PrettyExceptions->call()
#14 /home/tautline/public_html/simple-quiz/public/index.php(56): Slim\Slim->run()
#15 {main}

Slim Application Error

Hey! I am getting this error:
The application could not run because of the following error:

Details

Type: RuntimeException
Message: View cannot render index.php because the template does not exist
File: C:\wamp\www\Quiz\vendor\slim\slim\Slim\View.php
Line: 272
Trace
#0 C:\wamp\www\Quiz\vendor\slim\slim\Slim\View.php(255): Slim\View->render('index.php', NULL)
#1 C:\wamp\www\Quiz\vendor\slim\slim\Slim\View.php(243): Slim\View->fetch('index.php', NULL)
#2 C:\wamp\www\Quiz\vendor\slim\slim\Slim\Slim.php(757): Slim\View->display('index.php')
#3 C:\wamp\www\Quiz\routes\public.php(9): Slim\Slim->render('index.php', Array)
#4 [internal function]: {closure}()
#5 C:\wamp\www\Quiz\vendor\slim\slim\Slim\Route.php(468): call_user_func_array(Object(Closure), Array)
#6 C:\wamp\www\Quiz\vendor\slim\slim\Slim\Slim.php(1357): Slim\Route->dispatch()
#7 C:\wamp\www\Quiz\vendor\slim\slim\Slim\Middleware\Flash.php(85): Slim\Slim->call()
#8 C:\wamp\www\Quiz\vendor\slim\slim\Slim\Middleware\MethodOverride.php(92): Slim\Middleware\Flash->call()
#9 C:\wamp\www\Quiz\vendor\slim\slim\Slim\Middleware\PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#10 C:\wamp\www\Quiz\vendor\slim\slim\Slim\Slim.php(1302): Slim\Middleware\PrettyExceptions->call()
#11 C:\wamp\www\index.php(56): Slim\Slim->run()
#12 {main}

I do not have any knowledge on composer or slim framework. Could you help me with figuring out what's the problem or guide me where to read more in order to figure this out?

404 Page Not Found

Hi -

I've installed your application on a windows 2008r2 64bit running IIS and PHP 5.6.7
i've got your application to load the mysql tables and i can see the main page - however if i go to start an exam i immediately get the following
" 404 Page Not Found
The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.

Visit the Home Page"
capture

i'm not too sure where to go from here, i've check all the folders that they have the correct files as per your readme and they do.

also when i go to try and login with [email protected] and password 123456 nothing happens - the fields just reset back to default.

In IIS i edited the web.config file and added the following:
"httpErrors
remove statusCode="404" subStatusCode="-1" /
error statusCode="404" prefixLanguageFilePath="" path="/induction/index.php" responseMode="ExecuteURL" /
/httpErrors" -
so it would pass the 404 errors back to index.php ( this resolved an issue i was initially having when i first went to load your application )

i'm at a loss here, can you please help?

thank you

Take the quiz without username

Is it possible to make the quizes available without users having to type in a username? I'm aware that the high scores lists don't make any sense then, but I guess these are easy to hide.

Any ideas?

Multiple right answers

Wold it be possible to add multiple right answers ?
As in checkboxes instead of radio buttons.

Question storage needs to be increase

Hi Elan,

I am unable to save the lengthy questions using simple quiz application, could you please navigate/show the way how to increase the data type/ storage of questions. i need to save lengthy questions also please do the needful.

Thanks in advance.

Khadeer

Failed to read session data: user (path: C:\xampp\tmp)

Warning: session_start(): Failed to read session data: user (path: C:\xampp\tmp) in C:\xampp\htdocs\quiz\SimpleQuiz\Utils\Session.php on line 22

Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. in C:\xampp\htdocs\quiz\vendor\j4mie\idiorm\idiorm.php:254 Stack trace: #0 C:\xampp\htdocs\quiz\vendor\j4mie\idiorm\idiorm.php(254): PDO->__construct('mysql:host=loca...', '...', '...', NULL) #1 C:\xampp\htdocs\quiz\vendor\j4mie\idiorm\idiorm.php(237): ORM::_setup_db('default') #2 C:\xampp\htdocs\quiz\SimpleQuiz\Utils\Session.php(73): ORM::for_table('sessions') #3 [internal function]: SimpleQuiz\Utils\Session->read('o3g06mahtceuo3b...') #4 C:\xampp\htdocs\quiz\SimpleQuiz\Utils\Session.php(22): session_start() #5 C:\xampp\htdocs\quiz\public\index.php(9): SimpleQuiz\Utils\Session->__construct() #6 {main} thrown in C:\xampp\htdocs\quiz\vendor\j4mie\idiorm\idiorm.php on line 254

Internal Server Error

I'm getting the following error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

System: Wamp on Windows, Apache/2.4.9 (Win32) PHP/5.5.12
URL: localhost/simplequiz

Apache conf:

Alias /simplequiz "d:/wamp/www/simplequiz/public/" 

<Directory "d:/wamp/www/simplequiz/public/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order Deny,Allow
    Allow from all
</Directory>

Its something about the .htaccess file,
Without .htaccess, the main page works correctly, but the links are not working.
With .htaccess i'm getting "Internal Server Error".

Result page has to change

Greetings Elan,

I am using the Simple Quiz application as an admin of the quiz, i have observed the users want their result page at the start quiz. because, whenever they want to know their result of particular test they can login and review their previous test scores and their wrong attempts.

Request you to guide me the instructions that how can we link the result page beside of start quiz button.

I want to insert another button beside of start quiz button like "score card" in that we can have the results page of the attended tests.

Please help me and do the needful

Regards,
Khadeer

404 when going to http://quiz/admin/ or http://quiz/quiz/6

Hi,

I'm using nginx. I create virtual host at http://quiz/
When I load main page everything is ok, but any other page gives me 404.

Here what I have in nginx error log:

2014/10/16 19:42:57 [error] 10209#0: *1 open() "/Users/username/Dev/www/quiz/public/quiz/6" failed (2: No such file or directory), client: 127.0.0.1, server: quiz, request: "GET /quiz/6 HTTP/1.1", host: "quiz", referrer: "http://quiz/"
2014/10/16 19:42:57 [error] 10209#0: *1 open() "/Users/username/Dev/www/quiz/public404" failed (2: No such file or directory), client: 127.0.0.1, server: quiz, request: "GET /quiz/6 HTTP/1.1", host: "quiz", referrer: "http://quiz/"

"/Users/username/Dev/www/quiz/public" - it's path to quiz public folder

Here is my nginx conf:

server {
        listen 80;
        root /Users/username/Dev/www/quiz/public;
        index index.php;
        server_name quiz;
        error_page   404  =   /404.php;
        error_page   403  =  /404.php;

    location / {
        include   /usr/local/etc/nginx/conf.d/php-fpm;
    }

    location = /info {
        allow   127.0.0.1;
        deny    all;
        rewrite (.*) /.info.php;
    }

    error_page  404     /404.html;
    error_page  403     /403.html;

}

Please tell me what is the problem?

Trying to get things running

So I'm installing with the paths/locations a bit different from what you specified, and the database with a different name. I think I have changed the variables to get things sorted as the page now comes up.

I and am able login as admin, view the other quizes etc and create a new quiz which saves in the database, but I cannot start a quiz. Do you have any ideas? I don't get any errors as far as I can tell but the questions just don't come up.

EDIT: Nevermind - realized I can't take quiz as admin

Installation

I believe I have installed correctly.....

However when I run I get
Parse error: syntax error, unexpected '[', expecting ')' in /Applications/XAMPP/xamppfiles/htdocs/public/index.php on line 60

Import API/Feature

It would be nice to be able to bulk insert questions/answers rather than manually insert each one. I can craft up a SQL file by manually setting the foreign keys and stuff but it's a bit of a pain to repeat.

A feature to do this (if even outside of the web app) would be nice. Perhaps to read questions in from a JSON file and import them.

Session Issue

Hi I have installed using the zip archive and followed all steps. However there is some issue in generating the session id.
simplequiz error

Can you tell me how to resolve this?

2 questions.

Hi,

Because I could not find a other way to post questions I do it here.
I am unable to login as admin user not can I add a user. What type of password holds the pass field?
is it MD5, PASSWORD?? I cannot seem to find that out.

Thanks for any response.
Paul.

unable to check the scores of quiz users in admin panel

Hi Elan,

I have check in admin panel need to check the users scores and their mistakes like in which question they have attempt a wrong. could you please show the way can i find out the results through an admin panel.

Please do the needful.

Thanks in advance,
Khadeer

vendor/ dir missing

In repo and in the zip archive there is no vendor/ directory, listed in the "What's included" section of the README. After installation the application seems to be broken, beacause it cannot find the vendor/autoload.php file.

Warning: require(../vendor/autoload.php): failed to open stream: No such file or directory in /[path]/public/index.php on line 5

Fatal error: require(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /[path]/public/index.php on line 5

class ORM error

Hello,
Thanks for the awesome application, I'd love to use this application, I followed all the instructions step-by-step but I keep getting this error
Fatal error: Class 'ORM' not found in /home/ubuntu/workspace/simple-quiz/public/index.php on line 4
I tried everything before contact you here, but I couldn't find a solution.

Link is not working

I am a newbee.. somehow I am able to get it up and running in wamp but when I click on the link "Web Acronyms" at the right part of the application it says

Not Found

The requested URL /sq/public/quiz/1 was not found on this server.

Could you please share the step by step process for production set up ?

1
2

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.