Coder Social home page Coder Social logo

django_quiz's Introduction

Django quiz app

Build Status

This is a configurable quiz app for Django.

I use it to run a few medical revision websites. Here is an example website

My websites have used twitter bootstrap for the front end and I have tried to strip out anything from the template files that are dependant on bootstrap.

Questions

Current features

Features of each quiz:

  • Question order randomisation
  • Storing of quiz results under each user
  • Previous quiz scores can be viewed on category page
  • Correct answers can be shown after each question or all at once at the end
  • Logged in users can return to an incomplete quiz to finish it and non-logged in users can complete a quiz if their session persists
  • The quiz can be limited to one attempt per user
  • Questions can be given a category and subcategory
  • Success rate for each category can be monitored on a progress page
  • Explanation for each question result can be given
  • Pass marks can be set
  • Multiple choice question type
  • True/False question type
  • Essay question type
  • Display an image alongside the question
  • Custom message displayed for those that pass or fail a quiz
  • Custom permission (view_sittings) added, allowing users with that permission to view quiz results from users
  • A marking page which lists completed quizzes, can be filtered by quiz or user, and is used to mark essay questions
  • After selecting a larger pool of questions, a quiz can be set to show a random subset rather than all within the pool
  • Start and end times for sitting exams are recorded
  • i18n support
  • Russian and Italian language translation

Result page

Requirements

django-model-utils

Pillow

Tests are included and pass for Django versions 1.5, 1.6, 1.7 and 1.8, running with Python 2.7, 3.3 and 3.4

Installation

Clone the repo with git clone https://github.com/tomwalker/django_quiz.git.

Run pip install -r requirements.txt. Run python setup.py install

Add 'quiz', 'multichoice', 'true_false', 'essay' to your INSTALLED_APPS setting.

INSTALLED_APPS = (
    ...
    'quiz',
    'multichoice',
    'true_false',
'essay',
    ...
)

Add the following to your projects urls.py file, substituting q for whatever you want the quiz base url to be.

urlpatterns = patterns('',
    ...
    url(r'^q/', include('quiz.urls')),
	...
)

Contributors

MIT License (MIT) Copyright (c) 2012 - 2015 Dr Tom Walker

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

django_quiz's People

Contributors

alfredo avatar amboycharlie avatar boltomli avatar certifiedloud avatar d0ugal avatar eugena avatar managai avatar mrmyhuang avatar openrijal avatar piinterest avatar pxg avatar pyjavo avatar richardmansfield avatar rob-b avatar ryankask avatar salvafiorenza8 avatar sjardim avatar smirnovvad avatar swfiua avatar tomwalker 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  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

django_quiz's Issues

Starting the project

Yow,

I downloaded the project and installed it like the readme told me.
However, I can't run any migration or run the server locally using django-admin. Isn't the project meant to have a manage.py?

If someone could elaborate on how to actually run the project when downloaded and installed it would be great. I am currently evaluating this project for a client and if it suits our initial needs we could spend some hours contributing to this project.

Here is the error when I try to run the project (on windows):

