Skip to main content
Logo image

Using eBooks with Runestone Academy The PreTeXt Interactive Edition

Section 7.1 Adding an Exercise to the Exercise Bank

Subsection 7.1.1 Create New Exercises

The new Assignment Builder makes it easy to write your own exercises! Although all of the Runestone books have a pretty good selection of exercises, you can never have too many exercises. We hope to crowd source an enormous collection of questions and problems in our Exercise database. You can help by adding custom exercises for your own course to the database! Once your exercise is in the database, it is available for others to find using the search feature on the create assignment page. Community contributed exercises are shown with a person icon instead of a book icon under the source column.
To create new exercises, start or go to any assignment in the Instructor Dashboard "Assignment Builder". In the Exercises section of the assignment, click on "Add Exercise" and select "+ Create New Exercise".
Figure 7.1.1. Create new exercise
There are many different types of exercises that you can create as shown below. Some of these are discussed further in the sections below.
Figure 7.1.2. Exercise Types
Here are some examples of these different types of exercises. In the next pages, we will go through the steps to create some of these exercises.
Here is an example Multiple Choice Exercise:

Checkpoint 7.1.3.

What does the following code print?
System.out.println(2 + 3 * 5 - 1);
  • 24
  • This would be true if it was System.out.println(((2 + 3) * 5) - 1), but without the parentheses the multiplication is done first.
  • 14
  • This would be true if it was System.out.println(2 + (3 * (5 - 1))), but without the parentheses the multiplication is done first and the addition and subtraction are handled from left to right.
  • This will give a compile time error.
  • This will compile and run. Try it in DrJava. Look up operator precedence in Java.
  • 16
  • Correct! Remember PEMDAS. The multiplication is done first (3 * 5 = 15) and then the addition (2 + 15 = 17) and finally the subtraction (17 - 1 = 16).
Parsons (Mixed up Code) Problem:

Checkpoint 7.1.4.

The following has all the correct Java code to print out “Hi there!” when the code is run, but the code is mixed up and contains some extra blocks with errors. Drag the needed blocks from left to right and put them in the correct order. Click on the “Check Me” button to check your solution.
Here is an example of a simple Active Code exercise in Python:

Checkpoint 7.1.5.

Write a Python function that takes two numbers as input and returns their sum.
Here is an example of a Drag and Drop matching questions. You can also have Matching questions where you draw lines to match many to many objects.

Checkpoint 7.1.6.

Clickable Area:

Checkpoint 7.1.7.

Fill in the Blank:

Checkpoint 7.1.8.

Short Answer

Checkpoint 7.1.9.

Write an algorithm for someone (maybe a robot) to make a peanut butter and jelly sandwich. Be sure to include at least 5 precise steps in order. Have someone (maybe your instructor) act it out. Were your instructions precise enough?
Poll
    I am a
  • 1.
    beginner programmer
  • 2.
    intermediate programmer
  • 3.
    expert programmer
  • 4.
    prefer not to answer
Select Questions allow the students to choose between already existing questions: