I use git for all my digital exams, I have a simple script that just commits all changes every 5 minutes. That way I can go back to old revisions or undelete things as needed. This works pretty well as I write everything in LaTeX. This also means that I can see exactly how much I had done at any point in time. I’ve used this to graph the lines of code in my LaTeX document over time, for a 5 hour physics exam I took 2 days ago.
It seems I worked more or less continuously for the first 60 or so minutes. After that it’s all in steps, where I’ve had a problem, thought about it, and then written the solution down.