You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.4 KiB
59 lines
1.4 KiB
<?php
|
|
|
|
namespace BusinessClass;
|
|
|
|
abstract class BoxQuestion extends Question
|
|
{
|
|
private array $possibleResponses; // un dictionnaire qui associe chaque réponse
|
|
// possible à un ou plusieurs objets Category
|
|
private array $categories;
|
|
|
|
/**
|
|
* @param array $possibleResponses
|
|
* @param string $content
|
|
* @param array $categories
|
|
* @param int $id
|
|
*/
|
|
public function __construct(array $possibleResponses, string $content, array $categories, int $id)
|
|
{
|
|
parent::__construct($id, $content);
|
|
$this->categories = $categories;
|
|
$this->possibleResponses = $possibleResponses;
|
|
}
|
|
|
|
public abstract function responseStrategy();
|
|
|
|
public abstract function printStrategy(): string;
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getPossibleResponses(): array
|
|
{
|
|
return $this->possibleResponses;
|
|
}
|
|
|
|
/**
|
|
* @param array $possibleResponses
|
|
*/
|
|
public function setPossibleResponses(array $possibleResponses): void
|
|
{
|
|
$this->possibleResponses = $possibleResponses;
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getCategories(): array
|
|
{
|
|
return $this->categories;
|
|
}
|
|
|
|
/**
|
|
* @param array $categories
|
|
*/
|
|
public function setCategories(array $categories): void
|
|
{
|
|
$this->categories = $categories;
|
|
}
|
|
} |