Writing Exercises

Some tips on writing effective exercises.

Guidelines

See Tutorial Type examples (Task, Technique, Package Overview, Tool) for suggestions on exercises.

  • You will have 3-6 exercises in your one-hour tutorial - one for each section.

  • Exercises should take 2-5 minutes to complete. Shorter is usually better. See more on timing and difficulty below.

  • Don't try to trick your learners.

  • Show them everything they need to do in the related teaching materials before the exercise. Give them code to copy/paste and modify in teaching materials leading to exercise.

    • If they need to look something up, be explicit. For example, if you want them to check the documentation and use some input or argument you haven't covered, show them how to do that.

    • If they need to use logic beyond what you just demonstrated in the teaching materials, or combine multiple concepts together, tell them that.

  • Exercises should not rely on participants having completed previous exercises correctly (but conceptually building on previous exercises is good!). If there is code they need to run to set up an exercise, give it to them again to run if needed as part of the exercise so everyone starts in the same place.

    • Remind them to run any code that needs to be run to set up the exercise.

    • If they might have messed up a data set in some way in a previous exercise, include an option to re-run data import and set up code.

  • While there might be more than one way to complete the exercise successfully, there should ideally be one clear answer that your teaching materials leading up to the exercise would point them to. If there is more than one way to do something, and you want to discuss multiple ways, plan more time to review the answers after the exercise.

Outlining Exercises

Each of the tutorial variants (Task, Technique, Package Overview, Tool, Language Basics) gives suggestions as to what each exercise might be: a step in a process, a function, a variation on a technique.

Start be creating the outline of the 3-6 things you want learners to do in the course of the tutorial. The outline needs to have enough detail to 1) help you figure out what characteristics you need your dataset or running example to have, and 2) write the teaching materials that will lead up to the exercise.

Example

Tutorial: R - Package Overview - dplyr - select, filter, mutate

Note: we already covered the very basic functionality of select and mutate in an introductory tutorial to a tidyverse series.

  • select - rename columns and exclude columns (2-part exercise)

  • select - use name matching function like starts_with or contains

  • filter - filter with a boolean expression using and/or

  • filter - use a function in the expression -- such as min or max

  • mutate - recode 1 or 2 values to missing NA

Characteristics of the dataset I'll need:

  • some columns (variables) with similar names to use starts_with or contains

  • a numeric column to use with filter and a function

  • a column with some errant values in it to recode to missing

Timing

You should be able to complete your own exercises in about 20 seconds or less. Participants will take roughly 10 times as long as you to do the exercises.

You'll get a better sense of how long exercises take with experience teaching them - ask people to type an answer or acknowledgement in the chat when they're done so you can start to estimate the range of time it takes participants. You want to give enough time for all participants who are paying attention and actively trying the exercises, and who have the prerequisite knowledge for your tutorial, to complete them or have had enough time to get stuck.

Until you get a sense of how long each exercise will take, here are some rough guidelines:

  • 30 seconds of overhead for context switching - for participants to switch from listening to you to doing the exercise themselves, and to potentially switch to a different browser tab or program depending on your technology.

  • 1 minute per line of code they need to write.

  • 20 seconds or more if participants need to run a few lines of code to import data or do other setup. More if the code they need to run isn't adjacent to the exercise code in your file.

  • If they need to read more than ~2 sentences of instructions or set up, add 30 seconds or more.

So, you can easily get to 2 minutes for even a simple exercise with 1 line of code. Remember, you are estimating for the participants who will take the most time. See the next section below for tips on adjusting exercise difficulty levels.

Remember that it will also take 2-3 minutes to go over the answer to each exercise and answer any additional questions.

Accommodating Different Experience Levels

If you think the exercise is too simple...it's probably not. That said:

  • Have multiple parts to the exercise with 2-3 variations on the same idea/concept

  • Keep it as is, but add in a challenge or bonus exercise that participants who finish early can tackle

If you think the exercise is too hard...

  • Provide hints

  • Provide template code with blanks for learners to fill in

  • Make sure you are focused on the core concept and not complicating the exercise with unrelated ideas

  • Break the exercise up into smaller parts

Resources

Teaching Tech Together has a section on different exercise types.

Last updated