← Back to Library
Lesson PlanFreeEN

CyberPi: Remote Classroom Polling

In this lesson students will analyze data charts and collect data with LAN broadcasting. Students will also process votes and generate a bar chart based on the data collected.

Gr. 7–8
CyberPi: Remote Classroom Polling

Lesson

Overview

Description

In this lesson students will analyze data charts and collect data with LAN broadcasting. Students will also process votes and generate a bar chart based on the data collected.

Objectives

  • Describe the features of LAN, and broadcast and receive data through LAN.

  • Generate a bar chart based on the votes.

  • Analyze poll results and draw conclusions.

  • Use mind maps to analyze how to make a remote classroom polling system.

  • Write programs and complete the remote classroom polling project.

Before the Lesson

Preparation

For the teacher and students:

Example program(s): CyberPi – Lesson 3 - Remote Classroom Polling Teachers Demo & Remote Classroom Polling Students Demo

For students:

  • Proficiency in block-based coding

  • Prior knowledge of CyperPi's major features

Review

Warm Up

Objective:

  • Use videos to bring up the voting and polling topic and introduce voting systems and LAN.

Procedures:

  • Start the class by saying: Have you ever watched any competition shows? In these shows, a voting session usually follows the competitors’ performances.

  • Ask: During the live voting session, how did the audience vote? What about those watching the show at home? Could they participate in the session?

Have students answer the questions:

  • Ask: Do you know how to limit access to the voting session? Like in the voting session I mentioned just now, only the live audience can vote, and the home audience can't.

  • Introduce LAN: One of the common ways is to connect the voting machines to the same private network. This kind of network is usually used within an area and hence, called Local Area Network (LAN). Unlike the Internet, a LAN is a closed network, which means only the devices connected to the same LAN can share resources and information.

Direct Instruction

Tour of mBlock 5

1. Open the mBlock software or mBlock 5 Web version.

2. Introduce students to the following key areas of the software interface:

Connect the CyberPi

3. Plug the CyberPi into the computer using the included cable. The CyberPi should boot up and the screen will display either the last program uploaded or the Home menu.

4. On the "Devices" tab in mBlock, click the "Add" button. Select CyberPi and click "Ok".

5. Click the "Connect" button. Then, select the USB port and click "Connect".

6. If connected successfully, the button will change to "Disconnect".

Guided Practice

Hands On

Objective:

  • Prepare a few poll questions in which students may be interested. Encourage students to brainstorm the features that a voting system should have.

Procedures:

  • Explain and ask: In this lesson, we will use CyberPi to form a LAN and then run a poll. And only we, in this classroom, can vote. So, how do we make a voting system with CyberPi and mBlock?

Give students time to discuss the question.

  • Conclude: First, we need an initiator to start a poll. Then, the rest of us will be voters. When the voting session closes, the initiator counts the votes.

Instruct students to use mind maps to analyze the project and prepare to program:

  • Demonstrate how remote classroom polling works.

  • Analyze with students what features the remote classroom polling project should have and draw a mind map.

Independent Practice

Try It

Objective:

  • Give students the freedom to explore further so that they can enhance their programming skills.

Procedures:

  • Explain: We write programs for the initiator and the voter separately, so we’ll need two CyberPi boards. In mBlock, select Upload mode before writing programs for the two boards.

  • Walk students through the programs for the initiator and the voter respectively. To write programs for the initiator, select CyberPi in "Devices", and select CyberPi 2 to write programs for the voter.

The initiator starts a poll:

  • To make multiple CyberPi boards communicate with each other, we need the LAN blocks.

  • Select CyberPi in Devices and write programs for the initiator.

  • Create two option variables to record the votes. The initiator CyberPi sends a LAN broadcast options, displays a prompt Options sent. Poll starts, and lights up indicators.

  • NOTE: Create two variables to record the votes for the two options and set both variables to 0.

Send out options/Set voting period: 

  • Apart from starting the poll, the initiator sets the voting period, so it needs to set a timer. Only during the voting period that is set up, voters can cast their votes. As the poll ends, the initiator starts counting the votes.

NOTE:

  • The timer will be used to decide whether a voter casts a vote within the voting period.

Voters send in votes:

  • When receiving the broadcast options, a voter starts to vote. During the voting session, voters send their votes on LAN through broadcasting. You’ll need these blocks in your program:

Display options:

  • Type options in when receiving ( ) broadcast on Wi-Fi. Make sure the broadcast name is the same as the one in the initiator program. When receiving the broadcast, the voter CyberPi lights up indicators and displays the options and voting instructions.

Cast votes:

  • Make sure voters can cast only one vote by recording their voting status. The voter CyberPi sends a LAN broadcast vote.  When the vote is sent through, a prompt will appear on the screen of the voter CyberPi, and indicators will light up.

  • Whether the joystick is pulled decides the voting status and the direction to which the joystick is pulled indicates the voter’s choice. You’ll need this block in your program:

