Kernel::System::Survey::Vote

NAME

Kernel::System::Survey::Vote – sub module of Kernel::System::Survey

SYNOPSIS

All survey vote functions.

PUBLIC INTERFACE

VoteGet()

to get all attributes of a vote

    my @Vote = $SurveyObject->VoteGet(
        RequestID => 13,
        QuestionID => 23
    );

returns:

    @Vote = (
        {
            RequestID => 123,
            VoteValue => 'Yes',
        },
        ...
    );

VoteGetAll()

to get all votes for a request id, including question data

    my @List = $SurveyObject->VoteGetAll(
        RequestID => 1,
    );

    Returns:
        [
            {
                'VoteID'       => 1,
                'VoteValue'    => 'Testvalue',
                'QuestionID'   => 1,
                'Question'     => 'Funny question #1',
                'QuestionType' => 'Checkbox',
            },
            ...
        ]

VoteList()

to get a array list of all vote items

    my @List = $SurveyObject->VoteList(
        SurveyID => 1,
        Embedded => 1, # optional to get vote of embedded question type, default 0
    );

returns:

    @List = (
        {
            RequestID => 123,
            TicketID  => 123,
            SendTime  => '2017-01-01 12:00:00',
            VoteTime  => '2017-01-02 12:00:00',
        },
        ...
    );

VoteAttributeGet()

to get all attributes of a vote

    my $VoteAttributeContent = $SurveyObject->VoteAttributeGet(
        VoteID => 13,
    );

returns: $VoteAttributeContent = 'Yes';

VoteCount()

to count all votes of a survey

    my $VoteCount = $SurveyObject->VoteCount(
        QuestionID => 123,
        VoteValue => 'The Value',
    );

VoteDelete()

delete vote by request id

    my $VoteDelete = $SurveyObject->VoteDelete(
        RequestID => 123,
    );
Scroll to Top