Skip to content

Feature/form analytics - #24

Merged
lpi-tn merged 5 commits into
mainfrom
Feature/form-analytics
Sep 2, 2026
Merged

lpi-tn merged 5 commits into
mainfrom
Feature/form-analytics

Conversation

@lpi-tn

@lpi-tn lpi-tn commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces a new AnalyticForm model for storing analytic feedback associated with user sessions, adds the QuestionType enumeration to standardize answer types, and updates related tests. It also makes minor naming adjustments for consistency in document-related tests.

New Analytic Feedback Model and Related Functionality:

  • Added a new AnalyticForm SQLAlchemy model in user_related.py to store analytic feedback forms, including fields for form name, question, answer, answer type, and a relationship to the user session.
  • Introduced the QuestionType enumeration (TEXT, CHECKBOX, PREDEFINED_TEXT) in enumeration.py to standardize the types of possible answers in analytic forms.

Test Enhancements:

  • Added tests for creating, reading, and verifying the session relationship of AnalyticForm entries in test_user_related.py.
  • Updated imports in test_user_related.py to include AnalyticForm and QuestionType.

Consistency Improvements:

  • Changed the field name from quantity to count in three document-related test cases to match the model definition. [1] [2] [3]

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new AnalyticForm model has a nullable/type mismatch for answer_type and a hardcoded FK schema string that should be made consistent to prevent invalid data and future drift.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds support for storing per-session analytic feedback by introducing a new AnalyticForm ORM model and a QuestionType enum to standardize how analytic form answers are typed, with accompanying CRUD/relationship tests and minor test-field naming alignment in document-related tests.

Changes:

  • Added AnalyticForm model under the user_related schema with a session relationship and typed answer_type.
  • Introduced QuestionType (TEXT, CHECKBOX, PREDEFINED_TEXT) to standardize analytic form answer types.
  • Extended tests to cover AnalyticForm creation/querying and its session relationship; aligned document tests from quantity to count.
File summaries
File Description
welearn_database/data/models/user_related.py Adds the AnalyticForm SQLAlchemy model and links it to Session.
welearn_database/data/enumeration.py Adds QuestionType enum used by analytic form answer typing.
tests/test_user_related.py Adds CRUD + relationship tests for AnalyticForm; updates imports accordingly.
tests/test_document_related.py Renames test argument from quantity to count to match model fields.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread welearn_database/data/models/user_related.py
Comment thread welearn_database/data/models/user_related.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@lpi-tn
lpi-tn merged commit 3e764b0 into main Sep 2, 2026
4 checks passed
@lpi-tn
lpi-tn deleted the Feature/form-analytics branch September 2, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants