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.
67 lines
1.3 KiB
67 lines
1.3 KiB
<?php
|
|
|
|
namespace BusinessClass;
|
|
|
|
abstract class BoxQuestion extends Question
|
|
{
|
|
private array $possibleResponses;
|
|
private array $categories;
|
|
|
|
|
|
public function __construct()
|
|
{
|
|
$ctp = func_num_args();
|
|
$args = func_get_args();
|
|
switch($ctp)
|
|
{
|
|
case 5:
|
|
parent::__construct($args[3], $args[1]);
|
|
$this->categories = $args[2];
|
|
$this->possibleResponses = $args[0];
|
|
break;
|
|
case 2:
|
|
parent::__construct($args[0], $args[1]);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
abstract public function responseStrategy();
|
|
|
|
abstract public 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;
|
|
}
|
|
}
|