Create weighted answers or interpretation quizzes with ease!
Project description
Create quizzes with ease!
Features
- Create weighted-answers quizzes (6 questions max, conclusions are in categories by points count, like "you have between 0 and 5 points", single (radio) OR multiple (checkboxes) answers per question!),
- Create interpretation quizzes (4 questions max, conclusions are in categories by max symbols count, like "you have a majority of ◆"),
- Create django-cms plugins that redirect to your quizzes (quizzes are available through a special url, you cannot add cms plugin to the quizzes by default).
- (optional) Save quizzes data in your database (started quizzes, finished quizzes, results)
- (optional) Add general questions to the end of the quiz to gather more data! ((fr) departements, job, age range, [...])
- (optional) Generate pdf from the saved data.
Warning!
Do not use versions < 3.0.0, they are not production-ready and have a lot of problems.
Install
- Install the package:
python3 -m pip install django-easy-quiz
- Add those apps to your
INSTALLED_APPS
:"filer", "ckeditor", "ckeditor_uploader", # for hosting images in your ckeditor view, see below for a ready-to-use config "ckeditor_filebrowser_filer", "django_easy_quiz",
- Add the
sessions
middleware in your settings if it's not already here:MIDDLEWARE = ( # [...] "django.contrib.sessions.middleware.SessionMiddleware", # [...] )
- Add those urls in your
urls.py
:# main app urls path("quiz/", include("django_easy_quiz.urls")), # ckeditor-related urls path("ckeditor/", include("ckeditor_uploader.urls")), path("filer/", include("filer.urls")), path("filebrowser_filer/", include("ckeditor_filebrowser_filer.urls")), path("filebrowser_filer/filer_", include("ckeditor_filebrowser_filer.urls")), # only add this line if you're using django-ckeditor-filebrowser-filer from the develop branch or our fork on the "various-fixes" branch
- Migrate
python3 manage.py migrate
- That's all folks!
Config
Ckeditor config
You will need to configure django-ckeditor
in order to make it work in the quiz descriptions. Here's a ready-to-use config snippet that you can paste on your project's settings:
CKEDITOR_UPLOAD_PATH = "uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
CKEDITOR_THUMBNAIL_SIZE = (150, 150)
CKEDITOR_ALLOW_NONIMAGE_FILES = False
CKEDITOR_CONFIGS = {
"default": {
"language": "{{ language }}",
"toolbar": "Simple",
"toolbar_Simple": [
["Undo", "Redo"],
["Styles", "Format"],
["TextColor", "BGColor"],
["Subscript", "Superscript", "-", "RemoveFormat", "PasteText", "PasteFromWord", "FilerImage"],
["Link", "Unlink"],
["Source"],
],
"autoParagraph": False,
"colorButton_colors": "01b6ad,00b6ef,a0cd49,ffc01c,9d1a75,fff,000",
"skin": "moono-lisa",
"height": "600px",
"extraPlugins": "filerimage",
"removePlugins": "image" # do not use the classic image plugin, use the one from django-ckeditor-filebrowser-filer
}
}
You can learn more about thoses config values and customize them values by having a look at the django-ckeditor documentation.
Save quizzes in your database
Add DJANGO_EASY_QUIZ_SAVE_QUIZZES_RESULTS=True
(default False
) in your settings.
Display new questions at the end of the quiz
Add DJANGO_EASY_QUIZ_GATHER_STATISTICS_END=True
(default False
) in your settings.
Download pdf with infos on the quiz
Add DJANGO_EASY_QUIZ_SAVE_PDF
(default False
) in your settings.
Only work if DJANGO_EASY_QUIZ_SAVE_QUIZZES_RESULTS
is true. Requires weasyprint. Template to edit is in django_easy_quiz/quiz_pdf.html
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_easy_quiz-4.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de4fdad5e97ea87118f54f7762c66949ebb315144e962e948bbef84796218f5a |
|
MD5 | 2fe2f8254c7e66da9d7958a3f66b5cb9 |
|
BLAKE2b-256 | 76c09d607efcfa5081541edc8ec34aeaf36fa07178c8d98280c540d890fc6364 |