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

Remove the Note qualitative analysis question type from exports #4941

Merged
merged 2 commits into from
May 24, 2024

Conversation

RuthShryock
Copy link
Member

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Notes

To test:

  • Checkout beta and create a project with an audio question
  • Submit a response and add a note in the analysis view
  • Make an export and you can see an extra column created for the note
  • Checkout this branch and restart your development environment
  • Make another export of the project and confirm that note doesn't generate an extra column

Copy link

Comment on lines 505 to 507
if field['type'] == 'qual_note':
# don't include note question type in exports
continue
Copy link
Member

Choose a reason for hiding this comment

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

Hey @RuthShryock, thanks for working on this. Since the this method, analysis_form_json(), is not specific to exports and is also used to generate API responses, could you please:

  1. Add a new parameter to this method; let's call it omit_question_types. This should be able to take a list of types that should be skipped.
  2. Make the default value for the parameter None
  3. Change your logic to continue if field['type'] matches any of the types in omit_question_types
  4. Find where analysis_form_json() is called by the export code, and pass omit_question_types=['qual_note'] to it there.

Let me know if you have any questions :)

@RuthShryock RuthShryock requested a review from jnm May 24, 2024 19:39
Copy link
Member

@jnm jnm left a comment

Choose a reason for hiding this comment

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

Awesome, thank you 🎉

@jnm jnm merged commit b1559d3 into beta May 24, 2024
5 checks passed
@jnm jnm deleted the remove-note-question-type branch May 24, 2024 20:20
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