NOTE: 

  1. To make sure each voter can only cast one vote, create a variable VotingStatus to record whether a voter finishes voting. When the variable is 0, it means the voter hasn’t voted yet. VotingStatus changes to 1 when the voter finishes voting.

  2. The example program includes only one option. Complete the program that provides two voting options.

Initiator collects votes:

  • The initiator collects the votes via LAN broadcast. You’ll need this block to enable that: 

  • Select CyberPi in Devices and write another initiator program.

  • Type vote in when receiving ( ) broadcast on Wi-Fi.  Make sure the broadcast name is the same as the one sent from the voter program. When receiving the broadcast during the voting period, the initiator collects the votes and lights up indicators.

NOTE:

  1. Include a timer in the script to check whether a vote is submitted within the voting period.

  2. To count the votes, set a conditional statement to check the broadcast value, and increase the vote by 1 for the corresponding option based on the value received.

  3. The example program counts the votes for option a. Complete the program that can count the votes for both options.

  4. If different CyberPi boards send through the same message via the same LAN at the same time, the receiver CyberPi will only receive the message once. That is if multiple voters select option A at the same time, then the initiator will count only one vote for Option A. However, the possibility of this incident is faint.

Initiator checks the polling result:

  • You can display the polling result with text or a bar chart. And these blocks may help: 

NOTE:

  1. The example program displays the vote tally for option a. Complete the program that displays the vote tally for both options.

  2. Set different colors for different bars when visualizing the result with a bar chart.

  3. If the number of voters is small, add a base number to the vote tally of each option. For example,

     . In this way, the bar chart will be clearer.

  • Allow students time to test their programs and then invite them to describe the bar chart and draw conclusions.

Extension

  • Have students create their own poll

  • Have students explore the table block under Display and use it to organize the collected votes in a table

Wrap Up

Wrap-Up & Quick Check

Objective:

  • Decide or have students decide the poll question. Give students time to try the voting system and analyze the result.

Procedures:

  • Initiate a classroom poll and invite students to vote. (Possible subject: favorite song/movie star/singer/game, etc.)

  • When the poll is done, invite students to analyze the result data chart. For example, have students figure out which is the most popular song among the class and discuss why it is so popular.

Downloadable Material

Example Program

Educational Standards

K12 CS Framework

K12 CS Framework

  • Practice 3-1: Identify complex, interdisciplinary, real-world problems that can be solved computationally.

  • Practice 3-3: Evaluate whether it is appropriate and feasible to solve a problem computationally.

ISTE

ISTE

  • 5c: Students break problems into component parts, extract key information, and develop descriptive models to understand complex systems or facilitate problem-solving.

CSTA

CSTA

  • 2-AP-13: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.

Alberta - Grade 7-8 - CTF & Mathematics

Grade 7-8

CTF

  • Planning, creating, appraising and communicating in response to challenges. 

  • Working independently and with others while exploring careers and technology

Mathematics

  • GCO: Collect, display and analyze data to solve problems.

British Columbia - Grade 7-8 - ADST

Grade 7

ADST

• Generate potential ideas and add to others’ ideas 

• Identify and evaluate the skills and skill levels needed, individually or as a group, in relation to a specific task, and develop them as needed 

• Select, and as needed learn about, appropriate tools and technologies to extend their capability to complete a task 

Grade 8

ADST

• Generate potential ideas and add to others’ ideas 

• Make a plan for production that includes key stages, and carry it out, making changes as needed

• Identify and evaluate the skills and skill levels needed, individually or as a group, in relation to a specific task, and develop them as needed

• Select, and as needed learn about, appropriate tools and technologies to extend their capability to complete a task

Manitoba - Grade 7-8 - Mathematics

Grade 7-8

Mathematics

  • GCO: Collect, display, and analyze data to solve problems.

Newfoundland & Labrador - Grade 7-8 - Mathematics

Grade 7-8

Mathematics

  • GCO: Collect, display, and analyze data to solve problems.

Nova Scotia - Grade 6-8 - Mathematics & ICT/Technology

Grade 6

Mathematics

N09 Students will be expected to explain and apply the order of operations, excluding exponents, with and without technology (limited to whole numbers). 

Performance Indicators: 

N09.01 Demonstrate and explain, with examples, why there is a need to have a standardized order of operations. 

N09.02 Apply the order of operations to solve multi-step problems with or without technology (e.g., computer, calculator). 

PR02 Students will be expected to represent and describe patterns and relationships, using graphs and tables. 

Performance Indicators: 

PR02.01 Translate a pattern to a table of values, and graph the table of values (limited to linear graphs with discrete elements). 

PR02.02 Create a table of values from a given pattern or a given graph. 

PR02.03 Describe, using everyday language, orally or in writing, the relationship shown on a graph. 

PR03 Students will be expected to represent generalizations arising from number relationships using equations with letter variables. 

Performance Indicators: 

SCO PR03 Students will be expected to represent generalizations arising from number relationships using equations with letter variables. [C, CN, PS, R, V] 

PR03.01 Write and explain the formula for finding the perimeter of any regular polygon. 

PR03.02 Write and explain the formula for finding the area of any given rectangle. 

