cms.apps.quizzes package

Submodules

cms.apps.quizzes.admin module

cms.apps.quizzes.cms_initialize module

class cms.apps.quizzes.cms_initialize.CMSInitialize

Bases: cms.core.models.CMSInitializeBase

iter_models()
models = (<class 'cms.apps.quizzes.models.QuizzesCategory'>, <class 'cms.apps.quizzes.models.QuizzesItem'>)

cms.apps.quizzes.cms_plugin module

class cms.apps.quizzes.cms_plugin.CMSPlugin

Bases: cms.core.plugins.CMSPluginBase

admin_icon_class = 'icon-question-sign'
author = 'inMeta.Networks'
author_mail = 'support@inmeta.net'
author_www = 'https://www.inmeta.net'
description = <django.utils.functional.__proxy__ object at 0x95a12d0>
license = 'Simplified BSD'
status = 'beta'
verbose_name = <django.utils.functional.__proxy__ object at 0x95a15d0>
version = '0.2'

cms.apps.quizzes.cms_sitemaps module

class cms.apps.quizzes.cms_sitemaps.QuizzesItemSitemap

Bases: cms.contrib.sitemaps.sitemap.SitemapBase

get_only_fields()

cms.apps.quizzes.exceptions module

exception cms.apps.quizzes.exceptions.QuizzesItemAlreadyEvaluated

Bases: exceptions.Exception

exception cms.apps.quizzes.exceptions.QuizzesItemDeadlineNotReached

Bases: exceptions.Exception

exception cms.apps.quizzes.exceptions.QuizzesItemNoDealine

Bases: exceptions.Exception

cms.apps.quizzes.filters module

class cms.apps.quizzes.filters.QuizzesSessionPassedFilter(request, params, model, model_admin)

Bases: django.contrib.admin.filters.SimpleListFilter

lookups(request, model_admin)
parameter_name = 'passed'
queryset(request, queryset)
title = <django.utils.functional.__proxy__ object at 0xa7236d0>

cms.apps.quizzes.forms module

class cms.apps.quizzes.forms.QuizzesAnonUsersForm(*args, **kwargs)

Bases: cms.core.forms.CMSSecurityModelForm

class Meta
fields = ['first_name', 'last_name', 'email']
model

alias of QuizzesAnonUsers

QuizzesAnonUsersForm.base_fields = OrderedDict([('first_name', <django.forms.fields.CharField object at 0xa713610>), ('last_name', <django.forms.fields.CharField object at 0x72cf490>), ('email', <django.forms.fields.EmailField object at 0xa713dd0>)])
QuizzesAnonUsersForm.declared_fields = OrderedDict()
QuizzesAnonUsersForm.media
class cms.apps.quizzes.forms.QuizzesQuestionMultichoiceForm(question, *args, **kwargs)

Bases: django.forms.forms.Form

base_fields = OrderedDict()
declared_fields = OrderedDict()
media
class cms.apps.quizzes.forms.QuizzesQuestionMultipleCchoiceForm(question, *args, **kwargs)

Bases: django.forms.forms.Form

base_fields = OrderedDict()
declared_fields = OrderedDict()
media
class cms.apps.quizzes.forms.QuizzesQuestionTextForm(question, *args, **kwargs)

Bases: django.forms.forms.Form

base_fields = OrderedDict()
declared_fields = OrderedDict()
media
class cms.apps.quizzes.forms.QuizzesQuestionTrueFalseForm(question, *args, **kwargs)

Bases: django.forms.forms.Form

base_fields = OrderedDict()
declared_fields = OrderedDict()
media

cms.apps.quizzes.management module

cms.apps.quizzes.management.create_group(sender, **kwargs)

cms.apps.quizzes.managers module

class cms.apps.quizzes.managers.QuizzesAnonUsersManager

Bases: django.db.models.manager.Manager

is_anonuser_email_permitted(email, quiz, session)
class cms.apps.quizzes.managers.QuizzesProgressManager

