Weather Wise is a multiple choice weather quiz that users can play to help improve there knowledge about weather and is a fun game for all ages, so everyone can play.
When a user first opens the quiz it will show a menu with a title and a brief overview of what it actually is. Below this it will then show a list of options with what the user would like to do next. Depending on there choice it will either start the game, show the instructions on how to play the game or quit the game. If the user inputs an incorrect value they will then be informed that whatever they have just inputted was incorrect and they need to write either 1, 2 or 3 depending on there choice. With the first option been chosen, it will then ask the user what level of difficulty the user would like for example easy, medium or hard. Again if the user inputs an incorrect value it will tell them that they have done so and need to write either 1, 2 or 3. Following there choice it will then ask how many questions they would like to answer for example 10, 25 or 50. Once more if the user didn't type a correct value it will tell them so and that they need to type either 1, 2 or 3. After this the app will then access data from the questions library and start asking randomly chosen multiple choice questions up until the user has answered there desired amount, for example what is rain? a. god peeing b. condensation from clouds c. water squirting from plains d. water that falls from clouds in the sky, that happens when tiny water droplets in the clouds join together and become too heavy to stay in the air. Once again if the user doesn't input a, b, c or d for any question they will be told to write a correct value from the options given. When the quiz has been finished there score will be toted up and then shown to the user, then the user will be asked if they would like to play again or quit the game. If the user doesn't input a correct value again they will be informed of this and asked to input a correct value. Providing they have chosen a correct value it will either take them to the menu or show message saying thank you for playing, goodbye. However at the menu screen if the user inputted the second option the app will then show the user how to play the quiz and once they have read this it will ask if they want to play again. Finally if the user chose the last option it will then double check they want to quit and if they do show the thank you for playing, goodbye.
Deployed site: https://ui.dev/amiresponsive?url=https://weather-wise-project-e6ccd7a6b753.herokuapp.com
source: amiresponsive
Header section
Menu options
Incorrect input for menu
Option 1
Incorrect option 1 choice
Option 1 part 2
Incorrect option 1 part 2
Option 2
Incorrect option 2 choice
Option 3
Incorrect option 3 choice
The quiz
Incorrect value for quiz
Score
Finished
Incorrect value at finish
git add
, git commit
, git push
)To follow best practice, a flowchart was created for the app's logic, and mapped out before coding began using a free version of Draw.io.
Below is the flowchart of the main process of this Python program. It shows the entire cycle of the program.
The program uses classes as a blueprint for the project's objects (OOP). This allows for the object to be reusable.
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑-START OF NOTES (to be deleted)
class Person:
""" Insert docstring comments here """
def __init__(self, name, age, health, inventory):
self.name = name
self.age = age
self.health = health
self.inventory = inventory
The primary functions used on this application are:
get_sales_data()
validate_data()
update_worksheet()
calculate_surplus_data()
get_last_5_entries_sales()
calculate_stock_data()
main()
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑-END OF NOTES (to be deleted)
I've used the following Python packages and/or external imported packages.
gspread
: used with the Google Sheets APIgoogle.oauth2.service_account
: used for the Google Sheets API credentialstime
: used for adding time delaysos
: used for adding a clear()
functioncolorama
: used for including color in the terminalrandom
: used to get a random choice from a listquestion
: used to pull all the questions from my own made file [!NOTE]
For all testing, please refer to the TESTING.md file.
Code Institute has provided a template to display the terminal view of this backend application in a modern web browser. This is to improve the accessibility of the project to others.
The live deployed application can be found deployed on Heroku.
This project uses Heroku, a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud.
Deployment steps are as follows, after account setup:
PORT
, and the value to 8000
then select add.Python
first, then Node.js
second. (if they are not in this order, you can drag them to rearrange them)Heroku needs three additional files in order to deploy properly.
You can install this project's requirements (where applicable) using:
pip3 install -r requirements.txt
If you have your own packages that have been installed, then the requirements file needs updated using:
pip3 freeze --local > requirements.txt
The Procfile can be created with the following command:
echo web: node index.js > Procfile
The runtime.txt file needs to know which Python version you're using:
python3 --version
in the terminal.python-3.9.19
For Heroku deployment, follow these steps to connect your own GitHub repository to the newly created app:
Either:
Or:
heroku login -i
heroku git:remote -a app_name
(replace app_name with your app name)add
, commit
, and push
to GitHub, you can now type:
git push heroku main
The frontend terminal should now be connected and deployed to Heroku!
This project can be cloned or forked in order to make a local copy on your own system.
For either method, you will need to install any applicable packages found within the requirements.txt file.
pip3 install -r requirements.txt
.If using any confidential credentials, such as CREDS.json
or env.py
data, these will need to be manually added to your own newly created project as well.
You can clone the repository by following these steps:
git clone https://github.com/AshLaw96/weather-wise.git
Alternatively, if using Gitpod, you can click below to create your own workspace using this repository.
Please note that in order to directly open the project in Gitpod, you need to have the browser extension installed. A tutorial on how to do that can be found here.
By forking the GitHub Repository, we make a copy of the original repository on our GitHub account to view and/or make changes without affecting the original owner's repository. You can fork this repository by using the following steps:
No differences were found between the local version and the live deployed version of the program.
Source | Location | Notes |
---|---|---|
Markdown Builder | README and TESTING | tool to help generate the Markdown files |
YouTube | PP3 terminal | tutorial for adding color to the Python terminal |
Chatgpt | question.py | used to generate randomly made multiple choice questions |
Source | Location | Type | Notes |
---|---|---|---|
Audio Micro | game page | audio | free audio files to generate the game sounds |
TinyPNG | entire site | image | tool for image compression |