Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Design the screen and the data

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

45 minutes

The paper book is already a design

Look at the club's paper book. Somebody drew columns by hand with a ruler: day, hour, court, name.

Those columns are a data design. They say what the club needs to remember about every booking.

Your job is to design the same thing for a computer, and to design the screen the staff will use.

Key words

WordWhat it meansExample
InterfaceWhat the user sees and uses on the screen.a form with buttons
WireframeA simple plan of a screen with no colour or style.boxes and labels
FieldOne piece of information in a record.hour
RecordAll the fields about one thing.one booking
Data dictionaryA table that describes each field: name, type, example and rule.hour, integer, 10, 9 to 20
Data typeThe kind of value a field holds.integer or string
IntegerA whole number.10
FloatA number with a decimal point.4.5
StringText in quote marks."Sam"
BooleanTrue or False.True
CSVA plain text file where each line is a record and commas (,) separate the fields.Sam,1,10
AccessibilityMaking a tool usable by as many people as possible.clear labels, big buttons

The cells students fill in are left blank in this preview.

A data dictionary for a booking

FieldData typeExampleRule
memberstringSam Jones1 to 30 letters
is_memberBooleanTrueTrue or False
courtinteger1Only 1 or 2
hourinteger10From 9 to 20
pricefloat4.0Worked out, never typed

The cells students fill in are left blank in this preview.

Choose the data type of each field

Have a go

Choose the data type of each field

6 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Try it: a record becomes a CSV line

Code: python
booking = {"member": "Sam", "court": 1, "hour": 10}

line = booking["member"] + "," + str(booking["court"]) + "," + str(booking["hour"])
print(line)

back = line.split(",")
print(back)
print(int(back[2]) + 1)

# split(",") cuts the text at each comma.
# Why do we need int() on the last line?

Try it: a very simple form

Code: web
<h1>Book a court</h1>
<label for="name">Name</label>
<input id="name">
<label for="court">Court (1 or 2)</label>
<input id="court" type="number" min="1" max="2">
<label for="hour">Hour (9 to 20)</label>
<input id="hour" type="number" min="9" max="20">
<button>Book</button>

Simple and accessible

data-callouts.tip.label

Give every box a label that says what to type. Make buttons big. Do not use colour alone to show a mistake: say it in words too. A person with a small phone, or a person who cannot see well, must be able to use it too.

The lesson goes on

4 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.