dispel.providers.generic.surveys module#

Core functionality to process surveys.

class dispel.providers.generic.surveys.ConcatenateSurveyLevels[source]#

Bases: LevelFilterProcessingStepMixin, ProcessingStep

Concatenate individual survey question and response levels.

This step creates a single raw data set out of individual levels to simplify the analysis of responses.

Parameters:
  • context_id – The context id that identifies which question was posed to the user.

  • level_filter (dispel.processing.level.LevelFilter) – An optional filter to only apply the concatenation to specific levels.

__init__(context_id, level_filter=None)[source]#
Parameters:
get_levels(reading)[source]#

Get the levels used for the concatenation.

Parameters:

reading (Reading) –

Return type:

Iterable[Level]

get_raw_data_sets(reading)[source]#

Get the raw data sets used for the concatenation.

Parameters:

reading (Reading) –

Return type:

List[RawDataSet]

process_reading(reading, **kwargs)[source]#

Concatenate individual levels.

Parameters:

reading (Reading) –

Return type:

Generator[ProcessingResult | ProcessingControlResult, None, None]

class dispel.providers.generic.surveys.ExtractSurveyResponse[source]#

Bases: ExtractStep

Extract the actual value of the survey question.

__init__(question)[source]#
Parameters:

question (SurveyQuestion) –

class dispel.providers.generic.surveys.ExtractSurveyResponseMeasures[source]#

Bases: ProcessingStepGroup

Extract measures for individual questions.

__init__(question)[source]#
Parameters:

question (SurveyQuestion) –

class dispel.providers.generic.surveys.ExtractSurveyResponseSummary[source]#

Bases: ExtractMultipleStep

Extract measures on response changes.

__init__(question)[source]#
Parameters:

question (SurveyQuestion) –

class dispel.providers.generic.surveys.ExtractSurveyResponseTimesSummary[source]#

Bases: ExtractMultipleStep

Extract measures on response times to questions.

__init__(question)[source]#
Parameters:

question (SurveyQuestion) –

class dispel.providers.generic.surveys.SurveyQuestion[source]#

Bases: object

A data class for survey questions.

__init__(id, label, abbr, full, responses)#
Parameters:
Return type:

None

abbr: str#

The abbreviation of the question.

This is used as the part of the measure name

property av#

Get the abbreviated value representation for the question.

full: str#

The full description of the question posed to the user.

id: str#

The id that identifies the question.

This is the value of the context variable specified for ConcatenateSurveyLevels.

label: str#

An abbreviated form of the question presented to the user.

This is used as part of the measure name.

responses: Dict[Any, str]#

A dictionary of responses and their labels.