Hide TOC in Exam Mode

I am creating a publication that has an exam menu button that takes the user to a particular webpage in the publication. Is it possible when the exam menu button is clicked the TOC is automatically hidden? Also when the user navigates out of the exam webpage the TOC reappear. Thanks in advance for any help on this. :slight_smile:

In your UserMain script, copy/paste this code (and remove existing OnBeforeNavigate block first);

function OnBeforeNavigate(NewURL, TargetFrame: String): Boolean;
 // Before the publication displays a page. Set Result to True to stop the operation.
 ShowLeftPanel(2, CompareText(NewURL, "http://heserver/exam.htm") = 0);
 Result := False;                        

Replace the URL with the one of your exam page.
(Not tested)