Bases: django.db.models.manager.Manager

new_progress(user)
class cms.apps.quizzes.managers.QuizzesSessionManager

Bases: django.db.models.manager.Manager

get_anon_session(session_key, quiz, lang)
get_or_create_user_session(user, quiz, lang)
get_user_session(user, quiz, lang)
is_anonuser_session_permitted(session_key, quiz, lang)
is_user_permitted(user, quiz, lang)
new_session(user, quiz, lang)

cms.apps.quizzes.models module

class cms.apps.quizzes.models.QuizzesAnonUsers(*args, **kwargs)

Bases: cms.core.models.BaseData

Used to store name an mail adress of anonym users.

class ApiPrivate
fields = ('email', 'first_name', 'last_name', 'quizsession')
exception QuizzesAnonUsers.DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception QuizzesAnonUsers.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

QuizzesAnonUsers.created_by
QuizzesAnonUsers.get_next_by_created_date(*moreargs, **morekwargs)
QuizzesAnonUsers.get_next_by_modified_date(*moreargs, **morekwargs)
QuizzesAnonUsers.get_previous_by_created_date(*moreargs, **morekwargs)
QuizzesAnonUsers.get_previous_by_modified_date(*moreargs, **morekwargs)
QuizzesAnonUsers.modified_by
QuizzesAnonUsers.objects = <cms.apps.quizzes.managers.QuizzesAnonUsersManager object at 0x9908250>
QuizzesAnonUsers.quizsession
class cms.apps.quizzes.models.QuizzesCategory(*args, **kwargs)

Bases: cms.core.models.Displayable, cms.core.models.Ownable

A category for grouping quiz into a series.

class ApiPrivate
fields = ('quizzesitem',)
exception QuizzesCategory.DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

class QuizzesCategory.Menus
exception QuizzesCategory.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class QuizzesCategory.Settings
MEDIA_PATH = {'default': 'categories'}
SITEMAP_CHANGEFREQ = 'weekly'
SITEMAP_PRIORITY = 0.5
QuizzesCategory.author
QuizzesCategory.created_by
QuizzesCategory.get_absolute_url()
QuizzesCategory.get_keywordsfield_name()
QuizzesCategory.get_mark_display(*moreargs, **morekwargs)
QuizzesCategory.get_next_by_created_date(*moreargs, **morekwargs)
QuizzesCategory.get_next_by_modified_date(*moreargs, **morekwargs)
QuizzesCategory.get_next_by_published_date(*moreargs, **morekwargs)
QuizzesCategory.get_previous_by_created_date(*moreargs, **morekwargs)
QuizzesCategory.get_previous_by_modified_date(*moreargs, **morekwargs)
QuizzesCategory.get_previous_by_published_date(*moreargs, **morekwargs)
QuizzesCategory.get_schema
QuizzesCategory.get_status_display(*moreargs, **morekwargs)
QuizzesCategory.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

QuizzesCategory.modified_by
QuizzesCategory.objects = <cms.core.managers.DisplayableManager object at 0xa407a90>
QuizzesCategory.quizzes
QuizzesCategory.sites
class cms.apps.quizzes.models.QuizzesItem(*args, **kwargs)

Bases: cms.core.models.Content, cms.core.models.Ownable, cms.core.models.Ratable, cms.core.models.Commentable

A quiz.

class ApiPrivate
fields = ('answers_at_end', 'answer_after_question', 'attempts', 'category', 'completed_date', 'contentfail', 'contentsuccess', 'deadline_date', 'questions', 'random_order', 'require_success', 'store_results')
exception QuizzesItem.DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

class QuizzesItem.Menus
exception QuizzesItem.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class QuizzesItem.Settings
MEDIA_PATH = {'default': 'items'}
SITEMAP_CHANGEFREQ = 'weekly'
SITEMAP_PRIORITY = 0.5
class QuizzesItem.Translation
fields = ('contentfail', 'contentsuccess')
QuizzesItem.anon_q_data()
QuizzesItem.anon_q_list()
QuizzesItem.anon_score_id()
QuizzesItem.anon_time_data()
QuizzesItem.author
QuizzesItem.category
QuizzesItem.comments

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

