diff --git a/src/qtism/runtime/tests/AbstractSessionManager.php b/src/qtism/runtime/tests/AbstractSessionManager.php index 9fa7d5aa3..f4ebb03c7 100644 --- a/src/qtism/runtime/tests/AbstractSessionManager.php +++ b/src/qtism/runtime/tests/AbstractSessionManager.php @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Copyright (c) 2013-2020 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); + * Copyright (c) 2013-2023 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); * * @author Jérôme Bogaerts * @license GPLv2 @@ -137,6 +137,17 @@ protected function getRoute(AssessmentTest $test, Route $route = null): Route return $route ?? $this->createRoute($test); } + /** + * Allow to recreate route items when AssessmentTest structure is changed + * + * @param AssessmentTest $test + * @return Route + */ + public function recreateRoute(AssessmentTest $test): Route + { + return $this->createRoute($test); + } + /** * Contains the logic of creating the Route of a brand new AssessmentTestSession object. * The resulting Route object will be injected in the created AssessmentTestSession. diff --git a/src/qtism/runtime/tests/AssessmentTestSession.php b/src/qtism/runtime/tests/AssessmentTestSession.php index bb0b71a10..84283c389 100644 --- a/src/qtism/runtime/tests/AssessmentTestSession.php +++ b/src/qtism/runtime/tests/AssessmentTestSession.php @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Copyright (c) 2013-2020 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); + * Copyright (c) 2013-2023 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); * * @author Jérôme Bogaerts * @license GPLv2 @@ -3061,6 +3061,16 @@ public function isNextRouteItemPredictible(): bool return true; } + /** + * In case of need to recreate item sessions after the route was created + * + * @param RouteItem $routeItem + */ + public function reinitializeAssessmentItemSession(RouteItem $routeItem): void + { + $this->initializeAssessmentItemSession($routeItem); + } + /** * @param RouteItem $routeItem */