<?php
namespace App\Entity;
use App\Repository\StudentEvaluationAnswerRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=StudentEvaluationAnswerRepository::class)
*/
class StudentEvaluationAnswer {
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=StudentEvaluation::class)
*/
private $studentEvaluation;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $answerType;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $answerSkillType;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $question;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $rightAnswer;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $answerGiven;
/**
* @ORM\Column(type="decimal", precision=5, scale=2, nullable=true)
*/
private $points;
/**
* @ORM\Column(type="decimal", precision=5, scale=2, nullable=true)
*/
private $score;
/**
* @ORM\Column(type="boolean", options={"default" : false})
*/
private $isChecked;
/**
* @ORM\OneToMany(targetEntity=StudentEvaluationPostRevision::class, mappedBy="answer")
*/
private $studentEvaluationPostRevisions;
public function __construct() {
$this->studentEvaluationPostRevisions = new ArrayCollection();
}
public function getId(): ?int {
return $this->id;
}
public function getStudentEvaluation(): ?StudentEvaluation {
return $this->studentEvaluation;
}
public function setStudentEvaluation(?StudentEvaluation $studentEvaluation): self {
$this->studentEvaluation = $studentEvaluation;
return $this;
}
public function getQuestion(): ?string {
return $this->question;
}
public function setQuestion(?string $question): self {
$this->question = $question;
return $this;
}
public function getScore(): ?string {
return $this->score;
}
public function setScore(?string $score): self {
$this->score = $score;
return $this;
}
public function getPoints(): ?string {
return $this->points;
}
public function setPoints(?string $points): self {
$this->points = $points;
return $this;
}
public function getAnswerGiven(): ?string {
return $this->answerGiven;
}
public function setAnswerGiven(?string $answerGiven): self {
$this->answerGiven = $answerGiven;
return $this;
}
public function getRightAnswer() {
return $this->rightAnswer;
}
public function setRightAnswer($rightAnswer): void {
$this->rightAnswer = $rightAnswer;
}
public function isIsChecked(): ?bool {
return $this->isChecked;
}
public function setIsChecked(bool $isChecked): self {
$this->isChecked = $isChecked;
return $this;
}
public function getAnswerType() {
return $this->answerType;
}
public function setAnswerType($answerType): void {
$this->answerType = $answerType;
}
public function getAnswerSkillType() {
return $this->answerSkillType;
}
public function setAnswerSkillType($answerSkillType): void {
$this->answerSkillType = $answerSkillType;
}
/**
* @return Collection<int, StudentEvaluationPostRevision>
*/
public function getStudentEvaluationPostRevisions(): Collection {
return $this->studentEvaluationPostRevisions;
}
public function addStudentEvaluationPostRevision(StudentEvaluationPostRevision $studentEvaluationPostRevision): self {
if (!$this->studentEvaluationPostRevisions->contains($studentEvaluationPostRevision)) {
$this->studentEvaluationPostRevisions[] = $studentEvaluationPostRevision;
$studentEvaluationPostRevision->setAnswer($this);
}
return $this;
}
public function removeStudentEvaluationPostRevision(StudentEvaluationPostRevision $studentEvaluationPostRevision): self {
if ($this->studentEvaluationPostRevisions->removeElement($studentEvaluationPostRevision)) {
// set the owning side to null (unless already changed)
if ($studentEvaluationPostRevision->getAnswer() === $this) {
$studentEvaluationPostRevision->setAnswer(null);
}
}
return $this;
}
/**
* Obtene si el numero es un decimal o un entero
* @param type $number
* @return type
*/
public function isDecimals($number) {
$decimals = floatval($number) - intval($number);
return ($decimals > 0);
}
}