PS C:\Users\myuser\Documents\Code\django_quiz> django-admin runserver
Traceback (most recent call last):
  File "C:\Python36\Scripts\django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "c:\python36\lib\site-packages\django\core\management\__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "c:\python36\lib\site-packages\django\core\management\__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "c:\python36\lib\site-packages\django\core\management\__init__.py", line 272, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "c:\python36\lib\site-packages\django\core\management\__init__.py", line 75, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "c:\python36\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "c:\python36\lib\site-packages\django\core\management\commands\runserver.py", line 12, in <module>
    from django.core.servers.basehttp import run, get_internal_wsgi_application
  File "c:\python36\lib\site-packages\django\core\servers\basehttp.py", line 20, in <module>
    from django.core.wsgi import get_wsgi_application
  File "c:\python36\lib\site-packages\django\core\wsgi.py", line 1, in <module>
    from django.core.handlers.wsgi import WSGIHandler
  File "c:\python36\lib\site-packages\django\core\handlers\wsgi.py", line 11, in <module>
    from django.core.handlers import base
  File "c:\python36\lib\site-packages\django\core\handlers\base.py", line 16, in <module>
    from django.views import debug
  File "c:\python36\lib\site-packages\django\views\debug.py", line 12, in <module>
    from django.template import Template, Context, TemplateDoesNotExist
  File "c:\python36\lib\site-packages\django\template\__init__.py", line 53, in <module>
    from django.template.base import (ALLOWED_VARIABLE_CHARS, BLOCK_TAG_END,
  File "c:\python36\lib\site-packages\django\template\base.py", line 19, in <module>
    from django.utils.html import escape
  File "c:\python36\lib\site-packages\django\utils\html.py", line 14, in <module>
    from .html_parser import HTMLParser, HTMLParseError
  File "c:\python36\lib\site-packages\django\utils\html_parser.py", line 12, in <module>
    HTMLParseError = _html_parser.HTMLParseError

Do I simply use too new of a Python version?

Best wishes,
Markus

NameError, Line 498 in quiz/models.py

Using the master branch with Django 1.7.1 & Python 3.4. When I submit the quiz, I'm gettin' a NameError on line 498, "name 'unicode' is not defined", in the quiz/models.py. I altered the line by removing the unicode() but it still gives me the same error, so I'm not sure what's going on there.

support for django 1.9 and 1.10

I would like to propose support for Django 1.9 and/or 1.10.

I tried to work on that, but seems like it need a deep dive. Anybody is interested or already working on that?

Make adding MCQuestions possible for visitors

Hello!

First I would very much like to thank you for amazing app which spared me A LOT of time.

I have an idea for my website but I am just getting started with Django and I'm losing faith I will get into it since I am new to programming.

However, I was able to run simple website using your app.

OK, to the point... I was thinking of allowing users to add MCQuestions themselves (taking all the risks into consideration) but the problem is... I don't know how to do it. It may be a basic thing to do but I didn't get the full picture of the code so I was just trying some simple ideas that didn't work out.

Is there any simple way to do this (ignoring the auth system - let's say every visitor -even non-registered - could add question)? I would very much appreciate if you helped me.

Thank you very much.

Project Documentation

So I know this is meant to be a library. However, can we get documentation on this? There is nothing but a brief readme. Can some of those who've set up the project successfully come chip in? It's 2019 by the way so can we as well move to latest versions of the dependencies with reference to Django and Python.

Template Missing

Hello.
Whenever I navigate to quiz/progress, I get a template missing error.

Exception Type: TemplateDoesNotExist
Exception Value: user_previous_exam.html

If that is a known issue, can you please explain what is that template.

Regards.

multiple true false question

I am requesting to add a question type or modifying the existing SBA type to multiple true false with/without penalty for wrong answer type question.

The quesiton will be a multiple true false type. Each question will have 5 stem, each will be tested for true/false. Each will carry partial marks eg. 1 will be awarded for a correct ans. And there will be a system for penalty eg. deduct 0.5 marks for a wrong answer of a stem.

for example:
ques: regarding "A"

  1. stem 1 - Tick if true/false
  2. stem 2 - Tick if true/false
  3. stem 3 - Tick if true/false
  4. stem 4 - Tick if true/false
  5. stem 5 - Tick if true/false

candidates will have options for not ticking any stems avoiding penalty.

Attribute Error

I installed the app without changing anything into my project, created a test quiz, but when I press the button Start Quiz, I get an error saying - 'int' object has no attribute 'essay_question'.

Am I doing something wrong? And how could this problem be solved?

Here's the log:

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/quiz/introductoryquiz/take/

Django Version: 1.9.1
Python Version: 2.7.10
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'myapp',
 'quiz',
 'essay',
 'multichoice',
 'true_false',
 'bootstrapform']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "/home/john/.virtualenvs/lfs/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  149.                     response = self.process_exception_by_middleware(e, request)

File "/home/john/.virtualenvs/lfs/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/john/.virtualenvs/lfs/local/lib/python2.7/site-packages/django/views/generic/base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "/home/john/myapp/quiz/views.py" in dispatch
  148.                                                         self.quiz)

File "/home/john/myapp/quiz/models.py" in user_sitting
  345.             sitting = self.new_sitting(user, quiz)

File "/home/john/myapp/quiz/models.py" in new_sitting
  316.         if len(question_set) == 0:

File "/home/john/.virtualenvs/lfs/local/lib/python2.7/site-packages/django/db/models/query.py" in __len__
  240.         self._fetch_all()

File "/home/john/.virtualenvs/lfs/local/lib/python2.7/site-packages/django/db/models/query.py" in _fetch_all
  1074.             self._result_cache = list(self.iterator())

File "/home/john/.virtualenvs/lfs/local/lib/python2.7/site-packages/model_utils/managers.py" in iterator
  80.                     sub_obj = self._get_sub_obj_recurse(obj, s)

