API - Question Structure - Anaysis API

Structure has now been added to the analysis API  you can use it as:


<structure a=”address_expression” />, where address_expression is a \Q.S reference

Examples:

  • <structure a=”\” /> (or <structure /> or <structure addr=”\” />)
    Gets the structure for all questions
  • <structure a=”\Q1” />
    Gets the structure for all subquestions in Q1
  • <structure a=”\Q1.b” />
    Gets the structure for Q1.b
  • <structure a=”\Q1.a,c,d” />
    Gets the structure for Q1.a, Q1.c and Q1.d
  • <structure a=”\Q1,,Q10” />
    Gets the structure for all subquestions in Q1 to Q10
  • <structure a=”\Q1,Q3,Q5” />
    Gets the structure for all subquestions in Q1, Q3 and Q5
  • <structure a=”\Q1.b” />: Gets the structure for Q1.b
  • <structure a=”\Q1,,Q4,Q7” />
    Gets the structure for all subquestions in Q1, Q2, Q3, Q4 and Q7

The result is slightly different than the result from our existing web API structure:

  • Only categorical rows (n/m) and grid columns (rn/rm) have codes
  • Only grid questions have columns
  • Multi language support

[
  {
    "subquestions": [
      {
        "qno": "1.a",
        "type": "n",
        "tag": "",
        "texts": [
          {
            "lang": "en",
            "value": "Gender"
          },
          {
            "lang": "sv",
            "value": "Gender"
          }
        ],
        "rows": [
          {
            "code": 1,
            "id": "1fc4adb3-dcea-4f12-b57d-21c45f03ab99",
            "tag": "",
            "pos": 1,
            "texts": [
              {
                "lang": "en",
                "value": "Male"
              },
              {
                "lang": "sv",
                "value": "Man"
              }
            ]
          },
          {
            "code": 2,
            "id": "d721f1fa-1d00-498a-a47e-f033bf1bcd8c",
            "tag": "",
            "pos": 2,
            "texts": [
              {
                "lang": "en",
                "value": "Female"
              },
              {
                "lang": "sv",
                "value": "Kvinna"
              }
            ]
          }
        ]
      },
….