plexus.reports.blocks.feedback_analysis module

class plexus.reports.blocks.feedback_analysis.FeedbackAnalysis(config: Dict[str, Any], params: Dict[str, Any] | None, api_client: PlexusDashboardClient)

Bases: BaseReportBlock

Analyzes feedback data using Gwet’s AC1 agreement coefficient.

This block retrieves FeedbackItem records and compares initial and final answer values to calculate agreement scores using Gwet’s AC1.

If a specific ‘score_id’ is provided in the config, it analyzes only that score. Otherwise, it analyzes all scores associated with the provided ‘scorecard’ that have a mapping to a Plexus Score with an externalId.

Config:

scorecard (str): Scorecard identifier. This is REQUIRED. days (int, optional): Number of days in the past to analyze (default: 14).

FeedbackItems updated within this period will be considered.

start_date (str, optional): Start date for analysis in YYYY-MM-DD format.

If provided, overrides ‘days’.

end_date (str, optional): End date for analysis in YYYY-MM-DD format.

Defaults to today if not specified.

score_id (str, optional): Specific score ID to analyze.

If specified, only this score will be analyzed.

DEFAULT_DESCRIPTION: str | None = 'Inter-rater Reliability Assessment'
DEFAULT_NAME: str | None = 'Feedback Analysis'
async generate() Tuple[Dict[str, Any] | None, str | None]

Fetches feedback data and performs agreement analysis.