File "/home/john/.virtualenvs/lfs/local/lib/python2.7/site-packages/model_utils/managers.py" in _get_sub_obj_recurse
  153.             node = getattr(obj, rel)

Exception Type: AttributeError at /quiz/introductoryquiz/take/
Exception Value: 'int' object has no attribute 'essay_question'

Add timer

Please Add Timer for the exam. So that timed exam can be created.

ValueError invalid literal for int() with base 10: '2,'

Following error I am getting will I start taking quiz:

Request Method: GET
http://127.0.0.1:8000/test/test/take/
1.10
ValueError
invalid literal for int() with base 10: '2,'
/home/pintu/djangogirls/myvenv/lib/python3.6/site-packages/django/db/models/fields/init.py in get_prep_value, line 1832
/home/pintu/djangogirls/myvenv/bin/python
3.6.0

Traceback Switch to copy-and-paste view

/home/pintu/djangogirls/test/models.py in user_sitting
sitting = self.get(user=user, quiz=quiz, complete=False)

During handling of the above exception (Sitting matching query does not exist.), another exception occurred:

/home/pintu/djangogirls/test/views.py in dispatch
self.quiz) ...
▶ Local vars
/home/pintu/djangogirls/test/models.py in user_sitting
sitting = self.new_sitting(user, quiz) ...
▶ Local vars
/home/pintu/djangogirls/test/models.py in new_sitting
user_answers='{}')

MC Questions with many correct answers dont work

Hi,

I run django_quiz on Python 3.4.3, Django 1.8.4, django-model-utils 2.3.1. Source from github installed via setup.py into my virtualenv.

It worked out of the box :)

Multiple choice questions take only one single answer. I changed the widget to CheckboxSelectMultiple which displays fine and offers multiple selections but does not save or evaluate.

Is there a solution to this already? If not, may I have some tipps where to change things?

Adding duration to quizzes.

I think adding a duration field for quizzes, specially multiple choice quizzes, would be a nice feature to have. I'm willing to contribute to add this feature.

It would be nice to know owner's/maintainer's views on this. Thanks.

Project running

I could not found any manage.py file as a result can't run the project with python manage.py runserver.
Please let me know the process to run the project.

Problems with running the proyect

Hi, I'm new with full Django proyects and I have an issue. I downloaded the proyect and did what the README says, but I don't know how to follow.

I will be very thankfull if anyone can help me. Thanks in advance.

drop django 1.5 support

support for django 1.5 ended in 2014
my proposal is to remove django 1.5 from .travis.yml

Quiz tags

I get anTemplateSyntaxError " 'quiz_tags' is not a valid tag library: Template library quiz_tags not found,".When taking a demo exam.The error source is {% load quiz_tags %} in the template files, line 3.But if that line is deleted it works fine.Is there any other work around and what is the cause.

Thanks

Installation from PyPI lacks README

On Python 2.7, 3.4, and 3.5 I get this error when I try to install from PyPI:

$ pip install django-quiz-app
Collecting django-quiz-app
  Downloading django-quiz-app-0.5.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/private/var/folders/h_/rdtpztvj4c9cfg2ctqyp_wl40000gp/T/pip-build-h8rl1rpd/django-quiz-app/setup.py", line 3, in <module>
        readme = open('README.rst').read()
    FileNotFoundError: [Errno 2] No such file or directory: 'README.rst'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/h_/rdtpztvj4c9cfg2ctqyp_wl40000gp/T/pip-build-h8rl1rpd/django-quiz-app

It's really strange, because your MANIFEST.in includes the README.rst file that's breaking the install.

get_form() missing 1 required positional argument: 'form_class'

I cannot find out why I've got this error. Any idea?

Traceback:

File "C:\Python35\lib\site-packages\django\core\handlers\exception.py" in inner
41. response = get_response(request)

File "C:\Python35\lib\site-packages\django\core\handlers\base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)

File "C:\Python35\lib\site-packages\django\core\handlers\base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\Python35\lib\site-packages\django\views\generic\base.py" in view
68. return self.dispatch(request, *args, **kwargs)

File "C:\mysite\quiz\views.py" in dispatch
155. return super(QuizTake, self).dispatch(request, *args, **kwargs)

File "C:\Python35\lib\site-packages\django\views\generic\base.py" in dispatch
88. return handler(request, *args, **kwargs)

File "C:\Python35\lib\site-packages\django\views\generic\edit.py" in get
174. return self.render_to_response(self.get_context_data())

