AP CSP CodeX - PT Practice Lesson 3

PT Practice Lesson 3 Lesson Plan

PT Practice Lesson 3

Students remix the Game_Spinner_traversal program to meet the requirements of the Create Performance Task.

⏰ 45 min 🎯 Grades 9-12 💻 CodeSpace 🎮 CodeX 🐍 Python
View Lesson Outline
📋

Overview

Students work on computers in the CodeSpace Sandbox. This lesson is not part of a mission. Students remix the Game_Spinner_traversal program to meet the requirements of the Create PT, working individually or with a partner. They follow the slides to create a list of student names, add a second list for a different class period, add a parameter and an if statement, complete the main program with button presses, and add a function for a menu or introduction. Students then brainstorm their own remix ideas in the Activity Guide and complete the wrap-up questions.

🎯 Mission Goal: Students will complete a program that meets the Create PT requirements.

🎯

Learning Targets

  • I can create and use a list in a meaningful way.
  • I can create a function with a parameter, selection and iteration.
  • I can use the parameter in an if statement.
💡

Key Concepts

  • The Create PT has specific requirements for the program students create.
  • The parameter does not have to be used in an if statement, but it should have an effect on the functionality. The easiest way to do this is to use the parameter in an if statement.
✅

Assessment Opportunities

☑️

Success Criteria

  • Create a list
  • Use the list in a loop
  • Create a function with a parameter
  • Create a function that has a loop and if statement
📁

Digital Resources

🧰

Classroom Materials

  • ▸CodeX
  • ▸USB-C cable
  • ▸Computer
🚀

Extensions & Cross-Curricular

ExtensionStudents add a third list for another class period and update the function so the parameter chooses between all three lists.
ExtensionStudents add a function that displays a message with the name the spinner picks, then call it from the main program.
MathIf a class list has 25 names and the spinner picks randomly, students calculate the chance that any one name is picked, then run 25 spins and compare the results with their calculation.
Lang ArtsStudents write a short paragraph, in the style of a Create PT written response, explaining what their function does and how the parameter changes what it does.
📐

Standards

▾

CSTA Standards

The Create PT Prep unit reviews the CSTA Standards for Units 1, 2 and 3.

AP CSP Framework

CRD-2.A - Describe the purpose of a computing innovation.
CRD-2.C - Identify input(s) to a program.
CRD-2.D - Identify output(s) produced by a program.
AAP-1.D - Develop data abstraction using lists to store multiple elements.
AAP-2.H - Write conditional statements.
AAP-2.K - Write iteration statements.
AAP-2.N - Write expressions that use list indexing and list procedures.
AAP-3.A - Write statements to call procedures.
AAP-3.C - Develop procedural abstractions to manage complexity in a program by writing procedures.
📝
Preparing for the Lesson
  • Prepare the Activity Guide to give to students. It is used for notes during the lesson, brainstorming remix ideas, and the wrap-up questions.
  • Make sure students have the Game_Spinner_traversal program from Traversing a List #1 completed and accessible, or have the starter code ready to give them.

🧑‍🏫
Teacher Notes
  • Students complete this lesson on the computer, using the Sandbox in CodeSpace for programming. This lesson is not part of a mission.
  • Students remix the Game_Spinner_traversal program to meet the requirements of the Create PT.
  • The best experience will come from students modifying their own code. However, we want all students to be engaged, so you can give them the original code to remix if needed. The Game_Spinner_traversal program can be found in Traversing a List #1.
  • Follow the slides for instructions and guidance. Additional help is provided in the Lesson Outline below.
  • Solution code for three intermediate steps and the final program is provided.
  • Requirements note: The function created by the student needs to have a parameter that has an effect on its functionality. This can be accomplished many ways. But students need to be able to understand how this works, and they may be asked to give two different function calls that run different parts of the function, or why it does not run different parts of the function. The wording has changed a little bit over the last couple of years. From a reader's viewpoint, the easiest way for students to be able to respond to this type of question is to use the parameter in an if statement, and for the if statement to be near the beginning of the function. All the examples in this unit will meet the requirement in this way.
🗺️

Lesson Outline

This outline gives one way to present the lesson.

🗣️Warm-up

Use a discussion strategy, like journaling, working at boards, selecting random students, or a form of think-pair-share. Slides 2-4:

  • Review the requirements for the Create Performance Task.
  • Review how the Create PT is like a remix project.
💻PT Practice 3

💻 Students can work individually or with a collaborative partner.

Important: Students will use the Game_Spinner_traversal program from Traversing a List #1. They need to have it completed and accessible. Alternatively, you can give students the code as a starter from the traversing lesson.

Teaching tip: Slides 5-7: Students review Game_Spinner_traversal. Use the Activity Guide. Students should answer the first four questions before seeing slide 7. You can show slide 7 to help them with their answers, or wait until they answer the questions and let them check their answers with the slide.
Teaching tip: Slides 8-11: Students start the remix by creating a new file for the program. They will create a list for students in a class. The example shows a list of Snoopy characters, but students should use their classmates. Students use the spin_animation() function and change it for this remix. The yellow star on slide 11 indicates the solution code up to this part is included (part 1).
Teaching tip: Slide 12: Students can keep the for loop the way it is, or change it to selecting a random name from the list. The yellow star on slide 12 indicates the solution code up to this part is available (part 2).
Teaching tip: Slides 13-18: Students add another list of student names for a different class period. The example shows a list of Simpsons characters, but students should use classmates from a different class. They add a parameter and if statement. Then they complete the main program with button presses. The yellow star on slide 17 indicates the solution code up to this part is available (part 3).
Teaching tip: Slides 19-20: Students add another function for a menu or introduction. The yellow star on slide 20 indicates the solution code for the final program is available (final).
Teaching tip: Slide 21: Students return to the Activity Guide and brainstorm their own remix ideas. Alternatively, you can use collaborative groups or whole class discussion with the question.
Teaching tip: Slides 22-23: Final slides that go over information about the program they may be asked to write about in the Create PT writing prompts. The wrap-up will start to ask potential writing prompts so students can practice their responses.
🧑‍🤝‍🧑Wrap-Up

The wrap-up reviews their programming process and gives potential writing prompts. The last three questions on the wrap-up are actual sample writing prompts from College Board. If time permits, have students review each other's responses. Or select a couple responses and anonymously display them with the class and discuss if the response answers the question.

✅ Formative assessment:

  • Daily reflection or journal entry
  • Wrap-up questions
  • Completed program
  • Exit ticket
  • Optional - pull a writing prompt from the Create PT Writing Prompts and have students write about their code