Example #1
0
from kitsune.karma.actions import KarmaAction
from kitsune.karma.manager import KarmaManager


class TestAction1(KarmaAction):
    """A test action for testing!"""
    action_type = 'test-action-1'
    default_points = 3


class TestAction2(KarmaAction):
    """Another test action for testing!"""
    action_type = 'test-action-2'
    default_points = 7


KarmaManager.action_types = {}  # Clear them out for tests.
KarmaManager.register(TestAction1)
KarmaManager.register(TestAction2)
Example #2
0
from kitsune.karma.actions import KarmaAction
from kitsune.karma.manager import KarmaManager


class TestAction1(KarmaAction):
    """A test action for testing!"""

    action_type = "test-action-1"
    default_points = 3


class TestAction2(KarmaAction):
    """Another test action for testing!"""

    action_type = "test-action-2"
    default_points = 7


KarmaManager.action_types = {}  # Clear them out for tests.
KarmaManager.register(TestAction1)
KarmaManager.register(TestAction2)
Example #3
0
class FirstAnswerAction(KarmaAction):
    """The user posted the first answer to a question."""
    action_type = 'first-answer'
    default_points = 5


class AnswerMarkedHelpfulAction(KarmaAction):
    """The user's answer was voted as helpful."""
    action_type = 'helpful-answer'
    default_points = 10


class AnswerMarkedNotHelpfulAction(KarmaAction):
    """The user's answer was voted as not helpful."""
    action_type = 'nothelpful-answer'
    default_points = -10


class SolutionAction(KarmaAction):
    """The user's answer was marked as the solution."""
    action_type = 'solution'
    default_points = 25


KarmaManager.register(AnswerAction)
KarmaManager.register(FirstAnswerAction)
KarmaManager.register(AnswerMarkedHelpfulAction)
KarmaManager.register(AnswerMarkedNotHelpfulAction)
KarmaManager.register(SolutionAction)