File "C:\mysite\quiz\views.py" in get_context_data
191. context = super(QuizTake, self).get_context_data(**kwargs)

File "C:\Python35\lib\site-packages\django\views\generic\edit.py" in get_context_data
93. kwargs['form'] = self.get_form()

Exception Type: TypeError at /hell/take/
Exception Value: get_form() missing 1 required positional argument: 'form_class'

randomization under categories

Dear all,

Thanks for the package. I have found it easy to get started and features are greate.

I'd like to clarify how randomization within a category works. the README says

After selecting a larger pool of questions, a quiz can be set to show a random subset rather than all within the pool

On a quiz admin page I can see a drop down menu to select a category, and then a max questions field to set.

It seems to me that max question number is drawn from both categories at the same time. What is the purpose of the drop down to select the category?

Also, consider the following use case: I have a pool of questions with two categories and I'd like to draw N questions from one category and M questions from the other. Is there a way to do it? I could settle to the same number of questions in each category.

Also, how easy is to place all questions on the same page?

Thanks in advance!

Saved image im question does not work

Hello. i tried to add an image to multichoise question. I can see that 'upload' folder is being created and the image is there. How ever the image in the question cannot be displayed. Instead i get an error telling me that image path is wrong. Im not sure what Im doing wrong. Thank u for your help.

Migrations

@tomwalker Are you active with this repo? Adding migrations folders to each app and an empty init.py will allow migrations to run for setup. Then the database migrations can be run with:

python manage.py makemigrations
python manage.py migrate

Also, besides a couple warnings, this app is working with Django 1.9.7 and Python 3.5.

Add support for figures

This app needs support for figures in the questions. I have already written the support into my own application, and I plan to share the code soon.

Question navigation feature?

There should be functionality where user can navigate through questions. Why can't user come back to previous question once answered? What if he wants to change the response afterwards. There must also be a timer to keep track of quiz. I tried implementing it using cookies, and it works fine. Only thing is when timer runs out, (and as the remaining questions are not answered), then the answer paper is not generated. It returns KeyError.

AttributeError: 'Options' object has no attribute 'get_all_related_objects'

Hello
Anytime i add
objects = InheritanceManager() i get this error
Internal Server Error: /quiz/ccna-quiz-2/take/
Traceback (most recent call last):
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/django/core/handlers/base.py", line 128, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/django/views/generic/base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
File "/home/photon/web_project/cbtapp/quiz_app/views.py", line 190, in dispatch
return super(QuizTake, self).dispatch(request, *args, **kwargs)
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/django/views/generic/base.py", line 89, in dispatch
return handler(request, *args, **kwargs)
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/django/views/generic/edit.py", line 133, in get
return self.render_to_response(self.get_context_data())
File "/home/photon/web_project/cbtapp/quiz_app/views.py", line 225, in get_context_data
context = super(QuizTake, self).get_context_data(**kwargs)
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/django/views/generic/edit.py", line 66, in get_context_data
kwargs['form'] = self.get_form()
File "/home/photon/web_project/cbtapp/quiz_app/views.py", line 194, in get_form
self.question = self.sitting.get_first_question()
File "/home/photon/web_project/cbtapp/quiz_app/models.py", line 397, in get_first_question
return Question.objects.get_subclass(id=question_id)
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/model_utils/managers.py", line 185, in get_subclass
return self.get_queryset().get_subclass(*args, **kwargs)
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/model_utils/managers.py", line 160, in get_subclass
return self.select_subclasses().get(*args, **kwargs)
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/model_utils/managers.py", line 20, in select_subclasses
self.model, levels=levels)
File "/home/photon/.local/share/virtualenvs/cbtapp-s8Tp4Urs/lib/python3.7/site-packages/model_utils/managers.py", line 106, in _get_subclasses_recurse
rel for rel in model._meta.get_all_related_objects()
AttributeError: 'Options' object has no attribute 'get_all_related_objects'
[10/Dec/2018 19:01:11] "GET /quiz/ccna-quiz-2/take/ HTTP/1.1" 500 117267

OperationalError (no such table: quiz_quiz) while trying to start application

Hello!

I am trying to run the barebones application with an empty Django prorject.

  • I followed the README.md instructions and I've got a .egg

  • I create a new Django project ( django-admin startproject xyz )

  • I move the .egg file to the app directory and add sys.path.append("django_quiz_app-0.5.1-py2.7.egg") to the manage.py (so that my Django app can see the required libs) and modify the settings.py and url.py (according to README.md instructions)

  • I start the project ( python manage.py runserver ) and it runs OK. However when I point my browser to 127.0.0.1/q , I get the following error:

