Chapter 6 Quiz: MicroSim Architecture and Layout
Test your understanding of MicroSim structural organization, canvas dimensions, and layout patterns for professional-looking simulations.
Instructions: Select the best answer for each question. After answering, click "Show Answer" to check your response and read the explanation.
1. What are the two main regions in standard MicroSim architecture?
- Header region and footer region
- Drawing region and control region
- Left panel and right panel
- Canvas region and code region
Show Answer
The correct answer is B. Standard MicroSim architecture divides the canvas into two distinct regions: the Drawing Region (where visualizations appear) and the Control Region (where sliders, buttons, and labels reside). This separation creates visual hierarchy and consistent user expectations.
Concept Tested: MicroSim Architecture, Drawing Region, Control Region
Bloom's Level: Remember
2. What is the typical background color for the drawing region?
- Pure white (255, 255, 255)
- Light gray (200, 200, 200)
- Alice blue (240, 248, 255)
- Sky blue (135, 206, 235)
Show Answer
The correct answer is C. Alice blue (240, 248, 255) is the standard background color for the drawing region. It provides gentle contrast without distraction, creating a professional appearance while being easy on the eyes.
Concept Tested: Drawing Region
Bloom's Level: Remember
3. How is canvasHeight typically calculated in a MicroSim?
- canvasHeight = drawHeight - controlHeight
- canvasHeight = drawHeight * controlHeight
- canvasHeight = drawHeight + controlHeight
- canvasHeight = drawHeight / 2
Show Answer
The correct answer is C. Canvas height is calculated as canvasHeight = drawHeight + controlHeight. The total canvas combines the visualization area and control area to create the complete MicroSim surface.
Concept Tested: Canvas Height, Draw Height, Control Height
Bloom's Level: Remember
4. Why do professional MicroSims use named dimension variables instead of magic numbers?
- They make the code run faster
- They make code readable, maintainable, and self-documenting
- They are required by p5.js
- They reduce file size
Show Answer
The correct answer is B. Named variables like canvasWidth, drawHeight, and margin make code readable and self-documenting. Code like rect(0, drawHeight, canvasWidth, controlHeight) clearly shows intent, while rect(0, 400, 400, 50) is cryptic.
Concept Tested: Canvas Width, Canvas Height
Bloom's Level: Understand
5. What is the purpose of the margin variable?
- To set the canvas border width
- To create spacing between content and canvas edges
- To define the control region height
- To set the slider width
Show Answer
The correct answer is B. The margin variable defines spacing between content and canvas edges, creating visual breathing room. Margins prevent elements from touching edges, making simulations feel polished and professional rather than cramped.
Concept Tested: Margin Variable
Bloom's Level: Understand
6. When should you use a two-column layout?
- When you have only one control
- When you need side-by-side visualization and data display
- When the canvas is narrow
- When creating mobile-only designs
Show Answer
The correct answer is B. The two-column layout is ideal when you need to show two related views simultaneously—like a main visualization paired with a graph, before/after comparisons, or a simulation with a data panel.
Concept Tested: Two-Column Layout
Bloom's Level: Apply
7. What pattern enables working in local coordinates for multi-column layouts?
- save() and restore()
- push(), translate(), and pop()
- beginShape() and endShape()
- loadPixels() and updatePixels()
Show Answer
The correct answer is B. The push(), translate(), and pop() pattern enables working in local coordinates. After translate(leftColumnWidth, 0), all drawing happens relative to the new origin, making multi-column layouts much easier to code.
Concept Tested: Two-Column Layout
Bloom's Level: Remember
8. What is the key difference between fixed and responsive layouts?
- Fixed layouts use more colors
- Responsive layouts adapt to container width; fixed layouts maintain constant dimensions
- Fixed layouts require more code
- Responsive layouts only work on mobile
Show Answer
The correct answer is B. Fixed layouts maintain constant dimensions regardless of browser window size, while responsive layouts adapt to available container width. Responsive layouts use windowResized() and updateCanvasSize() functions.
Concept Tested: Fixed Layout, Responsive Layout
Bloom's Level: Understand
9. Which function must be implemented for a responsive layout to work?
- setup() only
- draw() only
- windowResized()
- mousePressed()
Show Answer
The correct answer is C. Responsive layouts require the windowResized() function to detect when the container size changes. This function typically calls updateCanvasSize() and resizeCanvas() to adapt the MicroSim to the new dimensions.
Concept Tested: Responsive Layout
Bloom's Level: Remember
10. In a responsive layout, how should slider width be calculated?
- A fixed value like 200 pixels
- Relative to canvasWidth, such as
canvasWidth - sliderLeftMargin - margin - Always 50% of the screen
- Based on the number of sliders
Show Answer
The correct answer is B. Slider width should be calculated relative to canvasWidth so it adapts when the container resizes. A formula like canvasWidth - sliderLeftMargin - margin ensures the slider stretches appropriately while respecting spacing.
Concept Tested: Responsive Layout
Bloom's Level: Apply
11. What is the standard layout pattern best used for?
- Complex multi-view simulations
- Simple simulations with 1-3 controls in narrow containers
- Print-only designs
- Two-column comparisons
Show Answer
The correct answer is B. The standard layout is the default choice for simple simulations with single visualizations and 1-3 controls. It works well in narrow containers (under 500px), for mobile-friendly designs, and quick prototypes.
Concept Tested: Standard Layout
Bloom's Level: Understand
12. What must you remember to do when the canvas resizes in a responsive layout?
- Recreate all sliders from scratch
- Reposition and resize control elements like sliders
- Change the background color
- Reset all simulation variables
Show Answer
The correct answer is B. When the canvas resizes, you must reposition and resize control elements like sliders. Calling repositionControls() in windowResized() ensures sliders update their position and size to match the new canvas dimensions.
Concept Tested: Responsive Layout
Bloom's Level: Apply
Quiz Summary
Concepts Tested:
| Concept | Questions |
|---|---|
| MicroSim Architecture | 1 |
| Drawing Region | 1, 2 |
| Control Region | 1 |
| Canvas Width | 4 |
| Canvas Height | 3, 4 |
| Draw Height | 3 |
| Control Height | 3 |
| Margin Variable | 5 |
| Standard Layout | 11 |
| Two-Column Layout | 6, 7 |
| Fixed Layout | 8 |
| Responsive Layout | 8, 9, 10, 12 |
Bloom's Taxonomy Distribution:
- Remember: 4 questions (33%)
- Understand: 4 questions (33%)
- Apply: 4 questions (33%)