{"assignment":{"_schema_version":2,"course_id":37,"date_created":"2022-06-28T19:00:00+00:00","date_modified":"2022-10-17T14:02:38.461725+00:00","extra_instructor_files":"","extra_starting_files":"","forked_id":null,"forked_version":null,"hidden":false,"id":1161,"instructions":"{\n  \"settings\": {\n    \"readingId\": \"bakery_nesting_list_dataclasses_read\"\n  },\n  \"questions\": {\n    \"Count Instances\": {\n      \"type\": \"fill_in_multiple_blanks_question\",\n      \"points\": 3,\n      \"body\": \"Given the following code...\\n\\n```python\\nfrom dataclasses import dataclass\\n\\n@dataclass\\nclass Shape:\\n    color: str\\n    type: str\\n    size: int\\n    \\nshapes = [Shape(\\\"red\\\", \\\"circle\\\", 25),\\n          Shape(\\\"blue\\\", \\\"triangle\\\", 30),\\n          Shape(\\\"green\\\", \\\"square\\\", 27),\\n          Shape(\\\"red\\\", \\\"triangle\\\", 27)]\\n```\\n\\n1. How many lists are there? [countList]\\n2. How many dataclass instances are there? [countInstance]\\n3. How many string literal values are there? [countStrings]\"\n    },\n    \"Evaluate Nested Access\": {\n      \"type\": \"multiple_dropdowns_question\",\n      \"points\": 3,\n      \"body\": \"Given the following code...\\n\\n```python\\nfrom dataclasses import dataclass\\n\\n@dataclass\\nclass Shape:\\n    color: str\\n    type: str\\n    size: int\\n    \\nshapes = [Shape(\\\"red\\\", \\\"circle\\\", 25),\\n          Shape(\\\"blue\\\", \\\"triangle\\\", 30),\\n          Shape(\\\"green\\\", \\\"square\\\", 27),\\n          Shape(\\\"red\\\", \\\"triangle\\\", 27)] \\n```\\n\\nWhat will each of the following expressions produce?\\n\\n1. `shapes[0].color`: [firstColor]\\n2. `shapes[-1].type`: [lastType]\\n3. `shapes.size[0]`: [shapesSize]\\n4. `Shape.color`: [shapeColor]\\n5. `size[shapes]`: [sizeShapes]\",\n      \"answers\": {\n        \"firstColor\": [\n          \"\\\"red\\\"\",\n          \"\\\"blue\\\"\",\n          \"\\\"green\\\"\",\n          \"\\\"circle\\\"\",\n          \"\\\"triangle\\\"\",\n          \"\\\"square\\\"\",\n          \"25\",\n          \"27\",\n          \"30\",\n          \"int\",\n          \"str\",\n          \"An error occurs\"\n        ],\n        \"lastType\": [\n          \"\\\"red\\\"\",\n          \"\\\"blue\\\"\",\n          \"\\\"green\\\"\",\n          \"\\\"circle\\\"\",\n          \"\\\"triangle\\\"\",\n          \"\\\"square\\\"\",\n          \"25\",\n          \"27\",\n          \"30\",\n          \"int\",\n          \"str\",\n          \"An error occurs\"\n        ],\n        \"shapesSize\": [\n          \"\\\"red\\\"\",\n          \"\\\"blue\\\"\",\n          \"\\\"green\\\"\",\n          \"\\\"circle\\\"\",\n          \"\\\"triangle\\\"\",\n          \"\\\"square\\\"\",\n          \"25\",\n          \"27\",\n          \"30\",\n          \"int\",\n          \"str\",\n          \"An error occurs\"\n        ],\n        \"shapeColor\": [\n          \"\\\"red\\\"\",\n          \"\\\"blue\\\"\",\n          \"\\\"green\\\"\",\n          \"\\\"circle\\\"\",\n          \"\\\"triangle\\\"\",\n          \"\\\"square\\\"\",\n          \"25\",\n          \"27\",\n          \"30\",\n          \"int\",\n          \"str\",\n          \"An error occurs\"\n        ],\n        \"sizeShapes\": [\n          \"\\\"red\\\"\",\n          \"\\\"blue\\\"\",\n          \"\\\"green\\\"\",\n          \"\\\"circle\\\"\",\n          \"\\\"triangle\\\"\",\n          \"\\\"square\\\"\",\n          \"25\",\n          \"27\",\n          \"30\",\n          \"int\",\n          \"str\",\n          \"An error occurs\"\n        ]\n      },\n      \"retainOrder\": true\n    },\n    \"Evaluate Iteration Type\": {\n      \"type\": \"fill_in_multiple_blanks_question\",\n      \"points\": 3,\n      \"body\": \"Given the following code...\\n\\n```python\\nfrom dataclasses import dataclass\\n\\n@dataclass\\nclass Animal:\\n    name: str\\n    type: str\\n    weight: float\\n\\nzoo = [ Animal(\\\"Terry\\\", \\\"Giraffe\\\", 80.0),\\n        Animal(\\\"Jerry\\\", \\\"Elephant\\\", 100.0),\\n        Animal(\\\"Kerry\\\", \\\"Penguin\\\", 20.0)\\n]\\nresult = \\\"\\\"\\nfor an_animal in zoo:\\n    result += an_animal.name\\nprint(result)\\n```\\n\\nWhat will be the most accurate *type* of the following variables?\\n\\n1. `an_animal`: [iterVarType]\\n2. `an_animal.weight`: [weightType]\\n3. `zoo`: [listType]\\n4. `result`: [resultType]\"\n    },\n    \"Evaluate Loop Pattern\": {\n      \"type\": \"short_answer_question\",\n      \"points\": 1,\n      \"body\": \"When this code is executed, what will be printed?\\n\\n```python\\nfrom dataclasses import dataclass\\n\\n@dataclass\\nclass Animal:\\n    name: str\\n    type: str\\n    weight: int\\n\\nzoo = [ Animal(\\\"Terry\\\", \\\"Owl\\\", 5),\\n        Animal(\\\"Perry\\\", \\\"Giraffe\\\", 80),\\n        Animal(\\\"Kerry\\\", \\\"Penguin\\\", 20),\\n        Animal(\\\"Harry\\\", \\\"Lion\\\", 50),\\n        Animal(\\\"Larry\\\", \\\"Monkey\\\", 30),\\n        Animal(\\\"Jerry\\\", \\\"Elephant\\\", 100)\\n]\\n\\nresult = []\\ntaking = True\\nfor animal in zoo:\\n    if animal.name[1] == 'a':\\n        taking = False\\n    elif taking:\\n        result.append(animal)\\nbiggest = result[0]\\nfor animal in result:\\n    if animal.weight > biggest.weight:\\n        biggest = animal\\nprint(biggest.type)\\n```\"\n    }\n  }\n}","ip_ranges":"","name":"8A1) Lists of Dataclasses","on_change":"","on_eval":"","on_run":"","owner_id":1,"owner_id__email":"acbart@udel.edu","points":1,"public":true,"reviewed":false,"sample_submissions":[],"settings":"","starting_code":"","subordinate":false,"tags":[],"type":"quiz","url":"bakery_nesting_list_dataclasses_quiz","version":4},"ip":"216.73.216.157","submission":{"_schema_version":3,"assignment_id":1161,"assignment_version":4,"attempts":0,"code":"","correct":false,"course_id":37,"date_created":"2026-05-20T12:51:55.491121+00:00","date_due":"","date_graded":"","date_locked":"","date_modified":"2026-05-20T12:51:55.491121+00:00","date_started":"","date_submitted":"","endpoint":"","extra_files":"","feedback":"","grading_status":"NotReady","id":2036886,"score":0.0,"submission_status":"Started","time_limit":"","url":"submission_url-ee93ccbd-bab4-4b62-b0f5-bc8eacb70e7e","user_id":2044663,"user_id__email":"","version":0},"success":true}
