Merge pull request #386 from nextcloud/fix/result_order

This commit is contained in:
John Molakvoæ 2020-06-09 10:31:46 +02:00 committed by GitHub
commit af898d3ea4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 54 deletions

View file

@ -648,16 +648,8 @@ class ApiController extends Controller {
$submissions[] = $submission;
}
// Load question-texts, including deleted ones.
try {
$questionEntities = $this->questionMapper->findByForm($form->getId());
} catch (DoesNotExistException $e) {
//handle silently
}
$questions = [];
foreach ($questionEntities as $questionEntity) {
$questions[] = $questionEntity->read();
}
// Load currently active questions
$questions = $this->formsService->getQuestions($form->getId());
$response = [
'submissions' => $submissions,

View file

@ -85,7 +85,12 @@ class FormsService {
$this->currentUser = $userSession->getUser();
}
/**
* Load options corresponding to question
*
* @param integer $questionId
* @return array
*/
public function getOptions(int $questionId): array {
$optionList = [];
try {
@ -100,6 +105,12 @@ class FormsService {
}
}
/**
* Load questions corresponding to form
*
* @param integer $formId
* @return array
*/
public function getQuestions(int $formId): array {
$questionList = [];
try {