kuiperst / buggy-race-editor Goto Github PK
View Code? Open in Web Editor NEWThis project forked from buggyrace/buggy-race-editor
This project forked from buggyrace/buggy-race-editor
Some useful information — such as the cost of buggy components — is only
available on the race server. You can't access this information when you're
using your buggy editor offline.
Add a new page called /info
that displays the cost information.
Now you (or any user of your buggy editor) can investigate buggy costs without
going to the race server.
You need to be able to deploy the webserver, contained in app.py
, so you can view it in your web browser.
Run the python code so it listens on a port somewhere you can point your browser at.
Your editor looks identical to the basic one.
Make it look beautiful and different from everybody else's.
The buggies are just a bunch of numbers and settings!
Construct a visual representation of each buggy that shows its configuration.
The default app only lets you save one buggy. You should be able to save
different buggies so you can switch between them.
Modify the app to create a new buggy and subsequently update it, and to provide
a way to switch between the different buggies you've created.
Make it possible to create a new user to use when logging in with
user logins (4-USER).
Make a registration (or sign-in) page with a form for creating new users.
In the basic app, the form is blank when you visit it so it always implies the
default value.
Before you present the form, you should fill its values with the current
settings from the Buggy record in the database.
Anyone can login as any user they like... unless there is a password on user
accounts.
Set and store a password for each user.
The source code for the app you're going to be developing already exits: you
need to get your own copy of it to a place where you can edit it and run it.
Get the source code, ideally by using the VSCode workspace file we have prepared for you. It will clone your Github repository onto your personal directory in the CS Department's teaching server.
A requirement for the below steps is to install the main IDE (Integrated Development Environment) we will use for this module: VSCode. This is a modern, powerful and thorough IDE that will be a valuable asset in your toolbox! This is what needs to happen:
Fork
the template for the buggy race editor from [our Github repository]({{ site.editor_url }}) to yours.After VSCodes finishes connecting you to our teaching server, it will be time to get the code from Github, to your personal home directory in the server. Do not worry, we have also automated this for you. To get a copy of your buggy race editor repo to the server, do:
git clone https://github.com/
and wait.%BUGGY_EDITOR_REPO_NAME%
.%BUGGY_EDITOR_REPO_NAME%
folder is not in your home directory, then probably something went wrong. Try to reproduce the above steps once more.Flask behaves differently when it is running in development ("dev") and
production environments, which you can switch using environment variables. Get
that working so you can do your coding in development mode, but work on your
racing buggy in production mode.
Make sure the configuration is correct and you're using the environment
variable FLASK_ENV
correctly.
After you've made your some choices on your buggy form, there are still lots of
items to fill in. It would be good to auto-populate empty settings with values
that create a complete, viable buggy.
Add a button that automatically fills the other entries. Maybe these are just
sensible default values. Or perhaps you can ask for a cost limit when the button
is pressed, and try to add items so that the buggy's total cost is within that
limit.
The only data being collected by the form is the number of wheels.
Add more items to the form (and save it in the database).
You must demonstrate that you can change a template so the change appears in
the browser.
Edit some text in a template (e.g., templates/index.html
).
Confirm it changes when you hit the corresponding page in the browser.
You have multiple buggies: you should be able to delete ones you don't want.
Add a delete
route to remove a buggy.
Manually copying the JSON data from the editor to paste into the race server is
clunky — use the buggy submission API instead.
Ask for the API specification and implement an upload to server feature for
a selected buggy.
The basic form isn't easy to use. Can you make it better?
Try to lay out the form to be clear and easy to use.
If you enter "banana" for the number of wheels, you should get an error.
Add data validation: you app should check that the data input is the right kind
of thing (an integer) and reject it with a warning.
Any user can edit any buggy. Only the buggy's creator should be able to edit
(or delete) it.
Associate buggies with a specific user and only grant access to buggies to the
logged-in user.
This task is a freestyle placeholder for other developments to the editor
once you've done all the others.
Implement your own custom features.
You don't know how well different buggies did in their races, but you should
be able to see which ones have won more races, and how.
Store and present a log of race results for each buggy.
At least one user should be able to change other users (and admin, or superuser).
Use something like the is_admin
setting in the users table and add superuser
capability for manipulating buggies and users.
Anyone can access your app and edit a buggy: ultimately only the person who
created it should be able to. Add a login mechanism so you can tell the
difference between users.
Add usernames to distinguish between users, and a mechanism for starting and
ending a session (such as logging in and logging out).
You should be able to run automatic tests that confirm your app calculates the
cost correctly... as well as other things too.
You probably know your app works because you've been running it (and playing
with it) as you go along. But you should write some automated tests.
The cost of the buggy (worked out using the game rules) affects whether it can
be entered in some races. Add the cost to the record.
Add a new integer column called total_cost
to the buggies
table, and store
the total cost there.
A user who forgets their password can't log in.
There's no email address associated with a user, so to implement a reset
password option perhaps you'll need to add that to the user record, and find a
way to send an email from within Python. Or use a one-use token system (see
hints).
There are some configuration options that are not allowed (for example,
the quantity of wheels must be even).
Add game rules to your validation.
The user's choices for the colours and pattern of the buggy's pennant (flag) is
visual information but is probably displayed as text.
Show a graphical representation of the pennant in the browser.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.