|
|
|
@ -17,7 +17,19 @@ class GatewayQuestion
|
|
|
|
|
$this->connection = connect();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function insertQuestion(Question $question, int $idForm): void
|
|
|
|
|
public function addQuestion(Question $question, int $idForm): int
|
|
|
|
|
{
|
|
|
|
|
$query = "INSERT INTO Question(content, type, form) VALUES(:content, :type, :form)";
|
|
|
|
|
$this->connection->executeQuery($query, array(
|
|
|
|
|
':content' => array($question->getContent(), PDO::PARAM_STR),
|
|
|
|
|
':type' => array(get_class($question), PDO::PARAM_STR),
|
|
|
|
|
':form' => array($idForm, PDO::PARAM_INT)
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
return $this->connection->lastInsertId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function insertQuestion(Question $question, int $idForm): int
|
|
|
|
|
{
|
|
|
|
|
$gatewayPossibleResponse = new GatewayPossibleResponse();
|
|
|
|
|
|
|
|
|
@ -31,6 +43,7 @@ class GatewayQuestion
|
|
|
|
|
$idQuestion = $this->connection->lastInsertId();
|
|
|
|
|
|
|
|
|
|
if (get_class($question) != TextQuestion::class) {
|
|
|
|
|
var_dump($question);
|
|
|
|
|
$listPossibleResponse = $question->getPossibleResponses();
|
|
|
|
|
|
|
|
|
|
for ($i = 0; $i < count($listPossibleResponse); $i++) {
|
|
|
|
@ -51,6 +64,7 @@ class GatewayQuestion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $idQuestion;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function deleteQuestion(Question $question): void
|
|
|
|
|