INSTRUCTIONS
During the a coding quiz, you'll solve a programming chllenge by writing code in Processing. You will have up to 20 minutes to complete this section. The quiz will require you to solve one programming challenge. Each student will recieve a different challenge at random.
The next class period will offer a redo opportunity for any students who did poorly on the original. On the redo, you'll be given a random challenge and can complete it for a maximum score of 80%. You will receive the second score, even if it is lower.
The problems below are examples of the kinds of things I might ask you to do on a programming quiz. Your actual question will be similar, but not identical, to one of these. On the right, I have an example of my rubric which is scored on 5 elements, then scaled to 20 points for the quiz.
EXAMPLES
Example #1
Canvas size: 600 x 600
Background: Orange
A yellow circle with a diameter of 50 pixels that starts at a random position on the left side of the screen
It moves to the right side at a speed of 5 pixels per frame
Each time it reaches the right side of the screen, it appears at a new random position on the left side and increases its size by 40%
If this change would make the circle's diameter greater than 300, set the diameter to 50.
Example Rubric
Colors
Orange Background
Yellow Circle
Movement
Moves to the right
Wrapping
Wraps from right to left
Okay if it’s a bit janky
Grows
Up by 40% each time
Reset
Back to 50 pixels when it is over 300 pixels
Example #2
Canvas size: 600 x 600
Background: Blue
A white circle with a diameter of 30 pixels that starts at a random position on the bottom of the screen
It moves to the top at a speed of 2 pixels per frame
Each time it reaches the top of the screen, it appears at a new random position on the bottom of the screen and increases its speed by 50%.
If this change would make the circle's speed greater than 32 pixels per frame, it is instead reduced to 2 pixels per frame.
Example Rubric
Colors
Blue Background
White Circle
Movement
Moves to the top
Wrapping
Wraps from top to bottom
Okay if it’s a bit janky
Speeds Up
Speeds up by 50%
Reset
Returns to speed 2 when it reaches speed 32
Example #3
Canvas size: 600 x 600
Background: Pink
At the start of the program, a square is created at a random position on the screen. It has a random size between 10 and 100 and is assigned a random color.
The square should not be flashing; the color must stay constant.
When the user presses the mouse, the shape select a new random color, size, and position.
This can be done with either polling or event based methods.
Example Rubric
Background
Pink Background
Click
Changes on a click
Can use polling OR event based
3.Random Position
Does not move
4.Random Size
Does not grow/shrink
5.Random Color
Does not flicker/change
Example #4
Canvas Size: 600 x 600
Background: Purple
At the start of the program, a yellow rectangle is created at the top left corner of the screen. It has a width equal to the screen width and height of 30 pixels.
Each frame, move the rectangle down by 2 pixels and reduce its width by 2 pixels.
When the rectangle reaches the bottom of the screen, move it back to the top of the screen and restore the width to the full width.
Example Rubric
Colors
Purple Background
Yellow Bar
Shape / Position
Bar is 30 pixels tall and stretches across the window.
Movement
Moves from top to bottom
Shrink
Bar is reduced in size by 2 pixels per frame
Reset
Bar returns to top of screen