public function getStateMessage($testSession)
    {
        if ($testSession instanceof AssessmentTestSession) {
            switch ($testSession->getState()) {
                case AssessmentTestSessionState::SUSPENDED:
                    return $this->getPausedStateMessage($testSession);
                    
                case AssessmentTestSessionState::CLOSED:
                    return $this->getTerminatedStateMessage($testSession);
                    
                case AssessmentTestSessionState::INITIAL:
                    return $this->getInitialStateMessage($testSession);
                    
                default:
                    return $this->getRunningStateMessages($testSession);
            }             
        } else {
            throw new \common_exception_InvalidArgumentType(
                'QtiRunnerMessageService',
                'getStateMessage',
                0,
                'qtism\runtime\tests\AssessmentTestSession',
                $testSession
            );
        }
    }