Skip to content
PlayOwl

Coding · Grade 8

User Interfaces, Events and State

Learners design interface behaviour as state machines with named states, events and allowed transitions, and separate the model (state) from the view (a single render function) so the screen never disagrees with the data. They trace longer JavaScript event sequences with guards and counters, and design helpful feedback: clear status messages, disabled controls and an undo stack.

  • 4 lessons
  • About 85 minutes
  • Check what you learned: 8 questions
  • Ways to answer: choose an answer, put code in order, trace code, type a number, put in order and sort into groups
Try it now (no account) One of the five free starter courses Open in PlayOwl

What learners will discover

  • Model interface behaviour as a state machine and trace which events cause transitions or are ignored.
  • Separate model and view so handlers change state and one render function draws the screen from it.
  • Trace event sequences through JavaScript state machines that use guards and counters.
  • Design interface feedback with status messages, disabled controls and an undo stack.

Lessons

  1. State machines 6 steps3 practiceabout 22 min
  2. Keep the view in step with the state 5 steps3 practiceabout 20 min
  3. Tracing longer event sequences 5 steps3 practiceabout 20 min
  4. Feedback, undo and accessible controls 5 steps2 practiceabout 18 min
  5. Check what you learned 8 questions at the end

Keep exploring

Games to practice with

More 8th grade coding

Guide for grown-ups