diff --git a/Source/Config/Clean.php b/Source/Config/Clean.php index 99ad43d..fa96e6c 100644 --- a/Source/Config/Clean.php +++ b/Source/Config/Clean.php @@ -1,6 +1,7 @@ insertResponseInQuestion($response, $categories, $idQuestion); diff --git a/Source/Model/ModelCandidate.php b/Source/Model/ModelCandidate.php index 708269b..9485f7b 100644 --- a/Source/Model/ModelCandidate.php +++ b/Source/Model/ModelCandidate.php @@ -37,8 +37,8 @@ class ModelCandidate $category[] = $categs; } - $titleForm = (new GatewayForm())->getForm()[0]["title"]; - (new GatewayListResponseOfCandidate())->insertListResponsesOfCandidate($dataIds, $answer, $category, $titleForm); + $title = (new GatewayForm())->getForm()[0]["title"]; + (new GatewayListResponseOfCandidate())->insertListResponsesOfCandidate($dataIds, $answer, $category, $title); } diff --git a/Source/Views/HTML/form.php b/Source/Views/HTML/form.php index 0c5aa27..759300a 100644 --- a/Source/Views/HTML/form.php +++ b/Source/Views/HTML/form.php @@ -23,16 +23,6 @@ - + diff --git a/Source/Views/JS/getData-Ids.js b/Source/Views/JS/getData-Ids.js index 8b13789..1e976dd 100644 --- a/Source/Views/JS/getData-Ids.js +++ b/Source/Views/JS/getData-Ids.js @@ -1 +1,9 @@ +let dataIds = []; +let elements = document.querySelectorAll('[data-id]'); +elements.forEach(function(element) { + dataIds.push(element.getAttribute('data-id')); +}); + +let dataIdsInput = document.querySelector('input[name="data_ids"]'); +dataIdsInput.value = JSON.stringify(dataIds);