Quiz App
Decks
Folders
Back
Summary
{deck: {name: "2 How to Design Data"}, score: [{question_type: "multiple_choice", label: "Multiple choice", graded: true, count: 15, total: 15}, {question_type: "short_answer", label: "Short answer", graded: false, count: 0, total: 0}], answers: [{question_prompt: "What is the main purpose of a data definition?", question_type: "multiple_choice", choices: ["To document how problem-domain information is represented as program data", "To optimize runtime automatically", "To replace all function purposes", "To remove the need for tests"], selected_choice: "To document how problem-domain information is represented as program data", response: nil, correct: true}, {question_prompt: "Which chain best matches the design principle in the notes?", question_type: "multiple_choice", choices: ["Function body -> information -> data -> tests", "Information structure -> data structure -> template structure -> function structure", "Tests -> constants -> images -> data", "Template -> information -> compiler -> purpose"], selected_choice: "Information structure -> data structure -> template structure -> function structure", response: nil, correct: true}, {question_prompt: "When is an enumeration appropriate?", question_type: "multiple_choice", choices: ["When values form an unbounded list", "Whenever the data is numeric", "When information is one of a fixed number of distinct cases", "Only when using compound data"], selected_choice: "When information is one of a fixed number of distinct cases", response: nil, correct: true}, {question_prompt: "Which type comment describes an inclusive integer interval from 1 through 32?", question_type: "multiple_choice", choices: ["Integer(1,32)", "Natural(1,32]", "Number{1,32}", "Integer[1,32]"], selected_choice: "Integer[1,32]", response: nil, correct: true}, {question_prompt: "What is the template shape for an atomic non-distinct type such as CityName is String?", question_type: "multiple_choice", choices: ["A cond with one branch per possible string", "A natural recursion over the string", "A single body placeholder using the value", "Two self-references"], selected_choice: "A single body placeholder using the value", response: nil, correct: true}, {question_prompt: "What makes an itemization different from a simple enumeration?", question_type: "multiple_choice", choices: ["It always uses images", "At least one subclass is not a single distinct value", "It cannot use cond", "It has no interpretation"], selected_choice: "At least one subclass is not a single distinct value", response: nil, correct: true}, {question_prompt: "How does cond choose an answer?", question_type: "multiple_choice", choices: ["It evaluates questions in order and uses the answer for the first true question", "It evaluates all answers and combines them", "It always uses the final branch", "It chooses a random true branch"], selected_choice: "It evaluates questions in order and uses the answer for the first true question", response: nil, correct: true}, {question_prompt: "Why might an itemization cond use (and (number? c) (<= 1 c) ...)?", question_type: "multiple_choice", choices: ["To convert strings to numbers", "To force all clauses to run", "To create a self-reference", "To guard numeric operations so they are not applied to non-numbers"], selected_choice: "To guard numeric operations so they are not applied to non-numbers", response: nil, correct: true}, {question_prompt: "Why can the last numeric subclass sometimes be tested with only (number? c)?", question_type: "multiple_choice", choices: ["Because numbers are always within every interval", "Because the type comment guarantees that any legal remaining number belongs to that subclass", "Because cond ignores type errors", "Because intervals are enumerations"], selected_choice: "Because the type comment guarantees that any legal remaining number belongs to that subclass", response: nil, correct: true}, {question_prompt: "What does it mean that HtDF and HtDD are orthogonal?", question_type: "multiple_choice", choices: ["The function-design recipe remains largely the same while different data definitions supply different templates", "They cannot be used together", "HtDD replaces HtDF for non-primitive inputs", "Only primitive data can use HtDF"], selected_choice: "The function-design recipe remains largely the same while different data definitions supply different templates", response: nil, correct: true}, {question_prompt: "If LetterGrade has exactly \"A\", \"B\", and \"C\", how many main cond branches should its template have?", question_type: "multiple_choice", choices: ["1", "2", "3", "An unlimited number"], selected_choice: "3", response: nil, correct: true}, {question_prompt: "What is the interpretation in a data definition for?", question_type: "multiple_choice", choices: ["To list the function parameters", "To provide an optimized algorithm", "To define the module imports", "To state how the represented data corresponds to information in the problem domain"], selected_choice: "To state how the represented data corresponds to information in the problem domain", response: nil, correct: true}, {question_prompt: "A function consumes SeatNum defined as Integer[1,32]. Is 50 a legal input according to the data definition?", question_type: "multiple_choice", choices: ["No because it is outside the SeatNum interval", "Yes because 50 is an Integer", "Yes if the function has an else branch", "Only if 50 is converted to a String"], selected_choice: "No because it is outside the SeatNum interval", response: nil, correct: true}, {question_prompt: "Which statement correctly distinguishes purpose from interpretation?", question_type: "multiple_choice", choices: ["Interpretation belongs to function design; purpose belongs to data design", "Purpose belongs to function design; interpretation belongs to data design", "They are interchangeable", "Neither is part of a design recipe"], selected_choice: "Purpose belongs to function design; interpretation belongs to data design", response: nil, correct: true}, {question_prompt: "Why should tests for an itemization cover every subclass?", question_type: "multiple_choice", choices: ["Because Racket requires one test per source line", "Because itemizations cannot use stubs", "Because the data definition identifies distinct forms that can drive different function behavior", "Because every subclass must return the same literal value"], selected_choice: "Because the data definition identifies distinct forms that can drive different function behavior", response: nil, correct: true}]}
Copy JSON