diff --git a/src/LimeSurvey/Result/Item/Participant.php b/src/LimeSurvey/Result/Item/Participant.php index cf89f4b..19590fc 100644 --- a/src/LimeSurvey/Result/Item/Participant.php +++ b/src/LimeSurvey/Result/Item/Participant.php @@ -201,7 +201,12 @@ class Participant extends BaseItem break; case 'completed': - $this->completed = 'Y' === trim(strtoupper($value)); + if ('N' === trim(strtoupper($value))) { + $this->completed = false; + break; + } + + $this->completed = Date::isValidDate($value, true); break; case 'usesleft': diff --git a/tests/Result/Item/ParticipantTest.php b/tests/Result/Item/ParticipantTest.php index f7b6d20..3ce6993 100644 --- a/tests/Result/Item/ParticipantTest.php +++ b/tests/Result/Item/ParticipantTest.php @@ -200,7 +200,7 @@ class ParticipantTest extends BaseTestCase 'sent' => 'Y', 'remindersent' => 'N', 'remindercount' => 1, - 'completed' => 'Y', + 'completed' => (new DateTime())->format('Y-m-d H:i'), 'usesleft' => 5, 'validfrom' => (new DateTime())->format('Y-m-d H:i:s'), 'validuntil' => null,