Kernel::System::Survey::Answer

NAME

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

SYNOPSIS

All survey answer functions.

PUBLIC INTERFACE

AnswerAdd()

to add a new answer to a question

    my $Success = $SurveyObject->AnswerAdd(
        UserID => 1,
        QuestionID => 10,
        Answer => 'The Answer',
    );

AnswerDelete()

to delete a answer from a question

    my $Success = $SurveyObject->AnswerDelete(
        QuestionID => 10,
        AnswerID => 4,
    );

AnswerGet()

to get all attributes of a answer

    my %Answer = $SurveyObject->AnswerGet(
        AnswerID => 123
    );

returns:

    %Answer = (
        AnswerID   => 1,
        QuestionID => 2,
        Answer     => CheckBoxOne,
        Position   => 255,
        CreateTime => '2017-01-01 12:00:00',
        CreateBy   => 1,
        ChangeTime => '2017-01-01 12:00:00',
        ChangeBy   => 1,
    );

AnswerUpdate()

to update an existing answer

    my $Success = $SurveyObject->AnswerUpdate(
        UserID => 1,
        AnswerID => 6,
        QuestionID => 4,
        Answer => 'The Answer',
    );

AnswerList()

to get a array list of all answer items

    my @List = $SurveyObject->AnswerList(
        QuestionID => 1
    );

returns:

    @List = (
        {
            AnswerID   => 1,
            QuestionID => 2,
            Answer     => 'The Answer',
        },
        ...
    );

AnswerSort()

to sort all answers from a question

    my $Success = $SurveyObject->AnswerSort(
        QuestionID => 1,
    );

AnswerUp()

to move a answer up

    my $Success = $SurveyObject->AnswerUp(
        QuestionID => 4,
        AnswerID => 1,
    );

AnswerDown()

to move a answer down

    my $Success = $SurveyObject->AnswerDown(
        QuestionID => 4,
        AnswerID => 1,
    );

AnswerCount()

to count all answers of a question

    my $CountAnswer = $SurveyObject->AnswerCount(
        QuestionID => 123
    );

PublicAnswerSet()

to save a public vote

    my $Success = $SurveyObject->PublicAnswerSet(
        PublicSurveyKey => 'aVkdE82Dw2qw6erCda',
        QuestionID => 4,
        VoteValue => 'The Value',
    );
Scroll to Top