Create Your Own Quiz using_Python KS3 COMPUTING KS3 Computing

Slides:



Advertisements
Similar presentations
ProgressBook User Start-Up
Advertisements

The Writing Process Communication Arts.
ECS 15 if and random. Topic  Testing user input using if statements  Truth and falsehood in Python  Getting random numbers.
16-May-15 Sudden Python Drinking from the Fire Hose.
An introduction to Python A series of introductory lessons to Python that does not use too much maths!
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
Noadswood Science,  To know the basics of Python coding and decoding Monday, September 07, 2015.
An Introduction to Textual Programming
Joining an eService Class. Open your browser and go to this website: Step 1: Go to website.
Downloading and Installing Autodesk Revit 2016
Conditions. Objectives  Understanding what altering the flow of control does on programs and being able to apply thee to design code  Look at why indentation.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Lesson 6. Python 3.3 Objectives. In this lesson students will learn how to output data to the screen and request input from the user. Students will also.
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
Make a dice challenge! This is a starter activity and should take 5 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.Copy the code below in.
My Python Programmes NAME:.
Files Tutor: You will need ….
Python Let’s get started!.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
GCSE Computing: Programming GCSE Programming Remembering Python.
Hacking Minecraft on the Raspberry Pi using Python Lesson 2 1.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Functions. What is a Function?  We have already used a few functions. Can you give some examples?  Some functions take a comma-separated list of arguments.
Input, Output and Variables GCSE Computer Science – Python.
GCSE COMPUTER SCIENCE Practical Programming using Python Lesson 4 - Selection.
© Mark E. Damon - All Rights Reserved Add © All rights Reserved Your Name Topic of Game.
Scratch Programming Cards
GCSE COMPUTER SCIENCE Practical Programming using Python
Hardware & Software Lesson 1 Computer Systems & Components
Hardware & Software Lesson 3 Software KS3 COMPUTING KS3 Computing
GCSE COMPUTER SCIENCE Practical Programming using Python
Input and Output Upsorn Praphamontripong CS 1110
Lesson 1 - Sequencing.
Python Let’s get started!.
Introduction to Python
Lesson 4 - Challenges.
IF statements.
Lesson 3 - Repetition.
G7 programing language Teacher / Shamsa Hassan Alhassouni.
Let's Race! Typing on the Home Row
Engineering Innovation Center
Computer Science and an introduction to Pascal
Let’s make a shape…. Move!
Please log on a computer Open the web and then Open four tabs…
The Five Stages of Writing
Escape sequences: Practice using the escape sequences on the code below to see what happens. Try this next code to help you understand the last two sequences.
Study Island Student Demo:
Story time Task 5 Computer Programming Gray , Calibri 24
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
Superhero Quiz Year 9 Python.
Inputs and Variables Programming Guides.
The Five Stages of Writing
An introduction to Python
Joining an eService Class.
Joining an eService Class.
Programming In Lesson 4.
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
12th Computer Science – Unit 5
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
Programming In.
Introduction to Python
The Writing Process.
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
Hint idea 2 Split into shorter tasks like this.
Starter Activities GCSE Python.
Primary School Computing
GCSE Computing.
Presentation transcript:

Create Your Own Quiz using_Python KS3 COMPUTING KS3 Computing A Python Quiz

You are going to create a quiz on a topic of your own choice Introduction You are going to create a quiz on a topic of your own choice The topic is your choice as long as it is sensible Example topics include: A school subject General knowledge A hobby or interest

You will use the players name to personalise the quiz. Quiz Features Main quiz features Name You will use the players name to personalise the quiz. Minimum 3 Questions The quiz will have a minimum of 3 Questions. The quiz should be challenging, make it difficult! Output the Score Not only will your quiz tell the player their final score at the end, it will tell them their score after each question. Save Score to a File Every time your quiz is taken it will save the name and score of the person into a file.

How much progress am I making? Success Criteria How much progress am I making? All Students Created a quiz with at least three questions. Quiz runs with minor errors. P1 - P3 Most Students Created a quiz containing at least three questions using features such as various question types, elif statements and variable scores. Quiz runs with no errors. P4 - P6 Some Students Created a quiz containing at least five questions using features such as various question types, elif statements and variable scores. Saves data to a file. Quiz runs with no errors. P7 - P9 Your quiz should be unique and creative to get into the upper parts of each band. Copying and pasting will have a negative effect on your P score.

