|
|
@ -44,9 +44,9 @@ class ModelCandidate
|
|
|
|
foreach ($answersAndCategories as $answerAndCategory) {
|
|
|
|
foreach ($answersAndCategories as $answerAndCategory) {
|
|
|
|
$exploded = explode("||",$answerAndCategory);
|
|
|
|
$exploded = explode("||",$answerAndCategory);
|
|
|
|
if( count($exploded) == 3 ){
|
|
|
|
if( count($exploded) == 3 ){
|
|
|
|
$questionsId[] = $exploded[0];
|
|
|
|
$questionsId[] = Clean::int($exploded[0]);
|
|
|
|
$answer[] = $exploded[1];
|
|
|
|
$answer[] = Clean::simpleString($exploded[1]);
|
|
|
|
$categs = $exploded[2];
|
|
|
|
$categs = Clean::simpleStringArray($exploded[2]);
|
|
|
|
$categs = explode("_", $categs);
|
|
|
|
$categs = explode("_", $categs);
|
|
|
|
array_pop($categs);
|
|
|
|
array_pop($categs);
|
|
|
|
$category[] = $categs;
|
|
|
|
$category[] = $categs;
|
|
|
@ -58,6 +58,9 @@ class ModelCandidate
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
if(!Validate::answer($answer) || !Validate::category($category)){
|
|
|
|
|
|
|
|
throw new Exception("Les réponses ne sont pas valides");
|
|
|
|
|
|
|
|
}
|
|
|
|
$res = $this->client->request('GET', 'https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/getForm');
|
|
|
|
$res = $this->client->request('GET', 'https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/getForm');
|
|
|
|
$form = json_decode($res->getBody());
|
|
|
|
$form = json_decode($res->getBody());
|
|
|
|
$title = $form[0]["title"];
|
|
|
|
$title = $form[0]["title"];
|
|
|
|