QuizzesItem.complete_and_send(request)

Sends the notification mails to the users.

QuizzesItem.created_by
QuizzesItem.get_absolute_url()
QuizzesItem.get_commentsfield_name()
QuizzesItem.get_keywordsfield_name()
QuizzesItem.get_loosers_for_second_chance(lang, for_stats=False)
QuizzesItem.get_mark_display(*moreargs, **morekwargs)
QuizzesItem.get_max_score
QuizzesItem.get_next_by_created_date(*moreargs, **morekwargs)
QuizzesItem.get_next_by_deadline_date(*moreargs, **morekwargs)
QuizzesItem.get_next_by_modified_date(*moreargs, **morekwargs)
QuizzesItem.get_next_by_published_date(*moreargs, **morekwargs)
QuizzesItem.get_previous_by_created_date(*moreargs, **morekwargs)
QuizzesItem.get_previous_by_deadline_date(*moreargs, **morekwargs)
QuizzesItem.get_previous_by_modified_date(*moreargs, **morekwargs)
QuizzesItem.get_previous_by_published_date(*moreargs, **morekwargs)
QuizzesItem.get_questions()
QuizzesItem.get_ratingfield_name()
QuizzesItem.get_schema
QuizzesItem.get_schema_display(*moreargs, **morekwargs)
QuizzesItem.get_status_display(*moreargs, **morekwargs)
QuizzesItem.get_winners_and_looser(lang, for_stats=False)
QuizzesItem.image

A placeholder class that provides a way to set the attribute on the model.

QuizzesItem.imageteaser

A placeholder class that provides a way to set the attribute on the model.

QuizzesItem.is_running
QuizzesItem.is_running_with_prizes
QuizzesItem.is_user_permitted(user=None, session_key=None, email=None, session=None, lang=None)
QuizzesItem.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

QuizzesItem.license
QuizzesItem.modified_by
QuizzesItem.objects = <cms.core.managers.ContentManager object at 0x7c17950>
QuizzesItem.prizes
QuizzesItem.questions
QuizzesItem.ratings

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

QuizzesItem.save(*args, **kwargs)
QuizzesItem.sessions
QuizzesItem.sites
exception cms.apps.quizzes.models.QuizzesItemAlreadyEvaluated

Bases: exceptions.Exception

exception cms.apps.quizzes.models.QuizzesItemDeadlineNotReached

Bases: exceptions.Exception

exception cms.apps.quizzes.models.QuizzesItemNoDealine

Bases: exceptions.Exception

class cms.apps.quizzes.models.QuizzesPrize(*args, **kwargs)

Bases: cms.core.models.Orderable, cms.core.models.Displayable

A category for prizes.

class ApiPrivate
fields = ('quiz',)
exception QuizzesPrize.DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception QuizzesPrize.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

QuizzesPrize.created_by
QuizzesPrize.get_keywordsfield_name()
QuizzesPrize.get_mark_display(*moreargs, **morekwargs)
QuizzesPrize.get_next_by_created_date(*moreargs, **morekwargs)
QuizzesPrize.get_next_by_modified_date(*moreargs, **morekwargs)
QuizzesPrize.get_next_by_published_date(*moreargs, **morekwargs)
QuizzesPrize.get_previous_by_created_date(*moreargs, **morekwargs)
QuizzesPrize.get_previous_by_modified_date(*moreargs, **morekwargs)
QuizzesPrize.get_previous_by_published_date(*moreargs, **morekwargs)
QuizzesPrize.get_status_display(*moreargs, **morekwargs)
QuizzesPrize.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

