|
|
|
@ -7,6 +7,7 @@ use Model\ModelAdmin;
|
|
|
|
|
class ControllerAdmin
|
|
|
|
|
{
|
|
|
|
|
public function addQuestion(): void
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
global $rep, $views;
|
|
|
|
|
|
|
|
|
@ -15,15 +16,26 @@ class ControllerAdmin
|
|
|
|
|
$questionContent = $_POST['question'];
|
|
|
|
|
$type = $_POST['type'];
|
|
|
|
|
|
|
|
|
|
require_once($rep.$views['possibleResponsesForm']);
|
|
|
|
|
}
|
|
|
|
|
if(strcmp($type, "BusinessClass\TextQuestion") == 0)
|
|
|
|
|
{
|
|
|
|
|
$this->goToAdminPage();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
require_once($rep.$views['possibleResponsesForm']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public function addResponse(): void
|
|
|
|
|
{
|
|
|
|
|
(new ModelAdmin())->addResponse();
|
|
|
|
|
|
|
|
|
|
global $rep, $views;
|
|
|
|
|
$idQuestion = $_POST['idQuestion'];
|
|
|
|
|
$categories = (new ModelAdmin())->getCategories();
|
|
|
|
|
$questionContent = $_POST['question'];
|
|
|
|
|
$type = $_POST['type'];
|
|
|
|
|
require_once($rep.$views['continue']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -31,13 +43,16 @@ class ControllerAdmin
|
|
|
|
|
{
|
|
|
|
|
global $rep, $views;
|
|
|
|
|
|
|
|
|
|
$idQuestion = $_POST['idQuestion'];
|
|
|
|
|
$choose = $_POST['choose'];
|
|
|
|
|
if($choose == "Oui") {
|
|
|
|
|
$idQuestion = $_POST['idQuestion'];
|
|
|
|
|
$categories = (new ModelAdmin())->getCategories();
|
|
|
|
|
$questionContent = $_POST['question'];
|
|
|
|
|
$type = $_POST['type'];
|
|
|
|
|
require_once($rep.$views['possibleResponsesForm']);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
require_once($rep.$views['']);
|
|
|
|
|
$this->goToAdminPage();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|