*/ class SelectAdaptiveNextItemEvent implements Event { /** @var string Current item id */ protected $currentItemId; /** @var array Item ids of the next items. */ protected $catItemIds; /** @var array Item ids which were used to give current item identifier. */ protected $preCatItemIds; /** @var AssessmentTestSession */ protected $testSession; /** @var bool A parameter to store if item is adaptive or retrieve from shadow */ protected $isShadowItem = false; /** * SelectAdaptiveNextItemEvent constructor. * * @param AssessmentTestSession $testSession * @param $currentItemId * @param array|null $preCatItemIds * @param array|null $catItemIds * @param bool $isShadowItem */ public function __construct(AssessmentTestSession $testSession, $currentItemId, array $preCatItemIds = null, array $catItemIds = null, $isShadowItem = false) { $this->currentItemId = $currentItemId; $this->preCatItemIds = $preCatItemIds; $this->catItemIds = $catItemIds; $this->testSession = $testSession; $this->isShadowItem = $isShadowItem; } /** * @return string */ public function getName() { return __CLASS__; } /** * @return AssessmentTestSession */ public function getTestSession() { return $this->testSession; } /** * Returns current item identifier. * * @return string */ public function getCurrentItemId() { return $this->currentItemId; } /** * Returns next item identifier. * * @return string|null */ public function getNextItem() { return $this->catItemIds === null ? null : $this->catItemIds[0]; } /** * Returns the item ids of the next items. * * @return array|null */ public function getCatItemIds() { return $this->catItemIds; } /** * Returns the item ids given from cat engine to select current item (from previous call). * * @return array|null */ public function getPreCatItemIds() { return $this->preCatItemIds; } /** * @return bool */ public function isShadowItem() { return (bool) $this->isShadowItem; } }