QuizzesPrize.modified_by
QuizzesPrize.objects = <cms.core.managers.DisplayableManager object at 0x84bc450>
QuizzesPrize.quiz
QuizzesPrize.sites
class cms.apps.quizzes.models.QuizzesProgress(*args, **kwargs)

Bases: cms.core.models.BaseData

A progress for quizzes.

class ApiPrivate
fields = ('score', 'user')
exception QuizzesProgress.DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception QuizzesProgress.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

QuizzesProgress.created_by
QuizzesProgress.get_next_by_created_date(*moreargs, **morekwargs)
QuizzesProgress.get_next_by_modified_date(*moreargs, **morekwargs)
QuizzesProgress.get_previous_by_created_date(*moreargs, **morekwargs)
QuizzesProgress.get_previous_by_modified_date(*moreargs, **morekwargs)
QuizzesProgress.list_all_cat_scores

Returns a dict in which the key is the category name and the item is a list of three integers. The first is the number of questions correct, the second is the possible best score, the third is the percentage correct. The dict will have one key for every category that you have defined

QuizzesProgress.modified_by
QuizzesProgress.objects = <cms.apps.quizzes.managers.QuizzesProgressManager object at 0x84bcc10>
QuizzesProgress.show_exams()

Finds the previous quizzes marked as ‘exam papers’. Returns a queryset of complete exams.

QuizzesProgress.update_score(quiz, score_to_add=0, possible_to_add=0)

Pass in question object, amount to increase score and max possible. Does not return anything.

QuizzesProgress.user
class cms.apps.quizzes.models.QuizzesQuestion(*args, **kwargs)

Bases: cms.core.models.Content, cms.core.models.Ownable

Base class for all question types. Shared properties placed here.

class ApiPrivate
fields = ('contentexplanation', 'hint')
exception QuizzesQuestion.DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception QuizzesQuestion.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class QuizzesQuestion.Settings
MEDIA_PATH = {'default': 'questions'}
class QuizzesQuestion.Translation
fields = ('contentexplanation', 'hint', '-teaser', '-imageteaser', '-imageteaserdescription')
QuizzesQuestion.author
QuizzesQuestion.created_by
QuizzesQuestion.get_keywordsfield_name()
QuizzesQuestion.get_mark_display(*moreargs, **morekwargs)
QuizzesQuestion.get_next_by_created_date(*moreargs, **morekwargs)
QuizzesQuestion.get_next_by_modified_date(*moreargs, **morekwargs)
QuizzesQuestion.get_next_by_published_date(*moreargs, **morekwargs)
QuizzesQuestion.get_previous_by_created_date(*moreargs, **morekwargs)
QuizzesQuestion.get_previous_by_modified_date(*moreargs, **morekwargs)
QuizzesQuestion.get_previous_by_published_date(*moreargs, **morekwargs)
QuizzesQuestion.get_schema_display(*moreargs, **morekwargs)
QuizzesQuestion.get_slug(**kwargs)
QuizzesQuestion.get_status_display(*moreargs, **morekwargs)
QuizzesQuestion.get_teaser(**kwargs)
QuizzesQuestion.image

A placeholder class that provides a way to set the attribute on the model.

QuizzesQuestion.imageteaser

A placeholder class that provides a way to set the attribute on the model.

QuizzesQuestion.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

QuizzesQuestion.license
QuizzesQuestion.modified_by
QuizzesQuestion.objects = <cms.core.managers.InheritanceManager object at 0xa407890>
QuizzesQuestion.quizzesitem_set
QuizzesQuestion.quizzesquestionmultichoice
QuizzesQuestion.quizzesquestiontext
QuizzesQuestion.quizzesquestiontruefalse
QuizzesQuestion.related_label()
QuizzesQuestion.sites
class cms.apps.quizzes.models.QuizzesQuestionMultichoice(id, keywords_string, created_date, modified_date, created_by_id, modified_by_id, description, description_auto, login_required, title, slug, status, published_date, expired_date, sitemapped, mark, content, teaser, teaser_auto, image, imagedescription, imageteaser, imageteaserdescription, license_id, schema, author_id, contentexplanation, hint, quizzesquestion_ptr_id, answer_order, multiple_answers)

