src/Entity/StudentEvaluationAnswer.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StudentEvaluationAnswerRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=StudentEvaluationAnswerRepository::class)
  9.  */
  10. class StudentEvaluationAnswer {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity=StudentEvaluation::class)
  19.      */
  20.     private $studentEvaluation;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private $answerType;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $answerSkillType;
  29.     /**
  30.      * @ORM\Column(type="text", nullable=true)
  31.      */
  32.     private $question;
  33.     /**
  34.      * @ORM\Column(type="text", nullable=true)
  35.      */
  36.     private $rightAnswer;
  37.     /**
  38.      * @ORM\Column(type="text", nullable=true)
  39.      */
  40.     private $answerGiven;
  41.     /**
  42.      * @ORM\Column(type="decimal", precision=5, scale=2, nullable=true)
  43.      */
  44.     private $points;
  45.     /**
  46.      * @ORM\Column(type="decimal", precision=5, scale=2, nullable=true)
  47.      */
  48.     private $score;
  49.     /**
  50.      * @ORM\Column(type="boolean", options={"default" : false})
  51.      */
  52.     private $isChecked;
  53.     /**
  54.      * @ORM\OneToMany(targetEntity=StudentEvaluationPostRevision::class, mappedBy="answer")
  55.      */
  56.     private $studentEvaluationPostRevisions;
  57.     public function __construct() {
  58.         $this->studentEvaluationPostRevisions = new ArrayCollection();
  59.     }
  60.     public function getId(): ?int {
  61.         return $this->id;
  62.     }
  63.     public function getStudentEvaluation(): ?StudentEvaluation {
  64.         return $this->studentEvaluation;
  65.     }
  66.     public function setStudentEvaluation(?StudentEvaluation $studentEvaluation): self {
  67.         $this->studentEvaluation $studentEvaluation;
  68.         return $this;
  69.     }
  70.     public function getQuestion(): ?string {
  71.         return $this->question;
  72.     }
  73.     public function setQuestion(?string $question): self {
  74.         $this->question $question;
  75.         return $this;
  76.     }
  77.     public function getScore(): ?string {
  78.         return $this->score;
  79.     }
  80.     public function setScore(?string $score): self {
  81.         $this->score $score;
  82.         return $this;
  83.     }
  84.     public function getPoints(): ?string {
  85.         return $this->points;
  86.     }
  87.     public function setPoints(?string $points): self {
  88.         $this->points $points;
  89.         return $this;
  90.     }
  91.     public function getAnswerGiven(): ?string {
  92.         return $this->answerGiven;
  93.     }
  94.     public function setAnswerGiven(?string $answerGiven): self {
  95.         $this->answerGiven $answerGiven;
  96.         return $this;
  97.     }
  98.     public function getRightAnswer() {
  99.         return $this->rightAnswer;
  100.     }
  101.     public function setRightAnswer($rightAnswer): void {
  102.         $this->rightAnswer $rightAnswer;
  103.     }
  104.     public function isIsChecked(): ?bool {
  105.         return $this->isChecked;
  106.     }
  107.     public function setIsChecked(bool $isChecked): self {
  108.         $this->isChecked $isChecked;
  109.         return $this;
  110.     }
  111.     public function getAnswerType() {
  112.         return $this->answerType;
  113.     }
  114.     public function setAnswerType($answerType): void {
  115.         $this->answerType $answerType;
  116.     }
  117.     public function getAnswerSkillType() {
  118.         return $this->answerSkillType;
  119.     }
  120.     public function setAnswerSkillType($answerSkillType): void {
  121.         $this->answerSkillType $answerSkillType;
  122.     }
  123.     /**
  124.      * @return Collection<int, StudentEvaluationPostRevision>
  125.      */
  126.     public function getStudentEvaluationPostRevisions(): Collection {
  127.         return $this->studentEvaluationPostRevisions;
  128.     }
  129.     public function addStudentEvaluationPostRevision(StudentEvaluationPostRevision $studentEvaluationPostRevision): self {
  130.         if (!$this->studentEvaluationPostRevisions->contains($studentEvaluationPostRevision)) {
  131.             $this->studentEvaluationPostRevisions[] = $studentEvaluationPostRevision;
  132.             $studentEvaluationPostRevision->setAnswer($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeStudentEvaluationPostRevision(StudentEvaluationPostRevision $studentEvaluationPostRevision): self {
  137.         if ($this->studentEvaluationPostRevisions->removeElement($studentEvaluationPostRevision)) {
  138.             // set the owning side to null (unless already changed)
  139.             if ($studentEvaluationPostRevision->getAnswer() === $this) {
  140.                 $studentEvaluationPostRevision->setAnswer(null);
  141.             }
  142.         }
  143.         return $this;
  144.     }
  145.     /**
  146.      * Obtene si el numero es un decimal o un entero
  147.      * @param type $number
  148.      * @return type
  149.      */
  150.     public function isDecimals($number) {
  151.         $decimals floatval($number) - intval($number);
  152.         return ($decimals 0);
  153.     }
  154.     
  155. }