  In this paper we consider the problem of modelling when students end their
session in an online mathematics educational system. Being able to model this
accurately will help us optimize the way content is presented and consumed.
This is done by modelling the probability of an action being the last in a
session, which we denote as the End-of-Session probability. We use log data
from a system where students can learn mathematics through various kinds of
learning materials, as well as multiple types of exercises, such that a student
session can consist of many different activities. We model the End-of-Session
probability by a deep recurrent neural network in order to utilize the long
term temporal aspect, which we experimentally show is central for this task.
Using a large scale dataset of more than 70 million student actions, we obtain
an AUC of 0.81 on an unseen collection of students. Through a detailed error
analysis, we observe that our model is robust across different session
structures and across varying session lengths.
