code: public function check(RunnerServiceContext $context)
      {
          $state = $context->getTestSession()->getState();
  
          if ($state == AssessmentTestSessionState::CLOSED) {
              throw new QtiRunnerClosedException();
          }
  
          return true;
      }
docs: Checks if the test is still valid
  @param RunnerServiceContext $context
  @return boolean
  @throws \common_Exception
  @throws QtiRunnerClosedException