LimeSurvey API - Master branch

AnswersService
in package
Uses ValidateTrait

Question Aggregate Service

Service class for editing question data.

Dependencies are injected to enable mocking.

Table of Contents

Properties

$modelAnswer  : Answer
$modelAnswerL10n  : AnswerL10n

Methods

__construct()  : mixed
save()  : void
Based on QuestionAdministrationController::actionSaveQuestionData()
validateCodes()  : void
Validate subquestion/answer codes.
storeAnswerL10n()  : void
Store new answer L10n
storeAnswerOption()  : int
Stores a single answer.
storeAnswerOptions()  : void
Store new answer options.

Properties

Methods

validateCodes()

Validate subquestion/answer codes.

public validateCodes(array<string|int, mixed> $requestDataArray) : void
Parameters
$requestDataArray : array<string|int, mixed>

Data from request.

Tags
throws
PersistErrorException

storeAnswerOption()

Stores a single answer.

private storeAnswerOption(Question $question,  $answerId, array<string|int, mixed> $optionArray, int &$count) : int

Different from update during active survey?

Parameters
$question : Question
$answerId :
$optionArray : array<string|int, mixed>
$count : int
Tags
throws
BadRequestException
throws
PersistErrorException
throws
DependencyException
throws
NotFoundException
Return values
int

storeAnswerOptions()

Store new answer options.

private storeAnswerOptions(Question $question, array<string|int, mixed> $optionsArray) : void

Different from update during active survey?

Parameters
$question : Question
$optionsArray : array<string|int, mixed>
Tags
throws
PersistErrorException

        
On this page

Search results