From 24f9a237ae23034aabbf938e8d8a70a3f3d777a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Frankiewicz?= Date: Fri, 2 Jul 2021 08:59:44 +0200 Subject: [PATCH] [UW-2538] fixes method --- src/Service/SurveyService.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Service/SurveyService.php b/src/Service/SurveyService.php index 4efb519..29026e3 100644 --- a/src/Service/SurveyService.php +++ b/src/Service/SurveyService.php @@ -432,9 +432,9 @@ class SurveyService $arguments = [ $surveyId, $offset = 0, - $limit = 1, + $limit = 10, $includeUnused = false, - $attributes = false, + ['completed'], ['email' => $email] ]; @@ -443,9 +443,13 @@ class SurveyService $participants = $this ->client ->run(MethodType::LIST_PARTICIPANTS, $arguments) - ->getData(); + ->getData(true); - return $participants->count() > 0; + foreach ($participants as $participant) { + if ('N' !== $participant['completed']) { + return true; + } + } } catch (CannotProcessDataException $exception) { if (ReasonType::NO_PARTICIPANTS_FOUND !== $exception->getReason()) { throw $exception;