parent
959b47d273
commit
9aaf918073
@ -1,148 +1,175 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Entity;
|
namespace Entity;
|
||||||
|
|
||||||
|
class QuestionEntity
|
||||||
|
{
|
||||||
|
private int $id_question;
|
||||||
|
private string $question;
|
||||||
|
private string $answerA;
|
||||||
|
private string $answerB;
|
||||||
|
private string $answerC;
|
||||||
|
private string $answerD;
|
||||||
|
private string $cAnswer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor to initialize the QuestionEntity object.
|
||||||
|
*
|
||||||
|
* @param int $id_question The ID of the question.
|
||||||
|
* @param string $question The question text.
|
||||||
|
* @param string $answerA The text for answer A.
|
||||||
|
* @param string $answerB The text for answer B.
|
||||||
|
* @param string $answerC The text for answer C.
|
||||||
|
* @param string $answerD The text for answer D.
|
||||||
|
* @param string $cAnswer The correct answer.
|
||||||
|
*/
|
||||||
|
public function __construct(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer)
|
||||||
|
{
|
||||||
|
$this->id_question = $id_question;
|
||||||
|
$this->question = $question;
|
||||||
|
$this->answerA = $answerA;
|
||||||
|
$this->answerB = $answerB;
|
||||||
|
$this->answerC = $answerC;
|
||||||
|
$this->answerD = $answerD;
|
||||||
|
$this->cAnswer = $cAnswer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the ID of the question.
|
||||||
|
*
|
||||||
|
* @return int The ID of the question.
|
||||||
|
*/
|
||||||
|
public function getIdQuestion(): int
|
||||||
|
{
|
||||||
|
return $this->id_question;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the ID of the question.
|
||||||
|
*
|
||||||
|
* @param int $id_question The ID of the question.
|
||||||
|
*/
|
||||||
|
public function setIdQuestion(int $id_question): void
|
||||||
|
{
|
||||||
|
$this->id_question = $id_question;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the question text.
|
||||||
|
*
|
||||||
|
* @return string The question text.
|
||||||
|
*/
|
||||||
|
public function getQuestion(): string
|
||||||
|
{
|
||||||
|
return $this->question;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the question text.
|
||||||
|
*
|
||||||
|
* @param string $question The question text.
|
||||||
|
*/
|
||||||
|
public function setQuestion(string $question): void
|
||||||
|
{
|
||||||
|
$this->question = $question;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the text for answer A.
|
||||||
|
*
|
||||||
|
* @return string The text for answer A.
|
||||||
|
*/
|
||||||
|
public function getAnswerA(): string
|
||||||
|
{
|
||||||
|
return $this->answerA;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the text for answer A.
|
||||||
|
*
|
||||||
|
* @param string $answerA The text for answer A.
|
||||||
|
*/
|
||||||
|
public function setAnswerA(string $answerA): void
|
||||||
|
{
|
||||||
|
$this->answerA = $answerA;
|
||||||
|
}
|
||||||
|
|
||||||
class QuestionEntity
|
/**
|
||||||
|
* Get the text for answer B.
|
||||||
|
*
|
||||||
|
* @return string The text for answer B.
|
||||||
|
*/
|
||||||
|
public function getAnswerB(): string
|
||||||
{
|
{
|
||||||
private int $id_question;
|
return $this->answerB;
|
||||||
private string $question;
|
}
|
||||||
private string $answerA;
|
|
||||||
private string $answerB;
|
/**
|
||||||
private string $answerC;
|
* Set the text for answer B.
|
||||||
private string $answerD;
|
*
|
||||||
private string $cAnswer;
|
* @param string $answerB The text for answer B.
|
||||||
|
*/
|
||||||
/**
|
public function setAnswerB(string $answerB): void
|
||||||
* @param int $id_question
|
{
|
||||||
* @param string $question
|
$this->answerB = $answerB;
|
||||||
* @param string $answerA
|
}
|
||||||
* @param string $answerB
|
|
||||||
* @param string $answerC
|
|
||||||
* @param string $answerD
|
|
||||||
* @param string $cAnswer
|
|
||||||
*/
|
|
||||||
public function __construct(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer)
|
|
||||||
{
|
|
||||||
$this->id_question = $id_question;
|
|
||||||
$this->question = $question;
|
|
||||||
$this->answerA = $answerA;
|
|
||||||
$this->answerB = $answerB;
|
|
||||||
$this->answerC = $answerC;
|
|
||||||
$this->answerD = $answerD;
|
|
||||||
$this->cAnswer = $cAnswer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getIdQuestion(): int
|
|
||||||
{
|
|
||||||
return $this->id_question;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $id_question
|
|
||||||
*/
|
|
||||||
public function setIdQuestion(int $id_question): void
|
|
||||||
{
|
|
||||||
$this->id_question = $id_question;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getQuestion(): string
|
|
||||||
{
|
|
||||||
return $this->question;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $question
|
|
||||||
*/
|
|
||||||
public function setQuestion(string $question): void
|
|
||||||
{
|
|
||||||
$this->question = $question;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getAnswerA(): string
|
|
||||||
{
|
|
||||||
return $this->answerA;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $answerA
|
|
||||||
*/
|
|
||||||
public function setAnswerA(string $answerA): void
|
|
||||||
{
|
|
||||||
$this->answerA = $answerA;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getAnswerB(): string
|
|
||||||
{
|
|
||||||
return $this->answerB;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $answerB
|
|
||||||
*/
|
|
||||||
public function setAnswerB(string $answerB): void
|
|
||||||
{
|
|
||||||
$this->answerB = $answerB;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getAnswerC(): string
|
|
||||||
{
|
|
||||||
return $this->answerC;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $answerC
|
|
||||||
*/
|
|
||||||
public function setAnswerC(string $answerC): void
|
|
||||||
{
|
|
||||||
$this->answerC = $answerC;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getAnswerD(): string
|
|
||||||
{
|
|
||||||
return $this->answerD;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $answerD
|
|
||||||
*/
|
|
||||||
public function setAnswerD(string $answerD): void
|
|
||||||
{
|
|
||||||
$this->answerD = $answerD;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getCAnswer(): string
|
|
||||||
{
|
|
||||||
return $this->cAnswer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $cAnswer
|
|
||||||
*/
|
|
||||||
public function setCAnswer(string $cAnswer): void
|
|
||||||
{
|
|
||||||
$this->cAnswer = $cAnswer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the text for answer C.
|
||||||
|
*
|
||||||
|
* @return string The text for answer C.
|
||||||
|
*/
|
||||||
|
public function getAnswerC(): string
|
||||||
|
{
|
||||||
|
return $this->answerC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the text for answer C.
|
||||||
|
*
|
||||||
|
* @param string $answerC The text for answer C.
|
||||||
|
*/
|
||||||
|
public function setAnswerC(string $answerC): void
|
||||||
|
{
|
||||||
|
$this->answerC = $answerC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the text for answer D.
|
||||||
|
*
|
||||||
|
* @return string The text for answer D.
|
||||||
|
*/
|
||||||
|
public function getAnswerD(): string
|
||||||
|
{
|
||||||
|
return $this->answerD;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the text for answer D.
|
||||||
|
*
|
||||||
|
* @param string $answerD The text for answer D.
|
||||||
|
*/
|
||||||
|
public function setAnswerD(string $answerD): void
|
||||||
|
{
|
||||||
|
$this->answerD = $answerD;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the correct answer.
|
||||||
|
*
|
||||||
|
* @return string The correct answer.
|
||||||
|
*/
|
||||||
|
public function getCAnswer(): string
|
||||||
|
{
|
||||||
|
return $this->cAnswer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the correct answer.
|
||||||
|
*
|
||||||
|
* @param string $cAnswer The correct answer.
|
||||||
|
*/
|
||||||
|
public function setCAnswer(string $cAnswer): void
|
||||||
|
{
|
||||||
|
$this->cAnswer = $cAnswer;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in new issue