/**
  * Stuff to be undertaken when the Assessment Item presented to the candidate
  * times out.
  * 
  * @param AssessmentTestSessionException $timeOutException The AssessmentTestSessionException object thrown to indicate the timeout.
  */
 protected function onTimeout(AssessmentTestSessionException $timeOutException)
 {
     $session = $this->getTestSession();
     if ($session->getCurrentNavigationMode() === NavigationMode::LINEAR) {
         switch ($timeOutException->getCode()) {
             case AssessmentTestSessionException::ASSESSMENT_TEST_DURATION_OVERFLOW:
                 $session->endTestSession();
                 break;
             case AssessmentTestSessionException::TEST_PART_DURATION_OVERFLOW:
                 $session->moveNextTestPart();
                 break;
             case AssessmentTestSessionException::ASSESSMENT_SECTION_DURATION_OVERFLOW:
                 $session->moveNextAssessmentSection();
                 break;
             case AssessmentTestSessionException::ASSESSMENT_ITEM_DURATION_OVERFLOW:
                 $session->moveNextAssessmentItem();
                 break;
         }
         if ($session->isRunning() === true && taoQtiTest_helpers_TestRunnerUtils::isTimeout($session) === false) {
             taoQtiTest_helpers_TestRunnerUtils::beginCandidateInteraction($session);
         }
     } else {
         $itemSession = $session->getCurrentAssessmentItemSession();
         $itemSession->endItemSession();
     }
 }