{"assignment":{"_schema_version":2,"course_id":37,"date_created":"2022-06-28T19:00:00+00:00","date_modified":"2022-08-24T20:10:59.099507+00:00","extra_instructor_files":"","extra_starting_files":"","forked_id":null,"forked_version":null,"hidden":false,"id":1157,"instructions":"{\n  \"settings\": {\n    \"readingId\": \"bakery_structures_dataclasses_read\"\n  },\n  \"questions\": {\n    \"IdentifyPartsOfDataclass\": {\n      \"type\": \"fill_in_multiple_blanks_question\",\n      \"points\": 3,\n      \"body\": \"Given the following dataclass:\\n\\n```python\\nfrom dataclasses import dataclass\\n\\n@dataclass\\nclass Assignment:\\n    name: str\\n    points: int\\n    late: bool\\n```\\n\\nHow many fields are in the dataclass? [fieldCount]\\n\\nWhat is the type of the first field? [firstFieldType]\\n\\nWhat is the name of the last field? [lastFieldName]\\n\\nWhat is the name of the constructor function? [constructorName]\\n\"\n    },\n    \"DataclassDefinitionRequires\": {\n      \"type\": \"multiple_answers_question\",\n      \"points\": 4,\n      \"body\": \"Which of the following parts of a dataclass definition are required?\",\n      \"answers\": [\n        \"The dataclass decorator\",\n        \"The dataclass import\",\n        \"The name of the dataclass\",\n        \"The `class` keyword\",\n        \"A field named `name` with the type `str`\",\n        \"At least three fields\",\n        \"Indentation under the header\",\n        \"An `if` statement\"\n      ]\n    },\n    \"DefineDataclassTerms\": {\n      \"type\": \"matching_question\",\n      \"points\": 3,\n      \"body\": \"Match each term to the best definition possible.\",\n      \"answers\": [\n        \"Dataclass\",\n        \"Attribute\",\n        \"Field\",\n        \"Decorator\",\n        \"Instance\",\n        \"Constructor\",\n        \"Period\",\n        \"Conditional\"\n      ],\n      \"statements\": [\n        \"A data structure for combining multiple kinds of data together to represent something\",\n        \"A synonym for field\",\n        \"A named bit of data inside of a Dataclass\",\n        \"The `@dataclass` above the header\",\n        \"A specific, concrete version of a general dataclass with actual values\",\n        \"A function automatically created when you define a Dataclass that allows you to make instances\"\n      ]\n    },\n    \"AvoidAccessingClassField\": {\n      \"type\": \"multiple_choice_question\",\n      \"points\": 1,\n      \"body\": \"In the following code, what value will be printed?\\n\\n```python\\nfrom dataclasses import dataclass\\n\\n@dataclass\\nclass House:\\n    color: str\\n    address: str\\n\\nprint(House.color)\\n```\",\n      \"answers\": [\n        \"Nothing, an error will occur because you are accessing the field of the dataclass instead of an instance\",\n        \"The type, `str`\",\n        \"The empty string, which is the default for strings\",\n        \"The text `red`, because Python knows that our house is red.\",\n        \"Nothing, an error will occur because you did not unit test the constructor function.\"\n      ]\n    },\n    \"PredictAccessInstanceField\": {\n      \"type\": \"multiple_choice_question\",\n      \"points\": 1,\n      \"body\": \"In the following code, what value will be printed?\\n\\n```python\\nfrom dataclasses import dataclass\\n\\n@dataclass\\nclass Tree:\\n    height: float\\n    age: int\\n    kind: str\\n\\nspruce = Tree(25.7, 12, 'Spruce')\\n\\nprint(spruce.height)\\n```\",\n      \"answers\": [\n        \"The value `25.7`, because the `height` field will have that value\",\n        \"The value `12`, because the fields will be alphabetically ordered in the constructor\",\n        \"The value `Spruce`, because you can only print strings\",\n        \"The text `Tree(height=25.7, age=12, kind='Spruce')`, because you can only print the entire dataclass, not its fields\",\n        \"Nothing, an error will occur because you are accessing the field of an instance, instead of the dataclass\"\n      ]\n    },\n    \"ListDataclassAdvantages\": {\n      \"type\": \"multiple_answers_question\",\n      \"points\": 3,\n      \"body\": \"Which of the following are advantages of a Dataclass?\",\n      \"answers\": [\n        \"Dataclasses allow us to combine multiple types of values into a single new type\",\n        \"Instances of a dataclass can be printed to see what they contain\",\n        \"Dataclasses are faster than functions, and do the same thing only better\",\n        \"Dataclasses are faster than `if` statements, and do the same thing only better\",\n        \"Dataclasses do not require any imports, so they are very easy to write like `if` statements and function definitions\",\n        \"You can make any number of instances based on a single dataclass definition.\"\n      ]\n    }\n  }\n}","ip_ranges":"","name":"4A1) 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_structures_dataclasses_quiz","version":2},"ip":"216.73.216.157","submission":{"_schema_version":3,"assignment_id":1157,"assignment_version":2,"attempts":0,"code":"","correct":false,"course_id":37,"date_created":"2026-05-20T12:42:01.469596+00:00","date_due":"","date_graded":"","date_locked":"","date_modified":"2026-05-20T12:42:01.469596+00:00","date_started":"","date_submitted":"","endpoint":"","extra_files":"","feedback":"","grading_status":"NotReady","id":2036761,"score":0.0,"submission_status":"Started","time_limit":"","url":"submission_url-98ffc0d3-4550-4eae-8a5d-34b6e342ae3a","user_id":2044660,"user_id__email":"","version":0},"success":true}