Request Method: | GET
-- | --
http://127.0.0.1:8000/q/
1.6.5
OperationalError
no such table: quiz_quiz
/usr/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 451
/usr/local/opt/python/bin/python2.7

Is there something I am doing wrong?

Upload Quiz Questions

I tweeted concerning putting questions into the Quiz app.Can questions be imported into a mysql
database bypassing the Interface method.Also can i add images to Questions in the Quiz,Thank you.

multiple choice is not multiple

Hi,

I created a question in multichoice and selected two answers as correct. But I can only select one answer.

how can i switch from single answer to multiple selectable answers?

Update integration tests to support Django 3 and drop Django 1 and Python 2.7

I've created a local version of this library that passes all the included unit tests for Python 3.8, Django 3.0.2, and the long-term-support Django 2.2. But it's not compatible with Python 2 or Django 1. So if I open a pull request now, it's not going to pass the integration tests as currently configured.

I propose dropping the relevant TOX_ENVs from .travis.yml and adding new ones for Python 3.7 and 3.8, and for Django 3.0.

I think some people might now be encountering problems integrating this into Django 3.0 projects. So I think the benefit of updating for Django 3 compatibility outweighs any costs of ending Django 1 and Python 2.7 support.

fr-FR locale

Hello,

I've translated .po files for "fr-FR", but I don't really know how to merge them in the project. I don't even managed to use them on my personnal project.

I join them in this issue so a good samaritan may success where I failed.
I don't care about any attributions.

fr-FR_po_files.zip

Restricting access to certain questions/categories

good day, firstly this is a great project, I have learnt quite a bit about django using this project.

my question: is it possible to restrict specific exam subcategories/categories to a group ?

ie. category 1 restrict to group 1 only, group 2 cannot access nor see category 1

Progress in Django 1.5.5

Hello,

looks like this App works very solid on Django 1.5.5 there are some bugs that I have found and I'm just not that far with Django that I could debug them.

If I take a look at quiz/progress I get this Error:

ZeroDivisionError at /quiz/progress

float division

Request Method: GET
Request URL: http://127.0.0.1:8000/de/quiz/progress
Django Version: 1.5.5
Exception Type: ZeroDivisionError
Exception Value: float division

The 2 Files that I get the error from are views.py and models.py.

Models.py this:

percent = int(round((float(score) / float(possible)) * 100))

Views.py this:

cat_scores = progress.list_all_cat_scores() # dict {category name: list of three integers [score, possible, percent]}

Would it be possible to get this App runing 100% with Django 1.5.5?

Quiz Page and Quiz by Category.

Hello.

I have been testing this app for using it in an application.

I noticed that there is no template when we navigate to the quiz page i.e. myapp.com/quiz.

Also, is it possible to list all quizzes in a particular category, like myapp.com/quiz/mycategory/ would show all quizzes listed in that category, and upon clicking the link would take me to that quiz.

Is it an issue, or just the features are not implemented? Please let me know.

Regards.

change the figure field

I try to drop the figure field in multiple-choice and replace it with a new charfield figure_url to save url of figure saved in another website (I also changed admin and template accordingly). First, I ran "python manage.py makemigrations + migrate", no migration applied, then I used "python manage.py makemigrations quiz + migrate". Got the following message for failing of running migration. Thanks.

Operations to perform:
Synchronize unmigrated apps: django_markdown, staticfiles, multichoice, smart_selects, messages, true_false, crispy_fo
rms, mptt, essay
Apply all migrations: rango, sites, quiz, tagging, admin, registration, contenttypes, auth, biology, blog, sessions, d
jango_comments, zinnia, flatpages
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states...Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "...\lib\site-packages\django\core\management__init__.py", line 338, in execute_
from_command_line
utility.execute()
File "...\lib\site-packages\django\core\management__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "...\lib\site-packages\django\core\management\base.py", line 390, in run_from_arg
v
self.execute(_args, *_cmd_options)
File "...\lib\site-packages\django\core\management\base.py", line 441, in execute
output = self.handle(_args, *_options)
File "...\lib\site-packages\django\core\management\commands\migrate.py", line 221, in
handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File "...\lib\site-packages\django\db\migrations\executor.py", line 100, in migrate
state.apps # Render all real_apps -- performance critical
File "...\lib\site-packages\django\utils\functional.py", line 60, in get
res = instance.dict[self.name] = self.func(instance)
File "...\lib\site-packages\django\db\migrations\state.py", line 166, in apps
return StateApps(self.real_apps, self.models)
File "...\lib\site-packages\django\db\migrations\state.py", line 232, in init
self.render_multiple(list(models.values()) + self.real_models)
File "...\lib\site-packages\django\db\migrations\state.py", line 270, in render_multip
le
"for more" % (new_unrendered_models, get_docs_version())
django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'multichoice.MCQuestion'>, <ModelSt
ate: 'true_false.TF_Question'>, <ModelState: 'essay.Essay_Question'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
in an app with no migrations; see https://docs.djangoproject.com/en/1.8/topics/migrations/#dependencies for more

