/** * Gets the map of the reachable items. * @param AssessmentTestSession $session * @return array The map of the test */ public static function getTestMap($session) { $map = array(); if ($session->isRunning() !== false) { $route = $session->getRoute(); $routeItems = $route->getAllRouteItems(); $offset = $route->getRouteItemPosition($routeItems[0]); foreach ($routeItems as $routeItem) { $itemRef = $routeItem->getAssessmentItemRef(); $occurrence = $routeItem->getOccurence(); // get the session related to this route item. $store = $session->getAssessmentItemSessionStore(); $itemSession = $store->getAssessmentItemSession($itemRef, $occurrence); $map[] = new Jump($offset, $routeItem, $itemSession); $offset++; } } return $map; }