PR03.03 Develop and justify equations using letter variables that illustrate the commutative property of addition and multiplication (e.g., a + b = b + a or a × b = b × a). 

PR03.04 Describe the relationship in a given table using a mathematical expression. 

PR03.05 Represent a pattern rule using a simple mathematical expression, such as 4d or 2n + 1. 

SP01 Students will be expected to create, label, and interpret line graphs to draw conclusions. 

Performance Indicators: 

SP01.01 Determine the common attributes (title, axes, and intervals) of line graphs by comparing a given set of line graphs. 

SP01.02 Determine whether a given set of data can be represented by a line graph (continuous data) or a series of points (discrete data) and explain why. 

SP01.03 Create a line graph from a given table of values or a set of data. 

SP01.04 Interpret a given line graph to draw conclusions. 

SP02 Students will be expected to select, justify, and use appropriate methods of collecting data, including questionnaires, experiments, databases, and electronic media. 

Performance Indicators: 

SP02.01 Select a method for collecting data to answer a given question, and justify the choice. 

SP02.02 Design and administer a questionnaire for collecting data to answer a given question, and record the results. 

SP02.03 Answer a given question by performing an experiment, recording the results, and drawing a conclusion. 

SP02.04 Explain when it is appropriate to use a database as a source data. 

SP02.05 Gather data for a given question by using electronic media, including selecting data from databases. 

ICT

  • P2: Students will be expected to use digital tools to develop ideas and original works in innovative ways.

  • TOC1: Students will be expected to

* safely use many forms of current technology for learning with growing competence

* demonstrate conceptual understanding of how information and communication technology, digital tools, and authorized networks support their learning

* use terminology related to information and communication technology

Grade 7

Mathematics

PR05 Students will be expected to evaluate an expression given the value of the variable(s). 

Performance Indicator: 

PR05.01 Substitute a value for an unknown in a given expression and evaluate the expression. 

PR02 Students will be expected to create a table of values from a linear relation, graph the table of values, and analyze the graph to draw conclusions and solve problems. 

Performance Indicators: 

PR02.01 Create a table of values for a given linear relation by substituting values for the variable. 

PR02.02 Create a table of values, using a linear relation, and graph the table of values (limited to discrete elements). 

PR02.03 Sketch the graph from a table of values created for a given linear relation, and describe the patterns found in the graph to draw conclusions (e.g., graph the relationship between n and 2n + 3). 

PR02.04 Describe, using everyday language, in spoken or written form, the relationship shown on a graph to solve problems. 

PR02.05 Match a given set of linear relations to a set of graphs. 

PR02.06 Match a given set of graphs to a given set of linear relations. 

Technology

  • GCO1: Students will be expected to design, develop, evaluate, and articulate technological solutions

  • GCO2: Students will be expected to operate and manage technological systems

Grade 8

Mathematics

PR01 Students will be expected to graph and analyze two-variable linear relations. 

Performance Indicators: 

PR01.01 Determine the missing value in an ordered pair for a given equation. 

PR01.02 Create a table of values by substituting values for a variable in the equation of a given linear relation. 

PR01.03 Construct a graph from the equation of a given linear relation (limited to discrete data). 

PR01.04 Describe the relationship between the variables of a given graph. 

SP01 Students will be expected to critique ways in which data is presented. 

Performance Indicators: 

SP01.01 Compare information provided for the same data set by a given set of graphs, including circle graphs, line graphs, bar graphs, and pictographs, to determine the strengths and limitations of each graph. 

SP01.02 Identify the advantages and disadvantages of different graphs, including circle graphs, line graphs, bar graphs, and pictographs, in representing a given set of data. 

SP01.03 Justify the choice of a graphical representation for a given situation and its corresponding data set. 

SP01.04 Explain how the format of a given graph, such as the size of the intervals, the width of the bars, and the visual representation, may lead to misinterpretation of the data. 

SP01.05 Explain how a given formatting choice could misrepresent the data. 

SP01.06 Identify conclusions that are inconsistent with a given data set or graph, and explain the misinterpretation. 

Technology

  • GCO1: Students will be expected to design, develop, evaluate, and articulate technological solutions

  • GCO2: Students will be expected to operate and manage technological systems

Ontario - Grade 7-8 - Mathematics

Grade 7

Mathematics

Algebra

  • C3.1 solve problems and create computational representations of mathematical situations by writing and executing code, including code that involves events influenced by a defined count and/or sub-program and other control structures

Data

  • D1.2 collect qualitative data and discrete and continuous quantitate data to answer questions of interest, and organize the sets of data as appropriate, including using percentages

Grade 8

Mathematics

Algebra

  • C3.1 solve problems and create computational representations of mathematical situations by writing and executing code, including code that involves the analysis of data in order to inform and communicate decisions

Prince Edward Island - Grade 7-8 - Mathematics

Grade 7-8

Mathematics

  • GCO: Collect, display, and analyze data to solve problems.

Quebec - Grade 7-8 - Mathematics

Grade 7-8

Mathematics

  • Formulates questions for a survey (based on age-appropriate topics, students’ language level, etc.)