category name with white spaces return an error

creating a new category with spaces retunr an error

Exception Type: NoReverseMatch
Exception Value: Reverse for 'quiz_category_list_matching' with arguments '()' and keyword arguments '{'category_name': 'Il corso degli eventi'}' not found. 1 pattern(s) tried: ['it/category/(?P<category_name>[\w.-]+)/$']

quiz/templates/quiz/category_list.html, error at line 11

a solution should be to have 3 fields in quiz_category DB:

  • id
  • name
  • label
    where name acts like url-friendly url for wordpress posts (the url is build in lowercase and whitespaces are replaced by - char)
    name should be automatically suggested as in wordpress

Quiz Submit Redirection

Hello.
When I submit an answer to a quiz, the url changes from /quiz/quiz-name to /quiz-name/take/?guess=4

Because of this, the template does not load. Where do I change this behaviour? Please help.

Add quiz timer option

As a user it would be great if I could set a time limit in which to complete the test, which once the set time elapses the test concludes and the score is generated.
P.S a back and forward button would be really helpful especially when your not 100% sure of an answer
Thanks

Getting error while creating a quiz and taking it.

I' m noob to Django and was trying to run the app. I simply downloaded the app and getting the following error.

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/quiz/test1/take/

Django Version: 1.9.1
Python Version: 2.7.10
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'true_false',
'quiz',
'multichoice',
'essay',
'aetsv_apps_2.agriera_apps.mysite',
'aetsv_apps_2.agriera_apps.myapp']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:

File "/home/mahesh/anaconda2/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = self.process_exception_by_middleware(e, request)
    

File "/home/mahesh/anaconda2/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    

File "/home/mahesh/anaconda2/lib/python2.7/site-packages/django/views/generic/base.py" in view

  1.         return self.dispatch(request, _args, *_kwargs)
    

File "/home/mahesh/anaconda2/lib/python2.7/site-packages/django_quiz_app-0.5.1-py2.7.egg/quiz/views.py" in dispatch

  1.                                                     self.quiz)
    

File "/home/mahesh/anaconda2/lib/python2.7/site-packages/django_quiz_app-0.5.1-py2.7.egg/quiz/models.py" in user_sitting

  1.         sitting = self.new_sitting(user, quiz)
    

File "/home/mahesh/anaconda2/lib/python2.7/site-packages/django_quiz_app-0.5.1-py2.7.egg/quiz/models.py" in new_sitting

  1.     if len(question_set) == 0:
    

File "/home/mahesh/anaconda2/lib/python2.7/site-packages/django/db/models/query.py" in len

  1.     self._fetch_all()
    

File "/home/mahesh/anaconda2/lib/python2.7/site-packages/django/db/models/query.py" in _fetch_all

  1.         self._result_cache = list(self.iterator())
    

File "/home/mahesh/anaconda2/lib/python2.7/site-packages/model_utils/managers.py" in iterator

  1.                 sub_obj = self._get_sub_obj_recurse(obj, s)
    

File "/home/mahesh/anaconda2/lib/python2.7/site-packages/model_utils/managers.py" in _get_sub_obj_recurse

  1.         node = getattr(obj, rel)
    

Exception Type: AttributeError at /quiz/test1/take/
Exception Value: 'long' object has no attribute 'essay_question'

Give the user the option to save a question to review later

Story: "As a user, when taking a quiz/exam, I'd like to save a question to review later so I can move on to the next question. I'd like to see the list of questions so I can go back and forth or go directly to one specific question and I'd like to see a status showing if the question is answered or marked to review. After I finish answering all the questions (in no particular order), I'd like to click on a button to finish the quiz/exam and go to the results page."

How is it best to approach that, storing in session?

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.