Bases: cms.apps.quizzes.models.QuizzesQuestion

ANSWER_ORDER_CHOICES = (('content', <django.utils.functional.__proxy__ object at 0xa407450>), ('random', <django.utils.functional.__proxy__ object at 0xa2dfc90>), ('none', <django.utils.functional.__proxy__ object at 0xa2df250>))
class ApiPrivate
fields = ('answer_order',)
exception QuizzesQuestionMultichoice.DoesNotExist

Bases: cms.apps.quizzes.models.DoesNotExist

exception QuizzesQuestionMultichoice.MultipleObjectsReturned

Bases: cms.apps.quizzes.models.MultipleObjectsReturned

class QuizzesQuestionMultichoice.Translation
fields = ('-image',)
QuizzesQuestionMultichoice.answer_choice_to_string(guess)
QuizzesQuestionMultichoice.answers
QuizzesQuestionMultichoice.check_if_correct(guess)
QuizzesQuestionMultichoice.get_answer_order_display(*moreargs, **morekwargs)
QuizzesQuestionMultichoice.get_answers()
QuizzesQuestionMultichoice.get_answers_list()
QuizzesQuestionMultichoice.get_keywordsfield_name()
QuizzesQuestionMultichoice.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

QuizzesQuestionMultichoice.objects = <django.db.models.manager.Manager object at 0xa2df190>
QuizzesQuestionMultichoice.order_answers(queryset)
QuizzesQuestionMultichoice.quizzesquestion_ptr
QuizzesQuestionMultichoice.save(*args, **kwargs)
class cms.apps.quizzes.models.QuizzesQuestionMultichoiceAnswer(id, created_date, modified_date, created_by_id, modified_by_id, content, correct, question_id)

Bases: cms.core.models.BaseData

class ApiPrivate
fields = ('content', 'correct', 'question')
exception QuizzesQuestionMultichoiceAnswer.DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception QuizzesQuestionMultichoiceAnswer.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class QuizzesQuestionMultichoiceAnswer.Translation
fields = ('content',)
QuizzesQuestionMultichoiceAnswer.created_by
QuizzesQuestionMultichoiceAnswer.get_next_by_created_date(*moreargs, **morekwargs)
QuizzesQuestionMultichoiceAnswer.get_next_by_modified_date(*moreargs, **morekwargs)
QuizzesQuestionMultichoiceAnswer.get_previous_by_created_date(*moreargs, **morekwargs)
QuizzesQuestionMultichoiceAnswer.get_previous_by_modified_date(*moreargs, **morekwargs)
QuizzesQuestionMultichoiceAnswer.modified_by
QuizzesQuestionMultichoiceAnswer.objects = <django.db.models.manager.Manager object at 0x967e210>
QuizzesQuestionMultichoiceAnswer.question
class cms.apps.quizzes.models.QuizzesQuestionText(id, keywords_string, created_date, modified_date, created_by_id, modified_by_id, description, description_auto, login_required, title, slug, status, published_date, expired_date, sitemapped, mark, content, teaser, teaser_auto, image, imagedescription, imageteaser, imageteaserdescription, license_id, schema, author_id, contentexplanation, hint, quizzesquestion_ptr_id)

Bases: cms.apps.quizzes.models.QuizzesQuestion

class ApiPrivate
fields = ('correct',)
exception QuizzesQuestionText.DoesNotExist

Bases: cms.apps.quizzes.models.DoesNotExist

exception QuizzesQuestionText.MultipleObjectsReturned

Bases: cms.apps.quizzes.models.MultipleObjectsReturned

