|
|
|
@ -52,8 +52,7 @@ class ModelCandidate
|
|
|
|
|
$categs = explode("_", $categs);
|
|
|
|
|
array_pop($categs);
|
|
|
|
|
$category[] = $categs;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
$questionsId[] = array_shift($dataIds);
|
|
|
|
|
$answer[] = $answerAndCategory;
|
|
|
|
|
$category[] = [];
|
|
|
|
@ -68,10 +67,10 @@ class ModelCandidate
|
|
|
|
|
$title = $form[0]->title;
|
|
|
|
|
$cate = "[".implode(',', array_map(function ($subArray) {return implode(',', $subArray);}, $category))."]";
|
|
|
|
|
$res =$this->client->request('POST', 'https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/insertListResponseOfCandidate?'.
|
|
|
|
|
'id='.implode(",",$questionsId).'&'.
|
|
|
|
|
'answer='.implode(",",$answer).'&'.
|
|
|
|
|
'category='.$cate.'&'.
|
|
|
|
|
'titleForm='.$title
|
|
|
|
|
'id=' . implode(",", $questionsId) . '&'.
|
|
|
|
|
'answer=' . implode(",", $answer) . '&'.
|
|
|
|
|
'category=' . $cate . '&'.
|
|
|
|
|
'titleForm=' . $title
|
|
|
|
|
);
|
|
|
|
|
if ($res->getStatusCode() != 200) {
|
|
|
|
|
throw new Exception('InsertListResponsesOfCandidate failed');
|
|
|
|
@ -112,7 +111,7 @@ class ModelCandidate
|
|
|
|
|
throw new Exception('GetAllQuestion failed');
|
|
|
|
|
}
|
|
|
|
|
$questionsTab = json_decode($res->getBody());
|
|
|
|
|
} catch (GuzzleException | ClientException $g){
|
|
|
|
|
} catch (GuzzleException | ClientException $g) {
|
|
|
|
|
echo "Error : " . $g->getMessage();
|
|
|
|
|
throw new Exception($g->getMessage(), $g->getCode(), $g);
|
|
|
|
|
}
|
|
|
|
@ -165,7 +164,8 @@ class ModelCandidate
|
|
|
|
|
* @throws InexistantLoginException
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
public function login() :void {
|
|
|
|
|
public function login(): void
|
|
|
|
|
{
|
|
|
|
|
global $rep, $views, $sel;
|
|
|
|
|
$password = Clean::simpleString($_REQUEST['password']);
|
|
|
|
|
$identifiant = Clean::simpleString($_REQUEST['login']);
|
|
|
|
|