Jupyter notebooks are increasingly being adopted by teachers to deliver
interactive practical sessions to their students. Notebooks come with many
attractive features, such as the ability to combine textual explanations,
multimedia content, and executable code alongside a flexible execution model
which encourages experimentation and exploration. However, this execution model
can quickly become an issue when students do not follow the intended execution
order of the teacher, leading to errors or misleading results that hinder their
learning. To counter this adverse effect, teachers usually write detailed
instructions about how students are expected to use the notebooks. Yet, the use
of digital media is known to decrease reading efficiency and compliance with
written instructions, resulting in frequent notebook misuse and students
getting lost during practical sessions. In this article, we present a novel
approach, MOON, designed to remedy this problem. The central idea is to provide
teachers with a language that enables them to formalize the expected usage of
their notebooks in the form of a script and to interpret this script to guide
students with visual indications in real time while they interact with the
notebooks. We evaluate our approach using a randomized controlled experiment
involving 21 students, which shows that MOON helps students comply better with
the intended scenario without hindering their ability to progress. Our
follow-up user study shows that about 75% of the surveyed students perceived
MOON as rather useful or very useful