class QuizzesQuestionText.Translation
fields = ('-image',)
QuizzesQuestionText.answer_choice_to_string(guess)
QuizzesQuestionText.check_if_correct(guess)
QuizzesQuestionText.get_answers()
QuizzesQuestionText.get_answers_list()
QuizzesQuestionText.get_keywordsfield_name()
QuizzesQuestionText.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

QuizzesQuestionText.objects = <django.db.models.manager.Manager object at 0x967e910>
QuizzesQuestionText.quizzesquestion_ptr
class cms.apps.quizzes.models.QuizzesQuestionTrueFalse(id, keywords_string, created_date, modified_date, created_by_id, modified_by_id, description, description_auto, login_required, title, slug, status, published_date, expired_date, sitemapped, mark, content, teaser, teaser_auto, image, imagedescription, imageteaser, imageteaserdescription, license_id, schema, author_id, contentexplanation, hint, quizzesquestion_ptr_id, correct)

Bases: cms.apps.quizzes.models.QuizzesQuestion

class ApiPrivate
fields = ('correct',)
exception QuizzesQuestionTrueFalse.DoesNotExist

Bases: cms.apps.quizzes.models.DoesNotExist

exception QuizzesQuestionTrueFalse.MultipleObjectsReturned

Bases: cms.apps.quizzes.models.MultipleObjectsReturned

class QuizzesQuestionTrueFalse.Translation
fields = ('-image',)
QuizzesQuestionTrueFalse.answer_choice_to_string(guess)
QuizzesQuestionTrueFalse.check_if_correct(guess)
QuizzesQuestionTrueFalse.get_answers()
QuizzesQuestionTrueFalse.get_answers_list()
QuizzesQuestionTrueFalse.get_keywordsfield_name()
QuizzesQuestionTrueFalse.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

QuizzesQuestionTrueFalse.objects = <django.db.models.manager.Manager object at 0x7c04150>
QuizzesQuestionTrueFalse.quizzesquestion_ptr
class cms.apps.quizzes.models.QuizzesSession(*args, **kwargs)

Bases: cms.core.models.BaseData

Used to store the progress of logged in users session a quiz. Replaces the session system used by anon users. Question_order is a list of integer pks of all the questions in the quiz, in order. Question_list is a list of integers which represent id’s of the unanswered questions in csv format. Incorrect_questions is a list in the same format. QuizzesSession deleted when quiz finished unless quiz.store_results is true. User_answers is a json object in which the question PK is stored with the answer the user gave.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception QuizzesSession.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

QuizzesSession.add_incorrect_question(question)

Adds uid of incorrect question to the list. The question object must be passed in.

QuizzesSession.add_to_score(points)
QuizzesSession.add_user_answer(question, guess)
QuizzesSession.anonuser
QuizzesSession.check_if_passed()
QuizzesSession.created_by
QuizzesSession.get_answer(question)
QuizzesSession.get_current_score
QuizzesSession.get_first_question()

Returns the next question. If no question is found, returns False Does NOT remove the question from the front of the list.

QuizzesSession.get_incorrect_questions

Returns a list of non empty integers, representing the pk of questions

QuizzesSession.get_is_allowed_for_prizes_display()
QuizzesSession.get_max_score
QuizzesSession.get_next_by_created_date(*moreargs, **morekwargs)
QuizzesSession.get_next_by_modified_date(*moreargs, **morekwargs)
QuizzesSession.get_percent_correct()
QuizzesSession.get_previous_by_created_date(*moreargs, **morekwargs)
QuizzesSession.get_previous_by_modified_date(*moreargs, **morekwargs)
QuizzesSession.get_questions(with_answers=False)
QuizzesSession.is_allowed_for_prizes
QuizzesSession.mark_quiz_complete()
QuizzesSession.modified_by
QuizzesSession.objects = <cms.apps.quizzes.managers.QuizzesSessionManager object at 0xa2eee90>
QuizzesSession.progress()

Returns the number of questions answered so far and the total number of questions.

