Giter VIP home page Giter VIP logo

phpquiz's Introduction

PHP Quiz ๐Ÿ˜

This is the public repository of the https://phpquiz.xyz website. It's a Symfony 5.1 application trying to respect best practices.

Badges ๐Ÿ…

All Contributors MIT License

SymfonyInsight

Requirements โš™

Here are the versions I currently use:

  • Symfony CLI v4.18.4
  • Docker 19.03.12
  • Docker-compose 1.26.2
  • Yarn 1.22.4

How to install this project ๐Ÿ“š

As you can see, there no "full-docker-setup" yet. But feel free to contribute if you want one, it would be nice.

To install and start the project, run the following commands:

  1. git clone [email protected]:strangebuzz/phpquiz.git
  2. cd phpquiz
  3. make install
  4. make start
  5. Browse http://127.0.0.1:8006

That's it; you should be ready to develop.

Dev ๐Ÿ“”

You can find the dev notes in the README.txt file.

To see the changes you do to the assets (Js, CSS), you must run yarn watch with the following command:

$ make watch

Coding standards โœจ

Execute this command to run PHPStan:

$ make cs

Tests โœ…

Execute this command to run the PHPUnit tests:

$ make test

Deploy ๐Ÿš€

There is a deploy file sample. To be able to deploy, copy it to config/prod/deploy.php and modify the settings it contains. Then you can deploy in production with:

$ make deploy

Contribute ๐Ÿค

Please create an an issue so we can talk about it.

Troubleshooting ๐Ÿ›

  • Verify that you have at least PHP 7.4 (php -v).
  • In other cases, verify your versions and eventually submit a bug report.

All Contributors

Thanks goes out to all these wonderful people:


COil

Fred

phpquiz's People

Contributors

coil avatar f2r avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

f2r

phpquiz's Issues

[social] Share image doesn't work

When trying to share a quiz:

https://phpquiz.xyz/question/1

The social image for sharing is :

html <meta name="twitter:image" content="https://pbs.twimg.com/media/EdmGDDEXoAAcmsH?format=png&name=small" />

Unfortunately, it doesn't work. Or is it a cache problem? I suspect the query parameters to be the problem. But accessing the URL without the format option doesn't work.

[feature] challenge mode

Currently, we have developed the "learning" mode, that mean that we pass each question. We have the correct answer and explanation when answering then we get to the next question.

The challenge mode will be different, this time we want to test the user :

  • We don't have the answer correct answer we go directly to the next question
  • We don't have the copy code button (in order to avoid the user to test manually)
  • We store each answer of each question
  • A time counter can also be implemented to spice things.
  • Once done a summary will be displayed to the user, the score and percent and the total time.

This functionality will have a different URL.

Symfony 5.2 update

Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "5.2.*"
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires doctrine/doctrine-fixtures-bundle ^3.3 -> satisfiable by doctrine/doctrine-fixtures-bundle[3.3.0, 3.3.1, 3.3.2, 3.4.0].
    - Conclusion: don't install doctrine/event-manager 1.1.1 (conflict analysis result)
    - Conclusion: don't install doctrine/orm 2.7.4 (conflict analysis result)
    - Root composer.json requires symfony/framework-bundle 5.2.* -> satisfiable by symfony/framework-bundle[v5.2.0].
    - Root composer.json requires antishov/doctrine-extensions-bundle ^1.4 -> satisfiable by antishov/doctrine-extensions-bundle[v1.4.0, v1.4.1, v1.4.2].
    - doctrine/orm[v2.7.0, ..., v2.7.3] require doctrine/event-manager ^1.1 -> satisfiable by doctrine/event-manager[1.1.0, 1.1.1].
    - Conclusion: don't install doctrine/event-manager 1.1.0 (conflict analysis result)
    - Root composer.json requires doctrine/orm ^2.7 -> satisfiable by doctrine/orm[v2.7.0, ..., 2.7.4].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

[feature] random mode

The random mode will display a random question. When hitting next a new random quiz (this it may me the same) is proposed to the user.

[data] 10 questions in fixtures

Currently, we have 6 questions, It would be nice to have 10 questions, so we start showing the website other PHP developers.

[docker] postgresql is used before it's ready

When running make run without doing make up first we get :

An exception occurred in driver: SQLSTATE[08006] [7] server closed the connection unexpectedly

It's because doctrine tries to use postgresql before it's ready.

Simplify datastructure

Some data fields appear to be little or not used. Moreover, the relevance of some fields does not always seem to be justified.
The data structure should therefore be simplified and replaced by more open data.

Question entity :

  • id: OK for testing
  • reminder: is it used ?? => to delete DONE
  • label: OK, but just a short text on a single line (for listing)
  • description: to add. Contains question details with embedded links, images, code snippets, etc. => markdown
  • codeImage: to delete and directly embedded into question description body
  • codeImageFile: to delete, like codeImage
  • answerExplanations: OK, but like question description => markdown with links, images, code snippets, etc. as markdown
  • liveSnippetUrl: to delete (embedded into answerExplanations)
  • twitterPollUrl: to rename as sourceUrl (could be nullable)
  • differencesOutputNotes: to delete (embedded into answerExplanations)
  • answers: OK
  • links: to delete (embedded into description and/or answerExplanations)
  • suggestedBy: OK
  • previousQuestion/nextQuestion: to delete => previous and next are parts of a quiz, not a question
  • difficulty: OK, but could be a simple integer level to reduce join complexity

Answer entity:

  • id: to delete => entity relationship is question_id (from question)
  • code: replace by "order: int" to set answers order for a question and manage the user response
  • label: OK
  • correct: replace by "score: float" because sometime, we can add partial score for multiple choices => 0 = wrong
  • pollResult: to discuss! (see after)

For "pollResult", it could be interesting to keep users score performance in an external table to calculate automatically the question difficulty and generate automatically some random quiz, based on this performance.

[feature] last quiz

Add a new entry to pass the last entered quiz only. The menu will show the date it was added.

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.