enhanced questionnaire version handling and handling uploads from outdated questionnaires through automatic revisioning and checks
Some checks failed
PHPUnit / test (push) Has been cancelled
Some checks failed
PHPUnit / test (push) Has been cancelled
This commit is contained in:
@ -137,18 +137,24 @@ abstract class QdbTestCase extends PHPUnitTestCase
|
||||
array $answers,
|
||||
?int $startedAt = null,
|
||||
?int $completedAt = null,
|
||||
?int $structureRevision = null,
|
||||
): array {
|
||||
$now = time();
|
||||
$startedAt ??= $now - 60;
|
||||
$completedAt ??= $now;
|
||||
|
||||
return $this->api()->encryptedPost($token, 'app_questionnaires', [
|
||||
$payload = [
|
||||
'questionnaireID' => $questionnaireId,
|
||||
'clientCode' => $clientCode,
|
||||
'answers' => $answers,
|
||||
'startedAt' => $startedAt,
|
||||
'completedAt' => $completedAt,
|
||||
]);
|
||||
];
|
||||
if ($structureRevision !== null) {
|
||||
$payload['structureRevision'] = $structureRevision;
|
||||
}
|
||||
|
||||
return $this->api()->encryptedPost($token, 'app_questionnaires', $payload);
|
||||
}
|
||||
|
||||
protected function submissionVersionCount(string $clientCode, string $questionnaireId): int
|
||||
|
||||
Reference in New Issue
Block a user