From d799a093fbec3ea0b9260c96e25d7c89b24210e0 Mon Sep 17 00:00:00 2001 From: alexi Date: Mon, 30 Jan 2023 17:30:03 +0100 Subject: [PATCH] Change print method to clean the source code --- Source/BusinessClass/CheckBoxQuestion.php | 10 +++++----- Source/BusinessClass/ListBoxQuestion.php | 12 ++++++------ Source/BusinessClass/TextQuestion.php | 8 ++++---- Source/BusinessClass/YesNoQuestion.php | 14 +++++++------- Source/Config/config.php | 1 + Source/Controller/ControllerAdmin.php | 2 +- Source/Model/ModelCandidate.php | 15 ++++++++------- 7 files changed, 32 insertions(+), 30 deletions(-) diff --git a/Source/BusinessClass/CheckBoxQuestion.php b/Source/BusinessClass/CheckBoxQuestion.php index 1e35392..054f582 100644 --- a/Source/BusinessClass/CheckBoxQuestion.php +++ b/Source/BusinessClass/CheckBoxQuestion.php @@ -25,8 +25,8 @@ class CheckBoxQuestion extends BoxQuestion $possibleResponses = $this->getPossibleResponses(); $categories = $this->getCategories(); - $html = "
- "; + $html = "\t\t\t
+\t\t\t\t\n"; for($i = 0; $i < count($possibleResponses); $i++) { @@ -35,10 +35,10 @@ class CheckBoxQuestion extends BoxQuestion { $categoriesSplit.= $category."_"; } - $html.= " - "; + $html.= "\t\t\t\t +\t\t\t\t\n"; } - $html.= "
"; + $html.= "\t\t\t
\n"; return $html; } diff --git a/Source/BusinessClass/ListBoxQuestion.php b/Source/BusinessClass/ListBoxQuestion.php index dc35e2c..d6426a0 100644 --- a/Source/BusinessClass/ListBoxQuestion.php +++ b/Source/BusinessClass/ListBoxQuestion.php @@ -25,16 +25,16 @@ class ListBoxQuestion extends BoxQuestion $possibleResponses = $this->getPossibleResponses(); $categories = $this->getCategories(); - $html = "
- - \n"; for($i = 0; $i < count($possibleResponses); $i++) { - $html.= ""; + $html.= "\t\t\t\t\t\n"; } - $html.= " -
"; + $html.= "\t\t\t\t +\t\t\t\n"; return $html; } diff --git a/Source/BusinessClass/TextQuestion.php b/Source/BusinessClass/TextQuestion.php index 0eb430f..4af587a 100644 --- a/Source/BusinessClass/TextQuestion.php +++ b/Source/BusinessClass/TextQuestion.php @@ -24,9 +24,9 @@ class TextQuestion extends Question public function printStrategy(): string // Possibilité de rajouter l'id de la question en parametre { // pour la mettre en id du input afin de la lier à ça question $content = $this->getContent(); - return "
- - -
"; + return "\t\t\t
+\t\t\t\t +\t\t\t\t +\t\t\t
\n"; } } \ No newline at end of file diff --git a/Source/BusinessClass/YesNoQuestion.php b/Source/BusinessClass/YesNoQuestion.php index 903b842..69a6b45 100644 --- a/Source/BusinessClass/YesNoQuestion.php +++ b/Source/BusinessClass/YesNoQuestion.php @@ -21,12 +21,12 @@ class YesNoQuestion extends Question public function printStrategy(): string { $content = $this->getContent(); - return "
- - -
"; + return "\t\t\t
+\t\t\t\t +\t\t\t\t +\t\t\t
\n"; } } \ No newline at end of file diff --git a/Source/Config/config.php b/Source/Config/config.php index 926a07e..a805314 100644 --- a/Source/Config/config.php +++ b/Source/Config/config.php @@ -1,3 +1,4 @@ + $title -

$description

-
-
"; + $html = " +

$title

\n +

$description

\n +
\n + \n"; foreach ($questions as $question) { - $html.= $question->printStrategy(); + $html.= $question->printStrategy()."\n"; } - $html.= " -
"; + $html.= "\t\t\n +\t
\n"; return $html; }