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

Add 'options' property to schema for choices in qualitative analysis select multiple questions #4631

Conversation

jnm
Copy link
Member

@jnm jnm commented Sep 8, 2023

Description

Qualitative analysis questions already had an options property, but choices for select multiple questions did not. This modifies the schema to allow options for both. We'll use options to store a deletion marker instead of purging questions and choices from the database when they are deleted in the UI.

Notes

The options object is not currently validated by the back end's schema. However, I'd suggest using "options": {"deleted": true} as the deletion flag for both questions and choices. Full example:

{
  "advanced_features": {
    "qual": {
      "qual_survey": [
        {
          "uuid": "73fae086-1249-4f97-a7eb-e0d3456c0015",
          "type": "qual_select_multiple",
          "labels": {
            "_default": "this is a select multiple question label"
          },
          "choices": [
            {
              "uuid": "260488e0-0dc7-4faa-85fb-bc1806c0d74e",
              "labels": {
                "_default": "this is a select multiple choice label 1"
              }
            },
            {
              "uuid": "953a8b6d-4b63-4bb1-be05-d25a2dbbd1d0",
              "labels": {
                "_default": "this is a select multiple deleted choice label"
              },
              "options": {
                "deleted": true
              }
            }
          ],
          "scope": "by_question#survey",
          "qpath": "source_question_path"
        },
        {
          "uuid": "507dc90d-2b66-4433-aa03-7a5bb28a1580",
          "type": "qual_text",
          "labels": {
            "_default": "this is a deleted text question label"
          },
          "scope": "by_question#survey",
          "qpath": "source_question_path",
          "options": {
            "deleted": true
          }
        }
      ]
    }
  }
}

Related issues

Fixes #4625

qualitative analysis select multiple questions
@magicznyleszek magicznyleszek merged commit fdb8fcb into feature-analysis-connect-api Sep 11, 2023
@magicznyleszek magicznyleszek deleted the feature-analysis__4625-allow-choice-deletion-marker branch September 11, 2023 21:19
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