code: public function assertQtiRunnerServiceContext(RunnerServiceContext $context)
      {
          if (!$context instanceof QtiRunnerServiceContext) {
              throw new \common_exception_InvalidArgumentType(
                  __CLASS__,
                  __FUNCTION__,
                  0,
                  QtiRunnerServiceContext::class,
                  $context
              );
          }
      }
docs: Check if the given RunnerServiceContext is a QtiRunnerServiceContext
  
  @param RunnerServiceContext $context
  @throws \common_exception_InvalidArgumentType