QuizzesSession.questions_with_user_answers
QuizzesSession.quiz
QuizzesSession.remove_first_question()
QuizzesSession.remove_incorrect_question(question)
QuizzesSession.result_message()
QuizzesSession.set_incorrect_question_for_anon(ids)
QuizzesSession.set_question_order_for_anon(ids)
QuizzesSession.user
QuizzesSession.userinfo

cms.apps.quizzes.tasks module

cms.apps.quizzes.tasks.get_addr(session)
cms.apps.quizzes.tasks.job_send_notification(addr_to, context, subject, template, count_current, count_all, lang, quiz_pk, session_pk, prize_pk=None)
cms.apps.quizzes.tasks.send_completed(item, request)

Does the actual work

cms.apps.quizzes.tokens module

class cms.apps.quizzes.tokens.QuizzesSessionTokenGenerator

Bases: django.contrib.auth.tokens.PasswordResetTokenGenerator

check_token(user, token)

Check that a password reset token is correct for a given user.

cms.apps.quizzes.urls module

cms.apps.quizzes.utils module

cms.apps.quizzes.utils.anon_session_score(session, to_add=0, possible=0)

Returns the session score for non-signed in users. If number passed in then add this to the running total and return session score. examples:

anon_session_score(1, 1) will add 1 out of a possible 1 anon_session_score(0, 2) will add 0 out of a possible 2 x, y = anon_session_score() will return the session score

without modification

Left this as an individual function for unit testing

cms.apps.quizzes.views module

class cms.apps.quizzes.views.QuizzesBaseView(**kwargs)

Bases: cms.core.views.GenericTemplateView

get_category(category)
get_data(request, category)
is_permitted_to_start(request)
use_deferred_manager = True
class cms.apps.quizzes.views.QuizzesItemBaseView(**kwargs)

Bases: cms.apps.quizzes.views.QuizzesBaseView

anon_load_session()
get_data2(request, category, slug)
new_anon_quiz_session()

Sets the session variables when starting a quiz for the first time as a non signed-in user

redirect_to_detail()
redirect_to_result()
redirect_to_take()
class cms.apps.quizzes.views.QuizzesItemDetailView(**kwargs)

Bases: cms.apps.quizzes.views.QuizzesBaseView, cms.core.views.GenericTemplateTooltipView

get(request, category, slug)
post(request, category, slug, pk)
template_name = 'quizzes/item_detail.html'
use_deferred_manager = False
class cms.apps.quizzes.views.QuizzesItemListView(**kwargs)

Bases: cms.apps.quizzes.views.QuizzesBaseView

get(request, category, page=None)
schema_body = 'CollectionPage'
schema_main = 'ItemList'
template_name = 'quizzes/item_list.html'
class cms.apps.quizzes.views.QuizzesItemResultTokenView(**kwargs)

Bases: cms.apps.quizzes.views.QuizzesItemResultView

final_result()
get(request, category, slug, uidb64, token)
get_quiz_session(request)
class cms.apps.quizzes.views.QuizzesItemResultView(**kwargs)

Bases: cms.apps.quizzes.views.QuizzesItemBaseView

final_result_anon()
final_result_data_input()
final_result_user()
get(request, category, slug)
get_anonuser_form()
get_quiz_session(request)
post(request, category, slug)
template_name = 'quizzes/item_detail_result.html'
use_deferred_manager = False
class cms.apps.quizzes.views.QuizzesItemTakeView(**kwargs)

Bases: django.views.generic.edit.FormMixin, cms.apps.quizzes.views.QuizzesItemBaseView

anon_load_session()
anon_next_question()
anon_session_progress()
form_invalid(form, request)
form_valid(form, request)
form_valid_anon(form)
form_valid_user(form)
get(request, category, slug)
get_form(form_class)
get_form_kwargs()
get_quiz_session(request)
post(request, category, slug)
process_quiz(request)
template_name = 'quizzes/item_detail_take.html'
template_name_ajax_form = 'quizzes/includes/question.html'

Module contents