code: public function getCurrentAssessmentSession(RunnerServiceContext $context)
      {
          if ($context->isAdaptive()) {
              return new AssessmentItemSession($context->getCurrentAssessmentItemRef(), new SessionManager());
          } else {
              return $context->getTestSession();
          }
      }
docs: Get Current Assessment Session.
  
  Depending on the context (adaptive or not), it will return an appropriate Assessment Object to deal with.
  
  In case of the context is not adaptive, an AssessmentTestSession corresponding to the current test $context is returned.
  
  Otherwise, an AssessmentItemSession to deal with is returned.
  
  @param \oat\taoQtiTest\models\runner\RunnerServiceContext $context
  @return \qtism\runtime\tests\AssessmentTestSession|\qtism\runtime\tests\AssessmentItemSession