citric.objects
Python classes associated with LimeSurvey objects (surveys, questions, etc.).
Classes
Participant
|
Participant data. |
AnswerOption
|
A single answer option for a list or dropdown question. |
Question
|
A LimeSurvey question that can export itself as an LSQ file. |
QuestionL10n
|
Localization data for a question in one language. |
Functions
to_yes_no(*, value)
|
Convert boolean to yes/no string. |
Package Contents
-
class citric.objects.Participant[source]
Participant data.
-
firstname: str[source]
-
lastname: str[source]
-
email: str[source]
-
participant_id: uuid.UUID | None = None[source]
-
language: str | None = 'en'[source]
-
blacklisted: bool = False[source]
-
attributes: dict[str, Any][source]
-
to_dict()[source]
Convert to dictionary.
- Returns:
Dictionary representation of participant.
- Return type:
dict[str, Any]
-
citric.objects.to_yes_no(*, value)[source]
Convert boolean to yes/no string.
-
class citric.objects.AnswerOption[source]
A single answer option for a list or dropdown question.
-
code: str[source]
-
l10ns: dict[str, str][source]
-
sort_order: int = 0[source]
-
assessment_value: int = 0[source]
-
scale_id: int = 0[source]
-
class citric.objects.Question[source]
A LimeSurvey question that can export itself as an LSQ file.
Added in version NEXT_VERSION.
-
title: str[source]
-
type: str[source]
-
l10ns: dict[str, QuestionL10n][source]
-
mandatory: bool = False[source]
-
other: bool = False[source]
-
encrypted: bool = False[source]
-
relevance: str = '1'[source]
-
scale_id: int = 0[source]
-
preg: str | None = None[source]
-
attributes: dict[str, str][source]
-
subquestions: list[Question] = [][source]
-
answer_options: list[AnswerOption] = [][source]
-
to_lsq(*, db_version=DEFAULT_DB_VERSION)[source]
Generate an LSQ XML stream for use with client.import_question().
- Parameters:
db_version (int) – The database version to set in the generated LSQ.
- Returns:
A BytesIO object containing the LSQ-format XML.
- Return type:
io.BytesIO
-
class citric.objects.QuestionL10n[source]
Localization data for a question in one language.
-
question: str = ''[source]
-
help: str = ''[source]
-
script: str = ''[source]