|
|
@ -10,7 +10,15 @@ class ModelCandidate
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public function submitForm(): void
|
|
|
|
public function submitForm(): void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// TODO: Implement submitForm() method.
|
|
|
|
$answersAndCategories = $_POST['answers'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$answers = array();
|
|
|
|
|
|
|
|
foreach ($answersAndCategories as $answerAndCategory)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$answer = explode("_", $answerAndCategory);
|
|
|
|
|
|
|
|
$answer = reset($answer);
|
|
|
|
|
|
|
|
$answers[] = $answer;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function getForm(): string
|
|
|
|
public function getForm(): string
|
|
|
@ -65,7 +73,7 @@ class ModelCandidate
|
|
|
|
<h1>$title</h1>\n
|
|
|
|
<h1>$title</h1>\n
|
|
|
|
<h3>$description</h3>\n
|
|
|
|
<h3>$description</h3>\n
|
|
|
|
<div id='container_form'>\n
|
|
|
|
<div id='container_form'>\n
|
|
|
|
<form>\n";
|
|
|
|
<form method='post'>\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($questions as $question)
|
|
|
|
foreach ($questions as $question)
|
|
|
@ -73,7 +81,9 @@ class ModelCandidate
|
|
|
|
$html.= $question->printStrategy()."\n";
|
|
|
|
$html.= $question->printStrategy()."\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$html.= "\t\t</form>\n
|
|
|
|
$html.= "\t\t\t<input type='submit'>\n
|
|
|
|
|
|
|
|
\t\t\t<input type='hidden' name='action' value='submitForm'>
|
|
|
|
|
|
|
|
\t\t</form>\n
|
|
|
|
\t</div>\n";
|
|
|
|
\t</div>\n";
|
|
|
|
|
|
|
|
|
|
|
|
return $html;
|
|
|
|
return $html;
|
|
|
|