Identifying and Fixing Errors Troubleshooting Identifying and Fixing Errors 1 Find the error yourself by following the steps below. 2 Ask the people sat either side of you to help you spot the error. 3 Ask the teacher only if you have tried everything else. Brackets & Speech Marks There should always been an even number (0, 2, 4, 6..) of both of these in each line. Data Types Make sure when a number is your answer you are using int, and not using it when you are using a word. Indents All lines under if/elif/else statements needed to indented four spaces using the tab key (above caps lock).

What Am I looking For? Questions Error-free Independently Features Assessment Criteria Questions How many questions you have produced? Error-free Is it error free? Independently Have you worked independently? Features What features of Python have you used? Creativity Have you work used your creativity and imagination?

Quiz Title Decide on an interesting title for your quiz to be displayed as soon as the program is run Start a new Python file Pick a title for your quiz import time print(“---------------------------------------”) print(“-----Mr Lyon’s Computer Game Quiz!-----”) Run your quiz by pressing F5 and save it as My Python Quiz

Ask the quiz player their name Player Name Ask the quiz player their name time.sleep(1) name = input(“What is your name? ”) time.sleep(1) pauses the game for one second, you can change this value.

Set a starting score and tell the player it Player Score Set a starting score and tell the player it time.sleep(1) score = 0 #you can chose your own starting score

Answer that is a word or sentence Question Example Answer that is a word or sentence WORD print(“Question 1!”) #change this to the correct question number time.sleep(1) answer = input(“What is the name of the arcade game released in 1978 based in space? “) #make sure there is a space after the question mark if answer.lower() == “space invaders”: #no capital letters print(“Correct!”) score = score + 1 #you can change this value print(name + “, your new score is “ + str(score) + “.”) else: print(“Wrong!”) print(name + “, your score is still “ + str(score) + “.”)

Question Example Answer that is a number NUMBER print(“Question 1!”) time.sleep(1) answer = int(input(“What year was Pacman released in? “)) #don’t forget second bracket if answer == 1985: #make sure there are no quotes around a number print(“Correct!”) score = score + 1 print(name + “, your new score is “ + str(score) + “.”) else: print(“Wrong!”) score = score – 1 #this is how you minus points print(name + “, your score is still “ + str(score) + “.”)

MULTI-ANSWER (Same score each answer) Question Example Question with more than one possible answer MULTI-ANSWER (Same score each answer) print(“Question 1!”) time.sleep(1) answer = input(“Name one supporting character from the Sonic series? “) if answer.lower() in [“tails”, “knuckles”]: #no capital letters print(“Correct!”) score = score + 1 print(name + “, your new score is “ + str(score) + “.”) else: print(“Wrong!”) print(name + “, your score is still “ + str(score) + “.”)

MULTI-ANSWER (Different score each answer) Question Example Different answers have different points MULTI-ANSWER (Different score each answer) print(“Question 1!”) time.sleep(1) answer = input(“Name one supporting character from the Sonic series? “) if answer.lower() == “tails”: #no capital letters print(“Correct!”) score = score + 10 print(name + “, your new score is “ + str(score) + “.”) elif answer.lower() == “knuckles”: score = score + 5 else: print(“Wrong!”) print(name + “, your score is still “ + str(score) + “.”)

Questions You need to have a minimum of 3 questions. Make sure you have 3 questions before going on to the next slide.

Tell the player their final score Output the Final Score Tell the player their final score Insert this code after your last question #prints the final score to the screen print(name + “, your final score is: “ + str(score) + “.”)

Save the player name and score to a text file Saving Scores part 1 Save the player name and score to a text file Insert the code below the title but before the player enters their name def saveScore(n,s): #opens the file or creates one if it does not already exist file = open(“scores.txt”, “a”) #records the user’s score in the file file.write(“Name: “ + n + ”, Score: “ + str(s) + ”\n”) #closes the file file.close() return You need part 2 on the next slide

Insert the code below at the very end of your program Saving Scores part 2 Insert the code below at the very end of your program #calls the saveScore function and passes the name and score variables saveScore(name,score) Next time you run the quiz, your score will be saved in a file (in the same folder as where your Python quiz is saved). Your quiz is finished!

The more questions you have the higher mark you will get. Keep adding them! The more questions you have the higher mark you will get.