Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix count_questions when no attribute is set for a question #885

Merged
merged 5 commits into from
Dec 21, 2023

Conversation

jochenklar
Copy link
Member

@jochenklar jochenklar commented Dec 15, 2023

  • Fix count_questions when no attribute is set for a question. In 2.1.1 not setting an attribute will cause a (hard to track) 500 on the navigation endpoint.
  • Fix count_questions for question sets. Before when set 1 has the first question answered and set 2 has the second question answered, the computed set count was only 1. Only when one question was answered several times the count increased.

@jochenklar jochenklar added this to the 2.1.1 milestone Dec 15, 2023
@jochenklar jochenklar self-assigned this Dec 15, 2023
Copy link
Member

@MyPyDavid MyPyDavid left a comment

Choose a reason for hiding this comment

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

I've added a minor refactor, it should pass the test , then I approve

for set_index in set_indexes:
if set_index not in counted_sets:
counted_sets.add(set_index)
if not isinstance(child, Question):
Copy link
Member Author

Choose a reason for hiding this comment

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

This is less readable in my opinion. I reverted the changes.

@jochenklar jochenklar merged commit dc2496b into dev-2.1.1 Dec 21, 2023
17 checks passed
@jochenklar jochenklar deleted the fix_progress branch December 21, 2023 13:50
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.

2 participants