Canvas Data 2 Nested Data Patterns

patdura
Community Member

Will nested data always have the same pattern? 

Will nested data ever have deeply nested data (nested within nested data)? Other than Quiz tables which seem to have deeply nested data.


Can you confirm the schema of the nested data which is being sent as string?

Example 1: requirements_met column:

"[{"id":913185,"type":"must_view"},{"id":913186,"type":"min_score","min_score":80.0}]"

Will this always be an array of structs:

Array:

   struct:

      id:

      type:

       ....

 

Example 2: question_data column

"{"answers":[{"weight":100,"id":7482,"text":"Strongly agree","blank_id":"resources"},{"weight":0,"id":2552,"text":"Agree","blank_id":"resources"},{"weight":0,"id":2713,"text":"Neither agree nor disagree","blank_id":"resources"},{"weight":0,"id":7861,"text":"Disagree","blank_id":"resources"},{"weight":0,"id":8903,"text":"Strongly disagree","blank_id":"resources"},{"weight":0,"id":1367,"text":"Strongly agree","blank_id":"resources"},{"weight":0,"id":4647,"text":"Agree","blank_id":"resources"},{"weight":0,"id":4658,"text":"Neither agree nor disagree","blank_id":"resources"},{"weight":0,"id":5426,"text":"Disagree","blank_id":"resources"},{"weight":0,"id":1674,"text":"Strongly disagree","blank_id":"resources"}],"correct_comments":"","incorrect_comments":"","question_text":"<p>Please rate your agreement with the following statements.</p>\n<table style=\"height: 295px; width: 95%; border-collapse: collapse; border-style: solid;\" border=\"1\">\n<tbody>\n<tr style=\"height: 29px;\">\n<td style=\"width: 50%; height: 29px;\">Accessing the learner labs was easy</td>\n<td style=\"width: 50%; height: 29px;\">[accessing labs]</td>\n</tr>\n<tr style=\"height: 29px;\">\n<td style=\"width: 50%; height: 29px;\">The … assignment</td>\n<td style=\"width: 50%; height: 35px;\">[resources]</td>\n</tr>\n<tr style=\"height: 35px;\">\n<td style=\"width: 50%; height: 35px;\">The learner labs allowed me to practice skills I could not have otherwise</td>\n<td style=\"width: 50%; height: 29px;\">[practice skills]</td>\n</tr>\n<tr style=\"height: 29px;\">\n<td style=\"width: 50%; height: 29px;\">The … adding value to my learning experience</td>\n<td style=\"width: 50%; height: 29px;\">[added value]</td>\n</tr>\n</tbody>\n</table>","question_type":"multiple_dropdowns_question","question_name":"Question 1","migration_id":"mastercourse_15691_193_0bc7a7527db1afe986d24c1eef022029","question_bank_name":"Unfiled Questions","points_possible":0.0,"prepped_for_import":true}"

 

Will this answers(struct) always be an array of struct?

Struct:
  Array:
     Struct:
        weight:
        id:
        text:
        ....

 

0 Likes