Kernel::System::Survey::Question

NAME

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

SYNOPSIS

All survey question functions.

PUBLIC INTERFACE

QuestionAdd()

to add a new question to a survey

    my $Success = $SurveyObject->QuestionAdd(
        UserID => 1,
        SurveyID => 10,
        Question => 'The Question',
        AnswerRequired => 1, # or 0
        Type => 'Radio',
    );

QuestionDelete()

to delete a question from a survey

    my $Success = $SurveyObject->QuestionDelete(
        SurveyID => 1,
        QuestionID => 10,
    );

QuestionGet()

to get all attributes of a question

    my %Question = $SurveyObject->QuestionGet(
        QuestionID => 123
    );

returns:

    %Question = (
        QuestionID     => 1,
        SurveyID       => 2,
        Question       => 'Question',
        Type           => 'YesNo',
        Position       => 12,
        AnswerRequired => 1,
        CreateTime     => '2017-01-01 12:00:00',
        CreateBy       => 1,
        ChangeTime     => '2017-01-01 12:00:00',
        ChangeBy       => 1,
    );

QuestionUpdate()

to update an existing question

    my $Success = $SurveyObject->QuestionUpdate(
        UserID => 1,
        QuestionID => 4,
        SurveyID => 3,
        AnswerRequired => '1', # or '0'
        Question => 'The Question',
    );

QuestionList()

to get a array list of all question items

    my @List = $SurveyObject->QuestionList(
        SurveyID => 1
    );

returns: @List = ( { QuestionID => 123,, SurveyID => 123, Question => 'Question' Type => 'YesNo', AnswerRequired => 1, }, … );

QuestionSort()

to sort all questions from a survey

    my $Success = $SurveyObject->QuestionSort(
        SurveyID => 1,
    );

QuestionUp()

to move a question up

    my $Success = $SurveyObject->QuestionUp(
        SurveyID => 1,
        QuestionID => 4,
    );

QuestionDown()

to move a question down

    my $Success = $SurveyObject->QuestionDown(
        SurveyID => 1,
        QuestionID => 4,
    );

QuestionCount()

to count all questions of a survey

    my $CountQuestion = $SurveyObject->QuestionCount(
        SurveyID => 123
    );

QuestionTypeLookup()

returns the id of the requested question type

    my $ID = $SurveyObject->QuestionTypeLookup(
        SurveyID   => 123,
        Type       => 'YesNo'
    );
Scroll to Top