10-WEEK COURSE ON TEACH ING COMPUTING TO GCS E This course is for teachers who have undertaken our Teaching Computing to KS3 Course, or who have preferably some experience of programming in their degree or another course, even if they are very rusty. Our courses take place at the end of the school day at Anglia Ruskin University, or at a local school who is able to host the course (in exchange for some free places). The course is divided into two sections: Theory (1 hour) and Programming (1 and a half hours). OUTLINE Week No Computing Theory ( 1 hour) Programming in Python (1.5 hours) 1 Structure of the course Introduction to Binary Variables/assignment 2 More binary logic/hex Assignment/Selecion 3 Truth tables/logic diagrams Selection/While loops 4 Structure of the processor While loops/For loops 5 Algorithms and Dry Runs For loops/Lists 6 The internet/ Networking Functions 7 The internet/ HTML and CSS Files 8 Database theory Databases 9 GCSE Controlled Assessment Tasks Databases 10 GCSE Controlled Assessment Tasks Consolidation Outline session plans for each session are given below. Powerpoint presentations that we have used are included later. Teaching Computing to GCSE Level with Python 1 Sue Sentance SESSION 1 This session consists of the following topics: - Introduction to the course Introduction to binary and binary arithmetic Introduction to programming in Python Time (mins) 5 10 15 Activity Resources Introductions Background to GCSE Specifications Binary Counting activity Teachers take part in activity designed for students similar to that shown at http://csunplugged.org/binary-numbers wherby volunteers from amongst the teachers hold up cards with the number of dots representing the place values and others in the class help them to count in binary. It's a good ice-breaker as they need to learn each others’ names. Powerpoint slides 6*A4 paper/card with these numbers of dots on – 1,2,4,8,16 6*A4 paper/card with 1 on one side and 0 on the other Graduate from dots to the paper with 1 on one side and 0 on another then repeat the exercise. Alternate counting with asking the other teachers to pick numbers. We also demonstrate other good techniques for teaching, including Finger Binary and the Cisco Binary Game (see the Resources section). 10 Example questions on binary to denary conversions and vice versa 10 Binary addition Explanation using whiteboard and slides Basic rules of binary addition with some examples given 10 Binary addition exercises 10 30 SHORT BREAK Introduction to Python programming In the programming session, the first thing we do is get our delegates to register at http://www.pythonschool.net if they haven't done so already. Powerpoint slides (displayed or printed out) Binary addition worksheet In the first session start by demonstrating a simple hello world program and writing a program to input name and age. This introduces - the print and input functions - the use of variables (We use a labelled box to illustrate the idea of a variable) - the use of the int function to convert a string to an integer - string and integer data types Teaching Computing to GCSE Level with Python 2 Sue Sentance 30 After about 20-30 minutes of demonstration and copying, we give teachers 30 minutes to work through the exercises on our Python website: http://www.pythonsummerschool.net/dayoneadditionalexercises/ (Basic exercises 1-7 at the bottom of this page). We circulate and help out (there are two of us). Some teachers want to go over the demonstrated material again so we provide sets of headphones so that they can watch and listen to the videoed tutorials going over the same material. 20 Recap and answer questions Explain .format to output string output Homework We always stress how important it is to practise programming between sessions. This week it is by completing as many exercises as possible in the Basic Exercises section. Our greatest concern with these sessions is that teachers are not finding the time to work on material between sessions. Teaching Computing to GCSE Level with Python 3 Sue Sentance SESSION 2 This session consists of the following topics: - Hexadecimal numbers Storing text: ASCII and Unicode Variables and assignment in Python Introduction to the IF statement Time (mins) 10 Activity Resources Past papers 5 Starter exercise Binary and binary addition question from a past paper Comparision of two specifications on this topic (very similar) 10 Explanation of hex numbers – use board Powerpoint slides 10 Work through examples of hex to binary and binary to hex conversions Hex worksheet – teachers to work through; go over answers Worksheet 10 10 5 Discuss methods of converting hex to denary and denary to hex This may be more difficult for teachers to do Final slide gives a few examples to sum up whole topic. Teachers do exercises then discuss answers Coding text – using ASCII and Unicode Discuss difference between data types and ASCII as a coding system. Show Insert Symbol in Word to look at codes for particular characters ASCII worksheet – question 1 only 10 15 BREAK Programming Recap concepts from previous week - variables, data types (integer and string), assignment Recap Python key words and functions - print, input, int, format 10 Use chr() and asc() to write a program to convert characters to ASCII codes and vice versa Discuss algorithm needed for binary to denary convertor (in pairs) Teachers to implement themselves (in pairs) 20 20 Also try: Currency convertor Exercises from http://www.pythonschool.net 10 Before close of session, point to next week’s work on IF statement with short demontration Powerpoint slides Powerpoint slides Worksheet ascii.py http://www.python school.net Homework: to do the denary to binary convertor Teaching Computing to GCSE Level with Python 4 Sue Sentance SESSION 3 This session consists of the following topics: - Binary Logic Truth Tables Drawing Logic diagrams The IF Statement in Python Introduction to the while loop (if time) Time (mins) 10 Activity Resources Starter: binary and hex conversion from last week 5 Background to GCSE Specifications (only OCR specification covers this topic; AQA does not) Binary logic and truth tables introduction Practical demonstration – use examples such as “Wearing glasses” & “Lives in Essex” to look at effect of AND and OR statements (Stand up/Sit Down exercise) Revision sheet from last week Powerpoint slides 10 Move from practical demo to truth table for AND 10 10 15 Work through Truth Table sheet for AND, OR, NOT with extension material for NAND, NOR, XOR (not needed for GCSE but good to know). Introduce http://logic.ly . There is a “Try online” option that Truth table worksheet Give out worksheet (3 parts) with up to 6 exercises to complete creating truth tables from logic diagrams. Logic diagram worksheet http://logic.ly Teachers can work through these in pairs; facilitator helps Make answers available during break if short of time to go through all exercises 10 15 BREAK Warm up exercise (during break): Code with errors – can you spot 7 errors Programming Introduce the IF Statement (if not started earlier). Python program with errors Weather.py Give weather example: if it is raining etc. Talk through program and develop more options using elif and else Discuss common errors 20 20 Programming practice Write program to give a grade for a mark. Teachers to work out algorithm first on paper (in pairs) then implement (in pairs or separately) Go through correct program together Work through other programs using IF: - Scores of football games - Currency conversion (developed from previous session) Teaching Computing to GCSE Level with Python 5 Grades.py Sue Sentance 15 - Password program - Others on http://www.pythonschool.net Usually, the password program leads on to a discussion about while loops password.py Work through while loop for password program altogether to allow the program to repeat until the password is correct 10 Extension: stay in while loop until either password is correct or user has had three tries Recap Homework: Go over the tutorials showing examples of if statement to make sure this is secure before we launch into more loops Teaching Computing to GCSE Level with Python 6 Sue Sentance SESSION 4 This session consists of the following topics: - Structure of the processor Fetch-Excecute Cycle Improving the performance of the computer Programming: For and While loops in Python Time (mins) 5-10 Activity Resources Previous examination question on last week’s material OCR June 2011 Specimen paper 5 Discuss what is in the GCSE Specs for two specificaitons: OCR GCSE Computing state the purpose of the CPU describe the function of the CPU as fetching and executing instructions stored in memory explain how common characteristics of CPUs such as clock speed, cache size and number of cores affect their performance. AQA GCSE Computer Science be able to categorise devices as input or output depending on their function be able to describe the purpose of the processor (CPU) understand how different components link to a processor (ROM, RAM, I/O, Storage, etc) be able to explain the effect of common CPU characteristics on the performance of the processor. These should include clock speed, number of cores and cache size/types 10 Start off with a few clips from the Royal Institution lectures and look at resources on the CS4FN website too. Hi Tech Trek DVD Breaking the speed limit 3:15 to 4-ish 6:45 to 8-ish 12:00 ish 10 Hand out the OCR handout with the content on that they need. Powerpoint presentation is on the shared area for reference also. Demonstrate animation from hartismere.com A few minutes to digest then in groups, discuss good ways of teaching the material. What will students know? What will they not know? How can it be made more interesting? OCR Handout http://www.hartisme re.com/Subjects/ICT/ ALevelComputing/CP UCycleAnimation 10 Activity Role Play This is a role play exercise from cse4k12 whereby teachers (as students) work in groups of three as Display, Memory and Computer. It is perfect for GCSE Computer Science so is a good resource that teachers can use in their own Teaching Computing to GCSE Level with Python 7 http://cse4k12.org/h ow_computers_work /index.html Sue Sentance lessons. 10 Little Man Computer exercises This introduces another resource that teachers can use to teach basic assembly language. It runs on the web and there are simple instruction sheets to follow. 5 Little Man Computer coursework – introduce but do not spend time attempting it. This is a difficult task to master in a short session. BREAK Programming 10 30 http://www.atkinson. yorku.ca/~sychen/res earch/LMC/LittleMan. html OCR A452 Coursework task Python Password – while loop Guessing game – while loop Introduce the For loop 30 20 Exercises from http://www.pythonschool.net For and While loops Teachers work through, mostly on own. Average problem (using running total) Difference between using a while and a for loop Teaching Computing to GCSE Level with Python 8 PythonSchool.net Sue Sentance SESSION 5 We have changed this session. The theory aspects of the course used to be on Sounds and Images but we now do that in the KS3 course. This session now consists of the following topics: - Dry runs Understanding pseudocode Working through trace tables Flow charts Programming: using Lists in Python, together with the For loop Time (mins) 10 5 Activity Resources Recap: Spot the errors in a program with a For Loop on the board Go through answers Background to GCSE Specifications – programming topics compared IWB Handout with more detail of different specification content OCR AQA Powerpoint slides Pseudocode Flowcharts Selection and iteration Data types 1-dimensional arrays Generations of languages Assembly language/machine code Compilers and interpreters Syntax, run-time and logical errors Data types Data structures (1 and 2 dimensional arrays) Flowcharts Structure diagrams Procedures Functions Parameters Syntax, run-time and logical errors 15 Move around to work in different pairs Work through exercise 1 of IterationSelection sheet Go through answers IterationSelection sheet (Adam’s) 10 Pseudocode summary – what is expected in Pseudocode AQA Pseudocode Summary – print out for teachers Introduce dry run and trace table explananation – give example on board of working through a program using a trace table 10 Dry Run Practice Teaching Computing to GCSE Level with Python Whiteboard Exercises 3 & 4 from sheet 9 Sue Sentance 10 10 If time, Question 7 from AQA Specimen – writing a program in Pseudocode Break AQA Specimen paper Programming 30 Shopping example to introduce lists. Model the development of a list step by step Use shopping.py Introduce – adding to a list, printing a list using the for loop, slicing the list, delete from list, search in a list. 25 Exercise from website. Teachers work on exercises on their own 15 Introduce 2D list. Simple example. Work through together 20 Stop 20 mins before end and give question from AQA specimen paper which combines lists, dry runs and all topics covered today. Teachers to answer Teaching Computing to GCSE Level with Python 10 Powerpoint slides on shared area as resource for teachers http://www.pythonsch ool.net AQA Specimen GCSE Paper Question 6 Sue Sentance SESSION 6 This session consists of the following topics: - The internet Networking – topologies IP addresses and domain names The Client-Server model Programming: Functions and passing parameters Time (mins) 10 10 Activity Resources Starter exercise: Dry run exercise as revision from last week Powerpoint slides Compare contents of different specifications (AQA and OCR) OCR (a) explain the advantages of networking stand-alone computers into a local area network (b) describe the hardware needed to connect stand-alone computers into a local area network, including hub/switches, wireless access points (c) explain the different roles of computers in a client-server and a peer-topeer network (d) describe, using diagrams or otherwise, the ring, bus and star network topologies (e) describe the differences between a local area network and a wide area network such as the Internet (f) explain the terms IP addressing, MAC addressing, packet and protocols (g) explain the need for security measures in networks, such as user access levels, suitable passwords and encryption techniques (h) describe and justify network policies such as acceptable use, disaster recovery, failover, back up, archiving. (i) describe the nature of the Internet as a worldwide collection of computer networks (j) describe the hardware needed to connect to the Internet including modems, router (k) explain the need for IP addressing of resources on the Internet and how this can be facilitated by the role of DNS servers AQA understand what a computer network is be able to discuss the advantages and disadvantages of using a computer network be able to describe and explain the bus, ring and star networking topologies be able to discuss the advantages and disadvantages of each of these topologies understand the client-server model be able to explain, in simple terms, the handshake process used in most modern networking protocols be able to explain how coding for a client-server model is different from coding for a stand-alone application understand the concept of coding at the server and client end Teaching Computing to GCSE Level with Python 11 Sue Sentance know what can be coded at the server end know what can be coded at the client end have experience of coding solutions to simple web application problems. This session may have to be carefully tweaked according to the knowledge base of the group of teachers, as some of them may have covered some of this material in A-level or GCSE Ict teaching, or have general knowledge on these topics. Focus on “how to teach” by taking suggestions from teachers on good ideas for teaching in an interesting and engaging way. 5 Introduction to the internet (short video less than 2 minutes) – suggestion for introducing to students http://www.wydea.co m/topic/internet 15 Optional : [Topologies – take feedback from teachers. This may well be familiar as exists in GCSE ICT, in which case this will not need to be covered. The material is in the Powerpoint slides - Ring - Bus - Star] Powerpoint slides 10 IP Addressing - format of an IP address - role of the DNS server - top-level domains Short reminders of what is in the specification may be all that is needed Client Server Model - role of client / server - some simple animations here: http://www.webclasses.net/3comu/intro/units/unit01/a_ClientServer.html - http://www.webclasses.net/3comu/intro/units/unit01/a_PeertoPeer.html Powerpoint slides Protocols – e.g. HTTP, TCP/IP, POP3 – take examples from teachers. Other suggested activities: - List non-computing examples of servers which can supply information resources to clients. Examples include a librarian, a friend with a watch, and a teacher. (from CSTA K-12 syllabus) 10 10 30 - Define an informal protocol for making requests of a server and returning information. - Any sort of role play with clients and server works well - CS Inside Tablets of Stone Activity (http://csi.dcs.gla.ac.uk/workshopview.php?workshopID=4 ) Extract from Chris Bishop 2008 RI Lecture http://richannel.org/christmas-lectures/2008/2008-chris-bishop#/christmaslectures-2008-chris-bishop--untangling-the-web about encrypting messages over the web BREAK Programming Introduce some of the reasons for using functions Teaching Computing to GCSE Level with Python 12 Titles.py Sue Sentance Work through example of using separate functions alongside use of a structure diagram (Title and initial program), covering: - parameters passed into functions - the return keyword 20 30 Teachers complete the exercise Old MacDonald example using functions and parameters for each animal and each noise Extension – return “a” or “an” depending on whether the animal and noise begin with a vowel Quiz – start to develop in pairs Use WB for building up the structure diagram Macdonald.py Quiz.py Task described at: http://www.pythonschool.net/basics_task2/ then extended at: http://www.pythonschool.net/daytwo_task3/ 10 Recap Teaching Computing to GCSE Level with Python 13 Sue Sentance SESSION 7 This session consists of the following topics: - HTMl and CSS Python and CGI scripting (a very basic introduction) Programming – reading and writing to text and .csv file Time (mins) 10 Activity Resources Networking past paper question 5 Drawing from GCSE Specifications: OCR January 2012, Question 4 Powerpoint slides OCR Only specific area is: (l) explain the importance of HTML and its derivatives as a standard for the creation of web pages (However OCR has a coursework task using JavaScript) AQA understand the concept of coding at the server and client end know what can be coded at the server end know what can be coded at the client end have experience of coding solutions to simple web application problems 10 Difference between HTML, CSS and JavaScript 15 Creating an HTML Page with an external style sheet Work through with examples in shared area 15 Creating an HTML form Teachers create a simple Name and Age form Responding dynamically to the form using a simple CGI Script (needed for AQA specification) 20 10 20 20 Break (late) Programming with files Work through an example on reading from a file - create a text file in Notepad - read into a list - process in Python (eg print out) - add a record - write new contents of file Exercises to carry out from website: Task 1a Additional Exercises 4 Exercise 1 and others that appeal Teaching Computing to GCSE Level with Python 14 Examples of HTML page/ CSS Ready-made examples as normally we would have all day to do this in the summer school http://www.python school.net Sue Sentance 20 Continue with Quiz example from last week Store quiz questions with answers in a .csv file 10 Recap and summarise Homework: complete the quiz Teaching Computing to GCSE Level with Python 15 Sue Sentance SESSION 8 This session consists of the following topics: - Database theory – entities, attributes and relationships Primary and foreign keys SQL queries Creating tables using DDL Python and sqLite3 Time (mins) 5 10 Activity Resources Starter: Database theory – matching exercise Short exercise to link terms to definitions Comparision of specifications OCR Candidates should be able to: (a) describe a database as a persistent organised store of data (b) explain the use of data handling software to create, maintain and interrogate a database. (c) separation of data from applications and why this is desirable (d) describe the principal features of a DBMS and how they can be used to create customised data handling applications. (e) understand the relationship between entities and tables (f) understand the components of a relational database, such as tables, forms, queries, reports and modules MatchingExercise.doc AQA 10 20 Powerpoint slides know how to read and write data from an external database in a way that is appropriate for the programming language(s) used and the problem being solved understand the basic concepts of a relational database as a data store be able to explain the terms record, field, table, query, primary key, relationship, index and search criteria be able to create simple SQL statements to extract, add and edit data stored in databases have experience of using these SQL statements from within their own coded systems be able to use databases from within their own web based applications Note that there are significant differences here between the requirements of the different specifications Recap on: - primary key - relationships - foreign key - QBE queries Introduction to SQL SELECT FROM Teaching Computing to GCSE Level with Python SQL Exercise sheet 16 Sue Sentance WHERE ORDER BY 20 Use slides and exercises to work through Open sqliteBrowser Open Movie database (from home page at http://pythonschool.net ) Try out exercises on worksheet (in pairs) Go through answers http://sqlitebrowser.sourcef orge.net/ Sqlitebrowser can be downloaded and run from a memory stick or My Documents (no administrative permissions needed) Movie worksheet.doc 10 20 Break (slightly late) Demonstrate how to write same SQL queries on the Movie database in Python. For example: sql = "select * from film" cursor.execute(sql) result = cursor.fetchall() #returns a list print(result) 25 Teachers follow first example and then work through further examples with Movie database Change database to Animals Database (http://www.pythonschool.net/daythree_tablemake/ ) Python Schoo resources Demonstrate how to create a table Demonstrate how to insert records All work through the example together 20 10 Teachers work through Animal database example - insert records - query result - delete a record - start to develop menu-based system of animals Recap and summarise http://www.pythonschool.n et/daythree_task1/ Homework: Very important to go over this material during the week as we will need to move on from this in the next session Teaching Computing to GCSE Level with Python 17 Sue Sentance SESSION 9 This session consists of the following topics: - Coursework examples from current specifications GUI options in Python More on database programming in Python Time (mins) 10 20 15 15 10 30 50 10 Activity Resources Starter exercise: past paper question on database Look at A452 examples - Encryption and Excel/VBA - JavaScript - Little Man Computer - App Inventor AQA Specimen SQL question Powerpoint slides/ OCR coursework resources Discuss in groups value and disadvantages of different tasks Look at AQA examples - mobile development - game programming (introduce PyGame) - web-based scenario (using CGI scripting) Examples of GUI in Python - EasyGui - Tkinter - PyQT (http://www.riverbankcomputing.com ) Break Programming: working with databases (continued) Linking two tables using foreign key Referential integrity in Python Animal database example from website Develop menu then add/delete/list animals Link vet table to animal table AQA Coursework material (currently only specimen materials available) See http://www.pythonschool.net for PyQT resources http://www.pythonschool.net Recap/discuss/summarise and point to further work Teaching Computing to GCSE Level with Python 18 Sue Sentance SESSION 10 This session consists of the following topics: - Programming coursework examples from current specifications Mark schemes and examples of student work Python: creating solutions to coursework exercises Time (mins) 15 25 Activity Resources Starter: Dry run exercise from OCR Past paper Comparison of coursework programming examples Mark schemes 20 Time to look at student work/ examples of coursework OCR Past papers Powerpoint slides Handouts – mark schemes etc. Sophie/ examples of coursework 10 10 Discussion of schemes of work/timing of coursework Break Programming consolidation Programming task 11: using functions/text files 30 OCR Controlled assessments Controlled assessment 3 (OCR) - simulating a dice throw - determining a character’s attribute 5 30 5 20 Recap and discussion Programming task 2: Validation & CSV files Controlled assessments Controlled assessment 4 (OCR) - validating an email address (use regular expressions) - retrieving and checking a password (use CSV files) Recap and discussion Where now? Planning of future meetings & developing skills through the website List of resources to look at Further courses with Python School (summer 2013) Hub meetings (Essex) 1 Examples of coursework chosen depend on what is current at the time Teaching Computing to GCSE Level with Python 19 Sue Sentance 8-WEEK COURSE ON TEACHING COMPUTING TO GCSE LEVEL WITH PYTHON This is an alternative model, followed by offering the course on databases as an additional one-day course. The discussion about Controlled Assessments is often a discussion at Hub meetings and also increasingly awarding-body dependent as teachers are now choosing different specificaitons to teach. In the revised course outline, the programming section stops short of databases and Python and the theory section does not include any discussion of examination-board specific controlled assessment material. Teaching Computing to GCSE Level with Python 20 Sue Sentance