You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.4 KiB
64 lines
1.4 KiB
<?php
|
|
|
|
namespace Controller;
|
|
|
|
use Model\ModelAdmin;
|
|
|
|
class ControllerAdmin
|
|
{
|
|
public function addQuestion(): void
|
|
{
|
|
global $rep, $views;
|
|
|
|
$idQuestion = (new ModelAdmin())->addQuestion();
|
|
$categories = (new ModelAdmin())->getCategories();
|
|
$questionContent = $_POST['question'];
|
|
$type = $_POST['type'];
|
|
|
|
require_once($rep.$views['possibleResponsesForm']);
|
|
}
|
|
|
|
public function addResponse(): void
|
|
{
|
|
(new ModelAdmin())->addResponse();
|
|
|
|
global $rep, $views;
|
|
$idQuestion = $_POST['idQuestion'];
|
|
require_once($rep.$views['continue']);
|
|
}
|
|
|
|
public function continueResponse(): void
|
|
{
|
|
global $rep, $views;
|
|
|
|
$idQuestion = $_POST['idQuestion'];
|
|
$choose = $_POST['choose'];
|
|
if($choose == "Oui") {
|
|
require_once($rep.$views['possibleResponsesForm']);
|
|
}
|
|
else {
|
|
require_once($rep.$views['']);
|
|
}
|
|
}
|
|
|
|
public function createForm(): void
|
|
{
|
|
(new ModelAdmin())->createForm();
|
|
}
|
|
|
|
public function goToAdminPage(): void
|
|
{
|
|
global $rep, $views;
|
|
|
|
$categories = (new ModelAdmin())->getCategories();
|
|
$questions = (new ModelAdmin())->getQuestions();
|
|
|
|
require_once($rep.$views['admin']);
|
|
}
|
|
|
|
public function addKeyword(): void
|
|
{
|
|
(new ModelAdmin())->addKeyword();
|
|
}
|
|
}
|