public function endQuestionnaire(\DateTime $endDate = null)
    {
        $configuration = $this->getUserConfiguration();

        if (is_null($configuration->getEndAt())) {
            $now = new \DateTime();

            if (!is_null($endDate)) {
                $now = $endDate;
            }

            $configuration = $this->getUserConfiguration();
            $configuration->setEndAt($now);

            $this->updateSessionConfiguration()
                ->clearQuestionnaire();
        }

        return $this;
    }